@lancc/cmark 1.2.0 → 1.2.1
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.
- package/CHANGELOG.md +8 -0
- package/LICENSE +21 -21
- package/README.md +47 -107
- package/assets/abnfDiagram-WEYOIA3C-CKV_7Upb.js +1 -0
- package/assets/architectureDiagram-ZHVYKT53-BvLudDvk.js +1 -0
- package/assets/blockDiagram-RJAE7QA3--gzkMGi2.js +1 -0
- package/assets/c4Diagram-XDPPPE54-ByfRiJGR.js +1 -0
- package/assets/chunk-2E7WHVMD-TfbC_dmh.js +1 -0
- package/assets/chunk-2Q5K7J3B-0YJgChVo.js +1 -0
- package/assets/chunk-4EMNKR2T-DHoYW7g5.js +1 -0
- package/assets/chunk-55XCU76K-Cq25Yw_G.js +1 -0
- package/assets/chunk-5VM5RSS4-CJaRXFHK.js +1 -0
- package/assets/chunk-JWPE2WC7-BP2iXBhe.js +1 -0
- package/assets/chunk-VQ5W62QI-B95zur4F.js +1 -0
- package/assets/chunk-XXDRQBXY-Ct0MhvQo.js +1 -0
- package/assets/chunk-ZCHMQSOR-C5VhW-wL.js +2 -0
- package/assets/classDiagram-v2-4MYWR3UA-C1G-Vkj0.js +1 -0
- package/assets/cose-bilkent-JH36ORCC-qIQoIBv0.js +1 -0
- package/assets/cynefin-EF2NZ3EQ-CR1E3YiZ.js +1 -0
- package/assets/cynefinDiagram-WF24UDRP-DaJFvZ3b.js +1 -0
- package/assets/cytoscape.esm-SjxgSg6I.js +9 -0
- package/assets/dagre-NK4GIZVX-BFRQhpii.js +1 -0
- package/assets/diagram-CBK3MWTC-DlueL6XZ.js +1 -0
- package/assets/diagram-I5XIIV2D-bITyafYX.js +1 -0
- package/assets/diagram-ODIL2UCW-Dlb4hg_-.js +1 -0
- package/assets/diagram-PFBEJUXE-CRfen0O7.js +1 -0
- package/assets/diagram-RJA3I4VV-CK-FlhGV.js +1 -0
- package/assets/diagram-TYUNFSNR-DmgVsxqa.js +1 -0
- package/assets/ebnfDiagram-V4P3TTPT-B9KGI9eQ.js +1 -0
- package/assets/echarts-CytsvCdp.js +25 -0
- package/assets/elk-QONTBCTQ-VgDftvsU.js +1 -0
- package/assets/erDiagram-KYQIGQAA-DkpP7sS4.js +1 -0
- package/assets/flowDiagram-IUGLLWBU-CRXa9Kxy.js +1 -0
- package/assets/ganttDiagram-R7GPNTJY-Cu2I55Wb.js +1 -0
- package/assets/gitGraphDiagram-PDYL7XHY-CwSo663I.js +1 -0
- package/assets/graph-Dz7AM1Q5.js +1 -0
- package/assets/index-BJ-NdQc4.js +100 -0
- package/assets/infoDiagram-MVDRKAX5-D3Qknzuo.js +1 -0
- package/assets/ishikawaDiagram-HPEHV2GE-9qYT75tk.js +1 -0
- package/assets/journeyDiagram-BOSHW7O7-DeSrJg9o.js +1 -0
- package/assets/kanban-definition-FNSA4HC5-DINkB6G7.js +1 -0
- package/assets/katex-DN8cTsI3.js +1 -0
- package/assets/markdown-S2mWvoE-.js +5 -0
- package/assets/mermaid-T_6Ze_cT.js +7 -0
- package/assets/mindmap-definition-6OY57UG3-DW5hqiAe.js +1 -0
- package/assets/pegDiagram-ECIUJNBX-BWy_tkzy.js +1 -0
- package/assets/pieDiagram-GNMPY74T-CniJbr6l.js +1 -0
- package/assets/quadrantDiagram-D57K4MC3-BVnDJkCv.js +1 -0
- package/assets/railroadDiagram-Y72NRBL7-BNKZpJJb.js +1 -0
- package/assets/requirementDiagram-EQYSW5RA-BETipHj0.js +1 -0
- package/assets/sankeyDiagram-SY24JHO5-ByEYqT7T.js +1 -0
- package/assets/sequenceDiagram-BLEHNHQU-BqCJ2tKG.js +1 -0
- package/assets/sizeCapture-INFHLROL-DlhrWFj-.js +1 -0
- package/assets/stateDiagram-v2-A6IESKWZ-DJUBWLTP.js +1 -0
- package/assets/swimlanes-B3ENRKFQ-D7k7tF5U.js +1 -0
- package/assets/swimlanesDiagram-AYQRV4AK-DoQBgB9o.js +1 -0
- package/assets/timeline-definition-JXYKGLGB-BCNhwnn6.js +1 -0
- package/assets/usecaseDiagram-WPOLBNNX-DRa_Rgl3.js +1 -0
- package/assets/vennDiagram-Q3Y3IDCW-Ba2eaO68.js +1 -0
- package/assets/wardleyDiagram-IVAIDKWA-W_i9vzY-.js +1 -0
- package/assets/xychartDiagram-4URNHDU4-ByfaGjvc.js +1 -0
- package/index.html +3 -3
- package/package.json +1 -1
- package/plugin.json +1 -1
- package/preload/git-panel.js +29 -5
- package/preload/git-service.js +48 -15
- package/preload/remote-setup.js +66 -33
- package/preload/remote-wizard.js +2 -0
- package/preload.js +30 -0
- package/assets/abnfDiagram-WEYOIA3C-BgXsTF7a.js +0 -1
- package/assets/architectureDiagram-ZHVYKT53-BsCWa_qC.js +0 -36
- package/assets/blockDiagram-RJAE7QA3-wbIxEiYN.js +0 -140
- package/assets/c4Diagram-XDPPPE54-5zdyxFvA.js +0 -38
- package/assets/chunk-2E7WHVMD-F85Lca-i.js +0 -88
- package/assets/chunk-2Q5K7J3B-CjpAZ0OI.js +0 -1
- package/assets/chunk-4EMNKR2T-C8Kbh83c.js +0 -1
- package/assets/chunk-55XCU76K-BINcFiLN.js +0 -1
- package/assets/chunk-5VM5RSS4-Diy5h2LS.js +0 -15
- package/assets/chunk-JWPE2WC7-BXnjDdh1.js +0 -1
- package/assets/chunk-VQ5W62QI-BM7ZZo1I.js +0 -1
- package/assets/chunk-XXDRQBXY-CW8CjB1w.js +0 -1
- package/assets/chunk-ZCHMQSOR-C7ATz1L1.js +0 -2
- package/assets/classDiagram-v2-4MYWR3UA-CMoqNk-b.js +0 -217
- package/assets/cose-bilkent-JH36ORCC-6rqR5iJk.js +0 -1
- package/assets/cynefin-EF2NZ3EQ-DypLIJxl.js +0 -141
- package/assets/cynefinDiagram-WF24UDRP-8b2CEBlR.js +0 -62
- package/assets/cytoscape.esm-CjX6Hyah.js +0 -331
- package/assets/dagre-NK4GIZVX-Dv6vuUbR.js +0 -4
- package/assets/diagram-CBK3MWTC-DJgMDeYd.js +0 -24
- package/assets/diagram-I5XIIV2D-BB9cMoRW.js +0 -24
- package/assets/diagram-ODIL2UCW-BVcRtsdy.js +0 -30
- package/assets/diagram-PFBEJUXE-BbGSOtJx.js +0 -3
- package/assets/diagram-RJA3I4VV-CzkY_8Fo.js +0 -41
- package/assets/diagram-TYUNFSNR-YTl5QdfL.js +0 -200
- package/assets/ebnfDiagram-V4P3TTPT-COVjPAjE.js +0 -1
- package/assets/echarts-BAPDkhe3.js +0 -61
- package/assets/elk-QONTBCTQ-DHsjY8Z_.js +0 -27
- package/assets/erDiagram-KYQIGQAA-CUAbTUl1.js +0 -99
- package/assets/flowDiagram-IUGLLWBU-CWsiqTQC.js +0 -213
- package/assets/ganttDiagram-R7GPNTJY-DetBW0Wm.js +0 -292
- package/assets/gitGraphDiagram-PDYL7XHY-ByrdgJmw.js +0 -106
- package/assets/graph-D8UmR1vK.js +0 -1
- package/assets/index-B17NCAw4.js +0 -758
- package/assets/infoDiagram-MVDRKAX5-BM48fjhU.js +0 -2
- package/assets/ishikawaDiagram-HPEHV2GE-DtHYywHZ.js +0 -70
- package/assets/journeyDiagram-BOSHW7O7-DJ1LiRh3.js +0 -139
- package/assets/kanban-definition-FNSA4HC5-DPPt8pwJ.js +0 -89
- package/assets/katex-CQL9J12G.js +0 -257
- package/assets/markdown-DVehI1Sg.js +0 -314
- package/assets/mermaid-C_q9pug0.js +0 -312
- package/assets/mindmap-definition-6OY57UG3-zbqYOEY6.js +0 -98
- package/assets/pegDiagram-ECIUJNBX-e7QG7TMq.js +0 -1
- package/assets/pieDiagram-GNMPY74T-Duf6YP0N.js +0 -39
- package/assets/quadrantDiagram-D57K4MC3-B2eYoUUy.js +0 -7
- package/assets/railroadDiagram-Y72NRBL7-BWCzPcI_.js +0 -1
- package/assets/requirementDiagram-EQYSW5RA-HhPMEqB1.js +0 -84
- package/assets/sankeyDiagram-SY24JHO5-CMUTwFBB.js +0 -40
- package/assets/sequenceDiagram-BLEHNHQU-C9wR2ll7.js +0 -169
- package/assets/sizeCapture-INFHLROL-DXfz37S6.js +0 -1
- package/assets/stateDiagram-v2-A6IESKWZ-D_gtonhE.js +0 -291
- package/assets/swimlanes-B3ENRKFQ-DdJOuuMV.js +0 -1
- package/assets/swimlanesDiagram-AYQRV4AK-BWt3HxHV.js +0 -8
- package/assets/timeline-definition-JXYKGLGB-DQsdwJe-.js +0 -120
- package/assets/usecaseDiagram-WPOLBNNX-DTRyFq7d.js +0 -370
- package/assets/vennDiagram-Q3Y3IDCW-dihYszm0.js +0 -34
- package/assets/wardleyDiagram-IVAIDKWA-BoPpgYfK.js +0 -78
- package/assets/xychartDiagram-4URNHDU4-DoLjYxeB.js +0 -7
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as e,a as n,c as t,b as r,f as o,e as a,i}from"./chunk-ZCHMQSOR-C5VhW-wL.js";import{_ as u,c as d,l as s,bc as c,bd as f,aE as g,aj as l,af as h,ad as p,ai as v,ak as y}from"./mermaid-T_6Ze_cT.js";import{i as b,a as w,d as m,e as x,b as E,c as L,f as j,g as O,h as k,j as N,s as I,o as S,k as P,l as _,m as C,r as M,U as R,S as T,n as X,p as A,q as D,t as B,u as G,v as F,w as V,x as Y,y as q,z as U,A as z,B as J,C as $,D as H,E as Q,F as W,H as Z,I as K,J as ee,K as ne,L as te,M as re,N as oe,O as ae,P as ie,Q as ue,R as de,G as se,T as ce,V as fe,W as ge,X as le,Y as he,Z as pe}from"./graph-Dz7AM1Q5.js";import"./markdown-S2mWvoE-.js";var ve=/\s/;var ye=/^\s+/;function be(e){return e?e.slice(0,function(e){for(var n=e.length;n--&&ve.test(e.charAt(n)););return n}(e)+1).replace(ye,""):e}var we=/^[-+]0x[0-9a-f]+$/i,me=/^0b[01]+$/i,xe=/^0o[0-7]+$/i,Ee=parseInt;var Le=1/0;function je(e){return e?(e=function(e){if("number"==typeof e)return e;if(b(e))return NaN;if(w(e)){var n="function"==typeof e.valueOf?e.valueOf():e;e=w(n)?n+"":n}if("string"!=typeof e)return 0===e?e:+e;e=be(e);var t=me.test(e);return t||xe.test(e)?Ee(e.slice(2),t?2:8):we.test(e)?NaN:+e}(e))===Le||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}var Oe=Object.create,ke=function(){function e(){}return function(n){if(!w(n))return{};if(Oe)return Oe(n);e.prototype=n;var t=new e;return e.prototype=void 0,t}}();function Ne(e,n,t){"__proto__"==n&&m?m(e,n,{configurable:!0,enumerable:!0,value:t,writable:!0}):e[n]=t}var Ie=Object.prototype.hasOwnProperty;function Se(e,n,t){var r=e[n];Ie.call(e,n)&&x(r,t)&&(void 0!==t||n in e)||Ne(e,n,t)}function Pe(e,n,t){if(!w(t))return!1;var r=typeof n;return!!("number"==r?E(t)&&L(n,t.length):"string"==r&&n in t)&&x(t[n],e)}var _e=Object.prototype.hasOwnProperty;function Ce(e){if(!w(e))return function(e){var n=[];if(null!=e)for(var t in Object(e))n.push(t);return n}(e);var n=O(e),t=[];for(var r in e)("constructor"!=r||!n&&_e.call(e,r))&&t.push(r);return t}function Me(e){return E(e)?k(e,!0):Ce(e)}function Re(e){return(null==e?0:e.length)?N(e):[]}var Te=P(Object.getPrototypeOf,Object),Xe=Function.prototype,Ae=Object.prototype,De=Xe.toString,Be=Ae.hasOwnProperty,Ge=De.call(Object);var Fe="object"==typeof exports&&exports&&!exports.nodeType&&exports,Ve=Fe&&"object"==typeof module&&module&&!module.nodeType&&module,Ye=Ve&&Ve.exports===Fe?M.Buffer:void 0,qe=Ye?Ye.allocUnsafe:void 0;function Ue(e,n){if(n)return e.slice();var t=e.length,r=qe?qe(t):new e.constructor(t);return e.copy(r),r}var ze=Object.prototype.hasOwnProperty;function Je(e){var n=new e.constructor(e.byteLength);return new R(n).set(new R(e)),n}var $e=/\w*$/;var He=T?T.prototype:void 0,Qe=He?He.valueOf:void 0;function We(e,n){var t=n?Je(e.buffer):e.buffer;return new e.constructor(t,e.byteOffset,e.length)}function Ze(e,n,t){var r,o,a,i,u,d=e.constructor;switch(n){case"[object ArrayBuffer]":return Je(e);case"[object Boolean]":case"[object Date]":return new d(+e);case"[object DataView]":return u=Je((i=e).buffer),new i.constructor(u,i.byteOffset,i.byteLength);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return We(e,t);case"[object Map]":case"[object Set]":return new d;case"[object Number]":case"[object String]":return new d(e);case"[object RegExp]":return(a=new(o=e).constructor(o.source,$e.exec(o))).lastIndex=o.lastIndex,a;case"[object Symbol]":return r=e,Qe?Object(Qe.call(r)):{}}}function Ke(e){return"function"!=typeof e.constructor||O(e)?{}:ke(Te(e))}var en=D&&D.isMap,nn=en?A(en):function(e){return _(e)&&"[object Map]"==X(e)};var tn=D&&D.isSet,rn=tn?A(tn):function(e){return _(e)&&"[object Set]"==X(e)},on="[object Arguments]",an="[object Function]",un="[object Object]",dn={};function sn(e,n,t,r,o,a){var i,u=1&n;if(void 0!==i)return i;if(!w(e))return e;var d=V(e);if(d)i=function(e){var n=e.length,t=new e.constructor(n);return n&&"string"==typeof e[0]&&ze.call(e,"index")&&(t.index=e.index,t.input=e.input),t}(e);else{var s=X(e),c=s==an||"[object GeneratorFunction]"==s;if(B(e))return Ue(e,u);if(s==un||s==on||c&&!o)i=c?{}:Ke(e);else{if(!dn[s])return o?e:{};i=Ze(e,s,u)}}a||(a=new G);var f=a.get(e);if(f)return f;a.set(e,i),rn(e)?e.forEach(function(r){i.add(sn(r,n,t,r,e,a))}):nn(e)&&e.forEach(function(r,o){i.set(o,sn(r,n,t,o,e,a))});var g=d?void 0:Y(e);return F(g||e,function(r,o){g&&(r=e[o=r]),Se(i,o,sn(r,n,t,o,e,a))}),i}dn[on]=dn["[object Array]"]=dn["[object ArrayBuffer]"]=dn["[object DataView]"]=dn["[object Boolean]"]=dn["[object Date]"]=dn["[object Float32Array]"]=dn["[object Float64Array]"]=dn["[object Int8Array]"]=dn["[object Int16Array]"]=dn["[object Int32Array]"]=dn["[object Map]"]=dn["[object Number]"]=dn[un]=dn["[object RegExp]"]=dn["[object Set]"]=dn["[object String]"]=dn["[object Symbol]"]=dn["[object Uint8Array]"]=dn["[object Uint8ClampedArray]"]=dn["[object Uint16Array]"]=dn["[object Uint32Array]"]=!0,dn["[object Error]"]=dn[an]=dn["[object WeakMap]"]=!1;function cn(e){return sn(e,5)}var fn=Object.prototype,gn=fn.hasOwnProperty,ln=j(function(e,n){e=Object(e);var t=-1,r=n.length,o=r>2?n[2]:void 0;for(o&&Pe(n[0],n[1],o)&&(r=1);++t<r;)for(var a=n[t],i=Me(a),u=-1,d=i.length;++u<d;){var s=i[u],c=e[s];(void 0===c||x(c,fn[s])&&!gn.call(e,s))&&(e[s]=a[s])}return e});function hn(e,n,t){(void 0!==t&&!x(e[n],t)||void 0===t&&!(n in e))&&Ne(e,n,t)}function pn(e,n){if(("constructor"!==n||"function"!=typeof e[n])&&"__proto__"!=n)return e[n]}function vn(e){return function(e,n,t){var r=!t;t||(t={});for(var o=-1,a=n.length;++o<a;){var i=n[o],u=void 0;void 0===u&&(u=e[i]),r?Ne(t,i,u):Se(t,i,u)}return t}(e,Me(e))}function yn(e,n,t,r,o,a,i){var u=pn(e,t),d=pn(n,t),s=i.get(d);if(s)hn(e,t,s);else{var c=a?a(u,d,t+"",e,n,i):void 0,f=void 0===c;if(f){var g=V(d),l=!g&&B(d),h=!g&&!l&&q(d);c=d,g||l||h?V(u)?c=u:U(u)?c=function(e,n){var t=-1,r=e.length;for(n||(n=Array(r));++t<r;)n[t]=e[t];return n}(u):l?(f=!1,c=Ue(d,!0)):h?(f=!1,c=We(d,!0)):c=[]:function(e){if(!_(e)||"[object Object]"!=C(e))return!1;var n=Te(e);if(null===n)return!0;var t=Be.call(n,"constructor")&&n.constructor;return"function"==typeof t&&t instanceof t&&De.call(t)==Ge}(d)||z(d)?(c=u,z(u)?c=vn(u):w(u)&&!J(u)||(c=Ke(d))):f=!1}f&&(i.set(d,c),o(c,d,r,a,i),i.delete(d)),hn(e,t,c)}}function bn(e,n,t,r,o){e!==n&&$(n,function(a,i){if(o||(o=new G),w(a))yn(e,n,i,t,bn,r,o);else{var u=r?r(pn(e,i),a,i+"",e,n,o):void 0;void 0===u&&(u=a),hn(e,i,u)}},Me)}function wn(e){var n=null==e?0:e.length;return n?e[n-1]:void 0}var mn=Math.max;var xn,En=(xn=function(e,n,t){var r=null==e?0:e.length;if(!r)return-1;var o,a,i=null==t?0:(o=je(t),a=o%1,o==o?a?o-a:o:0);return i<0&&(i=mn(r+i,0)),W(e,H(n),i)},function(e,n,t){var r=Object(e);if(!E(e)){var o=H(n);e=Q(e),n=function(e){return o(r[e],e,r)}}var a=xn(e,n,t);return a>-1?r[o?e[a]:a]:void 0});function Ln(e,n){var t=-1,r=E(e)?Array(e.length):[];return Z(e,function(e,o,a){r[++t]=n(e,o,a)}),r}function jn(e,n){return(V(e)?K:Ln)(e,H(n))}function On(e,n){return e>n}var kn=Object.prototype.hasOwnProperty;function Nn(e,n){return null!=e&&kn.call(e,n)}function In(e,n){return null!=e&&te(e,n,Nn)}function Sn(e,n){return e<n}function Pn(e,n){var t={};return n=H(n),ne(e,function(e,r,o){Ne(t,r,n(e,r,o))}),t}function _n(e,n,t){for(var r=-1,o=e.length;++r<o;){var a=e[r],i=n(a);if(null!=i&&(void 0===u?i==i&&!b(i):t(i,u)))var u=i,d=a}return d}function Cn(e){return e&&e.length?_n(e,re,On):void 0}var Mn,Rn=(Mn=function(e,n,t){bn(e,n,t)},j(function(e,n){var t=-1,r=n.length,o=r>1?n[r-1]:void 0,a=r>2?n[2]:void 0;for(o=Mn.length>3&&"function"==typeof o?(r--,o):void 0,a&&Pe(n[0],n[1],a)&&(o=r<3?void 0:o,r=1),e=Object(e);++t<r;){var i=n[t];i&&Mn(e,i,t,o)}return e}));function Tn(e){return e&&e.length?_n(e,re,Sn):void 0}function Xn(e,n){return e&&e.length?_n(e,H(n),Sn):void 0}function An(e,n,t,r){if(!w(e))return e;for(var o=-1,a=(n=oe(n,e)).length,i=a-1,u=e;null!=u&&++o<a;){var d=ae(n[o]),s=t;if("__proto__"===d||"constructor"===d||"prototype"===d)return e;if(o!=i){var c=u[d];void 0===(s=void 0)&&(s=w(c)?c:L(n[o+1])?[]:{})}Se(u,d,s),u=u[d]}return e}function Dn(e,n){if(e!==n){var t=void 0!==e,r=null===e,o=e==e,a=b(e),i=void 0!==n,u=null===n,d=n==n,s=b(n);if(!u&&!s&&!a&&e>n||a&&i&&d&&!u&&!s||r&&i&&d||!t&&d||!o)return 1;if(!r&&!a&&!s&&e<n||s&&t&&o&&!r&&!a||u&&t&&o||!i&&o||!d)return-1}return 0}function Bn(e,n,t){n=n.length?K(n,function(e){return V(e)?function(n){return ie(n,1===e.length?e[0]:e)}:e}):[re];var r=-1;return n=K(n,A(H)),function(e,n){var t=e.length;for(e.sort(n);t--;)e[t]=e[t].value;return e}(Ln(e,function(e,t,o){return{criteria:K(n,function(n){return n(e)}),index:++r,value:e}}),function(e,n){return function(e,n,t){for(var r=-1,o=e.criteria,a=n.criteria,i=o.length,u=t.length;++r<i;){var d=Dn(o[r],a[r]);if(d)return r>=u?d:d*("desc"==t[r]?-1:1)}return e.index-n.index}(e,n,t)})}function Gn(e,n){return function(e,n,t){for(var r=-1,o=n.length,a={};++r<o;){var i=n[r],u=ie(e,i);t(u,i)&&An(a,oe(i,e),u)}return a}(e,n,function(n,t){return ue(e,t)})}var Fn,Vn=I(S(Fn=function(e,n){return null==e?{}:Gn(e,n)},void 0,Re),Fn+""),Yn=Math.ceil,qn=Math.max;var Un=function(e,n,t){return t&&"number"!=typeof t&&Pe(e,n,t)&&(n=t=void 0),e=je(e),void 0===n?(n=e,e=0):n=je(n),function(e,n,t){for(var r=-1,o=qn(Yn((n-e)/(t||1)),0),a=Array(o);o--;)a[++r]=e,e+=t;return a}(e,n,t=void 0===t?e<n?1:-1:je(t))},zn=j(function(e,n){if(null==e)return[];var t=n.length;return t>1&&Pe(e,n[0],n[1])?n=[]:t>2&&Pe(n[0],n[1],n[2])&&(n=[n[0]]),Bn(e,N(n),[])}),Jn=0;function $n(e){var n=++Jn;return de(e)+n}class Hn{constructor(){var e={};e._next=e._prev=e,this._sentinel=e}dequeue(){var e=this._sentinel,n=e._prev;if(n!==e)return Qn(n),n}enqueue(e){var n=this._sentinel;e._prev&&e._next&&Qn(e),e._next=n._next,n._next._prev=e,n._next=e,e._prev=n}toString(){for(var e=[],n=this._sentinel,t=n._prev;t!==n;)e.push(JSON.stringify(t,Wn)),t=t._prev;return"["+e.join(", ")+"]"}}function Qn(e){e._prev._next=e._next,e._next._prev=e._prev,delete e._next,delete e._prev}function Wn(e,n){if("_next"!==e&&"_prev"!==e)return n}var Zn=fe(1);function Kn(e,n){if(e.nodeCount()<=1)return[];var t=function(e,n){var t=new se,r=0,o=0;ce(e.nodes(),function(e){t.setNode(e,{v:e,in:0,out:0})}),ce(e.edges(),function(e){var a=t.edge(e.v,e.w)||0,i=n(e),u=a+i;t.setEdge(e.v,e.w,u),o=Math.max(o,t.node(e.v).out+=i),r=Math.max(r,t.node(e.w).in+=i)});var a=Un(o+r+3).map(function(){return new Hn}),i=r+1;return ce(t.nodes(),function(e){nt(a,i,t.node(e))}),{graph:t,buckets:a,zeroIdx:i}}(e,n||Zn),r=function(e,n,t){var r,o=[],a=n[n.length-1],i=n[0];for(;e.nodeCount();){for(;r=i.dequeue();)et(e,n,t,r);for(;r=a.dequeue();)et(e,n,t,r);if(e.nodeCount())for(var u=n.length-2;u>0;--u)if(r=n[u].dequeue()){o=o.concat(et(e,n,t,r,!0));break}}return o}(t.graph,t.buckets,t.zeroIdx);return Re(jn(r,function(n){return e.outEdges(n.v,n.w)}))}function et(e,n,t,r,o){var a=o?[]:void 0;return ce(e.inEdges(r.v),function(r){var i=e.edge(r),u=e.node(r.v);o&&a.push({v:r.v,w:r.w}),u.out-=i,nt(n,t,u)}),ce(e.outEdges(r.v),function(r){var o=e.edge(r),a=r.w,i=e.node(a);i.in-=o,nt(n,t,i)}),e.removeNode(r.v),a}function nt(e,n,t){t.out?t.in?e[t.out-t.in+n].enqueue(t):e[e.length-1].enqueue(t):e[0].enqueue(t)}function tt(e){var n="greedy"===e.graph().acyclicer?Kn(e,function(e){return function(n){return e.edge(n).weight}}(e)):function(e){var n=[],t={},r={};function o(a){Object.prototype.hasOwnProperty.call(r,a)||(r[a]=!0,t[a]=!0,ce(e.outEdges(a),function(e){Object.prototype.hasOwnProperty.call(t,e.w)?n.push(e):o(e.w)}),delete t[a])}return ce(e.nodes(),o),n}(e);ce(n,function(n){var t=e.edge(n);e.removeEdge(n),t.forwardName=n.name,t.reversed=!0,e.setEdge(n.w,n.v,t,$n("rev"))})}function rt(e,n,t,r){var o;do{o=$n(r)}while(e.hasNode(o));return t.dummy=n,e.setNode(o,t),o}function ot(e){var n=new se({multigraph:e.isMultigraph()}).setGraph(e.graph());return ce(e.nodes(),function(t){e.children(t).length||n.setNode(t,e.node(t))}),ce(e.edges(),function(t){n.setEdge(t,e.edge(t))}),n}function at(e,n){var t,r,o=e.x,a=e.y,i=n.x-o,u=n.y-a,d=e.width/2,s=e.height/2;if(!i&&!u)throw new Error("Not possible to find intersection inside of the rectangle");return Math.abs(u)*d>Math.abs(i)*s?(u<0&&(s=-s),t=s*i/u,r=s):(i<0&&(d=-d),t=d,r=d*u/i),{x:o+t,y:a+r}}function it(e){var n=jn(Un(dt(e)+1),function(){return[]});return ce(e.nodes(),function(t){var r=e.node(t),o=r.rank;ge(o)||(n[o][r.order]=t)}),n}function ut(e,n,t,r){var o={width:0,height:0};return arguments.length>=4&&(o.rank=t,o.order=r),rt(e,"border",o,n)}function dt(e){return Cn(jn(e.nodes(),function(n){var t=e.node(n).rank;if(!ge(t))return t}))}function st(e,n){return n()}function ct(e,n,t,r,o,a){var i={width:0,height:0,rank:a,borderType:n},u=o[n][a-1],d=rt(e,"border",i,t);o[n][a]=d,e.setParent(d,r),u&&e.setEdge(u,d,{weight:1})}function ft(e){var n=e.graph().rankdir.toLowerCase();"bt"!==n&&"rl"!==n||function(e){ce(e.nodes(),function(n){ht(e.node(n))}),ce(e.edges(),function(n){var t=e.edge(n);ce(t.points,ht),Object.prototype.hasOwnProperty.call(t,"y")&&ht(t)})}(e),"lr"!==n&&"rl"!==n||(!function(e){ce(e.nodes(),function(n){pt(e.node(n))}),ce(e.edges(),function(n){var t=e.edge(n);ce(t.points,pt),Object.prototype.hasOwnProperty.call(t,"x")&&pt(t)})}(e),gt(e))}function gt(e){ce(e.nodes(),function(n){lt(e.node(n))}),ce(e.edges(),function(n){lt(e.edge(n))})}function lt(e){var n=e.width;e.width=e.height,e.height=n}function ht(e){e.y=-e.y}function pt(e){var n=e.x;e.x=e.y,e.y=n}function vt(e){e.graph().dummyChains=[],ce(e.edges(),function(n){!function(e,n){var t=n.v,r=e.node(t).rank,o=n.w,a=e.node(o).rank,i=n.name,u=e.edge(n),d=u.labelRank;if(a===r+1)return;e.removeEdge(n);var s,c,f=void 0;for(c=0,++r;r<a;++c,++r)u.points=[],s=rt(e,"edge",f={width:0,height:0,edgeLabel:u,edgeObj:n,rank:r},"_d"),r===d&&(f.width=u.width,f.height=u.height,f.dummy="edge-label",f.labelpos=u.labelpos),e.setEdge(t,s,{weight:u.weight},i),0===c&&e.graph().dummyChains.push(s),t=s;e.setEdge(t,o,{weight:u.weight},i)}(e,n)})}function yt(e){var n={};ce(e.sources(),function t(r){var o=e.node(r);if(Object.prototype.hasOwnProperty.call(n,r))return o.rank;n[r]=!0;var a=Tn(jn(e.outEdges(r),function(n){return t(n.w)-e.edge(n).minlen}));return a!==Number.POSITIVE_INFINITY&&null!=a||(a=0),o.rank=a})}function bt(e,n){return e.node(n.w).rank-e.node(n.v).rank-e.edge(n).minlen}function wt(e){var n,t,r=new se({directed:!1}),o=e.nodes()[0],a=e.nodeCount();for(r.setNode(o,{});mt(r,e)<a;)n=xt(r,e),t=r.hasNode(n.v)?bt(e,n):-bt(e,n),Et(r,e,t);return r}function mt(e,n){return ce(e.nodes(),function t(r){ce(n.nodeEdges(r),function(o){var a=o.v,i=r===a?o.w:a;e.hasNode(i)||bt(n,o)||(e.setNode(i,{}),e.setEdge(r,i,{}),t(i))})}),e.nodeCount()}function xt(e,n){return Xn(n.edges(),function(t){if(e.hasNode(t.v)!==e.hasNode(t.w))return bt(n,t)})}function Et(e,n,t){ce(e.nodes(),function(e){n.node(e).rank+=t})}function Lt(e,n,t){V(n)||(n=[n]);var r=(e.isDirected()?e.successors:e.neighbors).bind(e),o=[],a={};return ce(n,function(n){if(!e.hasNode(n))throw new Error("Graph does not have node: "+n);jt(e,n,"post"===t,a,r,o)}),o}function jt(e,n,t,r,o,a){Object.prototype.hasOwnProperty.call(r,n)||(r[n]=!0,t||a.push(n),ce(o(n),function(n){jt(e,n,t,r,o,a)}),t&&a.push(n))}function Ot(e){e=function(e){var n=(new se).setGraph(e.graph());return ce(e.nodes(),function(t){n.setNode(t,e.node(t))}),ce(e.edges(),function(t){var r=n.edge(t.v,t.w)||{weight:0,minlen:1},o=e.edge(t);n.setEdge(t.v,t.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})}),n}(e),yt(e);var n,t=wt(e);for(It(t),kt(t,e);n=Pt(t);)Ct(t,e,n,_t(t,e,n))}function kt(e,n){var t=function(e,n){return Lt(e,n,"post")}(e,e.nodes());t=t.slice(0,t.length-1),ce(t,function(t){!function(e,n,t){var r=e.node(t),o=r.parent;e.edge(t,o).cutvalue=Nt(e,n,t)}(e,n,t)})}function Nt(e,n,t){var r=e.node(t).parent,o=!0,a=n.edge(t,r),i=0;return a||(o=!1,a=n.edge(r,t)),i=a.weight,ce(n.nodeEdges(t),function(a){var u,d,s=a.v===t,c=s?a.w:a.v;if(c!==r){var f=s===o,g=n.edge(a).weight;if(i+=f?g:-g,u=t,d=c,e.hasEdge(u,d)){var l=e.edge(t,c).cutvalue;i+=f?-l:l}}}),i}function It(e,n){arguments.length<2&&(n=e.nodes()[0]),St(e,{},1,n)}function St(e,n,t,r,o){var a=t,i=e.node(r);return n[r]=!0,ce(e.neighbors(r),function(o){Object.prototype.hasOwnProperty.call(n,o)||(t=St(e,n,t,o,r))}),i.low=a,i.lim=t++,o?i.parent=o:delete i.parent,t}function Pt(e){return En(e.edges(),function(n){return e.edge(n).cutvalue<0})}function _t(e,n,t){var r=t.v,o=t.w;n.hasEdge(r,o)||(r=t.w,o=t.v);var a=e.node(r),i=e.node(o),u=a,d=!1;a.lim>i.lim&&(u=i,d=!0);var s=le(n.edges(),function(n){return d===Mt(e,e.node(n.v),u)&&d!==Mt(e,e.node(n.w),u)});return Xn(s,function(e){return bt(n,e)})}function Ct(e,n,t,r){var o=t.v,a=t.w;e.removeEdge(o,a),e.setEdge(r.v,r.w,{}),It(e),kt(e,n),function(e,n){var t=En(e.nodes(),function(e){return!n.node(e).parent}),r=function(e,n){return Lt(e,n,"pre")}(e,t);r=r.slice(1),ce(r,function(t){var r=e.node(t).parent,o=n.edge(t,r),a=!1;o||(o=n.edge(r,t),a=!0),n.node(t).rank=n.node(r).rank+(a?o.minlen:-o.minlen)})}(e,n)}function Mt(e,n,t){return t.low<=n.lim&&n.lim<=t.lim}function Rt(e){switch(e.graph().ranker){case"network-simplex":default:Xt(e);break;case"tight-tree":!function(e){yt(e),wt(e)}(e);break;case"longest-path":Tt(e)}}new Error,Ot.initLowLimValues=It,Ot.initCutValues=kt,Ot.calcCutValue=Nt,Ot.leaveEdge=Pt,Ot.enterEdge=_t,Ot.exchangeEdges=Ct;var Tt=yt;function Xt(e){Ot(e)}function At(e){var n=rt(e,"root",{},"_root"),t=function(e){var n={};function t(r,o){var a=e.children(r);a&&a.length&&ce(a,function(e){t(e,o+1)}),n[r]=o}return ce(e.children(),function(e){t(e,1)}),n}(e),r=Cn(he(t))-1,o=2*r+1;e.graph().nestingRoot=n,ce(e.edges(),function(n){e.edge(n).minlen*=o});var a=function(e){return pe(e.edges(),function(n,t){return n+e.edge(t).weight},0)}(e)+1;ce(e.children(),function(i){Dt(e,n,o,a,r,t,i)}),e.graph().nodeRankFactor=o}function Dt(e,n,t,r,o,a,i){var u=e.children(i);if(u.length){var d=ut(e,"_bt"),s=ut(e,"_bb"),c=e.node(i);e.setParent(d,i),c.borderTop=d,e.setParent(s,i),c.borderBottom=s,ce(u,function(u){Dt(e,n,t,r,o,a,u);var c=e.node(u),f=c.borderTop?c.borderTop:u,g=c.borderBottom?c.borderBottom:u,l=c.borderTop?r:2*r,h=f!==g?1:o-a[i]+1;e.setEdge(d,f,{weight:l,minlen:h,nestingEdge:!0}),e.setEdge(g,s,{weight:l,minlen:h,nestingEdge:!0})}),e.parent(i)||e.setEdge(n,d,{weight:0,minlen:o+a[i]})}else i!==n&&e.setEdge(n,i,{weight:0,minlen:t})}function Bt(e,n,t){var r=function(e){var n;for(;e.hasNode(n=$n("_root")););return n}(e),o=new se({compound:!0}).setGraph({root:r}).setDefaultNodeLabel(function(n){return e.node(n)});return ce(e.nodes(),function(a){var i=e.node(a),u=e.parent(a);(i.rank===n||i.minRank<=n&&n<=i.maxRank)&&(o.setNode(a),o.setParent(a,u||r),ce(e[t](a),function(n){var t=n.v===a?n.w:n.v,r=o.edge(t,a),i=ge(r)?0:r.weight;o.setEdge(t,a,{weight:e.edge(n).weight+i})}),Object.prototype.hasOwnProperty.call(i,"minRank")&&o.setNode(a,{borderLeft:i.borderLeft[n],borderRight:i.borderRight[n]}))}),o}function Gt(e,n){for(var t=0,r=1;r<n.length;++r)t+=Ft(e,n[r-1],n[r]);return t}function Ft(e,n,t){for(var r=function(e,n){return function(e,n,t){for(var r=-1,o=e.length,a=n.length,i={};++r<o;){var u=r<a?n[r]:void 0;t(i,e[r],u)}return i}(e||[],n||[],Se)}(t,jn(t,function(e,n){return n})),o=Re(jn(n,function(n){return zn(jn(e.outEdges(n),function(n){return{pos:r[n.w],weight:e.edge(n).weight}}),"pos")})),a=1;a<t.length;)a<<=1;var i=2*a-1;a-=1;var u=jn(new Array(i),function(){return 0}),d=0;return ce(o.forEach(function(e){var n=e.pos+a;u[n]+=e.weight;for(var t=0;n>0;)n%2&&(t+=u[n+1]),u[n=n-1>>1]+=e.weight;d+=e.weight*t})),d}function Vt(e,n){var t={};return ce(e,function(e,n){var r=t[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:n};ge(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)}),ce(n.edges(),function(e){var n=t[e.v],r=t[e.w];ge(n)||ge(r)||(r.indegree++,n.out.push(t[e.w]))}),function(e){var n=[];function t(e){return function(n){n.merged||(ge(n.barycenter)||ge(e.barycenter)||n.barycenter>=e.barycenter)&&function(e,n){var t=0,r=0;e.weight&&(t+=e.barycenter*e.weight,r+=e.weight);n.weight&&(t+=n.barycenter*n.weight,r+=n.weight);e.vs=n.vs.concat(e.vs),e.barycenter=t/r,e.weight=r,e.i=Math.min(n.i,e.i),n.merged=!0}(e,n)}}function r(n){return function(t){t.in.push(n),0===--t.indegree&&e.push(t)}}for(;e.length;){var o=e.pop();n.push(o),ce(o.in.reverse(),t(o)),ce(o.out,r(o))}return jn(le(n,function(e){return!e.merged}),function(e){return Vn(e,["vs","i","barycenter","weight"])})}(le(t,function(e){return!e.indegree}))}function Yt(e,n){var t,r=function(e,n){var t={lhs:[],rhs:[]};return ce(e,function(e){n(e)?t.lhs.push(e):t.rhs.push(e)}),t}(e,function(e){return Object.prototype.hasOwnProperty.call(e,"barycenter")}),o=r.lhs,a=zn(r.rhs,function(e){return-e.i}),i=[],u=0,d=0,s=0;o.sort((t=!!n,function(e,n){return e.barycenter<n.barycenter?-1:e.barycenter>n.barycenter?1:t?n.i-e.i:e.i-n.i})),s=qt(i,a,s),ce(o,function(e){s+=e.vs.length,i.push(e.vs),u+=e.barycenter*e.weight,d+=e.weight,s=qt(i,a,s)});var c={vs:Re(i)};return d&&(c.barycenter=u/d,c.weight=d),c}function qt(e,n,t){for(var r;n.length&&(r=wn(n)).i<=t;)n.pop(),e.push(r.vs),t++;return t}function Ut(e,n,t,r){var o=e.children(n),a=e.node(n),i=a?a.borderLeft:void 0,u=a?a.borderRight:void 0,d={};i&&(o=le(o,function(e){return e!==i&&e!==u}));var s=function(e,n){return jn(n,function(n){var t=e.inEdges(n);if(t.length){var r=pe(t,function(n,t){var r=e.edge(t),o=e.node(t.v);return{sum:n.sum+r.weight*o.order,weight:n.weight+r.weight}},{sum:0,weight:0});return{v:n,barycenter:r.sum/r.weight,weight:r.weight}}return{v:n}})}(e,o);ce(s,function(n){if(e.children(n.v).length){var o=Ut(e,n.v,t,r);d[n.v]=o,Object.prototype.hasOwnProperty.call(o,"barycenter")&&(i=o,ge((a=n).barycenter)?(a.barycenter=i.barycenter,a.weight=i.weight):(a.barycenter=(a.barycenter*a.weight+i.barycenter*i.weight)/(a.weight+i.weight),a.weight+=i.weight))}var a,i});var c=Vt(s,t);!function(e,n){ce(e,function(e){e.vs=Re(e.vs.map(function(e){return n[e]?n[e].vs:e}))})}(c,d);var f=Yt(c,r);if(i&&(f.vs=Re([i,f.vs,u]),e.predecessors(i).length)){var g=e.node(e.predecessors(i)[0]),l=e.node(e.predecessors(u)[0]);Object.prototype.hasOwnProperty.call(f,"barycenter")||(f.barycenter=0,f.weight=0),f.barycenter=(f.barycenter*f.weight+g.order+l.order)/(f.weight+2),f.weight+=2}return f}function zt(e){var n=dt(e),t=Jt(e,Un(1,n+1),"inEdges"),r=Jt(e,Un(n-1,-1,-1),"outEdges"),o=function(e){var n={},t=le(e.nodes(),function(n){return!e.children(n).length}),r=Cn(jn(t,function(n){return e.node(n).rank})),o=jn(Un(r+1),function(){return[]}),a=zn(t,function(n){return e.node(n).rank});return ce(a,function t(r){if(!In(n,r)){n[r]=!0;var a=e.node(r);o[a.rank].push(r),ce(e.successors(r),t)}}),o}(e);Ht(e,o);for(var a,i=Number.POSITIVE_INFINITY,u=0,d=0;d<4;++u,++d){$t(u%2?t:r,u%4>=2);var s=Gt(e,o=it(e));s<i&&(d=0,a=cn(o),i=s)}Ht(e,a)}function Jt(e,n,t){return jn(n,function(n){return Bt(e,n,t)})}function $t(e,n){var t=new se;ce(e,function(e){var r=e.graph().root,o=Ut(e,r,t,n);ce(o.vs,function(n,t){e.node(n).order=t}),function(e,n,t){var r,o={};ce(t,function(t){for(var a,i,u=e.parent(t);u;){if((a=e.parent(u))?(i=o[a],o[a]=u):(i=r,r=u),i&&i!==u)return void n.setEdge(i,u);u=a}})}(e,t,o.vs)})}function Ht(e,n){ce(n,function(n){ce(n,function(n,t){e.node(n).order=t})})}function Qt(e){var n=function(e){var n={},t=0;function r(o){var a=t;ce(e.children(o),r),n[o]={low:a,lim:t++}}return ce(e.children(),r),n}(e);ce(e.graph().dummyChains,function(t){for(var r=e.node(t),o=r.edgeObj,a=function(e,n,t,r){var o,a,i=[],u=[],d=Math.min(n[t].low,n[r].low),s=Math.max(n[t].lim,n[r].lim);o=t;do{o=e.parent(o),i.push(o)}while(o&&(n[o].low>d||s>n[o].lim));a=o,o=r;for(;(o=e.parent(o))!==a;)u.push(o);return{path:i.concat(u.reverse()),lca:a}}(e,n,o.v,o.w),i=a.path,u=a.lca,d=0,s=i[d],c=!0;t!==o.w;){if(r=e.node(t),c){for(;(s=i[d])!==u&&e.node(s).maxRank<r.rank;)d++;s===u&&(c=!1)}if(!c){for(;d<i.length-1&&e.node(s=i[d+1]).minRank<=r.rank;)d++;s=i[d]}e.setParent(t,s),t=e.successors(t)[0]}})}function Wt(e,n){var t={};return pe(n,function(n,r){var o=0,a=0,i=n.length,u=wn(r);return ce(r,function(n,d){var s=function(e,n){if(e.node(n).dummy)return En(e.predecessors(n),function(n){return e.node(n).dummy})}(e,n),c=s?e.node(s).order:i;(s||n===u)&&(ce(r.slice(a,d+1),function(n){ce(e.predecessors(n),function(r){var a=e.node(r),i=a.order;!(i<o||c<i)||a.dummy&&e.node(n).dummy||Zt(t,r,n)})}),a=d+1,o=c)}),r}),t}function Zt(e,n,t){if(n>t){var r=n;n=t,t=r}Object.prototype.hasOwnProperty.call(e,n)||Object.defineProperty(e,n,{enumerable:!0,configurable:!0,value:{},writable:!0});var o=e[n];Object.defineProperty(o,t,{enumerable:!0,configurable:!0,value:!0,writable:!0})}function Kt(e,n,t){if(n>t){var r=n;n=t,t=r}return!!e[n]&&Object.prototype.hasOwnProperty.call(e[n],t)}function er(e,n,t,r,o){var a={},i=function(e,n,t,r){var o=new se,a=e.graph(),i=function(e,n,t){return function(r,o,a){var i,u=r.node(o),d=r.node(a),s=0;if(s+=u.width/2,Object.prototype.hasOwnProperty.call(u,"labelpos"))switch(u.labelpos.toLowerCase()){case"l":i=-u.width/2;break;case"r":i=u.width/2}if(i&&(s+=t?i:-i),i=0,s+=(u.dummy?n:e)/2,s+=(d.dummy?n:e)/2,s+=d.width/2,Object.prototype.hasOwnProperty.call(d,"labelpos"))switch(d.labelpos.toLowerCase()){case"l":i=d.width/2;break;case"r":i=-d.width/2}return i&&(s+=t?i:-i),i=0,s}}(a.nodesep,a.edgesep,r);return ce(n,function(n){var r;ce(n,function(n){var a=t[n];if(o.setNode(a),r){var u=t[r],d=o.edge(u,a);o.setEdge(u,a,Math.max(i(e,n,r),d||0))}r=n})}),o}(e,n,t,o),u=o?"borderLeft":"borderRight";function d(e,n){for(var t=i.nodes(),r=t.pop(),o={};r;)o[r]?e(r):(o[r]=!0,t.push(r),t=t.concat(n(r))),r=t.pop()}return d(function(e){a[e]=i.inEdges(e).reduce(function(e,n){return Math.max(e,a[n.v]+i.edge(n))},0)},i.predecessors.bind(i)),d(function(n){var t=i.outEdges(n).reduce(function(e,n){return Math.min(e,a[n.w]-i.edge(n))},Number.POSITIVE_INFINITY),r=e.node(n);t!==Number.POSITIVE_INFINITY&&r.borderType!==u&&(a[n]=Math.max(a[n],t))},i.successors.bind(i)),ce(r,function(e){a[e]=a[t[e]]}),a}function nr(e,n){return Xn(he(n),function(n){var t,r,o=Number.NEGATIVE_INFINITY,a=Number.POSITIVE_INFINITY;return r=function(n,t){var r=function(e,n){return e.node(n).width}(e,t)/2;o=Math.max(n+r,o),a=Math.min(n-r,a)},null==(t=n)||$(t,ee(r),Me),o-a})}function tr(e){var n,t=it(e),r=Rn(Wt(e,t),function(e,n){var t={};function r(n,r,o,a,i){var u;ce(Un(r,o),function(r){u=n[r],e.node(u).dummy&&ce(e.predecessors(u),function(n){var r=e.node(n);r.dummy&&(r.order<a||r.order>i)&&Zt(t,n,u)})})}return pe(n,function(n,t){var o,a=-1,i=0;return ce(t,function(u,d){if("border"===e.node(u).dummy){var s=e.predecessors(u);s.length&&(o=e.node(s[0]).order,r(t,i,d,a,o),i=d,a=o)}r(t,i,t.length,o,n.length)}),t}),t}(e,t)),o={};ce(["u","d"],function(a){n="u"===a?t:he(t).reverse(),ce(["l","r"],function(t){"r"===t&&(n=jn(n,function(e){return he(e).reverse()}));var i=("u"===a?e.predecessors:e.successors).bind(e),u=function(e,n,t,r){var o={},a={},i={};return ce(n,function(e){ce(e,function(e,n){o[e]=e,a[e]=e,i[e]=n})}),ce(n,function(e){var n=-1;ce(e,function(e){var u=r(e);if(u.length){u=zn(u,function(e){return i[e]});for(var d=(u.length-1)/2,s=Math.floor(d),c=Math.ceil(d);s<=c;++s){var f=u[s];a[e]===e&&n<i[f]&&!Kt(t,e,f)&&(a[f]=e,a[e]=o[e]=o[f],n=i[f])}}})}),{root:o,align:a}}(0,n,r,i),d=er(e,n,u.root,u.align,"r"===t);"r"===t&&(d=Pn(d,function(e){return-e})),o[a+t]=d})});var a=nr(e,o);return function(e,n){var t=he(n),r=Tn(t),o=Cn(t);ce(["u","d"],function(t){ce(["l","r"],function(a){var i,u=t+a,d=e[u];if(d!==n){var s=he(d);(i="l"===a?r-Tn(s):o-Cn(s))&&(e[u]=Pn(d,function(e){return e+i}))}})})}(o,a),function(e,n){return Pn(e.ul,function(t,r){if(n)return e[n.toLowerCase()][r];var o=zn(jn(e,r));return(o[1]+o[2])/2})}(o,e.graph().align)}function rr(e){var n,t;(function(e){var n=it(e),t=e.graph().ranksep,r=0;ce(n,function(n){var o=Cn(jn(n,function(n){return e.node(n).height}));ce(n,function(n){e.node(n).y=r+o/2}),r+=o+t})})(e=ot(e)),n=tr(e),t=function(n,t){e.node(t).x=n},n&&ne(n,ee(t))}function or(e,n){var t=st;t("layout",()=>{var n=t(" buildLayoutGraph",()=>function(e){var n=new se({multigraph:!0,compound:!0}),t=hr(e.graph());return n.setGraph(Rn({},ir,lr(t,ar),Vn(t,ur))),ce(e.nodes(),function(t){var r=hr(e.node(t));n.setNode(t,ln(lr(r,dr),sr)),n.setParent(t,e.parent(t))}),ce(e.edges(),function(t){var r=hr(e.edge(t));n.setEdge(t,Rn({},fr,lr(r,cr),Vn(r,gr)))}),n}(e));t(" runLayout",()=>function(e,n){n(" makeSpaceForEdgeLabels",()=>function(e){var n=e.graph();n.ranksep/=2,ce(e.edges(),function(t){var r=e.edge(t);r.minlen*=2,"c"!==r.labelpos.toLowerCase()&&("TB"===n.rankdir||"BT"===n.rankdir?r.width+=r.labeloffset:r.height+=r.labeloffset)})}(e)),n(" removeSelfEdges",()=>function(e){ce(e.edges(),function(n){if(n.v===n.w){var t=e.node(n.v);t.selfEdges||(t.selfEdges=[]),t.selfEdges.push({e:n,label:e.edge(n)}),e.removeEdge(n)}})}(e)),n(" acyclic",()=>tt(e)),n(" nestingGraph.run",()=>At(e)),n(" rank",()=>Rt(ot(e))),n(" injectEdgeLabelProxies",()=>function(e){ce(e.edges(),function(n){var t=e.edge(n);if(t.width&&t.height){var r=e.node(n.v),o={rank:(e.node(n.w).rank-r.rank)/2+r.rank,e:n};rt(e,"edge-proxy",o,"_ep")}})}(e)),n(" removeEmptyRanks",()=>function(e){var n=Tn(jn(e.nodes(),function(n){return e.node(n).rank})),t=[];ce(e.nodes(),function(r){var o=e.node(r).rank-n;t[o]||(t[o]=[]),t[o].push(r)});var r=0,o=e.graph().nodeRankFactor;ce(t,function(n,t){ge(n)&&t%o!==0?--r:r&&ce(n,function(n){e.node(n).rank+=r})})}(e)),n(" nestingGraph.cleanup",()=>function(e){var n=e.graph();e.removeNode(n.nestingRoot),delete n.nestingRoot,ce(e.edges(),function(n){e.edge(n).nestingEdge&&e.removeEdge(n)})}(e)),n(" normalizeRanks",()=>function(e){var n=Tn(jn(e.nodes(),function(n){return e.node(n).rank}));ce(e.nodes(),function(t){var r=e.node(t);In(r,"rank")&&(r.rank-=n)})}(e)),n(" assignRankMinMax",()=>function(e){var n=0;ce(e.nodes(),function(t){var r=e.node(t);r.borderTop&&(r.minRank=e.node(r.borderTop).rank,r.maxRank=e.node(r.borderBottom).rank,n=Cn(n,r.maxRank))}),e.graph().maxRank=n}(e)),n(" removeEdgeLabelProxies",()=>function(e){ce(e.nodes(),function(n){var t=e.node(n);"edge-proxy"===t.dummy&&(e.edge(t.e).labelRank=t.rank,e.removeNode(n))})}(e)),n(" normalize.run",()=>vt(e)),n(" parentDummyChains",()=>Qt(e)),n(" addBorderSegments",()=>function(e){ce(e.children(),function n(t){var r=e.children(t),o=e.node(t);if(r.length&&ce(r,n),Object.prototype.hasOwnProperty.call(o,"minRank")){o.borderLeft=[],o.borderRight=[];for(var a=o.minRank,i=o.maxRank+1;a<i;++a)ct(e,"borderLeft","_bl",t,o,a),ct(e,"borderRight","_br",t,o,a)}})}(e)),n(" order",()=>zt(e)),n(" insertSelfEdges",()=>function(e){var n=it(e);ce(n,function(n){var t=0;ce(n,function(n,r){var o=e.node(n);o.order=r+t,ce(o.selfEdges,function(n){rt(e,"selfedge",{width:n.label.width,height:n.label.height,rank:o.rank,order:r+ ++t,e:n.e,label:n.label},"_se")}),delete o.selfEdges})})}(e)),n(" adjustCoordinateSystem",()=>function(e){var n=e.graph().rankdir.toLowerCase();"lr"!==n&&"rl"!==n||gt(e)}(e)),n(" position",()=>rr(e)),n(" positionSelfEdges",()=>function(e){ce(e.nodes(),function(n){var t=e.node(n);if("selfedge"===t.dummy){var r=e.node(t.e.v),o=r.x+r.width/2,a=r.y,i=t.x-o,u=r.height/2;e.setEdge(t.e,t.label),e.removeNode(n),t.label.points=[{x:o+2*i/3,y:a-u},{x:o+5*i/6,y:a-u},{x:o+i,y:a},{x:o+5*i/6,y:a+u},{x:o+2*i/3,y:a+u}],t.label.x=t.x,t.label.y=t.y}})}(e)),n(" removeBorderNodes",()=>function(e){ce(e.nodes(),function(n){if(e.children(n).length){var t=e.node(n),r=e.node(t.borderTop),o=e.node(t.borderBottom),a=e.node(wn(t.borderLeft)),i=e.node(wn(t.borderRight));t.width=Math.abs(i.x-a.x),t.height=Math.abs(o.y-r.y),t.x=a.x+t.width/2,t.y=r.y+t.height/2}}),ce(e.nodes(),function(n){"border"===e.node(n).dummy&&e.removeNode(n)})}(e)),n(" normalize.undo",()=>function(e){ce(e.graph().dummyChains,function(n){var t,r=e.node(n),o=r.edgeLabel;for(e.setEdge(r.edgeObj,o);r.dummy;)t=e.successors(n)[0],e.removeNode(n),o.points.push({x:r.x,y:r.y}),"edge-label"===r.dummy&&(o.x=r.x,o.y=r.y,o.width=r.width,o.height=r.height),n=t,r=e.node(n)})}(e)),n(" fixupEdgeLabelCoords",()=>function(e){ce(e.edges(),function(n){var t=e.edge(n);if(Object.prototype.hasOwnProperty.call(t,"x"))switch("l"!==t.labelpos&&"r"!==t.labelpos||(t.width-=t.labeloffset),t.labelpos){case"l":t.x-=t.width/2+t.labeloffset;break;case"r":t.x+=t.width/2+t.labeloffset}})}(e)),n(" undoCoordinateSystem",()=>ft(e)),n(" translateGraph",()=>function(e){var n=Number.POSITIVE_INFINITY,t=0,r=Number.POSITIVE_INFINITY,o=0,a=e.graph(),i=a.marginx||0,u=a.marginy||0;function d(e){var a=e.x,i=e.y,u=e.width,d=e.height;n=Math.min(n,a-u/2),t=Math.max(t,a+u/2),r=Math.min(r,i-d/2),o=Math.max(o,i+d/2)}ce(e.nodes(),function(n){d(e.node(n))}),ce(e.edges(),function(n){var t=e.edge(n);Object.prototype.hasOwnProperty.call(t,"x")&&d(t)}),n-=i,r-=u,ce(e.nodes(),function(t){var o=e.node(t);o.x-=n,o.y-=r}),ce(e.edges(),function(t){var o=e.edge(t);ce(o.points,function(e){e.x-=n,e.y-=r}),Object.prototype.hasOwnProperty.call(o,"x")&&(o.x-=n),Object.prototype.hasOwnProperty.call(o,"y")&&(o.y-=r)}),a.width=t-n+i,a.height=o-r+u}(e)),n(" assignNodeIntersects",()=>function(e){ce(e.edges(),function(n){var t,r,o=e.edge(n),a=e.node(n.v),i=e.node(n.w);o.points?(t=o.points[0],r=o.points[o.points.length-1]):(o.points=[],t=i,r=a),o.points.unshift(at(a,t)),o.points.push(at(i,r))})}(e)),n(" reversePoints",()=>function(e){ce(e.edges(),function(n){var t=e.edge(n);t.reversed&&t.points.reverse()})}(e)),n(" acyclic.undo",()=>function(e){ce(e.edges(),function(n){var t=e.edge(n);if(t.reversed){e.removeEdge(n);var r=t.forwardName;delete t.reversed,delete t.forwardName,e.setEdge(n.w,n.v,t,r)}})}(e))}(n,t)),t(" updateInputGraph",()=>function(e,n){ce(e.nodes(),function(t){var r=e.node(t),o=n.node(t);r&&(r.x=o.x,r.y=o.y,n.children(t).length&&(r.width=o.width,r.height=o.height))}),ce(e.edges(),function(t){var r=e.edge(t),o=n.edge(t);r.points=o.points,Object.prototype.hasOwnProperty.call(o,"x")&&(r.x=o.x,r.y=o.y)}),e.graph().width=n.graph().width,e.graph().height=n.graph().height}(e,n))})}var ar=["nodesep","edgesep","ranksep","marginx","marginy"],ir={ranksep:50,edgesep:20,nodesep:50,rankdir:"tb"},ur=["acyclicer","ranker","rankdir","align"],dr=["width","height"],sr={width:0,height:0},cr=["minlen","weight","width","height","labeloffset"],fr={minlen:1,weight:1,width:0,height:0,labeloffset:10,labelpos:"r"},gr=["labelpos"];function lr(e,n){return Pn(Vn(e,n),Number)}function hr(e){var n={};return ce(e,function(e,t){n[t.toLowerCase()]=e}),n}var pr=u((e,n,t)=>Math.max(n,Math.min(t,e)),"clamp"),vr=u((e="TB")=>{switch(e){case"BT":return"bottom";case"LR":return"right";case"RL":return"left";default:return"top"}},"getDefaultSelfLoopSide"),yr=u(e=>"flowchart"===e||"flowchart-v2"===e||"stateDiagram"===e||"er"===e||"classDiagram"===e,"shouldMergeSelfLoopSegments"),br=["x","y","width","height","labelBBox","intersect","calcIntersect","diff","clusterNode"],wr=u((e,n,t,r,o)=>{const a=[],i=new Set;if(t.forEach(({start:e,end:n})=>{e!==r&&i.add(e),n!==r&&i.add(n)}),i.forEach(n=>{const t=e.node(n);"number"==typeof t?.x&&"number"==typeof t?.y&&a.push(t)}),0===a.length&&t.forEach(({edge:e})=>{(e.points??[]).forEach(e=>{"number"==typeof e?.x&&"number"==typeof e?.y&&a.push(e)})}),0===a.length)return vr(o);const u=a.reduce((e,n)=>({x:e.x+n.x/a.length,y:e.y+n.y/a.length}),{x:0,y:0}),d=u.x-n.x,s=u.y-n.y;return Math.abs(d)>Math.abs(s)?d>0?"right":"left":Math.abs(s)>0?s>0?"bottom":"top":vr(o)},"getSelfLoopSide"),mr=u((e,n="top",t=0,r=0)=>{const o=e.x,a=e.y-t,i=e.width/2,u=e.height/2,d=Math.max(36,Math.min(100,.8*e.width)),s=pr(Math.max(r,.35*e.width),36,d),c=pr(.45*Math.min(e.width,e.height),24,48);switch(n){case"bottom":{const e=a+u;return[{x:o-s/2,y:e},{x:o-s/2,y:e+c},{x:o+s/2,y:e+c},{x:o+s/2,y:e}]}case"right":{const e=o+i;return[{x:e,y:a-s/2},{x:e+c,y:a-s/2},{x:e+c,y:a+s/2},{x:e,y:a+s/2}]}case"left":{const e=o-i;return[{x:e,y:a-s/2},{x:e-c,y:a-s/2},{x:e-c,y:a+s/2},{x:e,y:a+s/2}]}default:{const e=a-u;return[{x:o-s/2,y:e},{x:o-s/2,y:e-c},{x:o+s/2,y:e-c},{x:o+s/2,y:e}]}}},"getSelfLoopPoints"),xr=u((e,n,t="top",r=0,o={})=>{const a=e.x,i=e.y-r,u=o.width??0,d=o.height??0;switch(t){case"bottom":return{x:a,y:Math.max(...n.map(e=>e.y))+d/2+4};case"right":return{x:Math.max(...n.map(e=>e.x))+u/2+4,y:i};case"left":return{x:Math.min(...n.map(e=>e.x))-u/2-4,y:i};default:return{x:a,y:Math.min(...n.map(e=>e.y))-d/2-4}}},"getSelfLoopLabelPosition"),Er=u((e,n=0,{mergeSelfLoops:t=!0}={})=>{const r=new Map,o=[],a=e.graph()?.rankdir;return e.edges().forEach(n=>{const a=e.edge(n);if(t&&a.selfLoop){const e=a.selfLoop.id;r.has(e)||r.set(e,[]),r.get(e).push({edge:a,start:n.v,end:n.w})}else o.push({edge:a,start:n.v,end:n.w})}),r.forEach(t=>{if(3!==t.length)return void t.forEach(e=>o.push(e));t.sort((e,n)=>e.edge.selfLoop.order-n.edge.selfLoop.order);const[r,i,u]=t,d=r.edge.originalEdge??i.edge.originalEdge??u.edge.originalEdge??i.edge,s=e.node(d.start);if(!s)return void t.forEach(e=>o.push(e));const c={width:i.edge.width,height:i.edge.height},f=wr(e,s,t,d.start,a),g=mr(s,f,n,c.width??0),l=xr(s,g,f,n,c),h={...i.edge,...d,id:d.id,points:g,start:d.start,end:d.end,x:l.x,y:l.y,width:c.width,height:c.height,labelStyle:i.edge.labelStyle,fromCluster:r.edge.fromCluster??i.edge.fromCluster??u.edge.fromCluster,toCluster:r.edge.toCluster??i.edge.toCluster??u.edge.toCluster};delete h.selfLoop,delete h.originalEdge,o.push({edge:h,start:h.start,end:h.end})}),o},"getEdgesToRender"),Lr=u(async({element:e,graph:n,diagramType:t,id:d,parentCluster:h,siteConfig:p})=>{const v=n.graph().rankdir;s.trace("Dir in recursive render - dir:",v);const{clusters:y,edgePaths:b,edgeLabels:w,nodes:m,rootGroups:x}=r(e,{edgePathsClass:"edgePaths"});n.nodes()?s.info("Recursive render XXX",n.nodes()):s.info("No nodes found for",n),n.edges().length>0&&s.info("Recursive edges",n.edge(n.edges()[0]));const E=yr(t);await Promise.all(n.nodes().map(async function(e){const r=n.node(e);if(void 0!==h){const t=JSON.parse(JSON.stringify(h.clusterData));s.trace("Setting data for parent cluster XXX\n Node.id = ",e,"\n data=",t.height,"\nParent cluster",h.height),n.setNode(h.id,t),n.parent(e)||(s.trace("Setting parent",e,h.id),n.setParent(e,h.id,t))}if(s.info("(Insert) Node XXX"+e+": "+JSON.stringify(n.node(e))),r?.clusterNode){s.info("Cluster identified XBX",e,r.width,n.node(e));const{ranksep:o,nodesep:a}=n.graph();r.graph.setGraph({...r.graph.graph(),ranksep:o+25,nodesep:a});const i=await Pr({element:m,graph:r.graph,diagramType:t,id:d,parentCluster:n.node(e),siteConfig:p}),u=i.elem;c(r,u),r.diff=i.diff||0,s.info("New compound node after recursive render XAX",e,"width",r.width,"height",r.height),f(u,r)}else n.children(e).length>0?(s.trace("Cluster - the non recursive path XBX",e,r.id,r,r.width,"Graph:",n),s.trace(o(r.id,n)),a.set(r.id,{id:o(r.id,n),node:r})):(s.trace("Node - the non recursive path XAX",e,m,n.node(e),v),await i(m,n.node(e),{config:p,dir:v}))}));const L=u(async()=>{const e=n.edges().map(async function(e){const t=n.edge(e.v,e.w,e.name);if(s.info("Edge "+e.v+" -> "+e.w+": "+JSON.stringify(e)),s.info("Edge "+e.v+" -> "+e.w+": ",e," ",JSON.stringify(n.edge(e))),s.info("Fix",a,"ids:",e.v,e.w,"Translating: ",a.get(e.v),a.get(e.w)),E&&t.selfLoop){if(1!==t.selfLoop.order)return;const e={...t.originalEdge,...t,id:t.selfLoop.id,startLabelLeft:t.originalEdge?.startLabelLeft??t.startLabelLeft,startLabelRight:t.originalEdge?.startLabelRight??t.startLabelRight,endLabelLeft:t.originalEdge?.endLabelLeft??t.endLabelLeft,endLabelRight:t.originalEdge?.endLabelRight??t.endLabelRight};return await l(w,e),t.width=e.width,t.height=e.height,void(t.labelStyle=e.labelStyle)}await l(w,t)});await Promise.all(e)},"processEdges");await L();const{subGraphTitleTotalMargin:j}=g(p);return{elem:x,graph:n,groups:{clusters:y,edgePaths:b,edgeLabels:w,nodes:m,rootGroups:x},diagramType:t,id:d,mergeSelfLoops:E,subGraphTitleTotalMargin:j}},"measureDagreGraph"),jr=u(e=>{s.info("############################################# XXX"),s.info("### Layout ### XXX"),s.info("############################################# XXX"),or(e)},"runDagreGraphLayout"),Or=u((e,n,t)=>{const r=e.node(n);if(!r)return;const o={...r};return r?.clusterNode?o.y=(r.y??0)+t:e.children(n).length>0?o.height=(r.height??0)+t:o.y=(r.y??0)+t/2,o},"normalizeDagreNode"),kr=u((e,n)=>{br.forEach(t=>{void 0!==n[t]&&(e[t]=n[t])})},"applyDagreNodeLayout"),Nr=u((e,n,t,r)=>({...e,start:e.start??n,end:e.end??t,points:(e.points??[]).map(e=>({...e,y:"number"==typeof e.y?e.y+r:e.y}))}),"normalizeDagreEdge"),Ir=u((n,t)=>{const{graph:r,mergeSelfLoops:o,subGraphTitleTotalMargin:a=0}=t,i=new Map(n.nodes.map(e=>[e.id,e]));e(r).forEach(e=>{const n=Or(r,e,a);if(!n)return;kr(r.node(e),n);const t=i.get(e);t&&kr(t,n)});const u=a/2;return n.edges=Er(r,u,{mergeSelfLoops:o}).map(({edge:e,start:n,end:t})=>Nr(e,n,t,u)),n},"applyDagreLayoutResult"),Sr=u(async({elem:n,graph:t,groups:{clusters:r,edgePaths:o},diagramType:i,id:u,mergeSelfLoops:d,subGraphTitleTotalMargin:c})=>{let f=0;await Promise.all(e(t).map(async function(e){const n=t.node(e);if(s.info("Position XBX => "+e+": ("+n.x,","+n.y,") width: ",n.width," height: ",n.height),n?.clusterNode)n.y+=c,s.info("A tainted cluster node XBX1",e,n.id,n.width,n.height,n.x,n.y,t.parent(e)),a.get(n.id).node=n,h(n);else if(t.children(e).length>0){s.info("A pure cluster node XBX1",e,n.id,n.x,n.y,n.width,n.height,t.parent(e)),n.height+=c,t.node(n.parentId);const o=n?.padding/2||0,i=n?.labelBBox?.height||0,u=i-o||0;s.debug("OffsetY",u,"labelHeight",i,"halfPadding",o),await p(r,n),a.get(n.id).node=n}else{const e=t.node(n.parentId);n.y+=c/2,s.info("A regular node XBX1 - using the padding",n.id,"parent",n.parentId,n.width,n.height,n.x,n.y,"offsetY",n.offsetY,"parent",e,e?.offsetY,n),h(n)}}));const g=c/2;return Er(t,g,{mergeSelfLoops:d}).forEach(function({edge:e,start:n,end:r}){s.info("Edge "+n+" -> "+r+": "+JSON.stringify(e),e),e.points.forEach(e=>e.y+=g);const d=t.node(n),c=t.node(r),f=v(o,e,a,i,d,c,u);y(e,f)}),t.nodes().forEach(function(e){const n=t.node(e);s.info(e,n.type,n.diff),n.isGroup&&(f=n.diff)}),s.warn("Returning from recursive render XAX",n,f),{elem:n,diff:f}},"paintDagreLayoutCore"),Pr=u(async e=>{const n=await Lr(e);return jr(n.graph),await Sr(n)},"renderDagreSubgraph"),_r=u(e=>{const t=new se({multigraph:!0,compound:!0}).setGraph({rankdir:e.direction,nodesep:e.config?.nodeSpacing||e.nodeSpacing||e.config?.flowchart?.nodeSpacing,ranksep:e.config?.rankSpacing||e.rankSpacing||e.config?.flowchart?.rankSpacing,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});return e.nodes.forEach(e=>{t.setNode(e.id,{...e}),e.parentId&&t.setParent(e.id,e.parentId)}),s.debug("Edges:",e.edges),e.edges.forEach(e=>{if(e.start===e.end){const n=e.start,r=n+"---"+n+"---1",o=n+"---"+n+"---2",a=t.node(n);t.setNode(r,{domId:r,id:r,parentId:a.parentId,labelStyle:"",label:"",padding:0,shape:"labelRect",style:"",width:10,height:10}),t.setParent(r,a.parentId),t.setNode(o,{domId:o,id:o,parentId:a.parentId,labelStyle:"",padding:0,shape:"labelRect",label:"",style:"",width:10,height:10}),t.setParent(o,a.parentId);const i=structuredClone(e),u=structuredClone(e),d=structuredClone(e),s=structuredClone(e);u.originalEdge=i,u.selfLoop={id:i.id,order:0},d.originalEdge=i,d.selfLoop={id:i.id,order:1},s.originalEdge=i,s.selfLoop={id:i.id,order:2},u.label="",u.arrowTypeEnd="none",u.endLabelLeft="",u.endLabelRight="",u.startLabelLeft="",u.id=n+"-cyclic-special-1",d.startLabelRight="",d.startLabelLeft="",d.endLabelLeft="",d.endLabelRight="",d.arrowTypeStart="none",d.arrowTypeEnd="none",d.id=n+"-cyclic-special-mid",s.label="",s.startLabelRight="",s.startLabelLeft="",s.arrowTypeStart="none",a.isGroup&&(u.fromCluster=n,s.toCluster=n),s.id=n+"-cyclic-special-2",s.arrowTypeStart="none",t.setEdge(n,r,u,n+"-cyclic-special-0"),t.setEdge(r,o,d,n+"-cyclic-special-1"),t.setEdge(o,n,s,n+"-cyclic-special-2")}else t.setEdge(e.start,e.end,{...e},e.id)}),n(t),{graph:t}},"prepareLayoutForDagre"),Cr=u(async(e,{element:n,preparedLayout:t})=>{const r=t??_r(e),o=d(),a=await Lr({element:n,graph:r.graph,diagramType:e.type,id:e.diagramId,parentCluster:void 0,siteConfig:o});return r.measuredLayout=a,a},"measureDagreLayout"),Mr=u((e,n)=>{const t=n.preparedLayout?.measuredLayout;if(!t)throw new Error("runDagreLayoutCore requires measureDagreLayout to run first");return jr(t.graph),Ir(e,t),t},"runDagreLayoutCore"),Rr=t({prepareLayout:_r,measureLayout:Cr,runLayoutCore:Mr,paintOptions:{clusterDb:a,getNodes:u((n,{measure:t})=>e(t.graph).map(e=>t.graph.node(e)).filter(Boolean),"getDagrePaintNodes"),getEdgeNode:u((e,n,{measure:t})=>e?t.graph.node(e):void 0,"getDagreEdgeNode"),skipNode:u((e,{measure:n})=>!n.graph.hasNode(e.id),"skipNode"),isCluster:u((e,{measure:n})=>n.graph.hasNode(e.id)&&(n.graph.children(e.id)??[]).length>0,"isCluster")}});export{Ir as applyDagreLayoutResult,Er as getEdgesToRender,Cr as measureDagreLayout,_r as prepareLayoutForDagre,Rr as render,Mr as runDagreLayoutCore};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e}from"./chunk-JWPE2WC7-BP2iXBhe.js";import{_ as t,W as a,L as l,N as s,Q as r,d as n,as as o,l as i,T as c,at as d,au as p,av as h,k as m,b as y,a as f,q as u,t as S,g,s as x,O as C,aw as b,z as $}from"./mermaid-T_6Ze_cT.js";import{s as v}from"./chunk-VQ5W62QI-B95zur4F.js";import{p as w}from"./cynefin-EF2NZ3EQ-CR1E3YiZ.js";import"./markdown-S2mWvoE-.js";var L=class{constructor(){this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.setAccTitle=y,this.getAccTitle=f,this.setDiagramTitle=u,this.getDiagramTitle=S,this.getAccDescription=g,this.setAccDescription=x}static{t(this,"TreeMapDB")}getNodes(){return this.nodes}getConfig(){const e=C,t=l();return s({...e.treemap,...t.treemap??{}})}addNode(e,t){this.nodes.push(e),this.levels.set(e,t),0===t&&(this.outerNodes.push(e),this.root??=e)}getRoot(){return{name:"",children:this.outerNodes}}addClass(e,t){const a=this.classes.get(e)??{id:e,styles:[],textStyles:[]},l=t.replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");l&&l.forEach(e=>{b(e)&&(a?.textStyles?a.textStyles.push(e):a.textStyles=[e]),a?.styles?a.styles.push(e):a.styles=[e]}),this.classes.set(e,a)}getClasses(){return this.classes}getStylesForClass(e){return this.classes.get(e)?.styles??[]}clear(){$(),this.nodes=[],this.levels=new Map,this.outerNodes=[],this.classes=new Map,this.root=void 0}};function k(e){if(!e.length)return[];const t=[],a=[];return e.forEach(e=>{const l={name:e.name,children:"Leaf"===e.type?void 0:[]};for(l.classSelector=e?.classSelector,e?.cssCompiledStyles&&(l.cssCompiledStyles=e.cssCompiledStyles),"Leaf"===e.type&&void 0!==e.value&&(l.value=e.value);a.length>0&&a[a.length-1].level>=e.level;)a.pop();if(0===a.length)t.push(l);else{const e=a[a.length-1].node;e.children?e.children.push(l):e.children=[l]}"Leaf"!==e.type&&a.push({node:l,level:e.level})}),t}t(k,"buildHierarchy");var T=t((a,l)=>{e(a,l);const s=[];for(const e of a.TreemapRows??[])"ClassDefStatement"===e.$type&&l.addClass(e.className??"",e.styleText??"");for(const e of a.TreemapRows??[]){const t=e.item;if(!t)continue;const a=e.indent?parseInt(e.indent):0,r=z(t),n=t.classSelector?l.getStylesForClass(t.classSelector):[],o=n.length>0?n:void 0,i={level:a,name:r,type:t.$type,value:t.value,classSelector:t.classSelector,cssCompiledStyles:o};s.push(i)}const r=k(s),n=t((e,t)=>{for(const a of e)l.addNode(a,t),a.children&&a.children.length>0&&n(a.children,t+1)},"addNodesRecursively");n(r,0)},"populate"),z=t(e=>e.name?String(e.name):"","getItemName"),M={parser:{yy:void 0},parse:t(async e=>{try{const t=w,a=await t("treemap",e);i.debug("Treemap AST:",a);const l=M.parser?.yy;if(!(l instanceof L))throw new Error("parser.parser?.yy was not a TreemapDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");T(a,l)}catch(t){throw i.error("Error parsing treemap:",t),t}},"parse")},F=10,N={draw:t((e,a,s,y)=>{const f=y.db,u=f.getConfig(),S=u.padding??10,g=f.getDiagramTitle(),x=f.getRoot(),{themeVariables:C}=l();if(!x)return;const b=g?30:0,$=r(a),w=u.nodeWidth?u.nodeWidth*F:960,L=u.nodeHeight?u.nodeHeight*F:500,k=w,T=L+b;let z;$.attr("viewBox",`0 0 ${k} ${T}`),n($,T,k,u.useMaxWidth);try{const e=u.valueFormat||",";if("$0,0"===e)z=t(e=>"$"+o(",")(e),"valueFormat");else if(e.startsWith("$")&&e.includes(",")){const a=/\.\d+/.exec(e),l=a?a[0]:"";z=t(e=>"$"+o(","+l)(e),"valueFormat")}else if(e.startsWith("$")){const a=e.substring(1);z=t(e=>"$"+o(a||"")(e),"valueFormat")}else z=o(e)}catch(_){i.error("Error creating format function:",_),z=o(",")}const M=c().range(["transparent",C.cScale0,C.cScale1,C.cScale2,C.cScale3,C.cScale4,C.cScale5,C.cScale6,C.cScale7,C.cScale8,C.cScale9,C.cScale10,C.cScale11]),N=c().range(["transparent",C.cScalePeer0,C.cScalePeer1,C.cScalePeer2,C.cScalePeer3,C.cScalePeer4,C.cScalePeer5,C.cScalePeer6,C.cScalePeer7,C.cScalePeer8,C.cScalePeer9,C.cScalePeer10,C.cScalePeer11]),P=c().range([C.cScaleLabel0,C.cScaleLabel1,C.cScaleLabel2,C.cScaleLabel3,C.cScaleLabel4,C.cScaleLabel5,C.cScaleLabel6,C.cScaleLabel7,C.cScaleLabel8,C.cScaleLabel9,C.cScaleLabel10,C.cScaleLabel11]);g&&$.append("text").attr("x",k/2).attr("y",b/2).attr("class","treemapTitle").attr("text-anchor","middle").attr("dominant-baseline","middle").text(g);const W=$.append("g").attr("transform",`translate(0, ${b})`).attr("class","treemapContainer"),V=d(x).sum(e=>e.value??0).sort((e,t)=>(t.value??0)-(e.value??0)),D=p().size([w,L]).paddingTop(e=>e.children&&e.children.length>0?35:0).paddingInner(S).paddingLeft(e=>e.children&&e.children.length>0?F:0).paddingRight(e=>e.children&&e.children.length>0?F:0).paddingBottom(e=>e.children&&e.children.length>0?F:0).round(!0)(V),E=D.descendants().filter(e=>e.children&&e.children.length>0),j=W.selectAll(".treemapSection").data(E).enter().append("g").attr("class","treemapSection").attr("transform",e=>`translate(${e.x0},${e.y0})`);j.append("rect").attr("width",e=>e.x1-e.x0).attr("height",25).attr("class","treemapSectionHeader").attr("fill","none").attr("fill-opacity",.6).attr("stroke-width",.6).attr("style",e=>0===e.depth?"display: none;":""),j.append("clipPath").attr("id",(e,t)=>`clip-section-${a}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-12)).attr("height",25),j.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class",(e,t)=>`treemapSection section${t}`).attr("fill",e=>M(e.data.name)).attr("fill-opacity",.6).attr("stroke",e=>N(e.data.name)).attr("stroke-width",2).attr("stroke-opacity",.4).attr("style",e=>{if(0===e.depth)return"display: none;";const t=h({cssCompiledStyles:e.data.cssCompiledStyles});return t.nodeStyles+";"+t.borderStyles.join(";")}),j.append("text").attr("class","treemapSectionLabel").attr("x",6).attr("y",12.5).attr("dominant-baseline","middle").text(e=>0===e.depth?"":e.data.name).attr("font-weight","bold").attr("clip-path",(e,t)=>`url(#clip-section-${a}-${t})`).attr("style",e=>{if(0===e.depth)return"display: none;";return"dominant-baseline: middle; font-size: 12px; fill:"+P(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"+h({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")}).each(function(e){if(0===e.depth)return;const t=m(this),a=e.data.name;t.text(a);const l=e.x1-e.x0;let s;if(!1!==u.showValues&&e.value){s=l-10-30-10-6}else{s=l-6-6}const r=Math.max(15,s),n=t.node();if(n.getComputedTextLength()>r){const e="...";let l=a;for(;l.length>0;){if(l=a.substring(0,l.length-1),0===l.length){t.text(e),n.getComputedTextLength()>r&&t.text("");break}if(t.text(l+e),n.getComputedTextLength()<=r)break}}}),!1!==u.showValues&&j.append("text").attr("class","treemapSectionValue").attr("x",e=>e.x1-e.x0-10).attr("y",12.5).attr("text-anchor","end").attr("dominant-baseline","middle").text(e=>e.value?z(e.value):"").attr("font-style","italic").attr("style",e=>{if(0===e.depth)return"display: none;";return"text-anchor: end; dominant-baseline: middle; font-size: 10px; fill:"+P(e.data.name)+"; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;"+h({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")});const A=D.leaves(),R=A.length>20,I=R?16:38,Q=R?14:28,B=R?4:8,H=R?4:6,G=R?2:4,q=R?8:10,J=R?1:2,O=W.selectAll(".treemapLeafGroup").data(A).enter().append("g").attr("class",(e,t)=>`treemapNode treemapLeafGroup leaf${t}${e.data.classSelector?` ${e.data.classSelector}`:""}x`).attr("transform",e=>`translate(${e.x0},${e.y0})`);O.append("rect").attr("width",e=>e.x1-e.x0).attr("height",e=>e.y1-e.y0).attr("class","treemapLeaf").attr("fill",e=>e.parent?M(e.parent.data.name):M(e.data.name)).attr("style",e=>h({cssCompiledStyles:e.data.cssCompiledStyles}).nodeStyles).attr("fill-opacity",.3).attr("stroke",e=>e.parent?M(e.parent.data.name):M(e.data.name)).attr("stroke-width",3),O.append("clipPath").attr("id",(e,t)=>`clip-${a}-${t}`).append("rect").attr("width",e=>Math.max(0,e.x1-e.x0-4)).attr("height",e=>Math.max(0,e.y1-e.y0-4));if(O.append("text").attr("class","treemapLabel").attr("x",e=>(e.x1-e.x0)/2).attr("y",e=>(e.y1-e.y0)/2).attr("style",e=>`text-anchor: middle; dominant-baseline: middle; font-size: ${I}px;fill:`+P(e.data.name)+";"+h({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")).attr("clip-path",(e,t)=>`url(#clip-${a}-${t})`).text(e=>e.data.name).each(function(e){const t=m(this),a=e.x1-e.x0,l=e.y1-e.y0,s=t.node(),r=a-2*G,n=l-2*G;if(r<q||n<q)return void t.style("display","none");let o=parseInt(t.style("font-size"),10);for(;s.getComputedTextLength()>r&&o>B;)o--,t.style("font-size",`${o}px`);let i=Math.max(H,Math.min(Q,Math.round(.6*o))),c=o+J+i;for(;c>n&&o>B&&(o--,i=Math.max(H,Math.min(Q,Math.round(.6*o))),!(i<H&&o===B));)t.style("font-size",`${o}px`),c=o+J+i;t.style("font-size",`${o}px`),R?(o<B||n<B)&&t.style("display","none"):(s.getComputedTextLength()>r||o<B||n<o)&&t.style("display","none")}),!1!==u.showValues){O.append("text").attr("class","treemapValue").attr("x",e=>(e.x1-e.x0)/2).attr("y",function(e){return(e.y1-e.y0)/2}).attr("style",e=>`text-anchor: middle; dominant-baseline: hanging; font-size: ${Q}px;fill:`+P(e.data.name)+";"+h({cssCompiledStyles:e.data.cssCompiledStyles}).labelStyles.replace("color:","fill:")).attr("clip-path",(e,t)=>`url(#clip-${a}-${t})`).text(e=>e.value?z(e.value):"").each(function(e){const t=m(this),a=this.parentNode;if(!a)return void t.style("display","none");const l=m(a).select(".treemapLabel");if(l.empty()||"none"===l.style("display"))return void t.style("display","none");const s=parseFloat(l.style("font-size")),r=Math.max(H,Math.min(Q,Math.round(.6*s)));t.style("font-size",`${r}px`);const n=(e.y1-e.y0)/2+s/2+J;t.attr("y",n);const o=e.x1-e.x0,i=e.y1-e.y0-4,c=o-2*G;t.node().getComputedTextLength()>c||n+r>i||r<H?t.style("display","none"):t.style("display",null)})}const Z=u.diagramPadding??8;v($,Z,"flowchart",u?.useMaxWidth||!1)},"draw"),getClasses:t(function(e,t){return t.db.getClasses()},"getClasses")},P={sectionStrokeColor:"black",sectionStrokeWidth:"1",sectionFillColor:"#efefef",leafStrokeColor:"black",leafStrokeWidth:"1",leafFillColor:"#efefef",labelFontSize:"12px",valueFontSize:"10px",titleFontSize:"14px"},W=t(({treemap:e}={})=>{const t=a(),r=l(),n=s(t,r.themeVariables),o=s(P,e),i=o.titleColor??n.titleColor,c=o.labelColor??n.textColor,d=o.valueColor??n.textColor;return`\n .treemapNode.section {\n stroke: ${o.sectionStrokeColor};\n stroke-width: ${o.sectionStrokeWidth};\n fill: ${o.sectionFillColor};\n }\n .treemapNode.leaf {\n stroke: ${o.leafStrokeColor};\n stroke-width: ${o.leafStrokeWidth};\n fill: ${o.leafFillColor};\n }\n .treemapLabel {\n fill: ${c};\n font-size: ${o.labelFontSize};\n }\n .treemapValue {\n fill: ${d};\n font-size: ${o.valueFontSize};\n }\n .treemapTitle {\n fill: ${i};\n font-size: ${o.titleFontSize};\n }\n `},"getStyles"),V={parser:M,get db(){return new L},renderer:N,styles:W};export{V as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as t}from"./chunk-JWPE2WC7-BP2iXBhe.js";import{_ as e,N as a,Q as r,d as s,l as o,b as i,a as n,q as l,t as c,g as d,s as p,L as b,O as h,z as k}from"./mermaid-T_6Ze_cT.js";import{p as g}from"./cynefin-EF2NZ3EQ-CR1E3YiZ.js";import"./markdown-S2mWvoE-.js";var f=h.packet,u=class{constructor(){this.packet=[],this.setAccTitle=i,this.getAccTitle=n,this.setDiagramTitle=l,this.getDiagramTitle=c,this.getAccDescription=d,this.setAccDescription=p}static{e(this,"PacketDB")}getConfig(){const t=a({...f,...b().packet});return t.showBits&&(t.paddingY+=10),t}getPacket(){return this.packet}pushWord(t){t.length>0&&this.packet.push(t)}clear(){k(),this.packet=[]}},w=e((e,a)=>{t(e,a);let r=-1,s=[],i=1;const{bitsPerRow:n}=a.getConfig();for(let{start:t,end:l,bits:c,label:d}of e.blocks){if(void 0!==t&&void 0!==l&&l<t)throw new Error(`Packet block ${t} - ${l} is invalid. End must be greater than start.`);if(t??=r+1,t!==r+1)throw new Error(`Packet block ${t} - ${l??t} is not contiguous. It should start from ${r+1}.`);if(0===c)throw new Error(`Packet block ${t} is invalid. Cannot have a zero bit field.`);for(l??=t+(c??1)-1,c??=l-t+1,r=l,o.debug(`Packet block ${t} - ${r} with label ${d}`);s.length<=n+1&&a.getPacket().length<1e4;){const[e,r]=m({start:t,end:l,bits:c,label:d},i,n);if(s.push(e),e.end+1===i*n&&(a.pushWord(s),s=[],i++),!r)break;({start:t,end:l,bits:c,label:d}=r)}}a.pushWord(s)},"populate"),m=e((t,e,a)=>{if(void 0===t.start)throw new Error("start should have been set during first phase");if(void 0===t.end)throw new Error("end should have been set during first phase");if(t.start>t.end)throw new Error(`Block start ${t.start} is greater than block end ${t.end}.`);if(t.end+1<=e*a)return[t,void 0];const r=e*a-1,s=e*a;return[{start:t.start,end:r,label:t.label,bits:r-t.start},{start:s,end:t.end,label:t.label,bits:t.end-s}]},"getNextFittingBlock"),y={parser:{yy:void 0},parse:e(async t=>{const e=await g("packet",t),a=y.parser?.yy;if(!(a instanceof u))throw new Error("parser.parser?.yy was not a PacketDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");o.debug(e),w(e,a)},"parse")},x=e((t,e,a,o)=>{const i=o.db,n=i.getConfig(),{rowHeight:l,paddingY:c,bitWidth:d,bitsPerRow:p}=n,b=i.getPacket(),h=i.getDiagramTitle(),k=l+c,g=k*(b.length+1)-(h?0:l),f=d*p+2,u=r(e);u.attr("viewBox",`0 0 ${f} ${g}`),s(u,g,f,n.useMaxWidth);for(const[r,s]of b.entries())$(u,s,r,n);u.append("text").text(h).attr("x",f/2).attr("y",g-k/2).attr("dominant-baseline","middle").attr("text-anchor","middle").attr("class","packetTitle")},"draw"),$=e((t,e,a,{rowHeight:r,paddingX:s,paddingY:o,bitWidth:i,bitsPerRow:n,showBits:l,bitOrder:c})=>{const d=t.append("g"),p=a*(r+o)+o,b="descending"===c;for(const h of e){const t=h.end-h.start+1,e=h.start%n,a=(b?n-e-t:e)*i+1,o=t*i-s;if(d.append("rect").attr("x",a).attr("y",p).attr("width",o).attr("height",r).attr("class","packetBlock"),d.append("text").attr("x",a+o/2).attr("y",p+r/2).attr("class","packetLabel").attr("dominant-baseline","middle").attr("text-anchor","middle").text(h.label),!l)continue;const[c,k]=b?[h.end,h.start]:[h.start,h.end],g=1===t,f=p-2;d.append("text").attr("x",a+(g?o/2:0)).attr("y",f).attr("class","packetByte start").attr("dominant-baseline","auto").attr("text-anchor",g?"middle":"start").text(c),g||d.append("text").attr("x",a+o).attr("y",f).attr("class","packetByte end").attr("dominant-baseline","auto").attr("text-anchor","end").text(k)}},"drawWord"),B={draw:x},C={byteFontSize:"10px",startByteColor:"black",endByteColor:"black",labelColor:"black",labelFontSize:"12px",titleColor:"black",titleFontSize:"14px",blockStrokeColor:"black",blockStrokeWidth:"1",blockFillColor:"#efefef"},P=e(({packet:t}={})=>{const e=a(C,t);return`\n\t.packetByte {\n\t\tfont-size: ${e.byteFontSize};\n\t}\n\t.packetByte.start {\n\t\tfill: ${e.startByteColor};\n\t}\n\t.packetByte.end {\n\t\tfill: ${e.endByteColor};\n\t}\n\t.packetLabel {\n\t\tfill: ${e.labelColor};\n\t\tfont-size: ${e.labelFontSize};\n\t}\n\t.packetTitle {\n\t\tfill: ${e.titleColor};\n\t\tfont-size: ${e.titleFontSize};\n\t}\n\t.packetBlock {\n\t\tstroke: ${e.blockStrokeColor};\n\t\tstroke-width: ${e.blockStrokeWidth};\n\t\tfill: ${e.blockFillColor};\n\t}\n\t`},"styles"),v={parser:y,get db(){return new u},renderer:B,styles:P};export{v as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{I as e}from"./chunk-2Q5K7J3B-0YJgChVo.js";import{p as t}from"./chunk-JWPE2WC7-BP2iXBhe.js";import{q as n,b as i,s as o,t as r,g as s,a,_ as c,N as d,l,Q as h,d as p,L as g,z as f,j as u,ao as w,O as x,ap as m}from"./mermaid-T_6Ze_cT.js";import{p as b}from"./cynefin-EF2NZ3EQ-CR1E3YiZ.js";import"./markdown-S2mWvoE-.js";var y=/[─━│┃└┗├┣]/,k=/[└┗├┣]/,$=/[─━]/,v=/^[\s│┃]+$/,B=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,C=/^\s*%%/;function V(e){return e.some(e=>y.test(e))}function I(e){for(const t of e){const e=k.exec(t);if(e?.index&&e.index>0)return e.index}return 4}function T(e,t){return e.replace(/\bline\s+(\d+)\b/gi,(e,n)=>{const i=parseInt(n,10),o=t.get(i);return o?`line ${o}`:e})}function M(e){const t=e.split("\n"),n=new Map;let i=-1;for(const[c,d]of t.entries())if("treeView-beta"===d.trim()){i=c;break}if(-1===i)return{text:e,lineMap:n};const o=[];for(let c=i+1;c<t.length;c++){const e=t[c];""===e.trim()||C.test(e)||B.test(e)||(v.test(e)||o.push(e.replace(/\t/g," ")))}if(!V(o))return{text:e,lineMap:n};const r=I(o),s=[];let a=0;for(let c=0;c<=i;c++)s.push(t[c]),a++,n.set(a,c+1);for(let c=i+1;c<t.length;c++){const e=t[c],i=c+1;if(""===e.trim()){s.push(e),a++,n.set(a,i);continue}if(C.test(e)){s.push(e),a++,n.set(a,i);continue}if(B.test(e)){s.push(e),a++,n.set(a,i);continue}if(v.test(e))continue;const o=e.replace(/\t/g," "),d=k.exec(o);if(void 0!==d?.index){const e=d.index,t=Math.round(e/r)+1;let c=e+1;for(;c<o.length&&$.test(o[c]);)c++;for(;c<o.length&&" "===o[c];)c++;const l=o.slice(c).trimEnd();if(!l)throw new Error(`Line ${i}: Empty node — expected a filename or directory name after the box-drawing prefix`);const h=" ".repeat(t);s.push(h+l),a++,n.set(a,i)}else{if(/^[\s─━│┃└┗├┣]+$/.test(o))continue;if(y.test(o))s.push(e),a++,n.set(a,i);else{if(/^\s+/.test(o))throw new Error(`Line ${i}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);s.push(e),a++,n.set(a,i)}}}return{text:s.join("\n"),lineMap:n}}c(V,"isBoxDrawingFormat"),c(I,"inferSegmentWidth"),c(T,"remapErrorLines"),c(M,"preprocessBoxDrawing");var E=new e(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),A=c(()=>{E.reset(),f()},"clear"),N=c(()=>E.records.stack[0],"getRoot"),j=c(()=>E.records.cnt,"getCount"),z=x.treeView,D=c(()=>d(z,g().treeView),"getConfig"),L={clear:A,addNode:c((e,t,n,i,o,r)=>{for(;e<=E.records.stack[E.records.stack.length-1].level;)E.records.stack.pop();const s={id:E.records.cnt++,level:e,name:t,nodeType:n,icon:o,cssClass:i,description:r,children:[]};E.records.stack[E.records.stack.length-1].children.push(s),E.records.stack.push(s)},"addNode"),getRoot:N,getCount:j,getConfig:D,getAccTitle:a,getAccDescription:s,getDiagramTitle:r,setAccDescription:o,setAccTitle:i,setDiagramTitle:n},W=c(e=>{t(e,L);for(const t of e.nodes){const e="number"==typeof t.indent?t.indent:0;let n=t.name;const i=n.endsWith("/");i&&(n=n.slice(0,-1));const o=i?"directory":"file",r=t.classAnnotation||void 0,s=t.iconAnnotation,a=void 0!==s?s||"none":void 0,c=t.descAnnotation||void 0,d=c?u(c,g()):void 0;L.addNode(e,n,o,r,a,d)}},"populate"),X={parse:c(async e=>{const{text:t,lineMap:n}=M(e);try{const e=await b("treeView",t);l.debug(e),W(e)}catch(i){throw n.size>0&&i instanceof Error&&(i.message=T(i.message,n)),i}},"parse")},R={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function P(e,t){const n=t?.filenameIcons?.[e];if(n)return n;const i=e.lastIndexOf(".");if(i>0){const n=e.substring(i).toLowerCase(),o=t?.extensionIcons;return o?.[n]??o?.[n.slice(1)]}}function S(e,t){return e.includes(":")?e:e in R.icons||!t?`${R.prefix}:${e}`:`${t}:${e}`}function F(e,t){if("none"!==e.icon){if(e.icon)return S(e.icon,t.defaultIconPack);if(t.showIcons){if("file"===e.nodeType){const n=P(e.name,t);if("none"===n)return;if(n)return S(n,t.defaultIconPack)}return`${R.prefix}:${"directory"===e.nodeType?"folder":"file"}`}}}c(P,"detectIcon"),c(S,"qualifyIcon"),c(F,"getNodeIcon"),m([{name:R.prefix,icons:R}]);var H=c(async(e,t)=>{const n=[],i=c(e=>{const o=F(e,t);o&&n.push({icon:o,node:e}),e.children.forEach(i)},"collect");i(e);const o=await Promise.all(n.map(async({icon:e,node:t})=>({id:t.id,svg:await w(e,{height:14,width:14})})));return new Map(o.map(({id:e,svg:t})=>[e,t]))},"resolveNodeIcons"),Q=c((e,t,n,i,o,r)=>{const s=i.append("g");let a="treeView-node-label";"directory"===n.nodeType&&(a+=" treeView-node-dir"),n.cssClass&&(a+=` ${n.cssClass}`);const c=F(n,o),d=void 0!==c;c&&s.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${e+o.paddingX}, ${t+o.paddingY})`).html(r.get(n.id)??"");const l=s.append("text").text(n.name).attr("dominant-baseline","middle").attr("class",a),{height:h,width:p}=l.node().getBBox(),g=h+2*o.paddingY,f=e+o.paddingX+(d?18:0);l.attr("x",f),l.attr("y",t+g/2);const u=f+p,w=p+2*o.paddingX+(d?18:0);return n.BBox={x:e,y:t,width:w,height:g},n.cssClass?.split(/\s+/).includes("highlight")&&s.insert("rect",":first-child").attr("x",e).attr("y",t+1).attr("width",0).attr("height",g-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:n,nodeGroup:s,labelRightEdge:u,centerY:t+g/2}},"positionLabel"),Y=c((e,t,n,i,o,r)=>e.append("line").attr("x1",t).attr("y1",n).attr("x2",i).attr("y2",o).attr("stroke-width",r).attr("class","treeView-node-line"),"positionLine"),G=c((e,t,n,i)=>{let o=0,r=0;const s=[],a=c((e,t,n,a)=>{const c=a*(n.rowIndent+n.paddingX),d=Q(c,o,t,e,n,i);s.push(d);const{height:l,width:h}=t.BBox;Y(e,c-n.rowIndent,o+l/2,c,o+l/2,n.lineThickness),r=Math.max(r,c+h),o+=l},"drawNode"),d=c((t,i=0)=>{a(e,t,n,i),t.children.forEach(e=>{d(e,i+1)});const{x:o,y:r,height:s}=t.BBox;if(t.children.length){const{y:i,height:a}=t.children[t.children.length-1].BBox;Y(e,o+n.paddingX,r+s,o+n.paddingX,i+a/2+n.lineThickness/2,n.lineThickness)}},"processNode");d(t);const l=s.filter(e=>e.node.description);if(l.length>0){const e=Math.max(...s.map(e=>e.labelRightEdge))+16;for(const t of l){const i=t.nodeGroup.append("text").text(t.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",e).attr("y",t.centerY).node().getBBox();r=Math.max(r,e+i.width+n.paddingX)}}for(const c of s)if(c.node.cssClass?.split(/\s+/).includes("highlight")){const e=c.nodeGroup.select(".treeView-highlight-bg");if(!e.empty()){const t=r-c.node.BBox.x+8;e.attr("width",t),r=Math.max(r,c.node.BBox.x+t+2)}}return{totalHeight:o,totalWidth:r}},"drawTree"),O={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Z={db:L,renderer:{draw:c(async(e,t,n,i)=>{l.debug("Rendering treeView diagram\n"+e);const o=i.db,r=o.getRoot(),s=o.getConfig(),a=h(t),c=a.append("g");c.attr("class","tree-view");const d=await H(r,s),{totalHeight:g,totalWidth:f}=G(c,r,s,d);a.attr("viewBox",`-${s.lineThickness/2} 0 ${f} ${g}`),p(a,g,f,s.useMaxWidth)},"draw")},parser:X,styles:c(({treeView:e})=>{const{labelFontSize:t,labelColor:n,lineColor:i,iconColor:o,descriptionColor:r,highlightBg:s,highlightStroke:a}=d(O,e);return`\n .treeView-node-label {\n font-size: ${t};\n fill: ${n};\n white-space: pre;\n }\n .treeView-node-dir {\n font-weight: bold;\n }\n .treeView-node-line {\n stroke: ${i};\n }\n .treeView-node-icon {\n color: ${o};\n }\n .treeView-node-description {\n font-size: ${t};\n fill: ${r};\n font-style: italic;\n white-space: pre;\n }\n .treeView-highlight-bg {\n fill: ${s};\n stroke: ${a};\n stroke-width: 1;\n }\n `},"styles")};export{Z as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e}from"./chunk-JWPE2WC7-BP2iXBhe.js";import{t,q as n,s as a,g as i,a as r,b as o,_ as s,l,c as d,k as m,M as c,z as x,N as u,L as f,O as g,j as h,w as b,aq as p}from"./mermaid-T_6Ze_cT.js";import{p as w,i as v}from"./cynefin-EF2NZ3EQ-CR1E3YiZ.js";import"./markdown-S2mWvoE-.js";var y="position frame",P="frame positioned",M="position relation",k="relation positioned",S=s(function(e){l.debug("options str",e)},"setOptions"),B=s(function(){return{}},"getOptions"),F=s(function(){$(),x()},"clear");function $(){W={}}s($,"reset");var E=g.eventmodeling,A=s(()=>u({...E,...f().eventmodeling}),"getConfig"),W={};function R(){let e=I;const{ast:t}=W,n=H();if(!t)throw new Error("No data for EventModel");return t.frames.forEach((a,i)=>{const r=X(a,t.dataEntities,n);let o;e=re(e,{$kind:y,index:i,frame:a,textProps:r}),J(a)?(l.debug("source frame",a.sourceFrames),o=t.frames.filter(e=>a.sourceFrames.some(t=>t.$refText===e.name)),o.forEach(t=>{e=re(e,{$kind:M,index:i,frame:a,sourceFrame:t})})):e=re(e,{$kind:M,index:i,frame:a})}),e={...e,sortedSwimlanesArray:q(e.swimlanes)},e}function O(e){W.ast=void 0;const t=new Set;for(const n of e.frames){if(t.has(n.name)){const e=n.$cstNode?.range.start.line,t=void 0===e?"":` on line ${e+1}`;throw new Error(`Duplicate event modeling frame ID "${n.name}"${t}`)}t.add(n.name)}W.ast=e}s(R,"getState"),s(O,"setAst");var T={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function H(){return T}s(H,"getDiagramProps");var I={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function C(e){const t=e.split(".");if(2===t.length)return t[0]}function D(e){const t=e.split(".");return 2===t.length?t[1]:e}function N(e,t){if(t&&0!==t.length)return Object.values(e).find(e=>e.namespace===t)}function j(e,t,n){return Math.max(t,...Object.keys(e).filter(e=>{const a=Number.parseInt(e);return a>t&&a<n}).map(e=>Number.parseInt(e)))+1}function U(e,t){const n=C(e.entityIdentifier),a=N(t,n);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return a?{index:a.index,label:a.namespace||T.labelUiAutomation}:n?{index:j(t,0,100),label:T.labelUiAutomationPrefix+n}:{index:0,label:T.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return a?{index:a.index,label:a.namespace||T.labelCommandReadModel}:n?{index:j(t,100,200),label:T.labelCommandReadModelPrefix+n}:{index:100,label:T.labelCommandReadModel};default:return a?{index:a.index,label:a.namespace||T.labelEvents}:n?{index:j(t,200,300),label:T.labelEventsPrefix+n}:{index:200,label:T.labelEvents}}}function V(e){const{themeVariables:t}=f();switch(e.modelEntityType){case"ui":return{fill:t.emUiFill??"white",stroke:t.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:t.emProcessorFill??"#edb3f6",stroke:t.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:t.emReadModelFill??"#d3f1a2",stroke:t.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:t.emCommandFill??"#bcd6fe",stroke:t.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:t.emEventFill??"#ffb778",stroke:t.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}function X(e,t,n){const a=f(),i=h(D(e.entityIdentifier)??"",a);let r;const o={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"};let s=`<b>${b(i,n.textMaxWidth,o)}</b>`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=h(r,a),r=b(r,n.textMaxWidth,o),r=r.replaceAll(" "," ")),e.dataReference){const i=t.find(t=>t.name===e.dataReference?.$refText);i&&(r=i.dataBlockValue,r=r.substring(r.indexOf("{\n")+2),r=r.substring(0,r.lastIndexOf("}")-1),r=h(r,a),r=b(r,n.textMaxWidth,o),r=r.replaceAll(" "," "),r+="<br/>")}const d=void 0!==r;d&&(s+=`<br/><br/><code style="text-align: left; display: block;max-width:${n.textMaxWidth}px">${r}</code>`);const m=p(s,{fontSize:o.fontSize,fontWeight:o.fontWeight,fontFamily:o.fontFamily}),c={content:s,width:d?m.width/3:m.width,height:m.height};return l.debug(`[${e.name}] ${e.entityIdentifier} text`,c),c}function z(e,t){const n=t,a=V(n.frame),i={width:n.textProps.width+2*T.boxTextPadding,height:n.textProps.height+2*T.boxTextPadding};return[{$kind:P,frame:n.frame,index:n.index,visual:a,dimension:i,textProps:n.textProps}]}function G(e,t,n){return void 0===t?T.contentStartX:t.index===e.index&&e.r?e.r+T.boxPadding:void 0===n?T.contentStartX:n.r-T.boxOverlap+T.boxPadding}function L(e,t){const n=[...e.map(e=>e.r),t];return Math.max(...n)}function q(e){return Object.values(e).sort((e,t)=>e.index-t.index)}function Q(e,t){const n=t,a=U(n.frame,e.swimlanes);let i;i=a.index in e.swimlanes?e.swimlanes[a.index]:{index:a.index,label:a.label,r:0,y:a.index*T.swimlaneMinHeight+T.swimlaneGap,height:T.swimlaneMinHeight,maxHeight:T.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,o=void 0!==e.previousSwimlaneNumber?e.swimlanes[e.previousSwimlaneNumber]:void 0,s={width:Math.max(T.boxMinWidth,Math.min(T.boxMaxWidth,n.dimension.width))+2*T.boxPadding,height:Math.max(T.boxMinHeight,Math.min(T.boxMaxHeight,n.dimension.height))+2*T.boxPadding},l=G(i,o,r),d=l+s.width+T.boxPadding,m=L(Object.values(e.swimlanes),d);i.r=l+s.width,i.maxHeight=Math.max(i.maxHeight,s.height),i.height=Math.max(T.swimlaneMinHeight,i.maxHeight)+2*T.swimlanePadding;const c={x:l,y:T.swimlanePadding+i.y,r:d,dimension:s,leftSibling:!1,swimlane:i,visual:n.visual,text:n.textProps.content,frame:n.frame,index:n.index},x={...e,boxes:[...e.boxes,c],swimlanes:{...e.swimlanes,[`${i.index}`]:i},previousSwimlaneNumber:a.index,previousFrame:n.frame,maxR:m},u=q(x.swimlanes);u.length>0&&(u[0].y=0);for(let f=1;f<u.length;f++){const e=u[f],t=u[f-1];e.y=t.y+t.height+T.swimlaneGap}return x}function Y(e,t){return 0===e&&0===t.sourceFrames.length}function J(e){return void 0!==e.sourceFrames&&null!==e.sourceFrames&&e.sourceFrames.length>0}function Z(e,t){if(null!=t)return e.find(e=>e.frame.name===t.name)}function _(e,t,n){if(!(n<0))for(let a=n;a>=0;a--){const n=e[a];if(n.swimlane.index!==t)return n}}function K(e,t){const n=t;if(Y(n.index,n.frame))return[];const a=Z(e.boxes,n.frame);if(void 0===a)throw new Error(`Target box not found for frame ${n.frame.name}`);let i;if(n.sourceFrame)i=Z(e.boxes,n.sourceFrame);else{if(v(n.frame))return[];i=_(e.boxes,a.swimlane.index,n.index-1)}if(void 0===i)return[];return[{$kind:k,frame:n.frame,index:n.index,sourceBox:i,targetBox:a}]}function ee(e,t){const n=t,a={visual:{fill:"none",stroke:"#000"},source:{x:n.sourceBox.x,y:n.sourceBox.y},target:{x:n.targetBox.x,y:n.targetBox.y},sourceBox:n.sourceBox,targetBox:n.targetBox};return{...e,relations:[...e.relations,a]}}s(C,"extractNamespace"),s(D,"extractName"),s(N,"findSwimlaneByNamespace"),s(j,"findNextAvailableIndex"),s(U,"calculateSwimlaneProps"),s(V,"calculateEntityVisualProps"),s(X,"calculateTextProps"),s(z,"decidePositionFrame"),s(G,"calculateX"),s(L,"calculateMaxRight"),s(q,"sortedSwimlanesArray"),s(Q,"evolveFramePositioned"),s(Y,"isFirstFrame"),s(J,"hasSourceFrame"),s(Z,"findBoxByFrame"),s(_,"findBoxByLineIndex"),s(K,"decidePositionRelation"),s(ee,"evolveRelationPositioned");var te={[y]:z,[M]:K},ne={[P]:Q,[k]:ee};function ae(e,t){const n=te[t.$kind];if(null==n)return[];const a=n(e,t);return l.debug("decided events",a),a}function ie(e,t){const n=t.reduce((e,t)=>{const n=ne[t.$kind];return null==n?e:n(e,t)},e);return l.debug("evolve events",{state:e,newState:n,events:t}),n}function re(e,t){return ie(e,ae(e,t))}s(ae,"decide"),s(ie,"evolve"),s(re,"dispatch");var oe={getConfig:A,preserveCommentsWhenParsing:!0,setOptions:S,getOptions:B,clear:F,setAccTitle:o,getAccTitle:r,getAccDescription:i,setAccDescription:a,setDiagramTitle:n,getDiagramTitle:t,setAst:O,getDiagramProps:H,getState:R},se={parse:s(async t=>{const n=await w("eventmodeling",t);l.debug(n),oe.setAst(n),e(n,oe)},"parse")},le=d(),de=le?.eventmodeling;function me(e,t){return n=>{const a=n.swimlane.y+t.swimlanePadding,i=e.append("g").attr("class","em-box");i.append("rect").attr("x",n.x).attr("y",a).attr("rx","3").attr("width",n.dimension.width).attr("height",n.dimension.height).attr("stroke",n.visual.stroke).attr("fill",n.visual.fill);i.append("foreignObject").attr("x",n.x+t.boxPadding).attr("y",a+10).attr("width",n.dimension.width-2*t.boxPadding).attr("height",n.dimension.height-2*t.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(n.text)}}function ce(e,t){return e>t}function xe(e,t,n,a){return i=>{const r=i.sourceBox.swimlane.y+t.swimlanePadding,o=i.targetBox.swimlane.y+t.swimlanePadding,s=ce(r,o),d=i.sourceBox.x+2*i.sourceBox.dimension.width/3,m=i.targetBox.x+i.targetBox.dimension.width/3;let c,x;l.debug(`rendering relation up=${s} for `,{sourceBox:i.sourceBox,targetBox:i.targetBox}),s?(c=r,x=o+i.targetBox.dimension.height):(c=r+i.sourceBox.dimension.height,x=o);const u=a.emRelationStroke??i.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",i.visual.fill).attr("stroke",u).attr("stroke-width","1").attr("marker-end",`url(#${n})`).attr("d",`M${d} ${c} L${m} ${x}`)}}function ue(e,t,n,a){return i=>{const r=e.append("g").attr("class","em-swimlane"),o=a.emSwimlaneBackgroundOdd??"rgb(250,250,250)",s=a.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",i.y).attr("rx","3").attr("width",t+n.swimlanePadding).attr("height",i.height).attr("fill",o).attr("stroke",s),r.append("text").attr("font-weight",n.swimlaneTextFontWeight).attr("x",30).attr("y",i.y+30).text(i.label)}}s(me,"renderD3Box"),s(ce,"dirUpwards"),s(xe,"renderD3Relation"),s(ue,"renderD3Swimlane");var fe={parser:se,db:oe,renderer:{draw:s(function(e,t,n,a){if(l.debug("in eventmodeling renderer",e+"\n","id:",t,n),!de)throw new Error("EventModeling config not found");const i=a.db,{themeVariables:r,eventmodeling:o}=d(),s=m(`[id="${t}"]`),x=i.getDiagramProps(),u=i.getState(),f=`em-arrowhead-${t}`,g=r.emArrowhead??"#000000";u.sortedSwimlanesArray.forEach(ue(s,u.maxR,x,r)),u.boxes.forEach(me(s,x)),u.relations.forEach(xe(s,x,f,r));s.append("defs").append("marker").attr("id",f).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",g),c(void 0,s,o?.padding??30,o?.useMaxWidth)},"draw")},styles:s(e=>"","getStyles")};export{fe as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as t}from"./chunk-JWPE2WC7-BP2iXBhe.js";import{s as e,g as a,t as r,q as n,a as s,b as i,_ as o,Q as l,z as c,N as d,L as g,O as p,l as u,W as x,d as h}from"./mermaid-T_6Ze_cT.js";import{p as m}from"./cynefin-EF2NZ3EQ-CR1E3YiZ.js";import"./markdown-S2mWvoE-.js";var $={showLegend:!0,ticks:5,max:null,min:0,graticule:"circle"},f={axes:[],curves:[],options:$},y=structuredClone(f),v=p.radar,w=o(()=>d({...v,...g().radar}),"getConfig"),b=o(()=>y.axes,"getAxes"),C=o(()=>y.curves,"getCurves"),M=o(()=>y.options,"getOptions"),L=o(t=>{y.axes=t.map(t=>({name:t.name,label:t.label??t.name}))},"setAxes"),k=o(t=>{y.curves=t.map(t=>({name:t.name,label:t.label??t.name,entries:T(t.entries)}))},"setCurves"),T=o(t=>{if(null==t[0].axis)return t.map(t=>t.value);const e=b();if(0===e.length)throw new Error("Axes must be populated before curves for reference entries");return e.map(e=>{const a=t.find(t=>t.axis?.$refText===e.name);if(void 0===a)throw new Error("Missing entry for axis "+e.label);return a.value})},"computeCurveEntries"),A={getAxes:b,getCurves:C,getOptions:M,setAxes:L,setCurves:k,setOptions:o(t=>{const e=t.reduce((t,e)=>(t[e.name]=e,t),{});y.options={showLegend:e.showLegend?.value??$.showLegend,ticks:e.ticks?.value??$.ticks,max:e.max?.value??$.max,min:e.min?.value??$.min,graticule:e.graticule?.value??$.graticule},y.options.ticks>32&&(u.warn(`Radar diagram ticks (${y.options.ticks}) exceeds maximum allowed (32). Using 32 instead.`),y.options.ticks=32)},"setOptions"),getConfig:w,clear:o(()=>{c(),y=structuredClone(f)},"clear"),setAccTitle:i,getAccTitle:s,setDiagramTitle:n,getDiagramTitle:r,getAccDescription:a,setAccDescription:e},O=o(e=>{t(e,A);const{axes:a,curves:r,options:n}=e;A.setAxes(a),A.setCurves(r),A.setOptions(n)},"populate"),S={parse:o(async t=>{const e=await m("radar",t);u.debug(e),O(e)},"parse")},E=o((t,e,a,r)=>{const n=r.db,s=n.getAxes(),i=n.getCurves(),o=n.getOptions(),c=n.getConfig(),d=n.getDiagramTitle(),g=l(e),p=I(g,c),u=o.max??Math.max(...i.map(t=>Math.max(...t.entries))),x=o.min,h=Math.min(c.width,c.height)/2;F(p,s,h,o.ticks,o.graticule),P(p,s,h,c),z(p,s,i,x,u,o.graticule,c),j(p,i,o.showLegend,c),p.append("text").attr("class","radarTitle").text(d).attr("x",0).attr("y",-c.height/2-c.marginTop)},"draw"),I=o((t,e)=>{const a=e.width+e.marginLeft+e.marginRight,r=e.height+e.marginTop+e.marginBottom,n=e.marginLeft+e.width/2,s=e.marginTop+e.height/2;return h(t,r,a,e.useMaxWidth??!0),t.attr("viewBox",`0 0 ${a} ${r}`).attr("overflow","visible"),t.append("g").attr("transform",`translate(${n}, ${s})`)},"drawFrame"),F=o((t,e,a,r,n)=>{if("circle"===n)for(let s=0;s<r;s++){const e=a*(s+1)/r;t.append("circle").attr("r",e).attr("class","radarGraticule")}else if("polygon"===n){const n=e.length;for(let s=0;s<r;s++){const i=a*(s+1)/r,o=e.map((t,e)=>{const a=2*e*Math.PI/n-Math.PI/2;return`${i*Math.cos(a)},${i*Math.sin(a)}`}).join(" ");t.append("polygon").attr("points",o).attr("class","radarGraticule")}}},"drawGraticule"),P=o((t,e,a,r)=>{const n=e.length;for(let s=0;s<n;s++){const i=e[s].label,o=2*s*Math.PI/n-Math.PI/2,l=Math.cos(o),c=Math.sin(o);t.append("line").attr("x1",0).attr("y1",0).attr("x2",a*r.axisScaleFactor*l).attr("y2",a*r.axisScaleFactor*c).attr("class","radarAxisLine");const d=l>.01?"start":l<-.01?"end":"middle",g=c>.01?"hanging":c<-.01?"auto":"central",p=4;t.append("text").text(i).attr("x",a*r.axisLabelFactor*l+p*l).attr("y",a*r.axisLabelFactor*c+p*c).attr("text-anchor",d).attr("dominant-baseline",g).attr("class","radarAxisLabel")}},"drawAxes");function z(t,e,a,r,n,s,i){const o=e.length,l=Math.min(i.width,i.height)/2;a.forEach((e,a)=>{if(e.entries.length!==o)return;const c=e.entries.map((t,e)=>{const a=2*Math.PI*e/o-Math.PI/2,s=R(t,r,n,l);return{x:s*Math.cos(a),y:s*Math.sin(a)}});"circle"===s?t.append("path").attr("d",W(c,i.curveTension)).attr("class",`radarCurve-${a}`):"polygon"===s&&t.append("polygon").attr("points",c.map(t=>`${t.x},${t.y}`).join(" ")).attr("class",`radarCurve-${a}`)})}function R(t,e,a,r){return r*(Math.min(Math.max(t,e),a)-e)/(a-e)}function W(t,e){const a=t.length;let r=`M${t[0].x},${t[0].y}`;for(let n=0;n<a;n++){const s=t[(n-1+a)%a],i=t[n],o=t[(n+1)%a],l=t[(n+2)%a],c={x:i.x+(o.x-s.x)*e,y:i.y+(o.y-s.y)*e},d={x:o.x-(l.x-i.x)*e,y:o.y-(l.y-i.y)*e};r+=` C${c.x},${c.y} ${d.x},${d.y} ${o.x},${o.y}`}return`${r} Z`}function j(t,e,a,r){if(!a)return;const n=3*(r.width/2+r.marginRight)/4,s=3*-(r.height/2+r.marginTop)/4;e.forEach((e,a)=>{const r=t.append("g").attr("transform",`translate(${n}, ${s+20*a})`);r.append("rect").attr("width",12).attr("height",12).attr("class",`radarLegendBox-${a}`),r.append("text").attr("x",16).attr("y",0).attr("class","radarLegendText").text(e.label)})}o(z,"drawCurves"),o(R,"relativeRadius"),o(W,"closedRoundCurve"),o(j,"drawLegend");var D={draw:E},B=o((t,e)=>{let a="";for(let r=0;r<t.THEME_COLOR_LIMIT;r++){const n=t[`cScale${r}`];a+=`\n\t\t.radarCurve-${r} {\n\t\t\tcolor: ${n};\n\t\t\tfill: ${n};\n\t\t\tfill-opacity: ${e.curveOpacity};\n\t\t\tstroke: ${n};\n\t\t\tstroke-width: ${e.curveStrokeWidth};\n\t\t}\n\t\t.radarLegendBox-${r} {\n\t\t\tfill: ${n};\n\t\t\tfill-opacity: ${e.curveOpacity};\n\t\t\tstroke: ${n};\n\t\t}\n\t\t`}return a},"genIndexStyles"),G=o(t=>{const e=x(),a=g(),r=d(e,a.themeVariables);return{themeVariables:r,radarOptions:d(r.radar,t)}},"buildRadarStyleOptions"),Q={parser:S,db:A,renderer:D,styles:o(({radar:t}={})=>{const{themeVariables:e,radarOptions:a}=G(t);return`\n\t.radarTitle {\n\t\tfont-size: ${e.fontSize};\n\t\tcolor: ${e.titleColor};\n\t\tdominant-baseline: hanging;\n\t\ttext-anchor: middle;\n\t}\n\t.radarAxisLine {\n\t\tstroke: ${a.axisColor};\n\t\tstroke-width: ${a.axisStrokeWidth};\n\t}\n\t.radarAxisLabel {\n\t\tfont-size: ${a.axisLabelFontSize}px;\n\t\tcolor: ${a.axisColor};\n\t}\n\t.radarGraticule {\n\t\tfill: ${a.graticuleColor};\n\t\tfill-opacity: ${a.graticuleOpacity};\n\t\tstroke: ${a.graticuleColor};\n\t\tstroke-width: ${a.graticuleStrokeWidth};\n\t}\n\t.radarLegendText {\n\t\ttext-anchor: start;\n\t\tfont-size: ${a.legendFontSize}px;\n\t\tdominant-baseline: hanging;\n\t}\n\t${B(e,a)}\n\t`},"styles")};export{Q as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as t}from"./chunk-5VM5RSS4-CJaRXFHK.js";import{g as e}from"./chunk-XXDRQBXY-Ct0MhvQo.js";import{s}from"./chunk-VQ5W62QI-B95zur4F.js";import{_ as i,o as n,l as r,c as a,p as o,r as u,u as l,b as c,s as d,q as h,a as p,g,t as f,m,v as y,J as b,x as A,y as E,k,z as x,A as C,B as S,C as T,D as _,E as D,F as v,G as F}from"./mermaid-T_6Ze_cT.js";import{c as $}from"./chunk-55XCU76K-Cq25Yw_G.js";import{p as L}from"./markdown-S2mWvoE-.js";var B={SHAPE_UNSUPPORTED:"SHAPE_UNSUPPORTED",SHAPE_REMOVED:"SHAPE_REMOVED",EDGE_OPERATOR_UNSUPPORTED:"EDGE_OPERATOR_UNSUPPORTED",REFERENCE_EDGE_LABEL_REJECTED:"REFERENCE_EDGE_LABEL_REJECTED",CONNECTOR_REF_UNRESOLVED:"CONNECTOR_REF_UNRESOLVED",CONNECTOR_REF_NOT_A_CONNECTOR:"CONNECTOR_REF_NOT_A_CONNECTOR",METADATA_KEY_MISAPPLIED:"METADATA_KEY_MISAPPLIED",DUPLICATE_ID_NODE:"DUPLICATE_ID_NODE",RESERVED_SYNTHETIC_ID:"RESERVED_SYNTHETIC_ID",CONTAINMENT_VIOLATION:"CONTAINMENT_VIOLATION",EDGE_SEMANTIC_CONTRADICTION:"EDGE_SEMANTIC_CONTRADICTION",FLOW_NO_INPUT:"FLOW_NO_INPUT"},I=new Set([B.SHAPE_UNSUPPORTED,B.SHAPE_REMOVED,B.CONTAINMENT_VIOLATION]);new Set(Object.values(B).filter(t=>!I.has(t)));var w=new Map([["task","roundedRect"],["tool","subroutine"],["input","lean-right"],["decision","diamond"],["refdoc","lin-doc"],["action","hexagon"],["round","rect"]]),M=new Set(["doc","stadium","terminal","circle","trapezoid","inv_trapezoid","inv-trapezoid","doublecircle","double-circle","typeDeclaration","procs","lean_left","lean-left","in-out","cylinder","ellipse","odd","tag-rect","tagged-rectangle","delay","half-rounded-rectangle","lin-rect","lined-rectangle","win-pane","window-pane","curv-trap","curved-trapezoid"]),N=new Set(["roundedRect","subroutine","subprocess","subproc","framed-rectangle","lean-right","diamond","lin-doc","lined-document","hexagon","hex","connector","collapsedGroup"]),R="roundedRect";function O(t){return t?w.get(t)??t:t}function V(t,e){for(const s of t)if(!s.isGroup){if(s.shape&&"squareRect"!==s.shape&&"rect"!==s.shape||(s.shape=R),M.has(s.shape)){const t=`shape "${s.shape}" was removed in v0.8.1, using "${R}"`;e?.emitError?e.emitError("SHAPE_REMOVED",t,{nodeId:s.id}):r.warn(`agentflow: ${t}`),s.shape=R;continue}if(!N.has(s.shape)){const t=`shape "${s.shape}" is not supported, using "${R}"`;e?.emitWarning?e.emitWarning("SHAPE_UNSUPPORTED",t,{nodeId:s.id}):r.warn(`agentflow: ${t}`),s.shape=R}}}i(O,"resolveShapeAlias"),i(V,"normaliseNodeShapes");var P=new Map([["tool",0],["task",1],["decision",2],["input",3],["refdoc",4],["connector",5],["action",6]]),G=P.size,U=i(t=>`af-kind-${t}`,"kindClass"),j=[...P.keys()],z=i(t=>Math.max(1,t-G),"containerSlotCount"),W=i((t,e)=>{const s=G+t%z(e);return e>0?s%e:s},"containerSlot");function K(t,e,s){const i=a().themeVariables?.borderColorArray,n=Array.isArray(i)?i.length:0;let r=s.size;for(const a of t??[]){if(a.isGroup||"collapsedGroup"===a.shape){const t=s.get(String(a.id))??r++;a.colorIndex=W(t,n);continue}const t=e(String(a.id));t&&P.has(t)&&(a.cssClasses=`${a.cssClasses??""} ${U(t)}`.replace(/\s+/g," ").trim())}}i(K,"assignColorSlots");var Y="agentflow-",H=new Set(["shape","view","icon","img","form","pos","w","h","class","style","labelType"]),X=new Set(["subroutine","subprocess","subproc","framed-rectangle","tool"]),q={flow:"flowGroup"};function Q(t){if(Array.isArray(t))return t.map(t=>Q(t));if(null===t||"object"!=typeof t)return t;const e={};for(const s of Object.keys(t))"__proto__"!==s&&"constructor"!==s&&"prototype"!==s&&(e[s]=Q(t[s]));return e}function J(t){let e,s=!1,i=!1,n=0;const r=[];for(const a of t.split("\n")){if(void 0!==e){const t=a.length-a.trimStart().length;if(""===a.trim()||t>e){r.push(a);continue}e=void 0}let t=-1;for(let e=0;e<a.length;e++){const r=a[e];if(i)"\\"===r?e++:'"'===r&&(i=!1);else if(s)"'"===r&&(s=!1);else if('"'===r)i=!0;else if("'"===r)s=!0;else{if("#"===r&&(0===e||" "===a[e-1]||"\t"===a[e-1])){t=e;break}"["===r||"{"===r?n++:"]"!==r&&"}"!==r||(n=Math.max(0,n-1))}}if(s||i||n>0){r.push(a);continue}const o=t>=0?a.slice(0,t):a,u=t>=0?a.slice(t):"";/:\s*[>|][\d+-]*\s*$/.test(o)?(e=a.length-a.trimStart().length,r.push(a)):r.push(o.replace(/,([\t ]*)$/,"$1")+u)}return r.join("\n")}i(Q,"stripPrototypeKeys"),i(J,"stripLineTrailingCommas");var Z=class{constructor(){this.vertexCounter=0,this.config=a(),this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.diagramId="",this.preserveCommentsWhenParsing=!0,this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,this.funs=[],this.setAccTitle=c,this.setAccDescription=d,this.setDiagramTitle=h,this.getAccTitle=p,this.getAccDescription=g,this.getDiagramTitle=f,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addGlobal=this.addGlobal.bind(this),this.addConnector=this.addConnector.bind(this),this.addConnectorMapping=this.addConnectorMapping.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.setFrontmatterLineOffset=this.setFrontmatterLineOffset.bind(this),this.addVertexMapping=this.addVertexMapping.bind(this),this.extendVertexMapping=this.extendVertexMapping.bind(this),this.addEdgeMapping=this.addEdgeMapping.bind(this),this.addSubgraphMapping=this.addSubgraphMapping.bind(this),this.emitWarning=this.emitWarning.bind(this),this.emitError=this.emitError.bind(this),this.getDiagnostics=this.getDiagnostics.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}static{i(this,"AgentFlowDB")}sanitizeText(t){return m.sanitizeText(t,this.config)}sanitizeNodeLabelType(t){switch(t){case"markdown":case"string":case"text":return t;default:return"markdown"}}setDiagramId(t){this.diagramId=t}lookUpDomId(t){for(const e of this.vertices.values())if(e.id===t)return this.diagramId?`${this.diagramId}-${e.domId}`:e.domId;return this.diagramId?`${this.diagramId}-${t}`:t}addVertex(t,e,s,i,n,r,o={},u,l){if(!t||0===t.trim().length)return;let c,d;if(void 0!==u){let t;t=u.includes("\n")?u+"\n":"{\n"+u+"\n}";try{c=y(t,{schema:b})??{}}catch(E){const t=u.includes("\n")?J(u):u;if(t!==u)try{c=y(t+"\n",{schema:b})??{}}catch{this.rethrowMetadataYamlError(E,u,l)}else this.rethrowMetadataYamlError(E,u,l)}c=Q(c)}if(c&&"string"==typeof c.shape){const t=c;d=t.shape;const e=O(d);e&&e!==d&&(t.shape=e)}const h=this.subGraphLookup.get(t);if(h&&c)return void(h.metadata={...h.metadata,...c});const p=this.connectors.get(t);if(p&&c)return void(p.metadata={...p.metadata,...c});if("connectors"===t)return;const g=this.edges.find(e=>e.id===t);if(g){const t=c;return void 0!==t?.animate&&(g.animate=t.animate),void 0!==t?.animation&&(g.animation=t.animation),void 0!==t?.curve&&(g.interpolate=t.curve),void(c&&(g.metadata={...g.metadata,...c}))}let f,m=this.vertices.get(t);if(void 0===m&&(m={id:t,labelType:"text",domId:Y+t+"-"+this.vertexCounter,styles:[],classes:[]},this.vertices.set(t,m)),this.vertexCounter++,void 0!==e?(this.config=a(),f=this.sanitizeText(e.text.trim()),m.labelType=e.type,f.startsWith('"')&&f.endsWith('"')&&(f=f.substring(1,f.length-1)),m.text=f):void 0===m.text&&(m.text=t),void 0!==s&&(m.type=s),null!=i&&i.forEach(t=>{m.styles.push(t)}),null!=n&&n.forEach(t=>{m.classes.push(t)}),void 0!==r&&(m.dir=r),void 0===m.props?m.props=o:void 0!==o&&Object.assign(m.props,o),c){if(m.metadata={...m.metadata,...c},c.shape){const t=d??c.shape;if("string"!=typeof t)throw this.positionedShapeError(`No such shape: ${JSON.stringify(t)}.`,l);if(t!==t.toLowerCase()||t.includes("_"))throw this.positionedShapeError(`No such shape: ${t}. Shape names should be lowercase.`,l);if(!A(c.shape))throw this.positionedShapeError(`No such shape: ${c.shape}.`,l);m.type=c?.shape}c?.label&&(m.text=this.sanitizeText(c.label),m.labelType=this.sanitizeNodeLabelType(c?.labelType))}}positionedShapeError(t,e){const s=new Error(t);if(!e)return s;const i=e.first_line+this.frontmatterLineOffset;return Object.assign(s,{hash:{text:"",token:null,line:i-1,loc:{first_line:i,last_line:e.last_line+this.frontmatterLineOffset,first_column:e.first_column,last_column:e.last_column},expected:[]}}),s}rethrowMetadataYamlError(t,e,s){const n=t;if(!n||"YAMLException"!==n.name||!n.mark||!s)throw t;let r;try{const t=!e.includes("\n"),a=t?"{\n"+e+"\n}":e+"\n",o=s.first_line+this.frontmatterLineOffset,u=s.first_column+2,l=i((e,s)=>t?{line:o,column:u+(1===e?s:0)}:{line:o+e,column:0===e?u+s:s},"toSource"),c=l(n.mark.line,n.mark.column),d=n.reason??(n.message??"").split("\n")[0].replace(/\s*\(\d+:\d+\)\s*$/,""),h=a.split("\n"),p=[];if(t)p.push(1);else for(let e=n.mark.line-1;e<=n.mark.line+1;e++)e<0||e>=h.length||e===h.length-1&&""===h[e]&&e!==n.mark.line||p.push(e);const g=Math.max(...p.map(t=>String(l(t,0).line).length)),f=[];for(const e of p){const t=l(e,0).line,s=` ${String(t).padStart(g)} | `;f.push(s+h[e].replace(/\t/g,"→")),e===n.mark.line&&f.push("-".repeat(s.length+n.mark.column)+"^")}r={message:`${d} (${c.line}:${c.column+1})\n\n${f.join("\n")}`,markLine:c.line-1,markColumn:c.column,hash:{text:"",token:null,line:c.line-1,loc:{first_line:c.line,last_line:c.line,first_column:c.column,last_column:c.column+1},expected:[]}}}catch{}throw r&&(n.message=r.message,n.mark.line=r.markLine,n.mark.column=r.markColumn,n.hash=r.hash),n}addSingleLink(t,e,s,i){const n={start:t,end:e,type:void 0,text:"",labelType:"text",classes:[],isUserDefinedId:!1,interpolate:this.edges.defaultInterpolate};r.info("abc78 Got edge...",n);const a=s.text;if(void 0!==a&&(n.text=this.sanitizeText(a.text.trim()),n.text.startsWith('"')&&n.text.endsWith('"')&&(n.text=n.text.substring(1,n.text.length-1)),n.labelType=this.sanitizeNodeLabelType(a.type)),void 0!==s&&(n.type=s.type,n.stroke=s.stroke,n.length=s.length>10?10:s.length,s.edgeSemantic&&(n.edgeSemantic=s.edgeSemantic)),i&&!this.edges.some(t=>t.id===i))n.id=i,n.isUserDefinedId=!0;else{const t=this.edges.filter(t=>t.start===n.start&&t.end===n.end);0===t.length?n.id=E(n.start,n.end,{counter:0,prefix:"L"}):n.id=E(n.start,n.end,{counter:t.length+1,prefix:"L"})}if(!(this.edges.length<(this.config.maxEdges??500)))throw new Error(`Edge limit exceeded. ${this.edges.length} edges found, but the limit is ${this.config.maxEdges}.\n\nInitialize mermaid with maxEdges set to a higher number to allow more edges.\nYou cannot set this config via configuration inside the diagram as it is a secure config.\nYou have to call mermaid.initialize.`);r.info("Pushing edge..."),this.edges.push(n)}isLinkData(t){return null!==t&&"object"==typeof t&&"id"in t&&"string"==typeof t.id}addLink(t,e,s){const i=this.isLinkData(s)?s.id.replace("@",""):void 0;r.info("addLink",t,e,i);for(const n of t)for(const r of e){const a=n===t[t.length-1],o=r===e[0];a&&o?this.addSingleLink(n,r,s,i):this.addSingleLink(n,r,s,void 0)}}updateLinkInterpolate(t,e){t.forEach(t=>{if("default"!==t){if("number"==typeof t&&t>=this.edges.length)throw new Error(`The index ${t} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);this.edges[t].interpolate=e}else this.edges.defaultInterpolate=e})}updateLink(t,e){t.forEach(t=>{if("number"==typeof t&&t>=this.edges.length)throw new Error(`The index ${t} for linkStyle is out of bounds. Valid indices for linkStyle are between 0 and ${this.edges.length-1}. (Help: Ensure that the index is within the range of existing edges.)`);"default"===t?this.edges.defaultStyle=e:(this.edges[t].style=e,(this.edges[t]?.style?.length??0)>0&&!this.edges[t]?.style?.some(t=>t?.startsWith("fill"))&&this.edges[t]?.style?.push("fill:none"))})}addClass(t,e){const s=e.join().replace(/\\,/g,"§§§").replace(/,/g,";").replace(/§§§/g,",").split(";");t.split(",").forEach(t=>{let e=this.classes.get(t);void 0===e&&(e={id:t,styles:[],textStyles:[]},this.classes.set(t,e)),null!=s&&s.forEach(t=>{if(/color/.exec(t)){const s=t.replace("fill","bgFill");e.textStyles.push(s)}e.styles.push(t)})})}setDirection(t){this.direction=t.trim(),/.*</.exec(this.direction)&&(this.direction="RL"),/.*\^/.exec(this.direction)&&(this.direction="BT"),/.*>/.exec(this.direction)&&(this.direction="LR"),/.*v/.exec(this.direction)&&(this.direction="TB"),"TD"===this.direction&&(this.direction="TB")}setClass(t,e){for(const s of t.split(",")){const t=this.vertices.get(s);t&&t.classes.push(e);const i=this.edges.find(t=>t.id===s);i&&i.classes.push(e);const n=this.subGraphLookup.get(s);n&&n.classes.push(e)}}setTooltip(t,e){if(void 0!==e){e=this.sanitizeText(e);for(const s of t.split(","))this.tooltips.set("gen-1"===this.version?this.lookUpDomId(s):s,e)}}setClickFun(t,e,s){if("loose"!==a().securityLevel)return;if(void 0===e)return;let i=[];if("string"==typeof s){i=s.split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/);for(let t=0;t<i.length;t++){let e=i[t].trim();e.startsWith('"')&&e.endsWith('"')&&(e=e.substr(1,e.length-2)),i[t]=e}}0===i.length&&i.push(t);const n=this.vertices.get(t);n&&(n.haveCallback=!0,this.funs.push(()=>{const s=this.lookUpDomId(t),n=document.querySelector(`[id="${s}"]`);null!==n&&n.addEventListener("click",()=>{l.runFunc(e,...i)},!1)}))}setLink(t,e,s){t.split(",").forEach(t=>{const i=this.vertices.get(t);void 0!==i&&(i.link=l.formatUrl(e,this.config),i.linkTarget=s)}),this.setClass(t,"clickable")}getTooltip(t){return this.tooltips.get(t)}setClickEvent(t,e,s){t.split(",").forEach(t=>{this.setClickFun(t,e,s)}),this.setClass(t,"clickable")}bindFunctions(t){this.funs.forEach(e=>{e(t)})}getDirection(){return this.direction?.trim()}getVertices(){return this.vertices}getEdges(){return this.edges}isToolDefinition(t){return X.has(t.type)}getTools(){const t=[];for(const e of this.vertices.values())this.isToolDefinition(e)&&t.push(e);return t}getClasses(){return this.classes}setupToolTips(t){const e=$();k(t).select("svg").selectAll("g.node").on("mouseover",t=>{const s=k(t.currentTarget),i=s.attr("title");if(null===i)return;const n=t.currentTarget?.getBoundingClientRect();e.transition().duration(200).style("opacity",".9"),e.text(s.attr("title")).style("left",window.scrollX+n.left+(n.right-n.left)/2+"px").style("top",window.scrollY+n.bottom+"px"),e.html(L.sanitize(i)),s.classed("hover",!0)}).on("mouseout",t=>{e.transition().duration(500).style("opacity",0);k(t.currentTarget).classed("hover",!1)})}clear(t="gen-2"){this.vertices=new Map,this.classes=new Map,this.edges=[],this.funs=[this.setupToolTips.bind(this)],this.subGraphs=[],this.subGraphLookup=new Map,this.globalNodes=new Set,this.connectors=new Map,this.subCount=0,this.tooltips=new Map,this.firstGraphFlag=!0,this.version=t,this.config=a(),this.diagramId="",this.vertexCounter=0,this.direction=void 0,this.secCount=-1,this.posCrossRef=[],this.frontmatterLineOffset=0,this.elementMappings=[],this.bareVertexMappings=new WeakSet,this.diagnostics=[],this.postParseValidationRun=!1,x()}setGen(t){this.version=t||"gen-2"}defaultStyle(){return"fill:#ffa;stroke: #f66; stroke-width: 3px; stroke-dasharray: 5, 5;fill:#ffa;stroke: #666;"}addSubGraph(t,e,s,n){let o=t?.text?.trim(),u=s?.text;t===s&&s?.text&&/\s/.exec(s.text)&&(o=void 0);const l=i(t=>{const e={boolean:{},number:{},string:{}},s=[];let i;return{nodeList:t.filter(function(t){const n=typeof t;return t.stmt&&"dir"===t.stmt?(i=t.value,!1):""!==t.trim()&&(n in e?!e[n].hasOwnProperty(t)&&(e[n][t]=!0):!s.includes(t)&&s.push(t))}),dir:i}},"uniq")(e.flat()),c=l.nodeList;let d=l.dir;const h=a().flowchart??{};if(d=d??(h.inheritDir?this.getDirection()??a().direction??void 0:void 0),"gen-1"===this.version)for(let i=0;i<c.length;i++)c[i]=this.lookUpDomId(c[i]);o=o??"subGraph"+this.subCount,u=u||"",u=this.sanitizeText(u),this.subCount=this.subCount+1;const p={id:o,nodes:c.filter(t=>t!==o&&!this.globalNodes.has(t)),title:u.trim(),classes:[],dir:d,labelType:this.sanitizeNodeLabelType(s?.type),type:n??"flow"};r.info("Adding",p.id,p.nodes,p.dir),p.nodes=this.makeUniq(p,this.subGraphs).nodes;const g=this.getPosForId(o);if(-1!==g){const t=this.subGraphs[g];for(const e of p.nodes)t.nodes.includes(e)||t.nodes.push(e);p.title&&(t.title=p.title),p.dir&&(t.dir=p.dir),p.type&&(t.type=p.type),this.subGraphLookup.set(o,t)}else this.subGraphs.push(p),this.subGraphLookup.set(o,p);return o}addGlobal(t){for(const e of t.flat()){if("string"!=typeof e)continue;const t=e.trim();""!==t&&this.globalNodes.add(t)}for(const e of this.subGraphs)e.nodes=e.nodes.filter(t=>!this.globalNodes.has(t))}getPosForId(t){for(const[e,s]of this.subGraphs.entries())if(s.id===t)return e;return-1}indexNodes2(t,e){const s=this.subGraphs[e].nodes;if(this.secCount=this.secCount+1,this.secCount>2e3)return{result:!1,count:0};if(this.posCrossRef[this.secCount]=e,this.subGraphs[e].id===t)return{result:!0,count:0};let i=0,n=1;for(;i<s.length;){const e=this.getPosForId(s[i]);if(e>=0){const s=this.indexNodes2(t,e);if(s.result)return{result:!0,count:n+s.count};n+=s.count}i+=1}return{result:!1,count:n}}getDepthFirstPos(t){return this.posCrossRef[t]}indexNodes(){this.secCount=-1,this.subGraphs.length>0&&this.indexNodes2("none",this.subGraphs.length-1)}addConnector(t,e){const s=t?.text?.trim();if(!s)return"";const i=e?.text?.trim()??"",n=i.length>0?this.sanitizeText(i):s;let r=this.connectors.get(s);return r?i.length>0&&(r.text=n):(r={id:s,labelType:"text",domId:Y+s+"-"+this.vertexCounter,styles:[],classes:[],isConnector:!0,text:n},this.connectors.set(s,r),this.vertices.set(s,r),this.vertexCounter++),s}getSubGraphs(){return this.subGraphs}getConnectors(){return[...this.connectors.values()]}firstGraph(){return!!this.firstGraphFlag&&(this.firstGraphFlag=!1,!0)}computeEdgeSemantic(t,e){return"arrow_point"===t&&"normal"===e?"sequence":"arrow_cross"===t&&"normal"===e?"failure":"arrow_open"===t&&"dotted"===e?"reference":void 0}destructStartLink(t){let e="normal";return t.trim().includes(".")&&(e="dotted"),{type:"arrow_open",stroke:e}}countChar(t,e){const s=e.length;let i=0;for(let n=0;n<s;++n)e[n]===t&&++i;return i}destructEndLink(t){const e=t.trim();let s=e.slice(0,-1),i="arrow_open";switch(e.slice(-1)){case"x":i="arrow_cross";break;case">":i="arrow_point";break;case"-":case".":i="arrow_open",s=e}let n="normal",r=s.length-1;const a=this.countChar(".",s);return a>0&&(n="dotted",r=a),{type:i,stroke:n,length:r}}destructLink(t,e){const s=this.destructEndLink(t);let i;return e?(i=this.destructStartLink(e),i.stroke!==s.stroke?{type:"INVALID",stroke:"INVALID"}:(i.type=s.type,i.length=s.length,{...i,edgeSemantic:this.computeEdgeSemantic(i.type,i.stroke)})):{...s,edgeSemantic:this.computeEdgeSemantic(s.type,s.stroke)}}exists(t,e){for(const s of t)if(s.nodes.includes(e))return!0;return!1}makeUniq(t,e){const s=[];return t.nodes.forEach((i,n)=>{this.exists(e,i)||s.push(t.nodes[n])}),{nodes:s}}getTypeFromVertex(t){const e="string"==typeof t.type?O(t.type):t.type;switch(e){case"square":case void 0:return"squareRect";case"round":return"roundedRect";case"ellipse":return"ellipse";default:return e}}findNode(t,e){return t.find(t=>t.id===e)}destructEdgeType(t){let e="none",s="arrow_point";switch(t){case"arrow_point":case"arrow_circle":case"arrow_cross":case"arrow_hierarchy":s=t;break;case"double_arrow_point":case"double_arrow_circle":case"double_arrow_cross":e=t.replace("double_",""),s=e}return{arrowTypeStart:e,arrowTypeEnd:s}}addNodeFromVertex(t,e,s,i,n,r){const a=s.get(t.id),o=i.get(t.id)??!1,u=this.findNode(e,t.id);if(u)u.cssStyles=t.styles,u.cssCompiledStyles=this.getCompiledStyles(t.classes),u.cssClasses=t.classes.join(" ");else{const s={id:t.id,label:t.text,labelType:t.labelType,labelStyle:"",parentId:a,padding:n.flowchart?.padding||8,cssStyles:t.styles,cssCompiledStyles:this.getCompiledStyles(["default","node",...t.classes]),cssClasses:"default "+t.classes.join(" "),dir:t.dir,domId:t.domId,look:r,link:t.link,linkTarget:t.linkTarget,tooltip:this.getTooltip(t.id),metadata:t.metadata};o?e.push({...s,isGroup:!0,shape:"rect"}):e.push({...s,isGroup:!1,shape:this.getTypeFromVertex(t),wrappingWidth:n.agentflow?.wrappingWidth,minWidth:n.agentflow?.minNodeWidth})}}getCompiledStyles(t){let e=[];for(const s of t){const t=this.classes.get(s);t?.styles&&(e=[...e,...t.styles??[]].map(t=>t.trim())),t?.textStyles&&(e=[...e,...t.textStyles??[]].map(t=>t.trim()))}return e}runPostParseValidators(){this.postParseValidationRun||(this.postParseValidationRun=!0)}getData(){this.runPostParseValidators();const t=a(),e=[],s=[],n=this.getSubGraphs(),r=new Map,o=new Map,u=new Set,l=new Map,c=i((t,e,s=new Set)=>{if(s.has(t))return;s.add(t);const i=this.subGraphLookup.get(t);if(i)for(const n of i.nodes)n===e||s.has(n)||(u.add(n),l.set(n,e),c(n,e,s))},"collectDescendants");for(const i of n)"collapsed"!==i.metadata?.view||u.has(i.id)||c(i.id,i.id);const d=i((t,e)=>{const s=new Set;let i=e;for(;void 0!==i&&!s.has(i);){if(i===t)return!0;s.add(i),i=r.get(i)}return!1},"wouldCloseContainmentCycle");for(let i=n.length-1;i>=0;i--){const t=n[i];if(!u.has(t.id)){t.nodes.length>0&&o.set(t.id,!0);for(const e of t.nodes)d(e,t.id)?this.emitWarning(B.CONTAINMENT_VIOLATION,`Container "${t.id}" cannot contain "${e}" because "${e}" already contains it. The nesting that would close the loop is dropped.`,{nodeId:e}):r.set(e,t.id)}}for(let i=n.length-1;i>=0;i--){const s=n[i];if(u.has(s.id))continue;if("collapsed"===s.metadata?.view){const i={...s.metadata,containerType:s.type};e.push({id:s.id,label:s.title,labelStyle:"",labelType:s.labelType,parentId:r.get(s.id),padding:8,cssCompiledStyles:this.getCompiledStyles(s.classes),cssClasses:s.classes.join(" "),shape:"collapsedGroup",dir:s.dir,isGroup:!1,look:t.look,metadata:i})}else e.push({id:s.id,label:s.title,labelStyle:"",labelType:s.labelType,parentId:r.get(s.id),padding:8,cssCompiledStyles:this.getCompiledStyles(s.classes),cssClasses:s.classes.join(" "),shape:q[s.type??"flow"],dir:s.dir,isGroup:!0,look:t.look,metadata:s.metadata})}this.getVertices().forEach(s=>{u.has(s.id)||this.addNodeFromVertex(s,e,r,o,t,t.look||"classic")});const h=this.getEdges();h.forEach((e,i)=>{const n=l.get(e.start)??e.start,r=l.get(e.end)??e.end;if(n===r&&e.start!==e.end)return;const{arrowTypeStart:a,arrowTypeEnd:o}=this.destructEdgeType(e.type),u=[...h.defaultStyle??[]];e.style&&u.push(...e.style);const c={id:E(n,r,{counter:i,prefix:"L"},e.id),isUserDefinedId:e.isUserDefinedId,start:n,end:r,type:e.type??"normal",label:e.text,labelType:e.labelType,labelpos:"c",thickness:e.stroke,minlen:e.length,classes:"invisible"===e?.stroke?"":"edge-thickness-normal edge-pattern-solid flowchart-link",arrowTypeStart:"invisible"===e?.stroke||"arrow_open"===e?.type?"none":a,arrowTypeEnd:"invisible"===e?.stroke||"arrow_open"===e?.type?"none":o,arrowheadStyle:"fill: #333",cssCompiledStyles:this.getCompiledStyles(e.classes),labelStyle:u,style:u,pattern:e.stroke,look:t.look,animate:e.animate,animation:e.animation,curve:e.interpolate||this.edges.defaultInterpolate||t.flowchart?.curve,metadata:e.metadata};s.push(c)}),V(e,this);const p=new Map,g=new Map;for(const i of n){const t=r.get(i.id);void 0!==t&&g.set(t,[...g.get(t)??[],i.id])}let f=0;const m=i(t=>{if(!p.has(t)){p.set(t,f++);for(const e of g.get(t)??[])m(e)}},"walkContainers");for(const i of n)void 0===r.get(i.id)&&m(i.id);const y=new Set(this.getConnectors().map(t=>t.id));return K(e,t=>{if(y.has(t))return"connector";const e=this.vertices.get(t);return e?this.deriveVertexKind(e,O(e.type)):void 0},p),{nodes:e,edges:s,other:{},config:t,connectors:this.getConnectors()}}defaultConfig(){return C.flowchart}deriveVertexKind(t,e){return this.isToolDefinition(t)?"tool":"hexagon"===e||"hex"===e?"action":"lean-right"===e||"lean_right"===e?"input":"lin-doc"===e||"lined-document"===e?"refdoc":"diamond"===e?"decision":"task"}getSemanticModel(){this.runPostParseValidators();const t=new Set(this.subGraphs.map(t=>t.id)),e=[],s=[];for(const[n,r]of this.vertices){if(t.has(n))continue;if(r.isConnector){const t={id:n};if(void 0!==r.text&&r.text!==n&&(t.title=r.text),r.metadata&&Object.keys(r.metadata).length>0){const e={};for(const[t,s]of Object.entries(r.metadata))H.has(t)||(e[t]=s);Object.keys(e).length>0&&(t.metadata=e)}s.push(t);continue}const i={id:n};void 0!==r.text&&(i.label=r.text);const a="string"==typeof r.type?O(r.type):r.type;if(void 0!==a&&(i.shape=a),i.vertexKind=this.deriveVertexKind(r,a),r.metadata&&Object.keys(r.metadata).length>0){const t={};for(const[e,s]of Object.entries(r.metadata))H.has(e)||(t[e]=s);Object.keys(t).length>0&&(i.metadata=t)}e.push(i)}const i={vertices:e,edges:this.edges.map(t=>{const e={start:t.start,end:t.end};return void 0!==t.id&&(e.id=t.id),"string"==typeof t.text&&t.text.length>0&&(e.label=t.text),void 0!==t.type&&(e.type=t.type),void 0!==t.stroke&&(e.stroke=t.stroke),void 0!==t.edgeSemantic&&(e.edgeSemantic=t.edgeSemantic),void 0!==t.length&&(e.length=t.length),t.metadata&&Object.keys(t.metadata).length>0&&(e.metadata={...t.metadata}),e}),subGraphs:this.subGraphs.map(t=>{const e={id:t.id,nodes:[...t.nodes]};if(void 0!==t.type&&(e.type=t.type),void 0!==t.title&&(e.title=t.title),void 0!==t.dir&&(e.direction=t.dir),t.metadata&&Object.keys(t.metadata).length>0){const s={};for(const[e,i]of Object.entries(t.metadata))H.has(e)||(s[e]=i);Object.keys(s).length>0&&(e.metadata=s)}return e}),connectors:s,diagnostics:this.diagnostics};return void 0!==this.direction&&(i.direction=this.direction),i}setFrontmatterLineOffset(t){this.frontmatterLineOffset=t??0}toElementPosition(t){const e=t?.first_line??0,s=t?.first_column??0,i=t?.last_line??e,n=t?.last_column??s,[r,a]=t?.range??[0,0];return{startLine:e+this.frontmatterLineOffset,startColumn:s,endLine:i+this.frontmatterLineOffset,endColumn:n,startIndex:r,endIndex:a}}pushMapping(t,e,s){if(!t)return;const i={id:t,type:e,position:this.toElementPosition(s)};return this.elementMappings.push(i),i}addVertexMapping(t,e,s,i){const n=this.pushMapping(t,"vertex",i);n&&null==s&&this.bareVertexMappings.add(n)}extendVertexMapping(t,e){if(!t||!e)return;const s=this.toElementPosition(e);for(let i=this.elementMappings.length-1;i>=0;i--){const e=this.elementMappings[i];if("vertex"===e.type&&e.id===t){this.bareVertexMappings.has(e)&&(e.type="attachment",this.bareVertexMappings.delete(e));return void((s.endLine>e.position.endLine||s.endLine===e.position.endLine&&s.endColumn>e.position.endColumn)&&(e.position.endLine=s.endLine,e.position.endColumn=s.endColumn,e.position.endIndex=s.endIndex))}}this.pushMapping(t,"attachment",e)}addEdgeMapping(t,e,s,i){const n=Array.isArray(e)?e.map(t=>"string"==typeof t?t:t?.id??"").filter(Boolean):[],r=n.length>0?n.join(">"):"edge";this.pushMapping(r,"edge",i)}addSubgraphMapping(t,e,s,i){const n=("string"==typeof t?t:t?.text)??"",r=this.toElementPosition(s),a=i?this.toElementPosition(i):r;n&&this.elementMappings.push({id:n,type:"subgraph",position:{startLine:r.startLine,startColumn:r.startColumn,endLine:a.endLine,endColumn:a.endColumn,startIndex:r.startIndex,endIndex:a.endIndex}})}addConnectorMapping(t,e,s,i){const n=t?.text?.trim()??"";if(!n)return;const r=this.toElementPosition(s),a=i?this.toElementPosition(i):r;this.elementMappings.push({id:n,type:"connector",position:{startLine:r.startLine,startColumn:r.startColumn,endLine:a.endLine,endColumn:a.endColumn,startIndex:r.startIndex,endIndex:a.endIndex}})}getElementMappings(){return[...this.elementMappings]}getElementById(t){return this.elementMappings.find(e=>e.id===t)}getElementsOnLine(t){return this.elementMappings.filter(e=>t>=e.position.startLine&&t<=e.position.endLine)}getElementAtPosition(t,e){const s=this.elementMappings.filter(s=>{const{startLine:i,startColumn:n,endLine:r,endColumn:a}=s.position;return!(t<i||t>r)&&(!(t===i&&e<n)&&!(t===r&&e>a))});if(0===s.length)return;const n=i(({position:t})=>[t.endLine-t.startLine,t.endColumn-t.startColumn],"span");return s.reduce((t,e)=>{const[s,i]=n(t),[r,a]=n(e);return r!==s?r<s?e:t:a<i?e:t})}getMappingStats(){let t=0,e=0,s=0,i=0,n=0;for(const r of this.elementMappings)"vertex"===r.type?t++:"edge"===r.type?e++:"subgraph"===r.type?s++:"connector"===r.type?i++:"attachment"===r.type&&n++;return{vertices:t,edges:e,subgraphs:s,connectors:i,attachments:n,totalElements:this.elementMappings.length}}emitDiagnostic(t,e,s,i){const n=i?.nodeId??i?.edgeId,a=n?this.getElementById(n):void 0,o={id:t,severity:e,message:s,...i?.nodeId?{nodeId:i.nodeId}:{},...i?.edgeId&&!i?.nodeId?{edgeId:i.edgeId}:{},...a?{position:a.position}:{}};if(this.diagnostics.some(t=>t.id===o.id&&t.severity===o.severity&&t.message===o.message&&t.nodeId===o.nodeId&&t.edgeId===o.edgeId))return;this.diagnostics.push(o);const u=`agentflow[${t}]: ${s}`;"error"===e?r.error(u):r.warn(u)}emitWarning(t,e,s){this.emitDiagnostic(t,"warning",e,s)}emitError(t,e,s){this.emitDiagnostic(t,"error",e,s)}getDiagnostics(){return[...this.diagnostics]}},tt={getClasses:i(function(t,e){return e.db.getClasses()},"getClasses"),draw:i(async function(t,i,n,c){r.debug("Drawing agentflow diagram",i);const{securityLevel:d,agentflow:h,layout:p}=a();c.db.setDiagramId(i),r.debug("Before getData: ");const g=c.db.getData();r.debug("Data: ",g);const f=e(i,d),m=c.db.getDirection();g.type=c.type,g.layoutAlgorithm=o(p),"dagre"===g.layoutAlgorithm&&"elk"===p&&r.warn("flowchart-elk was moved to an external package in Mermaid v11. Please refer [release notes](https://github.com/mermaid-js/mermaid/releases/tag/v11.0.0) for more details. This diagram will be rendered using `dagre` layout as a fallback."),g.direction=m,g.nodeSpacing=h?.nodeSpacing||50,g.rankSpacing=h?.rankSpacing||50,g.markers=["point","circle","cross","hierarchy"],g.diagramId=i,r.debug("REF1:",g),await u(g,f);const y=h?.diagramPadding??8;l.insertTitle(f,"agentflowTitleText",h?.titleTopMargin??0,c.db.getDiagramTitle()),s(f,y,"agentflow",h?.useMaxWidth??!0)},"draw")},et=function(){var t=i(function(t,e,s,i){for(s=s||{},i=t.length;i--;s[t[i]]=e);return s},"o"),e=[1,5],s=[1,4],n=[1,3],r=[1,6],a=[1,8,9,10,11,12,28,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],o=[2,2],u=[1,15],l=[1,16],c=[1,17],d=[1,18],h=[1,19],p=[1,26],g=[1,27],f=[1,28],m=[1,30],y=[1,31],b=[1,32],A=[1,55],E=[1,54],k=[1,34],x=[1,35],C=[1,36],S=[1,37],T=[1,38],_=[1,50],D=[1,52],v=[1,48],F=[1,53],$=[1,49],L=[1,56],B=[1,51],I=[1,57],w=[1,58],M=[1,39],N=[1,40],R=[1,41],O=[1,42],V=[1,43],P=[1,64],G=[1,8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],U=[1,70],j=[1,68],z=[1,67],W=[1,69],K=[8,9,10,12,78,80,81],Y=[1,88],H=[1,101],X=[1,106],q=[1,105],Q=[1,102],J=[1,98],Z=[1,104],tt=[1,100],et=[1,107],st=[1,103],it=[1,108],nt=[1,99],rt=[8,9,10,11,12,43,78,80,81],at=[8,9,10,11,12,43,49,78,80,81],ot=[8,9,10,11,12,30,43,47,49,51,53,55,57,59,61,63,66,68,70,71,73,78,80,81,92,105,108,109,112,114,117,118,119],ut=[8,9,10,12,47,63,78,80,81,92,105,108,109,112,114,117,118,119],lt=[47,63,92,105,108,109,112,114,117,118,119],ct=[1,131],dt=[1,132],ht=[1,134],pt=[1,133],gt=[47,63,65,77,92,105,108,109,112,114,117,118,119],ft=[1,143],mt=[1,157],yt=[1,158],bt=[1,159],At=[1,162],Et=[1,161],kt=[1,160],xt=[1,145],Ct=[1,147],St=[1,151],Tt=[1,139],_t=[1,140],Dt=[1,152],vt=[1,153],Ft=[1,154],$t=[1,155],Lt=[1,156],Bt=[1,163],It=[1,164],wt=[1,141],Mt=[1,142],Nt=[1,149],Rt=[1,144],Ot=[1,148],Vt=[1,146],Pt=[8,9,10,11,12,28,33,35,36,38,40,42,47,63,87,88,89,90,91,92,105,108,109,112,114,117,118,119,124,125,126,127,128],Gt=[1,168],Ut=[1,170],jt=[8,9,10,12],zt=[8,9,10,11,12,15,47,63,92,108,109,112,114,117,118,119],Wt=[1,190],Kt=[1,186],Yt=[1,187],Ht=[1,191],Xt=[1,188],qt=[1,189],Qt=[80,119,122],Jt=[8,9,10,11,12,13,15,28,30,33,35,36,43,47,63,78,87,88,89,90,91,92,93,108,112,114,117,118,119],Zt=[11,109],te=[32,52,54,56,58,60,65,67,69,70,72,74,119,120,121],ee=[1,269],se=[1,267],ie=[1,271],ne=[1,265],re=[1,266],ae=[1,268],oe=[1,270],ue=[1,272],le=[1,292],ce=[8,9,10,12,109],de=[8,9,10,11,12,63,87,108,109,112,113,114,115],he={trace:i(function(){},"trace"),yy:{},symbols_:{error:2,start:3,graphConfig:4,document:5,line:6,statement:7,COMMENT:8,SEMI:9,NEWLINE:10,SPACE:11,EOF:12,GRAPH:13,NODIR:14,DIR:15,FirstStmtSeparator:16,ending:17,endToken:18,spaceList:19,spaceListNewline:20,vertexStatement:21,separator:22,styleStatement:23,linkStyleStatement:24,classDefStatement:25,classStatement:26,clickStatement:27,flow:28,textNoTags:29,SQS:30,text:31,SQE:32,end:33,shapeData:34,global:35,connector:36,direction:37,acc_title:38,acc_title_value:39,acc_descr:40,acc_descr_value:41,acc_descr_multiline_value:42,SHAPE_DATA:43,link:44,node:45,styledVertex:46,AMP:47,vertex:48,STYLE_SEPARATOR:49,idString:50,DOUBLECIRCLESTART:51,DOUBLECIRCLEEND:52,PS:53,PE:54,"(-":55,"-)":56,STADIUMSTART:57,STADIUMEND:58,SUBROUTINESTART:59,SUBROUTINEEND:60,VERTEX_WITH_PROPS_START:61,"NODE_STRING[field]":62,COLON:63,"NODE_STRING[value]":64,PIPE:65,CYLINDERSTART:66,CYLINDEREND:67,DIAMOND_START:68,DIAMOND_STOP:69,TAGEND:70,TRAPSTART:71,TRAPEND:72,INVTRAPSTART:73,INVTRAPEND:74,linkStatement:75,arrowText:76,TESTSTR:77,START_LINK:78,edgeText:79,LINK:80,LINK_ID:81,edgeTextToken:82,STR:83,MD_STR:84,textToken:85,keywords:86,STYLE:87,LINKSTYLE:88,CLASSDEF:89,CLASS:90,CLICK:91,DOWN:92,UP:93,textNoTagsToken:94,stylesOpt:95,"idString[vertex]":96,"idString[class]":97,CALLBACKNAME:98,CALLBACKARGS:99,HREF:100,LINK_TARGET:101,"STR[link]":102,"STR[tooltip]":103,alphaNum:104,DEFAULT:105,numList:106,INTERPOLATE:107,NUM:108,COMMA:109,style:110,styleComponent:111,NODE_STRING:112,UNIT:113,BRKT:114,PCT:115,idStringToken:116,MINUS:117,MULT:118,UNICODE_TEXT:119,TEXT:120,TAGSTART:121,EDGE_TEXT:122,alphaNumToken:123,direction_tb:124,direction_bt:125,direction_rl:126,direction_lr:127,direction_td:128,$accept:0,$end:1},terminals_:{2:"error",8:"COMMENT",9:"SEMI",10:"NEWLINE",11:"SPACE",12:"EOF",13:"GRAPH",14:"NODIR",15:"DIR",28:"flow",30:"SQS",32:"SQE",33:"end",35:"global",36:"connector",38:"acc_title",39:"acc_title_value",40:"acc_descr",41:"acc_descr_value",42:"acc_descr_multiline_value",43:"SHAPE_DATA",47:"AMP",49:"STYLE_SEPARATOR",51:"DOUBLECIRCLESTART",52:"DOUBLECIRCLEEND",53:"PS",54:"PE",55:"(-",56:"-)",57:"STADIUMSTART",58:"STADIUMEND",59:"SUBROUTINESTART",60:"SUBROUTINEEND",61:"VERTEX_WITH_PROPS_START",62:"NODE_STRING[field]",63:"COLON",64:"NODE_STRING[value]",65:"PIPE",66:"CYLINDERSTART",67:"CYLINDEREND",68:"DIAMOND_START",69:"DIAMOND_STOP",70:"TAGEND",71:"TRAPSTART",72:"TRAPEND",73:"INVTRAPSTART",74:"INVTRAPEND",77:"TESTSTR",78:"START_LINK",80:"LINK",81:"LINK_ID",83:"STR",84:"MD_STR",87:"STYLE",88:"LINKSTYLE",89:"CLASSDEF",90:"CLASS",91:"CLICK",92:"DOWN",93:"UP",96:"idString[vertex]",97:"idString[class]",98:"CALLBACKNAME",99:"CALLBACKARGS",100:"HREF",101:"LINK_TARGET",102:"STR[link]",103:"STR[tooltip]",105:"DEFAULT",107:"INTERPOLATE",108:"NUM",109:"COMMA",112:"NODE_STRING",113:"UNIT",114:"BRKT",115:"PCT",117:"MINUS",118:"MULT",119:"UNICODE_TEXT",120:"TEXT",121:"TAGSTART",122:"EDGE_TEXT",124:"direction_tb",125:"direction_bt",126:"direction_rl",127:"direction_lr",128:"direction_td"},productions_:[0,[3,2],[5,0],[5,2],[6,1],[6,1],[6,1],[6,1],[6,1],[6,1],[4,2],[4,2],[4,2],[4,2],[4,3],[17,2],[17,1],[18,1],[18,1],[18,1],[16,1],[16,1],[16,2],[16,1],[20,2],[20,2],[20,2],[20,1],[20,1],[20,1],[19,2],[19,1],[7,2],[7,2],[7,2],[7,2],[7,2],[7,2],[7,9],[7,10],[7,6],[7,7],[7,4],[7,4],[7,7],[7,8],[7,4],[7,5],[7,1],[7,2],[7,2],[7,1],[22,1],[22,1],[22,1],[22,1],[34,2],[34,1],[21,4],[21,3],[21,4],[21,2],[21,2],[21,1],[45,1],[45,6],[45,5],[46,1],[46,3],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,8],[48,4],[48,4],[48,4],[48,6],[48,4],[48,4],[48,4],[48,4],[48,4],[48,1],[44,2],[44,3],[44,3],[44,1],[44,3],[44,4],[79,1],[79,2],[79,1],[79,1],[75,1],[75,2],[76,3],[31,1],[31,2],[31,1],[31,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[86,1],[29,1],[29,2],[29,1],[29,1],[25,5],[26,5],[27,2],[27,4],[27,3],[27,5],[27,3],[27,5],[27,5],[27,7],[27,2],[27,4],[27,2],[27,4],[27,4],[27,6],[23,5],[24,5],[24,5],[24,9],[24,9],[24,7],[24,7],[106,1],[106,3],[95,1],[95,3],[110,1],[110,2],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[111,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[116,1],[85,1],[85,1],[85,1],[85,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[94,1],[82,1],[82,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[123,1],[50,1],[50,2],[104,1],[104,2],[37,1],[37,1],[37,1],[37,1],[37,1]],performAction:i(function(t,e,s,i,n,r,a){var o=r.length-1;switch(n){case 2:case 5:case 33:case 34:case 35:case 36:case 37:this.$=[];break;case 3:(!Array.isArray(r[o])||r[o].length>0)&&r[o-1].push(r[o]),this.$=r[o-1];break;case 4:case 198:case 57:case 67:case 89:case 196:this.$=r[o];break;case 13:i.setDirection("TB"),this.$="TB";break;case 14:i.setDirection(r[o-1]),this.$=r[o-1];break;case 32:this.$=r[o-1].nodes;break;case 38:this.$=i.addSubGraph(r[o-6],r[o-1],r[o-4],"flow"),i.addSubgraphMapping&&i.addSubgraphMapping(r[o-6],r[o-4],a[o-8],a[o]);break;case 39:this.$=i.addSubGraph(r[o-7],r[o-1],r[o-5],"flow"),i.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,r[o-3],a[o-3]),i.addSubgraphMapping&&i.addSubgraphMapping(r[o-7],r[o-5],a[o-9],a[o]);break;case 40:this.$=i.addSubGraph(r[o-3],r[o-1],{text:"",type:"text"},"flow"),i.addSubgraphMapping&&i.addSubgraphMapping(r[o-3],{text:"",type:"text"},a[o-5],a[o]);break;case 41:this.$=i.addSubGraph(r[o-4],r[o-1],{text:"",type:"text"},"flow"),i.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,r[o-3],a[o-3]),i.addSubgraphMapping&&i.addSubgraphMapping(r[o-4],{text:"",type:"text"},a[o-6],a[o]);break;case 42:this.$=i.addSubGraph(void 0,r[o-1],void 0,"flow"),i.addSubgraphMapping&&i.addSubgraphMapping(void 0,void 0,a[o-3],a[o]);break;case 43:i.addGlobal(r[o-1]),this.$=[];break;case 44:this.$=i.addConnector(r[o-4],r[o-2]),i.addConnectorMapping&&i.addConnectorMapping(r[o-4],r[o-2],a[o-6],a[o]);break;case 45:this.$=i.addConnector(r[o-5],r[o-3]),i.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,r[o-1],a[o-1]),i.addConnectorMapping&&i.addConnectorMapping(r[o-5],r[o-3],a[o-7],a[o]);break;case 46:this.$=i.addConnector(r[o-1],{text:"",type:"text"}),i.addConnectorMapping&&i.addConnectorMapping(r[o-1],{text:"",type:"text"},a[o-3],a[o]);break;case 47:this.$=i.addConnector(r[o-2],{text:"",type:"text"}),i.addVertex(this.$,void 0,void 0,void 0,void 0,void 0,void 0,r[o-1],a[o-1]),i.addConnectorMapping&&i.addConnectorMapping(r[o-2],{text:"",type:"text"},a[o-4],a[o]);break;case 49:this.$=r[o].trim(),i.setAccTitle(this.$);break;case 50:case 51:this.$=r[o].trim(),i.setAccDescription(this.$);break;case 56:case 148:this.$=r[o-1]+r[o];break;case 58:i.addVertex(r[o-1][r[o-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,r[o],a[o]),i.extendVertexMapping&&i.extendVertexMapping(r[o-1][r[o-1].length-1],a[o]),i.addLink(r[o-3].stmt,r[o-1],r[o-2]),i.addEdgeMapping&&i.addEdgeMapping(r[o-3].stmt,r[o-1],r[o-2],this._$),this.$={stmt:r[o-1],nodes:r[o-1].concat(r[o-3].nodes)};break;case 59:i.addLink(r[o-2].stmt,r[o],r[o-1]),i.addEdgeMapping&&i.addEdgeMapping(r[o-2].stmt,r[o],r[o-1],this._$),this.$={stmt:r[o],nodes:r[o].concat(r[o-2].nodes)};break;case 60:i.addLink(r[o-3].stmt,r[o-1],r[o-2]),i.addEdgeMapping&&i.addEdgeMapping(r[o-3].stmt,r[o-1],r[o-2],this._$),this.$={stmt:r[o-1],nodes:r[o-1].concat(r[o-3].nodes)};break;case 61:this.$={stmt:r[o-1],nodes:r[o-1]};break;case 62:i.addVertex(r[o-1][r[o-1].length-1],void 0,void 0,void 0,void 0,void 0,void 0,r[o],a[o]),i.extendVertexMapping&&i.extendVertexMapping(r[o-1][r[o-1].length-1],a[o]),this.$={stmt:r[o-1],nodes:r[o-1],shapeData:r[o]};break;case 63:this.$={stmt:r[o],nodes:r[o]};break;case 64:case 143:case 145:this.$=[r[o]];break;case 65:i.addVertex(r[o-5][r[o-5].length-1],void 0,void 0,void 0,void 0,void 0,void 0,r[o-4],a[o-4]),i.extendVertexMapping&&i.extendVertexMapping(r[o-5][r[o-5].length-1],a[o-4]),this.$=r[o-5].concat(r[o]);break;case 66:this.$=r[o-4].concat(r[o]);break;case 68:this.$=r[o-2],i.setClass(r[o-2],r[o]);break;case 69:this.$=r[o-3],i.addVertex(r[o-3],r[o-1],"square"),i.addVertexMapping&&i.addVertexMapping(r[o-3],r[o-1],"square",this._$);break;case 70:this.$=r[o-3],i.addVertex(r[o-3],r[o-1],"doublecircle"),i.addVertexMapping&&i.addVertexMapping(r[o-3],r[o-1],"doublecircle",this._$);break;case 71:this.$=r[o-5],i.addVertex(r[o-5],r[o-2],"circle"),i.addVertexMapping&&i.addVertexMapping(r[o-5],r[o-2],"circle",this._$);break;case 72:this.$=r[o-3],i.addVertex(r[o-3],r[o-1],"ellipse"),i.addVertexMapping&&i.addVertexMapping(r[o-3],r[o-1],"ellipse",this._$);break;case 73:this.$=r[o-3],i.addVertex(r[o-3],r[o-1],"stadium"),i.addVertexMapping&&i.addVertexMapping(r[o-3],r[o-1],"stadium",this._$);break;case 74:this.$=r[o-3],i.addVertex(r[o-3],r[o-1],"subroutine"),i.addVertexMapping&&i.addVertexMapping(r[o-3],r[o-1],"subroutine",this._$);break;case 75:this.$=r[o-7],i.addVertex(r[o-7],r[o-1],"rect",void 0,void 0,void 0,Object.fromEntries([[r[o-5],r[o-3]]])),i.addVertexMapping&&i.addVertexMapping(r[o-7],r[o-1],"rect",this._$);break;case 76:this.$=r[o-3],i.addVertex(r[o-3],r[o-1],"cylinder"),i.addVertexMapping&&i.addVertexMapping(r[o-3],r[o-1],"cylinder",this._$);break;case 77:this.$=r[o-3],i.addVertex(r[o-3],r[o-1],"round"),i.addVertexMapping&&i.addVertexMapping(r[o-3],r[o-1],"round",this._$);break;case 78:this.$=r[o-3],i.addVertex(r[o-3],r[o-1],"diamond"),i.addVertexMapping&&i.addVertexMapping(r[o-3],r[o-1],"diamond",this._$);break;case 79:this.$=r[o-5],i.addVertex(r[o-5],r[o-2],"hexagon"),i.addVertexMapping&&i.addVertexMapping(r[o-5],r[o-2],"hexagon",this._$);break;case 80:this.$=r[o-3],i.addVertex(r[o-3],r[o-1],"odd"),i.addVertexMapping&&i.addVertexMapping(r[o-3],r[o-1],"odd",this._$);break;case 81:this.$=r[o-3],i.addVertex(r[o-3],r[o-1],"trapezoid"),i.addVertexMapping&&i.addVertexMapping(r[o-3],r[o-1],"trapezoid",this._$);break;case 82:this.$=r[o-3],i.addVertex(r[o-3],r[o-1],"inv_trapezoid"),i.addVertexMapping&&i.addVertexMapping(r[o-3],r[o-1],"inv_trapezoid",this._$);break;case 83:this.$=r[o-3],i.addVertex(r[o-3],r[o-1],"lean_right"),i.addVertexMapping&&i.addVertexMapping(r[o-3],r[o-1],"lean_right",this._$);break;case 84:this.$=r[o-3],i.addVertex(r[o-3],r[o-1],"lean_left"),i.addVertexMapping&&i.addVertexMapping(r[o-3],r[o-1],"lean_left",this._$);break;case 85:this.$=r[o],i.addVertex(r[o]),i.addVertexMapping&&i.addVertexMapping(r[o],void 0,void 0,this._$);break;case 86:r[o-1].text=r[o],this.$=r[o-1];break;case 87:case 88:r[o-2].text=r[o-1],this.$=r[o-2];break;case 90:var u=i.destructLink(r[o],r[o-2]);this.$={type:u.type,stroke:u.stroke,length:u.length,edgeSemantic:u.edgeSemantic,text:r[o-1]};break;case 91:u=i.destructLink(r[o],r[o-2]);this.$={type:u.type,stroke:u.stroke,length:u.length,edgeSemantic:u.edgeSemantic,text:r[o-1],id:r[o-3]};break;case 92:case 99:case 116:case 118:this.$={text:r[o],type:"text"};break;case 93:case 100:case 117:this.$={text:r[o-1].text+""+r[o],type:r[o-1].type};break;case 94:case 101:this.$={text:r[o],type:"string"};break;case 95:case 102:case 119:this.$={text:r[o],type:"markdown"};break;case 96:u=i.destructLink(r[o]);this.$={type:u.type,stroke:u.stroke,length:u.length,edgeSemantic:u.edgeSemantic};break;case 97:u=i.destructLink(r[o]);this.$={type:u.type,stroke:u.stroke,length:u.length,edgeSemantic:u.edgeSemantic,id:r[o-1]};break;case 98:this.$=r[o-1];break;case 120:this.$=r[o-4],i.addClass(r[o-2],r[o]);break;case 121:this.$=r[o-4],i.setClass(r[o-2],r[o]);break;case 122:case 130:this.$=r[o-1],i.setClickEvent(r[o-1],r[o]);break;case 123:case 131:this.$=r[o-3],i.setClickEvent(r[o-3],r[o-2]),i.setTooltip(r[o-3],r[o]);break;case 124:this.$=r[o-2],i.setClickEvent(r[o-2],r[o-1],r[o]);break;case 125:this.$=r[o-4],i.setClickEvent(r[o-4],r[o-3],r[o-2]),i.setTooltip(r[o-4],r[o]);break;case 126:this.$=r[o-2],i.setLink(r[o-2],r[o]);break;case 127:this.$=r[o-4],i.setLink(r[o-4],r[o-2]),i.setTooltip(r[o-4],r[o]);break;case 128:this.$=r[o-4],i.setLink(r[o-4],r[o-2],r[o]);break;case 129:this.$=r[o-6],i.setLink(r[o-6],r[o-4],r[o]),i.setTooltip(r[o-6],r[o-2]);break;case 132:this.$=r[o-1],i.setLink(r[o-1],r[o]);break;case 133:this.$=r[o-3],i.setLink(r[o-3],r[o-2]),i.setTooltip(r[o-3],r[o]);break;case 134:this.$=r[o-3],i.setLink(r[o-3],r[o-2],r[o]);break;case 135:this.$=r[o-5],i.setLink(r[o-5],r[o-4],r[o]),i.setTooltip(r[o-5],r[o-2]);break;case 136:this.$=r[o-4],i.addVertex(r[o-2],void 0,void 0,r[o]);break;case 137:this.$=r[o-4],i.updateLink([r[o-2]],r[o]);break;case 138:this.$=r[o-4],i.updateLink(r[o-2],r[o]);break;case 139:this.$=r[o-8],i.updateLinkInterpolate([r[o-6]],r[o-2]),i.updateLink([r[o-6]],r[o]);break;case 140:this.$=r[o-8],i.updateLinkInterpolate(r[o-6],r[o-2]),i.updateLink(r[o-6],r[o]);break;case 141:this.$=r[o-6],i.updateLinkInterpolate([r[o-4]],r[o]);break;case 142:this.$=r[o-6],i.updateLinkInterpolate(r[o-4],r[o]);break;case 144:case 146:r[o-2].push(r[o]),this.$=r[o-2];break;case 197:case 199:this.$=r[o-1]+""+r[o];break;case 200:this.$={stmt:"dir",value:"TB"};break;case 201:this.$={stmt:"dir",value:"BT"};break;case 202:this.$={stmt:"dir",value:"RL"};break;case 203:this.$={stmt:"dir",value:"LR"};break;case 204:this.$={stmt:"dir",value:"TD"}}},"anonymous"),table:[{3:1,4:2,8:e,10:s,11:n,13:r},{1:[3]},t(a,o,{5:7}),{4:8,8:e,10:s,11:n,13:r},{4:9,8:e,10:s,11:n,13:r},{4:10,8:e,10:s,11:n,13:r},{14:[1,11],15:[1,12]},{1:[2,1],6:13,7:14,8:u,9:l,10:c,11:d,12:h,21:20,23:21,24:22,25:23,26:24,27:25,28:p,35:g,36:f,37:29,38:m,40:y,42:b,45:33,46:44,47:A,48:45,50:46,63:E,87:k,88:x,89:C,90:S,91:T,92:_,105:D,108:v,109:F,112:$,114:L,116:47,117:B,118:I,119:w,124:M,125:N,126:R,127:O,128:V},t(a,[2,10]),t(a,[2,11]),t(a,[2,12]),t(a,[2,13]),{8:[1,63],9:[1,60],10:[1,61],11:P,16:59,19:62},t(G,[2,3]),t(G,[2,4]),t(G,[2,5]),t(G,[2,6]),t(G,[2,7]),t(G,[2,8]),t(G,[2,9]),{8:U,9:j,10:z,12:W,22:65,44:66,75:71,78:[1,72],80:[1,74],81:[1,73]},{8:U,9:j,10:z,12:W,22:75},{8:U,9:j,10:z,12:W,22:76},{8:U,9:j,10:z,12:W,22:77},{8:U,9:j,10:z,12:W,22:78},{8:U,9:j,10:z,12:W,22:79},{8:U,9:j,10:z,11:[1,80],12:W,22:81},{8:U,9:j,10:z,12:W,22:82},{11:[1,83]},t(G,[2,48]),{39:[1,84]},{41:[1,85]},t(G,[2,51]),t(K,[2,63],{19:86,34:87,11:P,43:Y}),{11:[1,89]},{11:[1,90]},{11:[1,91]},{11:[1,92]},{15:H,47:X,63:q,83:[1,96],92:Q,98:[1,93],100:[1,94],104:95,108:J,109:Z,112:tt,114:et,117:st,118:it,119:nt,123:97},t(G,[2,200]),t(G,[2,201]),t(G,[2,202]),t(G,[2,203]),t(G,[2,204]),t(rt,[2,64]),t(rt,[2,67],{49:[1,109]}),t(at,[2,85],{116:122,30:[1,110],47:A,51:[1,111],53:[1,112],55:[1,113],57:[1,114],59:[1,115],61:[1,116],63:E,66:[1,117],68:[1,118],70:[1,119],71:[1,120],73:[1,121],92:_,105:D,108:v,109:F,112:$,114:L,117:B,118:I,119:w}),t(ot,[2,196]),t(ot,[2,157]),t(ot,[2,158]),t(ot,[2,159]),t(ot,[2,160]),t(ot,[2,161]),t(ot,[2,162]),t(ot,[2,163]),t(ot,[2,164]),t(ot,[2,165]),t(ot,[2,166]),t(ot,[2,167]),t(a,[2,14]),t(a,[2,20]),t(a,[2,21]),{10:[1,123]},t(a,[2,23]),t(ut,[2,31],{19:124,11:P}),t(G,[2,32]),{45:125,46:44,47:A,48:45,50:46,63:E,92:_,105:D,108:v,109:F,112:$,114:L,116:47,117:B,118:I,119:w},t(G,[2,52]),t(G,[2,53]),t(G,[2,54]),t(G,[2,55]),t(lt,[2,89],{76:126,65:[1,128],77:[1,127]}),{79:129,82:130,83:ct,84:dt,119:ht,122:pt},{78:[1,135],80:[1,136]},t(gt,[2,96]),t(G,[2,33]),t(G,[2,34]),t(G,[2,35]),t(G,[2,36]),t(G,[2,37]),{11:ft,13:mt,15:yt,28:bt,29:137,33:At,35:Et,36:kt,47:xt,63:Ct,78:St,83:Tt,84:_t,86:150,87:Dt,88:vt,89:Ft,90:$t,91:Lt,92:Bt,93:It,94:138,108:wt,112:Mt,114:Nt,117:Rt,118:Ot,119:Vt},t(Pt,o,{5:165}),t(Pt,o,{5:166}),{11:ft,13:mt,15:yt,28:bt,29:167,33:At,35:Et,36:kt,47:xt,63:Ct,78:St,83:Tt,84:_t,86:150,87:Dt,88:vt,89:Ft,90:$t,91:Lt,92:Bt,93:It,94:138,108:wt,112:Mt,114:Nt,117:Rt,118:Ot,119:Vt},t(G,[2,49]),t(G,[2,50]),t(K,[2,61],{47:Gt}),t(K,[2,62],{19:169,11:P,43:Ut}),t(rt,[2,57]),{47:A,50:171,63:E,92:_,105:D,108:v,109:F,112:$,114:L,116:47,117:B,118:I,119:w},{105:[1,172],106:173,108:[1,174]},{47:A,50:175,63:E,92:_,105:D,108:v,109:F,112:$,114:L,116:47,117:B,118:I,119:w},{47:A,50:176,63:E,92:_,105:D,108:v,109:F,112:$,114:L,116:47,117:B,118:I,119:w},t(jt,[2,122],{11:[1,177],99:[1,178]}),{83:[1,179]},t(jt,[2,130],{123:181,11:[1,180],15:H,47:X,63:q,92:Q,108:J,109:Z,112:tt,114:et,117:st,118:it,119:nt}),t(jt,[2,132],{11:[1,182]}),t(zt,[2,198]),t(zt,[2,185]),t(zt,[2,186]),t(zt,[2,187]),t(zt,[2,188]),t(zt,[2,189]),t(zt,[2,190]),t(zt,[2,191]),t(zt,[2,192]),t(zt,[2,193]),t(zt,[2,194]),t(zt,[2,195]),{47:A,50:183,63:E,92:_,105:D,108:v,109:F,112:$,114:L,116:47,117:B,118:I,119:w},{31:184,70:Wt,83:Kt,84:Yt,85:185,119:Ht,120:Xt,121:qt},{31:192,70:Wt,83:Kt,84:Yt,85:185,119:Ht,120:Xt,121:qt},{31:194,53:[1,193],70:Wt,83:Kt,84:Yt,85:185,119:Ht,120:Xt,121:qt},{31:195,70:Wt,83:Kt,84:Yt,85:185,119:Ht,120:Xt,121:qt},{31:196,70:Wt,83:Kt,84:Yt,85:185,119:Ht,120:Xt,121:qt},{31:197,70:Wt,83:Kt,84:Yt,85:185,119:Ht,120:Xt,121:qt},{112:[1,198]},{31:199,70:Wt,83:Kt,84:Yt,85:185,119:Ht,120:Xt,121:qt},{31:200,68:[1,201],70:Wt,83:Kt,84:Yt,85:185,119:Ht,120:Xt,121:qt},{31:202,70:Wt,83:Kt,84:Yt,85:185,119:Ht,120:Xt,121:qt},{31:203,70:Wt,83:Kt,84:Yt,85:185,119:Ht,120:Xt,121:qt},{31:204,70:Wt,83:Kt,84:Yt,85:185,119:Ht,120:Xt,121:qt},t(ot,[2,197]),t(a,[2,22]),t(ut,[2,30]),t(K,[2,59],{34:205,19:206,11:P,43:Y}),t(lt,[2,86],{11:[1,207]}),{11:[1,208]},{31:209,70:Wt,83:Kt,84:Yt,85:185,119:Ht,120:Xt,121:qt},{80:[1,210],82:211,119:ht,122:pt},t(Qt,[2,92]),t(Qt,[2,94]),t(Qt,[2,95]),t(Qt,[2,183]),t(Qt,[2,184]),{79:212,82:130,83:ct,84:dt,119:ht,122:pt},t(gt,[2,97]),{8:U,9:j,10:z,11:ft,12:W,13:mt,15:yt,22:214,28:bt,30:[1,213],33:At,34:215,35:Et,36:kt,43:Y,47:xt,63:Ct,78:St,86:150,87:Dt,88:vt,89:Ft,90:$t,91:Lt,92:Bt,93:It,94:216,108:wt,112:Mt,114:Nt,117:Rt,118:Ot,119:Vt},t(Jt,[2,116]),t(Jt,[2,118]),t(Jt,[2,119]),t(Jt,[2,172]),t(Jt,[2,173]),t(Jt,[2,174]),t(Jt,[2,175]),t(Jt,[2,176]),t(Jt,[2,177]),t(Jt,[2,178]),t(Jt,[2,179]),t(Jt,[2,180]),t(Jt,[2,181]),t(Jt,[2,182]),t(Jt,[2,103]),t(Jt,[2,104]),t(Jt,[2,105]),t(Jt,[2,106]),t(Jt,[2,107]),t(Jt,[2,108]),t(Jt,[2,109]),t(Jt,[2,110]),t(Jt,[2,111]),t(Jt,[2,112]),t(Jt,[2,113]),t(Jt,[2,114]),t(Jt,[2,115]),{6:13,7:14,8:u,9:l,10:c,11:d,12:h,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,217],35:g,36:f,37:29,38:m,40:y,42:b,45:33,46:44,47:A,48:45,50:46,63:E,87:k,88:x,89:C,90:S,91:T,92:_,105:D,108:v,109:F,112:$,114:L,116:47,117:B,118:I,119:w,124:M,125:N,126:R,127:O,128:V},{6:13,7:14,8:u,9:l,10:c,11:d,12:h,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,218],35:g,36:f,37:29,38:m,40:y,42:b,45:33,46:44,47:A,48:45,50:46,63:E,87:k,88:x,89:C,90:S,91:T,92:_,105:D,108:v,109:F,112:$,114:L,116:47,117:B,118:I,119:w,124:M,125:N,126:R,127:O,128:V},{8:U,9:j,10:z,11:ft,12:W,13:mt,15:yt,22:220,28:bt,30:[1,219],33:At,34:221,35:Et,36:kt,43:Y,47:xt,63:Ct,78:St,86:150,87:Dt,88:vt,89:Ft,90:$t,91:Lt,92:Bt,93:It,94:216,108:wt,112:Mt,114:Nt,117:Rt,118:Ot,119:Vt},{11:P,19:222},{47:[1,223]},t(rt,[2,56]),{11:[1,224],47:A,63:E,92:_,105:D,108:v,109:F,112:$,114:L,116:122,117:B,118:I,119:w},{11:[1,225]},{11:[1,226],109:[1,227]},t(Zt,[2,143]),{11:[1,228],47:A,63:E,92:_,105:D,108:v,109:F,112:$,114:L,116:122,117:B,118:I,119:w},{11:[1,229],47:A,63:E,92:_,105:D,108:v,109:F,112:$,114:L,116:122,117:B,118:I,119:w},{83:[1,230]},t(jt,[2,124],{11:[1,231]}),t(jt,[2,126],{11:[1,232]}),{83:[1,233]},t(zt,[2,199]),{83:[1,234],101:[1,235]},t(rt,[2,68],{116:122,47:A,63:E,92:_,105:D,108:v,109:F,112:$,114:L,117:B,118:I,119:w}),{32:[1,236],70:Wt,85:237,119:Ht,120:Xt,121:qt},t(te,[2,99]),t(te,[2,101]),t(te,[2,102]),t(te,[2,168]),t(te,[2,169]),t(te,[2,170]),t(te,[2,171]),{52:[1,238],70:Wt,85:237,119:Ht,120:Xt,121:qt},{31:239,70:Wt,83:Kt,84:Yt,85:185,119:Ht,120:Xt,121:qt},{54:[1,240],70:Wt,85:237,119:Ht,120:Xt,121:qt},{56:[1,241],70:Wt,85:237,119:Ht,120:Xt,121:qt},{58:[1,242],70:Wt,85:237,119:Ht,120:Xt,121:qt},{60:[1,243],70:Wt,85:237,119:Ht,120:Xt,121:qt},{63:[1,244]},{67:[1,245],70:Wt,85:237,119:Ht,120:Xt,121:qt},{69:[1,246],70:Wt,85:237,119:Ht,120:Xt,121:qt},{31:247,70:Wt,83:Kt,84:Yt,85:185,119:Ht,120:Xt,121:qt},{32:[1,248],70:Wt,85:237,119:Ht,120:Xt,121:qt},{70:Wt,72:[1,249],74:[1,250],85:237,119:Ht,120:Xt,121:qt},{70:Wt,72:[1,252],74:[1,251],85:237,119:Ht,120:Xt,121:qt},t(K,[2,58],{19:169,11:P,43:Ut}),t(K,[2,60],{47:Gt}),t(lt,[2,88]),t(lt,[2,87]),{65:[1,253],70:Wt,85:237,119:Ht,120:Xt,121:qt},t(lt,[2,90]),t(Qt,[2,93]),{80:[1,254],82:211,119:ht,122:pt},{31:255,70:Wt,83:Kt,84:Yt,85:185,119:Ht,120:Xt,121:qt},t(Pt,o,{5:256}),{8:U,9:j,10:z,12:W,22:257,43:Ut},t(Jt,[2,117]),t(G,[2,42]),t(G,[2,43]),{31:258,70:Wt,83:Kt,84:Yt,85:185,119:Ht,120:Xt,121:qt},t(G,[2,46]),{8:U,9:j,10:z,12:W,22:259,43:Ut},{46:260,47:A,48:45,50:46,63:E,92:_,105:D,108:v,109:F,112:$,114:L,116:47,117:B,118:I,119:w},{11:P,19:261},{11:ee,63:se,87:ie,95:262,108:ne,110:263,111:264,112:re,113:ae,114:oe,115:ue},{11:ee,63:se,87:ie,95:273,107:[1,274],108:ne,110:263,111:264,112:re,113:ae,114:oe,115:ue},{11:ee,63:se,87:ie,95:275,107:[1,276],108:ne,110:263,111:264,112:re,113:ae,114:oe,115:ue},{108:[1,277]},{11:ee,63:se,87:ie,95:278,108:ne,110:263,111:264,112:re,113:ae,114:oe,115:ue},{47:A,50:279,63:E,92:_,105:D,108:v,109:F,112:$,114:L,116:47,117:B,118:I,119:w},t(jt,[2,123]),{83:[1,280]},{83:[1,281],101:[1,282]},t(jt,[2,131]),t(jt,[2,133],{11:[1,283]}),t(jt,[2,134]),t(at,[2,69]),t(te,[2,100]),t(at,[2,70]),{54:[1,284],70:Wt,85:237,119:Ht,120:Xt,121:qt},t(at,[2,77]),t(at,[2,72]),t(at,[2,73]),t(at,[2,74]),{112:[1,285]},t(at,[2,76]),t(at,[2,78]),{69:[1,286],70:Wt,85:237,119:Ht,120:Xt,121:qt},t(at,[2,80]),t(at,[2,81]),t(at,[2,83]),t(at,[2,82]),t(at,[2,84]),t([11,47,63,92,105,108,109,112,114,117,118,119],[2,98]),t(lt,[2,91]),{32:[1,287],70:Wt,85:237,119:Ht,120:Xt,121:qt},{6:13,7:14,8:u,9:l,10:c,11:d,12:h,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,288],35:g,36:f,37:29,38:m,40:y,42:b,45:33,46:44,47:A,48:45,50:46,63:E,87:k,88:x,89:C,90:S,91:T,92:_,105:D,108:v,109:F,112:$,114:L,116:47,117:B,118:I,119:w,124:M,125:N,126:R,127:O,128:V},t(Pt,o,{5:289}),{32:[1,290],70:Wt,85:237,119:Ht,120:Xt,121:qt},t(G,[2,47]),t(rt,[2,66]),{46:291,47:A,48:45,50:46,63:E,92:_,105:D,108:v,109:F,112:$,114:L,116:47,117:B,118:I,119:w},t(jt,[2,136],{109:le}),t(ce,[2,145],{111:293,11:ee,63:se,87:ie,108:ne,112:re,113:ae,114:oe,115:ue}),t(de,[2,147]),t(de,[2,149]),t(de,[2,150]),t(de,[2,151]),t(de,[2,152]),t(de,[2,153]),t(de,[2,154]),t(de,[2,155]),t(de,[2,156]),t(jt,[2,137],{109:le}),{11:[1,294]},t(jt,[2,138],{109:le}),{11:[1,295]},t(Zt,[2,144]),t(jt,[2,120],{109:le}),t(jt,[2,121],{116:122,47:A,63:E,92:_,105:D,108:v,109:F,112:$,114:L,117:B,118:I,119:w}),t(jt,[2,125]),t(jt,[2,127],{11:[1,296]}),t(jt,[2,128]),{101:[1,297]},{54:[1,298]},{65:[1,299]},{69:[1,300]},{8:U,9:j,10:z,12:W,22:301,34:302,43:Y},t(G,[2,40]),{6:13,7:14,8:u,9:l,10:c,11:d,12:h,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,303],35:g,36:f,37:29,38:m,40:y,42:b,45:33,46:44,47:A,48:45,50:46,63:E,87:k,88:x,89:C,90:S,91:T,92:_,105:D,108:v,109:F,112:$,114:L,116:47,117:B,118:I,119:w,124:M,125:N,126:R,127:O,128:V},{8:U,9:j,10:z,12:W,22:304,34:305,43:Y},t(rt,[2,65]),{11:ee,63:se,87:ie,108:ne,110:306,111:264,112:re,113:ae,114:oe,115:ue},t(de,[2,148]),{15:H,47:X,63:q,92:Q,104:307,108:J,109:Z,112:tt,114:et,117:st,118:it,119:nt,123:97},{15:H,47:X,63:q,92:Q,104:308,108:J,109:Z,112:tt,114:et,117:st,118:it,119:nt,123:97},{101:[1,309]},t(jt,[2,135]),t(at,[2,71]),{31:310,70:Wt,83:Kt,84:Yt,85:185,119:Ht,120:Xt,121:qt},t(at,[2,79]),t(Pt,o,{5:311}),{8:U,9:j,10:z,12:W,22:312,43:Ut},t(G,[2,41]),t(G,[2,44]),{8:U,9:j,10:z,12:W,22:313,43:Ut},t(ce,[2,146],{111:293,11:ee,63:se,87:ie,108:ne,112:re,113:ae,114:oe,115:ue}),t(jt,[2,141],{123:181,11:[1,314],15:H,47:X,63:q,92:Q,108:J,109:Z,112:tt,114:et,117:st,118:it,119:nt}),t(jt,[2,142],{123:181,11:[1,315],15:H,47:X,63:q,92:Q,108:J,109:Z,112:tt,114:et,117:st,118:it,119:nt}),t(jt,[2,129]),{32:[1,316],70:Wt,85:237,119:Ht,120:Xt,121:qt},{6:13,7:14,8:u,9:l,10:c,11:d,12:h,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,317],35:g,36:f,37:29,38:m,40:y,42:b,45:33,46:44,47:A,48:45,50:46,63:E,87:k,88:x,89:C,90:S,91:T,92:_,105:D,108:v,109:F,112:$,114:L,116:47,117:B,118:I,119:w,124:M,125:N,126:R,127:O,128:V},t(Pt,o,{5:318}),t(G,[2,45]),{11:ee,63:se,87:ie,95:319,108:ne,110:263,111:264,112:re,113:ae,114:oe,115:ue},{11:ee,63:se,87:ie,95:320,108:ne,110:263,111:264,112:re,113:ae,114:oe,115:ue},t(at,[2,75]),t(G,[2,38]),{6:13,7:14,8:u,9:l,10:c,11:d,12:h,21:20,23:21,24:22,25:23,26:24,27:25,28:p,33:[1,321],35:g,36:f,37:29,38:m,40:y,42:b,45:33,46:44,47:A,48:45,50:46,63:E,87:k,88:x,89:C,90:S,91:T,92:_,105:D,108:v,109:F,112:$,114:L,116:47,117:B,118:I,119:w,124:M,125:N,126:R,127:O,128:V},t(jt,[2,139],{109:le}),t(jt,[2,140],{109:le}),t(G,[2,39])],defaultActions:{},parseError:i(function(t,e){if(!e.recoverable){var s=new Error(t);throw s.hash=e,s}this.trace(t)},"parseError"),parse:i(function(t){var e=this,s=[0],n=[],r=[null],a=[],o=this.table,u="",l=0,c=0,d=a.slice.call(arguments,1),h=Object.create(this.lexer),p={yy:{}};for(var g in this.yy)Object.prototype.hasOwnProperty.call(this.yy,g)&&(p.yy[g]=this.yy[g]);h.setInput(t,p.yy),p.yy.lexer=h,p.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var f=h.yylloc;a.push(f);var m=h.options&&h.options.ranges;function y(){var t;return"number"!=typeof(t=n.pop()||h.lex()||1)&&(t instanceof Array&&(t=(n=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,i(function(t){s.length=s.length-2*t,r.length=r.length-t,a.length=a.length-t},"popStack"),i(y,"lex");for(var b,A,E,k,x,C,S,T,_={};;){if(A=s[s.length-1],this.defaultActions[A]?E=this.defaultActions[A]:(null==b&&(b=y()),E=o[A]&&o[A][b]),void 0===E||!E.length||!E[0]){var D="";for(x in T=[],o[A])this.terminals_[x]&&x>2&&T.push("'"+this.terminals_[x]+"'");D=h.showPosition?"Parse error on line "+(l+1)+":\n"+h.showPosition()+"\nExpecting "+T.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(D,{text:h.match,token:this.terminals_[b]||b,line:h.yylineno,loc:f,expected:T})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(E[0]){case 1:s.push(b),r.push(h.yytext),a.push(h.yylloc),s.push(E[1]),b=null,c=h.yyleng,u=h.yytext,l=h.yylineno,f=h.yylloc;break;case 2:if(C=this.productions_[E[1]][1],_.$=r[r.length-C],_._$={first_line:a[a.length-(C||1)].first_line,last_line:a[a.length-1].last_line,first_column:a[a.length-(C||1)].first_column,last_column:a[a.length-1].last_column},m&&(_._$.range=[a[a.length-(C||1)].range[0],a[a.length-1].range[1]]),void 0!==(k=this.performAction.apply(_,[u,c,l,p.yy,E[1],r,a].concat(d))))return k;C&&(s=s.slice(0,-1*C*2),r=r.slice(0,-1*C),a=a.slice(0,-1*C)),s.push(this.productions_[E[1]][0]),r.push(_.$),a.push(_._$),S=o[s[s.length-2]][s[s.length-1]],s.push(S);break;case 3:return!0}}return!0},"parse")},pe=function(){return{EOF:1,parseError:i(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:i(function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:i(function(){var t=this._input[0];return this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t,t.match(/(?:\r\n?|\n).*/g)?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:i(function(t){var e=t.length,s=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),s.length-1&&(this.yylineno-=s.length-1);var n=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===i.length?this.yylloc.first_column:0)+i[i.length-s.length].length-s[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[n[0],n[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:i(function(){return this._more=!0,this},"more"),reject:i(function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"reject"),less:i(function(t){this.unput(this.match.slice(t))},"less"),pastInput:i(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:i(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:i(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:i(function(t,e){var s,i,n;if(this.options.backtrack_lexer&&(n={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(n.yylloc.range=this.yylloc.range.slice(0))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],s=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in n)this[r]=n[r];return!1}return!1},"test_match"),next:i(function(){if(this.done)return this.EOF;var t,e,s,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var n=this._currentRules(),r=0;r<n.length;r++)if((s=this._input.match(this.rules[n[r]]))&&(!e||s[0].length>e[0].length)){if(e=s,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,n[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,n[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:i(function(){var t=this.next();return t||this.lex()},"lex"),begin:i(function(t){this.conditionStack.push(t)},"begin"),popState:i(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:i(function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},"_currentRules"),topState:i(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:i(function(t){this.begin(t)},"pushState"),stateStackSize:i(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:i(function(t,e,s,i){switch(s){case 0:return this.begin("acc_title"),38;case 1:return this.popState(),"acc_title_value";case 2:return this.begin("acc_descr"),40;case 3:return this.popState(),"acc_descr_value";case 4:this.begin("acc_descr_multiline");break;case 5:case 12:case 14:case 17:case 20:case 23:case 33:this.popState();break;case 6:return"acc_descr_multiline_value";case 7:return this.pushState("shapeData"),e.yytext="",43;case 8:return this.pushState("shapeDataStr"),43;case 9:return this.popState(),43;case 10:const s=/\n\s*/g;return e.yytext=e.yytext.replace(s,"<br/>"),43;case 11:return 43;case 13:this.begin("callbackname");break;case 15:this.popState(),this.begin("callbackargs");break;case 16:return 98;case 18:return 99;case 19:return"MD_STR";case 21:this.begin("md_string");break;case 22:return"STR";case 24:this.pushState("string");break;case 25:return 87;case 26:return 105;case 27:return 88;case 28:return 107;case 29:return 89;case 30:return 90;case 31:return 100;case 32:this.begin("click");break;case 34:return 91;case 35:return t.lex.firstGraph()&&this.begin("dir"),13;case 36:return 28;case 37:return 36;case 38:return 35;case 39:return 33;case 40:case 41:case 42:case 43:return 101;case 44:return this.popState(),14;case 45:case 46:case 47:case 48:case 49:case 50:case 51:case 52:case 53:case 54:return this.popState(),15;case 55:return 124;case 56:return 125;case 57:return 126;case 58:return 127;case 59:return 128;case 60:return 81;case 61:return 108;case 62:case 99:return 114;case 63:return 49;case 64:return 63;case 65:case 100:return 47;case 66:return 9;case 67:return 109;case 68:case 98:return 118;case 69:return this.popState(),80;case 70:return this.pushState("edgeText"),78;case 71:return 122;case 72:return 80;case 73:case 87:case 113:break;case 74:return this.popState(),56;case 75:case 114:return"TEXT";case 76:return this.pushState("ellipseText"),55;case 77:return this.popState(),58;case 78:return this.pushState("text"),57;case 79:return this.popState(),60;case 80:return this.pushState("text"),59;case 81:return 61;case 82:return this.pushState("text"),70;case 83:return this.popState(),67;case 84:return this.pushState("text"),66;case 85:return this.popState(),52;case 86:return this.pushState("text"),51;case 88:return this.popState(),72;case 89:return this.popState(),74;case 90:return 120;case 91:return this.pushState("trapText"),71;case 92:return this.pushState("trapText"),73;case 93:return 121;case 94:return 70;case 95:return 93;case 96:return"SEP";case 97:return 92;case 101:return 8;case 102:return 112;case 103:return 117;case 104:return 119;case 105:return this.popState(),65;case 106:return this.pushState("text"),65;case 107:return this.popState(),54;case 108:return this.pushState("text"),53;case 109:return this.popState(),32;case 110:return this.pushState("text"),30;case 111:return this.popState(),69;case 112:return this.pushState("text"),68;case 115:return"QUOTE";case 116:return 10;case 117:return 11;case 118:return 12}},"anonymous"),rules:[/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:@\{)/,/^(?:["])/,/^(?:["])/,/^(?:[^\"]+)/,/^(?:[^}^"]+)/,/^(?:\})/,/^(?:call[\s]+)/,/^(?:\([\s]*\))/,/^(?:\()/,/^(?:[^(]*)/,/^(?:\))/,/^(?:[^)]*)/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["][`])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:["])/,/^(?:style\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\b)/,/^(?:class\b)/,/^(?:href[\s])/,/^(?:click[\s]+)/,/^(?:[\s\n])/,/^(?:[^\s\n]*)/,/^(?:agentflow-beta\b)/,/^(?:flow\b)/,/^(?:connector\b)/,/^(?:global\b[ \t]*)/,/^(?:end\b[ \t]*)/,/^(?:_self\b)/,/^(?:_blank\b)/,/^(?:_parent\b)/,/^(?:_top\b)/,/^(?:(\r?\n)*\s*\n)/,/^(?:\s*LR\b)/,/^(?:\s*RL\b)/,/^(?:\s*TB\b)/,/^(?:\s*BT\b)/,/^(?:\s*TD\b)/,/^(?:\s*BR\b)/,/^(?:\s*<)/,/^(?:\s*>)/,/^(?:\s*\^)/,/^(?:\s*v\b)/,/^(?:.*direction\s+TB[^\n]*)/,/^(?:.*direction\s+BT[^\n]*)/,/^(?:.*direction\s+RL[^\n]*)/,/^(?:.*direction\s+LR[^\n]*)/,/^(?:.*direction\s+TD[^\n]*)/,/^(?:[^\s\"]+@(?=[^\{\"]))/,/^(?:[0-9]+)/,/^(?:#)/,/^(?::::)/,/^(?::)/,/^(?:&)/,/^(?:;)/,/^(?:,)/,/^(?:\*)/,/^(?:\s*--+[x>]\s*)/,/^(?:\s*--\s*)/,/^(?:[^-]|-(?!-)+)/,/^(?:\s*-\.+-\s*)/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[-/\)][\)])/,/^(?:[^\(\)\[\]\{\}]|!\)+)/,/^(?:\(-)/,/^(?:\]\))/,/^(?:\(\[)/,/^(?:\]\])/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:>)/,/^(?:\)\])/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\(\(\()/,/^(?:%%(?!\{)[^\n]*)/,/^(?:[\\(?=\])][\]])/,/^(?:\/(?=\])\])/,/^(?:\/(?!\])|\\(?!\])|(?:[^\\\[\]\(\)\{\}\/%]+|(?!))+)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:<)/,/^(?:>)/,/^(?:\^)/,/^(?:\\\|)/,/^(?:v\b)/,/^(?:\*)/,/^(?:#)/,/^(?:&)/,/^(?:[ \t]*%%(?!\{)[^\n]*)/,/^(?:([A-Za-z0-9!"\#$%&'*+\.`?\\_\/]|-(?=[^\>\-\.])|(?!))+)/,/^(?:-)/,/^(?:[\u00AA\u00B5\u00BA\u00C0-\u00D6\u00D8-\u00F6]|[\u00F8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377]|[\u037A-\u037D\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5]|[\u03F7-\u0481\u048A-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05D0-\u05EA]|[\u05F0-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE]|[\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA]|[\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u08A0]|[\u08A2-\u08AC\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0977]|[\u0979-\u097F\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2]|[\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u0A05-\u0A0A]|[\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39]|[\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8]|[\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0B05-\u0B0C]|[\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C]|[\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99]|[\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0]|[\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C33\u0C35-\u0C39\u0C3D]|[\u0C58\u0C59\u0C60\u0C61\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3]|[\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10]|[\u0D12-\u0D3A\u0D3D\u0D4E\u0D60\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1]|[\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81]|[\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3]|[\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6]|[\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A]|[\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081]|[\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D]|[\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0]|[\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310]|[\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F4\u1401-\u166C]|[\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u1700-\u170C\u170E-\u1711]|[\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7]|[\u17DC\u1820-\u1877\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191C]|[\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19C1-\u19C7\u1A00-\u1A16]|[\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF]|[\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1CE9-\u1CEC]|[\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D]|[\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D]|[\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3]|[\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F]|[\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128]|[\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184]|[\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3]|[\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6]|[\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE]|[\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C]|[\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312D]|[\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FCC]|[\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B]|[\uA640-\uA66E\uA67F-\uA697\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788]|[\uA78B-\uA78E\uA790-\uA793\uA7A0-\uA7AA\uA7F8-\uA801\uA803-\uA805]|[\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB]|[\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uAA00-\uAA28]|[\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA80-\uAAAF\uAAB1\uAAB5]|[\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4]|[\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E]|[\uABC0-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D]|[\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36]|[\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D]|[\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC]|[\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF]|[\uFFD2-\uFFD7\uFFDA-\uFFDC])/,/^(?:\|)/,/^(?:\|)/,/^(?:\))/,/^(?:\()/,/^(?:\])/,/^(?:\[)/,/^(?:(\}))/,/^(?:\{)/,/^(?:%%(?!\{)[^\n]*)/,/^(?:(?:[^\[\]\(\)\{\}\|\"%]+|(?!))+)/,/^(?:")/,/^(?:(\r?\n)+)/,/^(?:\s)/,/^(?:$)/],conditions:{shapeDataEndBracket:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},shapeDataStr:{rules:[9,10,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},shapeData:{rules:[8,11,12,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},callbackargs:{rules:[17,18,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},callbackname:{rules:[14,15,16,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},href:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},click:{rules:[21,24,33,34,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},edgeText:{rules:[21,24,69,71,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},trapText:{rules:[21,24,76,78,80,84,86,87,88,89,90,91,92,106,108,110,112],inclusive:!1},ellipseText:{rules:[21,24,73,74,75,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},text:{rules:[21,24,76,77,78,79,80,83,84,85,86,91,92,105,106,107,108,109,110,111,112,113,114],inclusive:!1},vertex:{rules:[21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},dir:{rules:[21,24,44,45,46,47,48,49,50,51,52,53,54,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_descr_multiline:{rules:[5,6,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_descr:{rules:[3,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},acc_title:{rules:[1,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},md_string:{rules:[19,20,21,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},string:{rules:[21,22,23,24,76,78,80,84,86,91,92,106,108,110,112],inclusive:!1},INITIAL:{rules:[0,2,4,7,13,21,24,25,26,27,28,29,30,31,32,35,36,37,38,39,40,41,42,43,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,72,76,78,80,81,82,84,86,91,92,93,94,95,96,97,98,99,100,101,102,103,104,106,108,110,112,115,116,117,118],inclusive:!0}}}}();function ge(){this.yy={}}return he.lexer=pe,i(ge,"Parser"),ge.prototype=he,he.Parser=ge,new ge}();et.parser=et;var st=et,it=Object.assign({},st);it.parse=t=>{const e=t.replace(/}[^\S\n]*\n/g,"}\n");return st.parse(e)};var nt=it,rt=i(t=>{const{theme:e,bkgColorArray:s,borderColorArray:n}=t;if(!S(e,n))return"";const r=T(t.look),a=_(s),o=D(t.THEME_COLOR_LIMIT,n),u=i(t=>n[t%n.length],"border"),l=i(t=>a?`fill: ${s[t%s.length]};`:"","fill");let c="";for(const i of j){const t=P.get(i),e=`[data-look="${r}"].node.${U(i)}`;c+=`\n\n ${e} rect,\n ${e} path,\n ${e} polygon {\n stroke: ${u(t)};\n ${l(t)}\n }\n`}for(let d=0;d<z(o);d++){const t=W(d,o),e=`[data-look="${r}"][data-color-id="color-${t}"].cluster`,s=`[data-look="${r}"][data-color-id="color-${t}"].node`,n=i(t=>`${e} ${t}, ${s} ${t}`,"rule");c+=`\n\n ${n("rect")},\n ${n("path")} {\n stroke: ${u(t)};\n ${l(t)}\n }\n`}return c},"genColor"),at=i((t,e)=>{const s=F,i=s(t,"r"),n=s(t,"g"),r=s(t,"b");return v(i,n,r,e)},"fade"),ot=i(e=>`${rt(e)}\n .label {\n font-family: ${e.fontFamily};\n color: ${e.nodeTextColor||e.textColor};\n }\n .cluster-label text {\n fill: ${e.titleColor};\n }\n .cluster-label span {\n color: ${e.titleColor};\n }\n .cluster-label span p {\n background-color: transparent;\n }\n\n .label text,span {\n fill: ${e.nodeTextColor||e.textColor};\n color: ${e.nodeTextColor||e.textColor};\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.mainBkg};\n stroke: ${e.nodeBorder};\n stroke-width: ${e.strokeWidth??1}px;\n }\n .rough-node .label text , .node .label text, .image-shape .label, .icon-shape .label {\n text-anchor: middle;\n }\n .node .katex path {\n fill: ${e.nodeTextColor||e.textColor};\n stroke: ${e.nodeTextColor||e.textColor};\n stroke-width: 1px;\n }\n\n .rough-node .label,.node .label, .image-shape .label, .icon-shape .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n\n .root .anchor path {\n fill: ${e.lineColor} !important;\n stroke-width: 0;\n stroke: ${e.lineColor};\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePaths .path {\n stroke: ${e.lineColor};\n stroke-width: ${e.strokeWidth??2}px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n p {\n background-color: ${e.edgeLabelBackground};\n }\n rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n }\n\n /* For html labels only */\n .labelBkg {\n background-color: ${at(e.edgeLabelBackground,.5)};\n }\n\n .cluster rect {\n fill: ${e.clusterBkg};\n stroke: ${e.clusterBorder};\n stroke-width: 1px;\n }\n\n .flow-cluster rect {\n fill: none;\n stroke: ${e.clusterBorder};\n stroke-width: 0.75px;\n }\n\n .node .collapsed-indicator {\n fill: ${e.nodeBorder};\n stroke: none;\n stroke-width: 0;\n opacity: 0.5;\n }\n\n .node .collapsed-separator {\n stroke-width: 0.75px;\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n .cluster span {\n color: ${e.titleColor};\n }\n /* .cluster div {\n color: ${e.titleColor};\n } */\n\n div.mermaidTooltip {\n position: absolute;\n text-align: center;\n max-width: 200px;\n padding: 2px;\n font-family: ${e.fontFamily};\n font-size: 12px;\n background: ${e.tertiaryColor};\n border: 1px solid ${e.border2};\n border-radius: 2px;\n pointer-events: none;\n z-index: 100;\n }\n\n .agentflowTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n\n rect.text {\n fill: none;\n stroke-width: 0;\n }\n\n .icon-shape, .image-shape {\n background-color: ${e.edgeLabelBackground};\n p {\n background-color: ${e.edgeLabelBackground};\n padding: 2px;\n }\n .label rect {\n opacity: 0.5;\n background-color: ${e.edgeLabelBackground};\n fill: ${e.edgeLabelBackground};\n }\n text-align: center;\n }\n ${t()}\n`,"getStyles"),ut={parser:nt,get db(){return new Z},renderer:tt,styles:ot,init:i(t=>{t.agentflow??={},t.layout&&n({layout:t.layout}),t.flowchart??={},t.flowchart.arrowMarkerAbsolute=t.arrowMarkerAbsolute,n({flowchart:{arrowMarkerAbsolute:t.arrowMarkerAbsolute}})},"init")};export{ut as diagram};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{g as e,r,d as t}from"./chunk-2E7WHVMD-TfbC_dmh.js";import{p as n}from"./chunk-JWPE2WC7-BP2iXBhe.js";import{_ as a,l as s}from"./mermaid-T_6Ze_cT.js";import{M as o,a as i}from"./cynefin-EF2NZ3EQ-CR1E3YiZ.js";import"./markdown-S2mWvoE-.js";var p=i().RailroadEbnf.parser.LangiumParser,m=a(e=>{const r=e.alternatives.map(l);return 1===r.length?r[0]:{type:"choice",alternatives:r}},"transformChoice"),l=a(e=>{const r=e.elements.map(c);return 1===r.length?r[0]:{type:"sequence",elements:r}},"transformSequence"),u=a(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return m(e.element);case"EbnfOptional":return{type:"optional",element:m(e.element)};case"EbnfRepetition":return{type:"repetition",element:m(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),f=a((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},u(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),c=a(e=>e.postfixes.reduce((e,r)=>f(e,r),u(e.base)),"transformTerm"),E=a(e=>({name:e.name,definition:m(e.definition)}),"transformRule"),y=a(e=>{n(e,t),e.title&&t.setTitle(e.title),e.rules.map(e=>t.addRule(E(e)))},"populateDb"),d={parser:{parse:a(e=>{t.clear(),s.debug("[EBNF Parser] Starting Langium parse");const r=p.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new o(r);const n=r.value;s.debug("[EBNF Parser] Parsed rules:",n.rules.length),y(n),s.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:t}},db:t,renderer:r,styles:e};export{d as diagram};
|