@juki-team/base-ui 1.4.128 → 1.4.129
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/dist/esm/{ArrowForwardIcon-Bnn7Iz4G.js → ArrowForwardIcon-IN9agpuQ.js} +1 -1
- package/dist/esm/{BarChart-D5bo7JIL.js → BarChart-BnEygCik.js} +1 -1
- package/dist/esm/{CartesianChart-CobjBy-5.js → CartesianChart-46JvJlt2.js} +1 -1
- package/dist/esm/{ChangePasswordModal-C8I37Lmc.js → ChangePasswordModal-W7o3d5xv.js} +1 -1
- package/dist/esm/{CodeEditor-B6Z_vVNE.js → CodeEditor-btUZu2Dy.js} +1 -1
- package/dist/esm/{DataGrid-EEmJvadS.js → DataGrid-C-1PcbQ9.js} +1 -1
- package/dist/esm/{DataViewer-BnJZ7RG7.js → DataViewer-DdoMfhBT.js} +1 -1
- package/dist/esm/{DrawerView-BYxdlHl8.js → DrawerView-C59g89Qq.js} +1 -1
- package/dist/esm/{ExcalidrawButton-D4U4cBk4.js → ExcalidrawButton-7RauNqcW.js} +1 -1
- package/dist/esm/{GraphvizViewer-CPnICZa2.js → GraphvizViewer-Cdd3s9Pz.js} +1 -1
- package/dist/esm/{ImageLoaderCropper-BogOFrVn.js → ImageLoaderCropper-By7-NpjH.js} +1 -1
- package/dist/esm/{InputCellPhoneNumber-iWeDD6qq.js → InputCellPhoneNumber-BoliLbve.js} +1 -1
- package/dist/esm/{InputColor-B70A4U4T.js → InputColor-B6fjWGPV.js} +1 -1
- package/dist/esm/{LineChart-DLFrUWfp.js → LineChart-yzQzjap8.js} +1 -1
- package/dist/esm/{MdMath-Cu7sz6X4.js → MdMath-DcAukZc5.js} +1 -1
- package/dist/esm/{MdMathEditor-Cld-MqNo.js → MdMathEditor-Ckf7tXlp.js} +2 -2
- package/dist/esm/{Popover-DdOfIlTm.js → Popover-DOgPkWfK.js} +1 -1
- package/dist/esm/{ReplyIcon-DJPfkoNy.js → ReplyIcon-DrZrr78M.js} +1 -1
- package/dist/esm/{SettingsIcon-CInONSNO.js → SettingsIcon-DM1F7UIb.js} +1 -1
- package/dist/esm/{SlideDeck-DNpkU3EW.js → SlideDeck-yImvO_hq.js} +1 -1
- package/dist/esm/{TableOfContents-D09Tl8Li.js → TableOfContents-KP3dhzIR.js} +1 -1
- package/dist/esm/{TextHeadCell-C5VCH0Lf.js → TextHeadCell-CtlRYJ1U.js} +1 -1
- package/dist/esm/{Tooltip-CeUrSz_E.js → Tooltip-CQx5RC2x.js} +1 -1
- package/dist/esm/{UserCodeEditor-DO0kLp8T.js → UserCodeEditor-DVycUyoi.js} +6 -6
- package/dist/esm/{ViewModuleIcon-DuqGYgdz.js → ViewModuleIcon-CBJGd2NB.js} +1 -1
- package/dist/esm/{VirtualizedRowsFixed-hIujSeOl.js → VirtualizedRowsFixed-CJRctik-.js} +1 -1
- package/dist/esm/{WorksheetAsSlides-BTbKEOuB.js → WorksheetAsSlides-33duB_50.js} +1 -1
- package/dist/esm/{WorksheetBodies-CyXJo3pU.js → WorksheetBodies-Ptk1_moK.js} +1 -1
- package/dist/esm/{WorksheetContents-Cosj3MBk.js → WorksheetContents-WKXb5Uk4.js} +1 -1
- package/dist/esm/{WorksheetEditor-dQ3FmK6E.js → WorksheetEditor-z9ucL22I.js} +1 -1
- package/dist/esm/{WorksheetNode-BRplV701.js → WorksheetNode-DdlERlmz.js} +1 -1
- package/dist/esm/{WorksheetViewer-B-RX22Je.js → WorksheetViewer-C8lplKFc.js} +1 -1
- package/dist/esm/{architectureDiagram-3BPJPVTR-GHdKy6q4.js → architectureDiagram-3BPJPVTR-mkUe-O1b.js} +1 -1
- package/dist/esm/{blockDiagram-GPEHLZMM-BsKkASna.js → blockDiagram-GPEHLZMM-DI6f452i.js} +1 -1
- package/dist/esm/{c4Diagram-AAUBKEIU-BubfHfIS.js → c4Diagram-AAUBKEIU-CprJ4eDK.js} +1 -1
- package/dist/esm/channel-B3QafhkE.js +1 -0
- package/dist/esm/{chunk-2J33WTMH-DQLkwr3H.js → chunk-2J33WTMH-CRrW12Q1.js} +1 -1
- package/dist/esm/{chunk-4BX2VUAB-CtK595Al.js → chunk-4BX2VUAB-DP1enpjM.js} +1 -1
- package/dist/esm/{chunk-55IACEB6-DA8sagOJ.js → chunk-55IACEB6-Qy7BShb8.js} +1 -1
- package/dist/esm/{chunk-727SXJPM-B6XP9Ejn.js → chunk-727SXJPM-DCaL4Ssn.js} +1 -1
- package/dist/esm/{chunk-AQP2D5EJ-BGXJS1L5.js → chunk-AQP2D5EJ-MvQ9vOa8.js} +1 -1
- package/dist/esm/{chunk-FMBD7UC4-DETYmnuw.js → chunk-FMBD7UC4-C_QBV__I.js} +1 -1
- package/dist/esm/{chunk-ND2GUHAM-cVaSk2c2.js → chunk-ND2GUHAM-Cz6MG9Ip.js} +1 -1
- package/dist/esm/{chunk-QZHKN3VN-pybgO0OQ.js → chunk-QZHKN3VN-CNeKC3i9.js} +1 -1
- package/dist/esm/{classDiagram-4FO5ZUOK-DAj9h4b_.js → classDiagram-4FO5ZUOK-CIl1HCsD.js} +1 -1
- package/dist/esm/{classDiagram-v2-Q7XG4LA2-DAj9h4b_.js → classDiagram-v2-Q7XG4LA2-CIl1HCsD.js} +1 -1
- package/dist/esm/{contest-aDQIqOJe.js → contest--aeYKKxf.js} +1 -1
- package/dist/esm/{cose-bilkent-S5V4N54A-Byki9rDQ.js → cose-bilkent-S5V4N54A-BU_DfNnH.js} +1 -1
- package/dist/esm/{dagre-BM42HDAG-DGcCaZtB.js → dagre-BM42HDAG-B0jhlami.js} +1 -1
- package/dist/esm/{diagram-2AECGRRQ-DxkVrRtM.js → diagram-2AECGRRQ-BoG6bCz0.js} +1 -1
- package/dist/esm/{diagram-5GNKFQAL-CI68cFUB.js → diagram-5GNKFQAL-CmPEF4Gb.js} +1 -1
- package/dist/esm/{diagram-KO2AKTUF-DeOvpWNz.js → diagram-KO2AKTUF-otFu6fY1.js} +1 -1
- package/dist/esm/{diagram-LMA3HP47-B3k-krze.js → diagram-LMA3HP47-BNvQPERF.js} +1 -1
- package/dist/esm/{diagram-OG6HWLK6-DF1a3R9r.js → diagram-OG6HWLK6-GT5ck18c.js} +1 -1
- package/dist/esm/{erDiagram-TEJ5UH35-D8tsDNJs.js → erDiagram-TEJ5UH35-DOTojUvv.js} +1 -1
- package/dist/esm/{flowDiagram-I6XJVG4X-BI4wwmRU.js → flowDiagram-I6XJVG4X-DMNWQIoP.js} +1 -1
- package/dist/esm/{ganttDiagram-6RSMTGT7-mtZrSAvl.js → ganttDiagram-6RSMTGT7-UueSCT2P.js} +1 -1
- package/dist/esm/{gitGraphDiagram-PVQCEYII-DjcI8VAu.js → gitGraphDiagram-PVQCEYII-BMejzE3B.js} +1 -1
- package/dist/esm/helpers.js +1 -1
- package/dist/esm/{index-8lCMBwuC.js → index-2vw3cISu.js} +1 -1
- package/dist/esm/{index-CYbDO0-3.js → index-CCC14puG.js} +1 -1
- package/dist/esm/{index-CMnRWttz.js → index-CWWVtFL-.js} +1 -1
- package/dist/esm/{index-DMMK2jqZ.js → index-C_iDYl6D.js} +1 -1
- package/dist/esm/{index-DRfZVlOJ.js → index-CroDROK5.js} +1 -1
- package/dist/esm/{index-BGlnGvON.js → index-MXDpbG5L.js} +1 -1
- package/dist/esm/index-P3Cb0cjc.js +1 -0
- package/dist/esm/index-mPuca8dy.js +1 -0
- package/dist/esm/{infoDiagram-5YYISTIA-Bh8b-n4b.js → infoDiagram-5YYISTIA-BSxjrZJf.js} +1 -1
- package/dist/esm/{ishikawaDiagram-YF4QCWOH-B7Ef_815.js → ishikawaDiagram-YF4QCWOH-B2-9liDF.js} +1 -1
- package/dist/esm/{journeyDiagram-JHISSGLW-BJmVcYZK.js → journeyDiagram-JHISSGLW-DBQd4ic_.js} +1 -1
- package/dist/esm/{kanban-definition-UN3LZRKU-mFRkclho.js → kanban-definition-UN3LZRKU-DFolGaRv.js} +1 -1
- package/dist/esm/main.js +1 -1
- package/dist/esm/{mermaid.core-S6eGK7_m.js → mermaid.core-EsBL2ECN.js} +1 -1
- package/dist/esm/{mindmap-definition-RKZ34NQL-CKmS7PO4.js → mindmap-definition-RKZ34NQL-BIQZzlCy.js} +1 -1
- package/dist/esm/{pieDiagram-4H26LBE5-DRY8BTZd.js → pieDiagram-4H26LBE5-DZBAcvRC.js} +1 -1
- package/dist/esm/{quadrantDiagram-W4KKPZXB-BZghqn__.js → quadrantDiagram-W4KKPZXB-b5MVV3Rk.js} +1 -1
- package/dist/esm/{requirementDiagram-4Y6WPE33-BU3Hxtyb.js → requirementDiagram-4Y6WPE33-CLn9X-PZ.js} +1 -1
- package/dist/esm/{sankeyDiagram-5OEKKPKP-Cxm2hiMr.js → sankeyDiagram-5OEKKPKP-D4-b_g7U.js} +1 -1
- package/dist/esm/{sequenceDiagram-3UESZ5HK-BZMNpJbY.js → sequenceDiagram-3UESZ5HK-CCdY9Q3W.js} +1 -1
- package/dist/esm/server.js +1 -1
- package/dist/esm/settings.js +1 -1
- package/dist/esm/{stateDiagram-AJRCARHV-BgX0EzoX.js → stateDiagram-AJRCARHV-BSMAHoem.js} +1 -1
- package/dist/esm/{stateDiagram-v2-BHNVJYJU-StaZwSoO.js → stateDiagram-v2-BHNVJYJU-BeJ_O1Tl.js} +1 -1
- package/dist/esm/{timeline-definition-PNZ67QCA-gdRLr8en.js → timeline-definition-PNZ67QCA-o-UlOwfU.js} +1 -1
- package/dist/esm/{types-D3os_Tiq.js → types-TNt9NcVE.js} +1 -1
- package/dist/esm/{vennDiagram-CIIHVFJN-DOAjj0rn.js → vennDiagram-CIIHVFJN-CySj1ueN.js} +1 -1
- package/dist/esm/{wardleyDiagram-YWT4CUSO-IZo-xpbz.js → wardleyDiagram-YWT4CUSO-B7YSHlE3.js} +1 -1
- package/dist/esm/{xychartDiagram-2RQKCTM6-DQUY0LiW.js → xychartDiagram-2RQKCTM6-D6EqpoC5.js} +1 -1
- package/dist/module-types/src/components/atoms/server/icons/specials/types.d.ts +5 -6
- package/dist/module-types/src/settings/ApiManager.d.ts +164 -41
- package/package.json +2 -2
- package/src/vendor/fumadocs-ui/css/generated/docs.css +2 -0
- package/src/vendor/fumadocs-ui/css/generated/flux.css +1 -0
- package/src/vendor/fumadocs-ui/css/generated/notebook.css +2 -0
- package/src/vendor/fumadocs-ui/css/preset.css +0 -1
- package/dist/esm/channel-Bz5Urkbc.js +0 -1
- package/dist/esm/index-CZeOFoty.js +0 -1
- package/dist/esm/index-CcKNCy1-.js +0 -1
- package/dist/module-types/src/components/mockup/index.d.ts +0 -4
- package/dist/module-types/src/components/molecules/TabsInline/TabsInline.deprecated.d.ts +0 -2
- package/dist/module-types/src/components/molecules/TabsInlineBody/TabsInlineBody.deprecated.d.ts +0 -2
- package/dist/module-types/src/components/organisms/PresentationToolButtons/buttons/Pencil.deprecated.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/MdMathEditor/MdMathEditor.tiptap.deprecated.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/MdMathEditor/tip-tap.deprecated/TiptapEditorContent.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/MdMathEditor/tip-tap.deprecated/extensions/BlockImage.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/MdMathEditor/tip-tap.deprecated/extensions/ClearMarksOnEnter.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/MdMathEditor/tip-tap.deprecated/extensions/CurrentNodeHighlighter.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/MdMathEditor/tip-tap.deprecated/extensions/CustomCodeBlockLowlight.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/MdMathEditor/tip-tap.deprecated/extensions/CustomLink.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/MdMathEditor/tip-tap.deprecated/extensions/SmartHeadingBackspace.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/MdMathEditor/tip-tap.deprecated/extensions/SmartPasteMarkdown.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/MdMathEditor/tip-tap.deprecated/extensions/index.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/CodeEditorSheetSection/CodeEditorSheetSectionEditorModal.d.ts +0 -10
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/GraphSheetSection/GraphSheetSectionEditorModal.d.ts +0 -10
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/JkmdSheetSection/JkmdSheetSection.old.d.ts +0 -6
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/JkmdSheetSection/JkmdSheetSectionEditorModal.d.ts +0 -10
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/ListSheetSection/ListSheetRecursiveSection.d.ts +0 -9
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/ListSheetSection/ListSheetSection.d.ts +0 -7
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/ListSheetSection/index.d.ts +0 -1
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/QuizOptionsSheetSection/QuizOptionsSheetSectionEditorModal.d.ts +0 -10
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/QuizProblemSheetSection/QuizProblemSheetSectionEditorModal.d.ts +0 -10
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/QuizProblemSheetSection/QuizProblemSheetSectionEditorModal.old.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/QuizProblemSheetSection/QuizProblemSheetSectionView.old.d.ts +0 -0
- package/dist/module-types/src/components/organisms/_layz_/WorksheetEditor/sheets/UpRemoveDownButtons.d.ts +0 -7
- package/dist/module-types/src/components/providers/JukiPageInitializer/useMouseInsidePage.d.ts +0 -1
- package/dist/module-types/src/components/templates/MainMenu/DrawerViewMenuMobile/index.d.ts +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as t}from"./chunk-FMBD7UC4-DETYmnuw.js";import{ac as e,Y as r,ad as a,aO as s,aN as i,aQ as n,aP as o,aM as c,aK as l,aH as d,au as h,ao as g,an as u,aj as y,a8 as p,a7 as x,a9 as b,I as f,H as m,A as w,h as k,z as S,d as L,e as _,c as E,a as T,N as D,aA as $,w as v,ai as I,n as N,ay as C,T as B,O,a0 as R,R as z,x as A,u as M,X as P,aT as j,s as Y,W as F,az as W,D as X,v as H}from"./mermaid.core-S6eGK7_m.js";import{G as U}from"./graph-ByvXLzfz.js";import{c as K}from"./channel-Bz5Urkbc.js";import{A as q,l as Z}from"./string-CQk_HvWX.js";import"./index-BGlnGvON.js";import"react/jsx-runtime";import"react";import"./ViewModuleIcon-DuqGYgdz.js";import"./index-CZeOFoty.js";import"./settings-DgLs6IK_.js";import"./enums.js";import"./date-D28INXpp.js";import"./time-BHcZPeyw.js";import"./contest-aDQIqOJe.js";import"./worksheet-BBAH_yZC.js";import"motion/react";import"react-dom";import"./index-Dwi3ag-n.js";import"swr";import"@ably/spaces";import"@ably/spaces/react";import"ably";import"ably/liveobjects";import"ably/react";import"@ably/spaces/dist/mjs/react";import"./purify.es-J-_UhghA.js";import"./isSymbol-BuOnvf7n.js";import"./isUndefined-DFy0_ZQT.js";function V(t){if(e(t))return t;const T=r(t);if(!function(t){switch(r(t)){case E:case _:case L:case S:case k:case w:case m:case f:case b:case x:case p:case y:case u:case g:case h:case d:case l:case c:case o:case n:case i:case s:return!0;default:return!1}}(t))return{};if(D=t,Array.isArray(D)){const e=Array.from(t);return t.length>0&&"string"==typeof t[0]&&Object.hasOwn(t,"index")&&(e.index=t.index,e.input=t.input),e}var D;if(a(t)){const e=t;return new(0,e.constructor)(e.buffer,e.byteOffset,e.length)}if("[object ArrayBuffer]"===T)return new ArrayBuffer(t.byteLength);if("[object DataView]"===T){const e=t,r=e.buffer,a=e.byteOffset,s=e.byteLength,i=new ArrayBuffer(s),n=new Uint8Array(r,a,s);return new Uint8Array(i).set(n),new DataView(i)}if("[object Boolean]"===T||"[object Number]"===T||"[object String]"===T){const e=new(0,t.constructor)(t.valueOf());return"[object String]"===T?function(t,e){const r=e.valueOf().length;for(const a in e)Object.hasOwn(e,a)&&(Number.isNaN(Number(a))||Number(a)>=r)&&(t[a]=e[a])}(e,t):G(e,t),e}if("[object Date]"===T)return new Date(Number(t));if("[object RegExp]"===T){const e=t,r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,r}if("[object Symbol]"===T)return Object(Symbol.prototype.valueOf.call(t));if("[object Map]"===T){const e=t,r=new Map;return e.forEach((t,e)=>{r.set(e,t)}),r}if("[object Set]"===T){const e=t,r=new Set;return e.forEach(t=>{r.add(t)}),r}if("[object Arguments]"===T){const e=t,r={};return G(r,e),r.length=e.length,r[Symbol.iterator]=e[Symbol.iterator],r}const $={};return function(t,e){const r=Object.getPrototypeOf(e);null!==r&&"function"==typeof e.constructor&&Object.setPrototypeOf(t,r)}($,t),G($,t),function(t,e){const r=Object.getOwnPropertySymbols(e);for(let a=0;a<r.length;a++){const s=r[a];Object.prototype.propertyIsEnumerable.call(e,s)&&(t[s]=e[s])}}($,t),$}function G(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}var J=function(){var t=T(function(t,e,r,a){for(r=r||{},a=t.length;a--;r[t[a]]=e);return r},"o"),e=[1,15],r=[1,7],a=[1,13],s=[1,14],i=[1,19],n=[1,16],o=[1,17],c=[1,18],l=[8,30],d=[8,10,21,28,29,30,31,39,43,46],h=[1,23],g=[1,24],u=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],p=[1,49],x={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:T(function(t,e,r,a,s,i,n){var o=i.length-1;switch(s){case 4:a.getLogger().debug("Rule: separator (NL) ");break;case 5:a.getLogger().debug("Rule: separator (Space) ");break;case 6:a.getLogger().debug("Rule: separator (EOF) ");break;case 7:a.getLogger().debug("Rule: hierarchy: ",i[o-1]),a.setHierarchy(i[o-1]);break;case 8:a.getLogger().debug("Stop NL ");break;case 9:a.getLogger().debug("Stop EOF ");break;case 10:a.getLogger().debug("Stop NL2 ");break;case 11:a.getLogger().debug("Stop EOF2 ");break;case 12:a.getLogger().debug("Rule: statement: ",i[o]),"number"==typeof i[o].length?this.$=i[o]:this.$=[i[o]];break;case 13:a.getLogger().debug("Rule: statement #2: ",i[o-1]),this.$=[i[o-1]].concat(i[o]);break;case 14:a.getLogger().debug("Rule: link: ",i[o],t),this.$={edgeTypeStr:i[o],label:""};break;case 15:a.getLogger().debug("Rule: LABEL link: ",i[o-3],i[o-1],i[o]),this.$={edgeTypeStr:i[o],label:i[o-1]};break;case 18:const e=parseInt(i[o]),r=a.generateId();this.$={id:r,type:"space",label:"",width:e,children:[]};break;case 23:a.getLogger().debug("Rule: (nodeStatement link node) ",i[o-2],i[o-1],i[o]," typestr: ",i[o-1].edgeTypeStr);const s=a.edgeStrToEdgeData(i[o-1].edgeTypeStr),n=a.edgeStrToEdgeStartData(i[o-1].edgeTypeStr),c=a.edgeStrToThickness(i[o-1].edgeTypeStr),l=a.edgeStrToPattern(i[o-1].edgeTypeStr);this.$=[{id:i[o-2].id,label:i[o-2].label,type:i[o-2].type,directions:i[o-2].directions},{id:i[o-2].id+"-"+i[o].id,start:i[o-2].id,end:i[o].id,label:i[o-1].label,type:"edge",thickness:c,pattern:l,directions:i[o].directions,arrowTypeEnd:s,arrowTypeStart:n},{id:i[o].id,label:i[o].label,type:a.typeStr2Type(i[o].typeStr),directions:i[o].directions}];break;case 24:a.getLogger().debug("Rule: nodeStatement (abc88 node size) ",i[o-1],i[o]),this.$={id:i[o-1].id,label:i[o-1].label,type:a.typeStr2Type(i[o-1].typeStr),directions:i[o-1].directions,widthInColumns:parseInt(i[o],10)};break;case 25:a.getLogger().debug("Rule: nodeStatement (node) ",i[o]),this.$={id:i[o].id,label:i[o].label,type:a.typeStr2Type(i[o].typeStr),directions:i[o].directions,widthInColumns:1};break;case 26:a.getLogger().debug("APA123",this?this:"na"),a.getLogger().debug("COLUMNS: ",i[o]),this.$={type:"column-setting",columns:"auto"===i[o]?-1:parseInt(i[o])};break;case 27:a.getLogger().debug("Rule: id-block statement : ",i[o-2],i[o-1]),a.generateId(),this.$={...i[o-2],type:"composite",children:i[o-1]};break;case 28:a.getLogger().debug("Rule: blockStatement : ",i[o-2],i[o-1],i[o]);const d=a.generateId();this.$={id:d,type:"composite",label:"",children:i[o-1]};break;case 29:a.getLogger().debug("Rule: node (NODE_ID separator): ",i[o]),this.$={id:i[o]};break;case 30:a.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",i[o-1],i[o]),this.$={id:i[o-1],label:i[o].label,typeStr:i[o].typeStr,directions:i[o].directions};break;case 31:a.getLogger().debug("Rule: dirList: ",i[o]),this.$=[i[o]];break;case 32:a.getLogger().debug("Rule: dirList: ",i[o-1],i[o]),this.$=[i[o-1]].concat(i[o]);break;case 33:a.getLogger().debug("Rule: nodeShapeNLabel: ",i[o-2],i[o-1],i[o]),this.$={typeStr:i[o-2]+i[o],label:i[o-1]};break;case 34:a.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",i[o-3],i[o-2]," #3:",i[o-1],i[o]),this.$={typeStr:i[o-3]+i[o],label:i[o-2],directions:i[o-1]};break;case 35:case 36:this.$={type:"classDef",id:i[o-1].trim(),css:i[o].trim()};break;case 37:this.$={type:"applyClass",id:i[o-1].trim(),styleClass:i[o].trim()};break;case 38:this.$={type:"applyStyles",id:i[o-1].trim(),stylesStr:i[o].trim()}}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:s,31:i,39:n,43:o,46:c},{8:[1,20]},t(l,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:a,29:s,31:i,39:n,43:o,46:c}),t(d,[2,16],{14:22,15:h,16:g}),t(d,[2,17]),t(d,[2,18]),t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),t(d,[2,22]),t(u,[2,25],{27:[1,25]}),t(d,[2,26]),{19:26,26:12,31:i},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:s,31:i,39:n,43:o,46:c},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(l,[2,13]),{26:35,31:i},{31:[2,14]},{17:[1,36]},t(u,[2,24]),{10:e,11:37,13:4,14:22,15:h,16:g,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:s,31:i,39:n,43:o,46:c},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(y,[2,30]),{18:[1,43]},{18:[1,44]},t(u,[2,23]),{18:[1,45]},{30:[1,46]},t(d,[2,28]),t(d,[2,35]),t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),{36:[1,47]},{33:48,34:p},{15:[1,50]},t(d,[2,27]),t(y,[2,33]),{38:[1,51]},{33:52,34:p,38:[2,31]},{31:[2,15]},t(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:T(function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)},"parseError"),parse:T(function(t){var e=this,r=[0],a=[],s=[null],i=[],n=this.table,o="",c=0,l=0,d=i.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var u in this.yy)Object.prototype.hasOwnProperty.call(this.yy,u)&&(g.yy[u]=this.yy[u]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var y=h.yylloc;i.push(y);var p=h.options&&h.options.ranges;function x(){var t;return"number"!=typeof(t=a.pop()||h.lex()||1)&&(t instanceof Array&&(t=(a=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,T(function(t){r.length=r.length-2*t,s.length=s.length-t,i.length=i.length-t},"popStack"),T(x,"lex");for(var b,f,m,w,k,S,L,_,E={};;){if(f=r[r.length-1],this.defaultActions[f]?m=this.defaultActions[f]:(null==b&&(b=x()),m=n[f]&&n[f][b]),void 0===m||!m.length||!m[0]){var D="";for(k in _=[],n[f])this.terminals_[k]&&k>2&&_.push("'"+this.terminals_[k]+"'");D=h.showPosition?"Parse error on line "+(c+1)+":\n"+h.showPosition()+"\nExpecting "+_.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(c+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:y,expected:_})}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+f+", token: "+b);switch(m[0]){case 1:r.push(b),s.push(h.yytext),i.push(h.yylloc),r.push(m[1]),b=null,l=h.yyleng,o=h.yytext,c=h.yylineno,y=h.yylloc;break;case 2:if(S=this.productions_[m[1]][1],E.$=s[s.length-S],E._$={first_line:i[i.length-(S||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(S||1)].first_column,last_column:i[i.length-1].last_column},p&&(E._$.range=[i[i.length-(S||1)].range[0],i[i.length-1].range[1]]),void 0!==(w=this.performAction.apply(E,[o,l,c,g.yy,m[1],s,i].concat(d))))return w;S&&(r=r.slice(0,-1*S*2),s=s.slice(0,-1*S),i=i.slice(0,-1*S)),r.push(this.productions_[m[1]][0]),s.push(E.$),i.push(E._$),L=n[r[r.length-2]][r[r.length-1]],r.push(L);break;case 3:return!0}}return!0},"parse")},b=function(){return{EOF:1,parseError:T(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:T(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:T(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:T(function(t){var e=t.length,r=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 a=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),r.length-1&&(this.yylineno-=r.length-1);var s=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:r?(r.length===a.length?this.yylloc.first_column:0)+a[a.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(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:T(function(t){this.unput(this.match.slice(t))},"less"),pastInput:T(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:T(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:T(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:T(function(t,e){var r,a,s;if(this.options.backtrack_lexer&&(s={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&&(s.yylloc.range=this.yylloc.range.slice(0))),(a=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var i in s)this[i]=s[i];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;var t,e,r,a;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),i=0;i<s.length;i++)if((r=this._input.match(this.rules[s[i]]))&&(!e||r[0].length>e[0].length)){if(e=r,a=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,s[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[a]))&&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:T(function(){var t=this.next();return t||this.lex()},"lex"),begin:T(function(t){this.conditionStack.push(t)},"begin"),popState:T(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(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:T(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:T(function(t){this.begin(t)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:T(function(t,e,r,a){switch(r){case 0:return t.getLogger().debug("Found block-beta"),10;case 1:return t.getLogger().debug("Found id-block"),29;case 2:return t.getLogger().debug("Found block"),10;case 3:t.getLogger().debug(".",e.yytext);break;case 4:t.getLogger().debug("_",e.yytext);break;case 5:return 5;case 6:return e.yytext=-1,28;case 7:return e.yytext=e.yytext.replace(/columns\s+/,""),t.getLogger().debug("COLUMNS (LEX)",e.yytext),28;case 8:case 76:case 77:case 99:this.pushState("md_string");break;case 9:return"MD_STR";case 10:case 34:case 79:this.popState();break;case 11:this.pushState("string");break;case 12:t.getLogger().debug("LEX: POPPING STR:",e.yytext),this.popState();break;case 13:return t.getLogger().debug("LEX: STR end:",e.yytext),"STR";case 14:return e.yytext=e.yytext.replace(/space\:/,""),t.getLogger().debug("SPACE NUM (LEX)",e.yytext),21;case 15:return e.yytext="1",t.getLogger().debug("COLUMNS (LEX)",e.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:case 38:case 40:case 41:case 44:return this.popState(),t.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),t.getLogger().debug("Lex: ))"),"NODE_DEND";case 42:return this.popState(),t.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),t.getLogger().debug("Lex: -)"),"NODE_DEND";case 45:return this.popState(),t.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),t.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),t.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:case 49:return this.popState(),t.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),t.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),t.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),t.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),t.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return t.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return t.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return t.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:case 59:case 60:case 61:case 64:return t.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return t.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 62:return t.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return t.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 65:case 66:case 67:case 68:case 69:case 70:case 71:return this.pushState("NODE"),35;case 72:return t.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),t.getLogger().debug("LEX ARR START"),37;case 74:return t.getLogger().debug("Lex: NODE_ID",e.yytext),31;case 75:return t.getLogger().debug("Lex: EOF",e.yytext),8;case 78:return"NODE_DESCR";case 80:t.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:t.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return t.getLogger().debug("LEX: NODE_DESCR:",e.yytext),"NODE_DESCR";case 83:t.getLogger().debug("LEX POPPING"),this.popState();break;case 84:t.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (right): dir:",e.yytext),"DIR";case 86:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (left):",e.yytext),"DIR";case 87:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (x):",e.yytext),"DIR";case 88:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (y):",e.yytext),"DIR";case 89:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (up):",e.yytext),"DIR";case 90:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (down):",e.yytext),"DIR";case 91:return e.yytext="]>",t.getLogger().debug("Lex (ARROW_DIR end):",e.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 93:case 94:case 95:return t.getLogger().debug("Lex: LINK",e.yytext),15;case 96:case 97:case 98:return t.getLogger().debug("Lex: START_LINK",e.yytext),this.pushState("LLABEL"),16;case 100:return t.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 102:case 103:return this.popState(),t.getLogger().debug("Lex: LINK",e.yytext),15;case 104:return t.getLogger().debug("Lex: COLON",e.yytext),e.yytext=e.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}}}();function f(){this.yy={}}return x.lexer=b,T(f,"Parser"),f.prototype=x,x.Parser=f,new f}();J.parser=J;var Q=J,tt=new Map,et=[],rt=new Map,at="color",st="fill",it=O(),nt=new Map,ot="",ct=T(t=>Y.sanitizeText(t,it),"sanitizeText"),lt=T(function(t,e=""){let r=nt.get(t);r||(r={id:t,styles:[],textStyles:[]},nt.set(t,r)),null!=e&&e.split(",").forEach(t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(at).exec(t)){const t=e.replace(st,"bgFill").replace(at,st);r.textStyles.push(t)}r.styles.push(e)})},"addStyleClass"),dt=T(function(t,e=""){const r=tt.get(t);null!=e&&(r.styles=e.split(","))},"addStyle2Node"),ht=T(function(t,e){t.split(",").forEach(function(t){let r=tt.get(t);if(void 0===r){const e=t.trim();r={id:e,type:"na",children:[]},tt.set(e,r)}r.classes||(r.classes=[]),r.classes.push(e)})},"setCssClass"),gt=T((t,e)=>{const r=t.flat(),a=[],s=r.find(t=>"column-setting"===t?.type),i=s?.columns??-1;for(const t of r)if("number"==typeof i&&i>0&&"column-setting"!==t.type&&"number"==typeof t.widthInColumns&&t.widthInColumns>i&&I.warn(`Block ${t.id} width ${t.widthInColumns} exceeds configured column width ${i}`),t.label&&(t.label=ct(t.label)),"classDef"!==t.type)if("applyClass"!==t.type)if("applyStyles"!==t.type)if("column-setting"===t.type)e.columns=t.columns??-1;else if("edge"===t.type){const e=(rt.get(t.id)??0)+1;rt.set(t.id,e),t.id=e+"-"+t.id,et.push(t)}else{t.label||("composite"===t.type?t.label="":t.label=t.id);const e=tt.get(t.id);if(void 0===e?tt.set(t.id,t):("na"!==t.type&&(e.type=t.type),t.label!==t.id&&(e.label=t.label)),t.children&>(t.children,t),"space"===t.type){const e=t.width??1;for(let r=0;r<e;r++){const e=V(t);e.id=e.id+"-"+r,tt.set(e.id,e),a.push(e)}}else void 0===e&&a.push(t)}else t?.stylesStr&&dt(t.id,t?.stylesStr);else ht(t.id,t?.styleClass??"");else lt(t.id,t.css);e.children=a},"populateBlockDatabase"),ut=[],yt={id:"root",type:"composite",children:[],columns:-1},pt=T(()=>{I.debug("Clear called"),N(),yt={id:"root",type:"composite",children:[],columns:-1},tt=new Map([["root",yt]]),ut=[],nt=new Map,et=[],rt=new Map,ot=""},"clear");function xt(t){switch(I.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return I.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}function bt(t){return I.debug("typeStr2Type",t),"=="===t?"thick":"normal"}function ft(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}function mt(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}function wt(t){return t.includes("==")?"thick":"normal"}function kt(t){return t.includes(".-")?"dotted":"solid"}T(xt,"typeStr2Type"),T(bt,"edgeTypeStr2Type"),T(ft,"edgeStrToEdgeData"),T(mt,"edgeStrToEdgeStartData"),T(wt,"edgeStrToThickness"),T(kt,"edgeStrToPattern");var St=0,Lt=T(()=>(St++,"id-"+Math.random().toString(36).substr(2,12)+"-"+St),"generateId"),_t=T(t=>{yt.children=t,gt(t,yt),ut=yt.children},"setHierarchy"),Et=T(t=>{const e=tt.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),Tt=T(()=>[...tt.values()],"getBlocksFlat"),Dt=T(()=>ut||[],"getBlocks"),$t=T(()=>et,"getEdges"),vt=T(t=>tt.get(t),"getBlock"),It=T(t=>{tt.set(t.id,t)},"setBlock"),Nt=T(t=>{ot=t},"setDiagramId"),Ct=T(()=>ot,"getDiagramId"),Bt=T(()=>I,"getLogger"),Ot=T(function(){return nt},"getClasses"),Rt={getConfig:T(()=>D().block,"getConfig"),typeStr2Type:xt,edgeTypeStr2Type:bt,edgeStrToEdgeData:ft,edgeStrToEdgeStartData:mt,edgeStrToThickness:wt,edgeStrToPattern:kt,getLogger:Bt,getBlocksFlat:Tt,getBlocks:Dt,getEdges:$t,setHierarchy:_t,getBlock:vt,setBlock:It,getColumns:Et,getClasses:Ot,clear:pt,generateId:Lt,setDiagramId:Nt,getDiagramId:Ct},zt=T((t,e)=>{const r=K,a=r(t,"r"),s=r(t,"g"),i=r(t,"b");return C(a,s,i,e)},"fade"),At=T(e=>`.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,p {\n color: ${e.titleColor};\n }\n\n\n\n .label text,span,p {\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: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n /*\n * This is for backward compatibility with existing code that didn't\n * add a \`<p>\` around edge labels.\n *\n * TODO: We should probably remove this in a future release.\n */\n p {\n margin: 0;\n padding: 0;\n display: inline;\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: ${e.edgeLabelBackground};\n }\n\n .node .cluster {\n // fill: ${zt(e.mainBkg,.5)};\n fill: ${zt(e.clusterBkg,.5)};\n stroke: ${zt(e.clusterBorder,.2)};\n box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n .cluster span,p {\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 .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n ${t()}\n`,"getStyles"),Mt=T((t,e,r,a)=>{e.forEach(e=>{Pt[e](t,r,a)})},"insertMarkers"),Pt={extension:T((t,e,r)=>{I.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),composition:T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),aggregation:T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),dependency:T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),lollipop:T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),point:T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),circle:T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),cross:T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),barb:T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb")},jt=Mt,Yt=O()?.block?.padding??8;function Ft(t,e){if(0===t||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(1===t)return{px:0,py:e};return{px:e%t,py:Math.floor(e/t)}}T(Ft,"calculateBlockPosition");var Wt=T(t=>{let e=0,r=0;for(const a of t.children){const{width:t,height:s,x:i,y:n}=a.size??{width:0,height:0,x:0,y:0};if(I.debug("getMaxChildSize abc95 child:",a.id,"width:",t,"height:",s,"x:",i,"y:",n,a.type),"space"===a.type)continue;const o=t/(a.widthInColumns??1);o>e&&(e=o),s>r&&(r=s)}return{width:e,height:r}},"getMaxChildSize");function Xt(t,e,r=0,a=0){I.debug("setBlockSizes abc95 (start)",t.id,t?.size?.x,"block width =",t?.size,"siblingWidth",r),t?.size?.width||(t.size={width:r,height:a,x:0,y:0});let s=0,i=0;if(t.children?.length>0){for(const r of t.children)Xt(r,e);const n=Wt(t);s=n.width,i=n.height,I.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",s,i);for(const e of t.children)e.size&&(I.debug(`abc95 Setting size of children of ${t.id} id=${e.id} ${s} ${i} ${JSON.stringify(e.size)}`),e.size.width=s*(e.widthInColumns??1)+Yt*((e.widthInColumns??1)-1),e.size.height=i,e.size.x=0,e.size.y=0,I.debug(`abc95 updating size of ${t.id} children child:${e.id} maxWidth:${s} maxHeight:${i}`));for(const r of t.children)Xt(r,e,s,i);const o=t.columns??-1;let c=0;for(const e of t.children)c+=e.widthInColumns??1;let l=t.children.length;o>0&&o<c&&(l=o);const d=Math.ceil(c/l);let h=l*(s+Yt)+Yt,g=d*(i+Yt)+Yt;if(h<r){I.debug(`Detected to small sibling: abc95 ${t.id} siblingWidth ${r} siblingHeight ${a} width ${h}`),h=r,g=a;const e=(r-l*Yt-Yt)/l,n=(a-d*Yt-Yt)/d;I.debug("Size indata abc88",t.id,"childWidth",e,"maxWidth",s),I.debug("Size indata abc88",t.id,"childHeight",n,"maxHeight",i),I.debug("Size indata abc88 xSize",l,"padding",Yt);for(const r of t.children)r.size&&(r.size.width=e,r.size.height=n,r.size.x=0,r.size.y=0)}if(I.debug(`abc95 (finale calc) ${t.id} xSize ${l} ySize ${d} columns ${o}${t.children.length} width=${Math.max(h,t.size?.width||0)}`),h<(t?.size?.width||0)){h=t?.size?.width||0;const e=o>0?Math.min(t.children.length,o):t.children.length;if(e>0){const r=(h-e*Yt-Yt)/e;I.debug("abc95 (growing to fit) width",t.id,h,t.size?.width,r);for(const e of t.children)e.size&&(e.size.width=r)}}t.size={width:h,height:g,x:0,y:0}}I.debug("setBlockSizes abc94 (done)",t.id,t?.size?.x,t?.size?.width,t?.size?.y,t?.size?.height)}function Ht(t,e){I.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`);const r=t.columns??-1;if(I.debug("layoutBlocks columns abc95",t.id,"=>",r,t),t.children&&t.children.length>0){const e=t?.children[0]?.size?.width??0,a=t.children.length*e+(t.children.length-1)*Yt;I.debug("widthOfChildren 88",a,"posX");const s=new Map;{let e=0;for(const a of t.children){if(!a.size)continue;const{py:t}=Ft(r,e),i=s.get(t)??0;a.size.height>i&&s.set(t,a.size.height);let n=a?.widthInColumns??1;r>0&&(n=Math.min(n,r-e%r)),e+=n}}const i=new Map;{let t=0;const e=[...s.keys()].sort((t,e)=>t-e);for(const r of e)i.set(r,t),t+=(s.get(r)??0)+Yt}let n=0;I.debug("abc91 block?.size?.x",t.id,t?.size?.x);let o=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-Yt,c=0;for(const e of t.children){const a=t;if(!e.size)continue;const{width:l,height:d}=e.size,{px:h,py:g}=Ft(r,n);if(g!=c&&(c=g,o=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-Yt,I.debug("New row in layout for block",t.id," and child ",e.id,c)),I.debug(`abc89 layout blocks (child) id: ${e.id} Pos: ${n} (px, py) ${h},${g} (${a?.size?.x},${a?.size?.y}) parent: ${a.id} width: ${l}${Yt}`),a.size){const t=l/2;e.size.x=o+Yt+t,I.debug(`abc91 layout blocks (calc) px, pyid:${e.id} startingPos=X${o} new startingPosX${e.size.x} ${t} padding=${Yt} width=${l} halfWidth=${t} => x:${e.size.x} y:${e.size.y} ${e.widthInColumns} (width * (child?.w || 1)) / 2 ${l*(e?.widthInColumns??1)/2}`),o=e.size.x+t;const r=i.get(g)??0,n=s.get(g)??d;e.size.y=a.size.y-a.size.height/2+r+n/2+Yt,I.debug(`abc88 layout blocks (calc) px, pyid:${e.id}startingPosX${o}${Yt}${t}=>x:${e.size.x}y:${e.size.y}${e.widthInColumns}(width * (child?.w || 1)) / 2${l*(e?.widthInColumns??1)/2}`)}e.children&&Ht(e);let u=e?.widthInColumns??1;r>0&&(u=Math.min(u,r-n%r)),n+=u,I.debug("abc88 columnsPos",e,n)}}I.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`)}function Ut(t,{minX:e,minY:r,maxX:a,maxY:s}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&"root"!==t.id){const{x:i,y:n,width:o,height:c}=t.size;i-o/2<e&&(e=i-o/2),n-c/2<r&&(r=n-c/2),i+o/2>a&&(a=i+o/2),n+c/2>s&&(s=n+c/2)}if(t.children)for(const i of t.children)({minX:e,minY:r,maxX:a,maxY:s}=Ut(i,{minX:e,minY:r,maxX:a,maxY:s}));return{minX:e,minY:r,maxX:a,maxY:s}}function Kt(t){const e=t.getBlock("root");if(!e)return;Xt(e,t,0,0),Ht(e),I.debug("getBlocks",JSON.stringify(e,null,2));const{minX:r,minY:a,maxX:s,maxY:i}=Ut(e);return{x:r,y:a,width:s-r,height:i-a}}T(Xt,"setBlockSizes"),T(Ht,"layoutBlocks"),T(Ut,"findBounds"),T(Kt,"layout");var qt=T(async(t,e,r,a=!1,s=!1)=>{let i=e||"";"object"==typeof i&&(i=i[0]);const n=O(),o=z(n);return await A(t,i,{style:r,isTitle:a,useHtmlLabels:o,markdown:!1,isNode:s,width:Number.POSITIVE_INFINITY},n)},"createLabel"),Zt=T((t,e,r,a,s)=>{e.arrowTypeStart&&Gt(t,"start",e.arrowTypeStart,r,a,s),e.arrowTypeEnd&&Gt(t,"end",e.arrowTypeEnd,r,a,s)},"addEdgeMarkers"),Vt={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Gt=T((t,e,r,a,s,i)=>{const n=Vt[r];if(!n)return void I.warn(`Unknown arrow type: ${r}`);const o="start"===e?"Start":"End";t.attr(`marker-${e}`,`url(${a}#${s}_${i}-${n}${o})`)},"addEdgeMarker"),Jt={},Qt={},te=T(async(t,e)=>{const r=O(),a=z(r),s=t.insert("g").attr("class","edgeLabel"),i=s.insert("g").attr("class","label"),n="markdown"===e.labelType,o=await A(t,e.label,{style:e.labelStyle,useHtmlLabels:a,addSvgBackground:n,isNode:!1,markdown:n,width:n?void 0:Number.POSITIVE_INFINITY},r);i.node().appendChild(o);let c,l=o.getBBox(),d=l;if(a){const t=o.children[0],e=$(o);l=t.getBoundingClientRect(),d=l,e.attr("width",l.width),e.attr("height",l.height)}else{const t=$(o).select("text").node();t&&"function"==typeof t.getBBox&&(d=t.getBBox())}if(i.attr("transform",M(d,a)),Jt[e.id]=s,e.width=l.width,e.height=l.height,e.startLabelLeft){const r=t.insert("g").attr("class","edgeTerminals"),s=r.insert("g").attr("class","inner"),i=await qt(s,e.startLabelLeft,e.labelStyle);c=i;let n=i.getBBox();if(a){const t=i.children[0],e=$(i);n=t.getBoundingClientRect(),e.attr("width",n.width),e.attr("height",n.height)}s.attr("transform",M(n,a)),Qt[e.id]||(Qt[e.id]={}),Qt[e.id].startLeft=r,ee(c,e.startLabelLeft)}if(e.startLabelRight){const r=t.insert("g").attr("class","edgeTerminals"),s=r.insert("g").attr("class","inner"),i=await qt(s,e.startLabelRight,e.labelStyle);c=i;let n=i.getBBox();if(a){const t=i.children[0],e=$(i);n=t.getBoundingClientRect(),e.attr("width",n.width),e.attr("height",n.height)}s.attr("transform",M(n,a)),Qt[e.id]||(Qt[e.id]={}),Qt[e.id].startRight=r,ee(c,e.startLabelRight)}if(e.endLabelLeft){const r=t.insert("g").attr("class","edgeTerminals"),s=r.insert("g").attr("class","inner"),i=await qt(r,e.endLabelLeft,e.labelStyle);c=i;let n=i.getBBox();if(a){const t=i.children[0],e=$(i);n=t.getBoundingClientRect(),e.attr("width",n.width),e.attr("height",n.height)}s.attr("transform",M(n,a)),Qt[e.id]||(Qt[e.id]={}),Qt[e.id].endLeft=r,ee(c,e.endLabelLeft)}if(e.endLabelRight){const r=t.insert("g").attr("class","edgeTerminals"),s=r.insert("g").attr("class","inner"),i=await qt(r,e.endLabelRight,e.labelStyle);c=i;let n=i.getBBox();if(a){const t=i.children[0],e=$(i);n=t.getBoundingClientRect(),e.attr("width",n.width),e.attr("height",n.height)}s.attr("transform",M(n,a)),Qt[e.id]||(Qt[e.id]={}),Qt[e.id].endRight=r,ee(c,e.endLabelRight)}return o},"insertEdgeLabel");function ee(t,e){z(O())&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}T(ee,"setTerminalWidth");var re=T((t,e)=>{I.debug("Moving label abc88 ",t.id,t.label,Jt[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const a=O(),{subGraphTitleTotalMargin:s}=P(a);if(t.label){const a=Jt[t.id];let i=t.x,n=t.y;if(r){const a=j.calcLabelPosition(r);I.debug("Moving label "+t.label+" from (",i,",",n,") to (",a.x,",",a.y,") abc88"),e.updatedPath&&(i=a.x,n=a.y)}a.attr("transform",`translate(${i}, ${n+s/2})`)}if(t.startLabelLeft){const e=Qt[t.id].startLeft;let a=t.x,s=t.y;if(r){const e=j.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);a=e.x,s=e.y}e.attr("transform",`translate(${a}, ${s})`)}if(t.startLabelRight){const e=Qt[t.id].startRight;let a=t.x,s=t.y;if(r){const e=j.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);a=e.x,s=e.y}e.attr("transform",`translate(${a}, ${s})`)}if(t.endLabelLeft){const e=Qt[t.id].endLeft;let a=t.x,s=t.y;if(r){const e=j.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);a=e.x,s=e.y}e.attr("transform",`translate(${a}, ${s})`)}if(t.endLabelRight){const e=Qt[t.id].endRight;let a=t.x,s=t.y;if(r){const e=j.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);a=e.x,s=e.y}e.attr("transform",`translate(${a}, ${s})`)}},"positionEdgeLabel"),ae=T((t,e)=>{const r=t.x,a=t.y,s=Math.abs(e.x-r),i=Math.abs(e.y-a),n=t.width/2,o=t.height/2;return s>=n||i>=o},"outsideNode"),se=T((t,e,r)=>{I.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(r)}\n node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const a=t.x,s=t.y,i=Math.abs(a-r.x),n=t.width/2;let o=r.x<e.x?n-i:n+i;const c=t.height/2,l=Math.abs(e.y-r.y),d=Math.abs(e.x-r.x);if(Math.abs(s-e.y)*n>Math.abs(a-e.x)*c){let t=r.y<e.y?e.y-c-s:s-c-e.y;o=d*t/l;const a={x:r.x<e.x?r.x+o:r.x-d+o,y:r.y<e.y?r.y+l-t:r.y-l+t};return 0===o&&(a.x=e.x,a.y=e.y),0===d&&(a.x=e.x),0===l&&(a.y=e.y),I.debug(`abc89 topp/bott calc, Q ${l}, q ${t}, R ${d}, r ${o}`,a),a}{o=r.x<e.x?e.x-n-a:a-n-e.x;let t=l*o/d,s=r.x<e.x?r.x+d-o:r.x-d+o,i=r.y<e.y?r.y+t:r.y-t;return I.debug(`sides calc abc89, Q ${l}, q ${t}, R ${d}, r ${o}`,{_x:s,_y:i}),0===o&&(s=e.x,i=e.y),0===d&&(s=e.x),0===l&&(i=e.y),{x:s,y:i}}},"intersection"),ie=T((t,e)=>{I.debug("abc88 cutPathAtIntersect",t,e);let r=[],a=t[0],s=!1;return t.forEach(t=>{if(ae(e,t)||s)a=t,s||r.push(t);else{const i=se(e,a,t);let n=!1;r.forEach(t=>{n=n||t.x===i.x&&t.y===i.y}),r.some(t=>t.x===i.x&&t.y===i.y)||r.push(i),s=!0}}),r},"cutPathAtIntersect"),ne=T(function(t,e,r,a,s,i,n){let o=r.points;I.debug("abc88 InsertEdge: edge=",r,"e=",e);let c=!1;const l=i.node(e.v);var d=i.node(e.w);d?.intersect&&l?.intersect&&(o=o.slice(1,r.points.length-1),o.unshift(l.intersect(o[0])),o.push(d.intersect(o[o.length-1]))),r.toCluster&&(I.debug("to cluster abc88",a[r.toCluster]),o=ie(r.points,a[r.toCluster].node),c=!0),r.fromCluster&&(I.debug("from cluster abc88",a[r.fromCluster]),o=ie(o.reverse(),a[r.fromCluster].node).reverse(),c=!0);const h=o.filter(t=>!Number.isNaN(t.y));let g=Z;!r.curve||"graph"!==s&&"flowchart"!==s||(g=r.curve);const{x:u,y:y}=B(r),p=q().x(u).y(y).curve(g);let x;switch(r.thickness){case"normal":x="edge-thickness-normal";break;case"thick":case"invisible":x="edge-thickness-thick";break;default:x=""}switch(r.pattern){case"solid":x+=" edge-pattern-solid";break;case"dotted":x+=" edge-pattern-dotted";break;case"dashed":x+=" edge-pattern-dashed"}const b=t.append("path").attr("d",p(h)).attr("id",r.id).attr("class"," "+x+(r.classes?" "+r.classes:"")).attr("style",r.style);let f="";(O().flowchart.arrowMarkerAbsolute||O().state.arrowMarkerAbsolute)&&(f=R(!0)),Zt(b,r,f,n,s);let m={};return c&&(m.updatedPath=o),m.originalPath=r.points,m},"insertEdge"),oe=T(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r)}return e},"expandAndDeduplicateDirections"),ce=T((t,e,r,a)=>{const s=oe(t),i=e.height+2*r.padding,n=i/2,o=a??e.width+2*n+r.padding,c=r.padding/2;return s.has("right")&&s.has("left")&&s.has("up")&&s.has("down")?[{x:0,y:0},{x:n,y:0},{x:o/2,y:2*c},{x:o-n,y:0},{x:o,y:0},{x:o,y:-i/3},{x:o+2*c,y:-i/2},{x:o,y:-2*i/3},{x:o,y:-i},{x:o-n,y:-i},{x:o/2,y:-i-2*c},{x:n,y:-i},{x:0,y:-i},{x:0,y:-2*i/3},{x:-2*c,y:-i/2},{x:0,y:-i/3}]:s.has("right")&&s.has("left")&&s.has("up")?[{x:n,y:0},{x:o-n,y:0},{x:o,y:-i/2},{x:o-n,y:-i},{x:n,y:-i},{x:0,y:-i/2}]:s.has("right")&&s.has("left")&&s.has("down")?[{x:0,y:0},{x:n,y:-i},{x:o-n,y:-i},{x:o,y:0}]:s.has("right")&&s.has("up")&&s.has("down")?[{x:0,y:0},{x:o,y:-n},{x:o,y:-i+n},{x:0,y:-i}]:s.has("left")&&s.has("up")&&s.has("down")?[{x:o,y:0},{x:0,y:-n},{x:0,y:-i+n},{x:o,y:-i}]:s.has("right")&&s.has("left")?[{x:n,y:0},{x:n,y:-c},{x:o-n,y:-c},{x:o-n,y:0},{x:o,y:-i/2},{x:o-n,y:-i},{x:o-n,y:-i+c},{x:n,y:-i+c},{x:n,y:-i},{x:0,y:-i/2}]:s.has("up")&&s.has("down")?[{x:o/2,y:0},{x:0,y:-c},{x:n,y:-c},{x:n,y:-i+c},{x:0,y:-i+c},{x:o/2,y:-i},{x:o,y:-i+c},{x:o-n,y:-i+c},{x:o-n,y:-c},{x:o,y:-c}]:s.has("right")&&s.has("up")?[{x:0,y:0},{x:o,y:-n},{x:0,y:-i}]:s.has("right")&&s.has("down")?[{x:0,y:0},{x:o,y:0},{x:0,y:-i}]:s.has("left")&&s.has("up")?[{x:o,y:0},{x:0,y:-n},{x:o,y:-i}]:s.has("left")&&s.has("down")?[{x:o,y:0},{x:0,y:0},{x:o,y:-i}]:s.has("right")?[{x:n,y:-c},{x:n,y:-c},{x:o-n,y:-c},{x:o-n,y:0},{x:o,y:-i/2},{x:o-n,y:-i},{x:o-n,y:-i+c},{x:n,y:-i+c},{x:n,y:-i+c}]:s.has("left")?[{x:n,y:0},{x:n,y:-c},{x:o-n,y:-c},{x:o-n,y:-i+c},{x:n,y:-i+c},{x:n,y:-i},{x:0,y:-i/2}]:s.has("up")?[{x:n,y:-c},{x:n,y:-i+c},{x:0,y:-i+c},{x:o/2,y:-i},{x:o,y:-i+c},{x:o-n,y:-i+c},{x:o-n,y:-c}]:s.has("down")?[{x:o/2,y:0},{x:0,y:-c},{x:n,y:-c},{x:n,y:-i+c},{x:o-n,y:-i+c},{x:o-n,y:-c},{x:o,y:-c}]:[{x:0,y:0}]},"getArrowPoints");function le(t,e){return t.intersect(e)}T(le,"intersectNode");var de=le;function he(t,e,r,a){var s=t.x,i=t.y,n=s-a.x,o=i-a.y,c=Math.sqrt(e*e*o*o+r*r*n*n),l=Math.abs(e*r*n/c);a.x<s&&(l=-l);var d=Math.abs(e*r*o/c);return a.y<i&&(d=-d),{x:s+l,y:i+d}}T(he,"intersectEllipse");var ge=he;function ue(t,e,r){return ge(t,e,e,r)}T(ue,"intersectCircle");var ye=ue;function pe(t,e,r,a){var s,i,n,o,c,l,d,h,g,u,y,p,x;if(s=e.y-t.y,n=t.x-e.x,c=e.x*t.y-t.x*e.y,g=s*r.x+n*r.y+c,u=s*a.x+n*a.y+c,!(0!==g&&0!==u&&xe(g,u)||(i=a.y-r.y,o=r.x-a.x,l=a.x*r.y-r.x*a.y,d=i*t.x+o*t.y+l,h=i*e.x+o*e.y+l,0!==d&&0!==h&&xe(d,h)||0===(y=s*o-i*n))))return p=Math.abs(y/2),{x:(x=n*l-o*c)<0?(x-p)/y:(x+p)/y,y:(x=i*c-s*l)<0?(x-p)/y:(x+p)/y}}function xe(t,e){return t*e>0}T(pe,"intersectLine"),T(xe,"sameSign");var be=pe,fe=me;function me(t,e,r){var a=t.x,s=t.y,i=[],n=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach(function(t){n=Math.min(n,t.x),o=Math.min(o,t.y)}):(n=Math.min(n,e.x),o=Math.min(o,e.y));for(var c=a-t.width/2-n,l=s-t.height/2-o,d=0;d<e.length;d++){var h=e[d],g=e[d<e.length-1?d+1:0],u=be(t,r,{x:c+h.x,y:l+h.y},{x:c+g.x,y:l+g.y});u&&i.push(u)}return i.length?(i.length>1&&i.sort(function(t,e){var a=t.x-r.x,s=t.y-r.y,i=Math.sqrt(a*a+s*s),n=e.x-r.x,o=e.y-r.y,c=Math.sqrt(n*n+o*o);return i<c?-1:i===c?0:1}),i[0]):t}T(me,"intersectPolygon");var we={node:de,circle:ye,ellipse:ge,polygon:fe,rect:T((t,e)=>{var r,a,s=t.x,i=t.y,n=e.x-s,o=e.y-i,c=t.width/2,l=t.height/2;return Math.abs(o)*c>Math.abs(n)*l?(o<0&&(l=-l),r=0===o?0:l*n/o,a=l):(n<0&&(c=-c),r=c,a=0===n?0:c*o/n),{x:s+r,y:i+a}},"intersectRect")},ke=T(async(t,e,r,a)=>{const s=O();let i;const n=e.useHtmlLabels||z(s);i=r||"node default";const o=t.insert("g").attr("class",i).attr("id",e.domId||e.id),c=o.insert("g").attr("class","label").attr("style",e.labelStyle);let l,d;l=void 0===e.labelText?"":"string"==typeof e.labelText?e.labelText:e.labelText[0],d="markdown"===e.labelType?A(c,W(X(l),s),{useHtmlLabels:n,width:e.width||s.flowchart.wrappingWidth,classes:"markdown-node-label"},s):await qt(c,W(X(l),s),e.labelStyle,!1,a);let h=d.getBBox();const g=e.padding/2;if(z(s)){const t=d.children[0],e=$(d);await H(t,l),h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}return n?c.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"):c.attr("transform","translate(0, "+-h.height/2+")"),e.centerLabel&&c.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:o,bbox:h,halfPadding:g,label:c}},"labelHelper"),Se=T((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function Le(t,e,r,a){return t.insert("polygon",":first-child").attr("points",a.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}T(Le,"insertPolygonShape");var _e=T(async(t,e)=>{e.useHtmlLabels||z(O())||(e.centerLabel=!0);const{shapeSvg:r,bbox:a,halfPadding:s}=await ke(t,e,"node "+e.classes,!0);I.info("Classes = ",e.classes);const i=r.insert("rect",":first-child");return i.attr("rx",e.rx).attr("ry",e.ry).attr("x",-a.width/2-s).attr("y",-a.height/2-s).attr("width",a.width+e.padding).attr("height",a.height+e.padding),Se(e,i),e.intersect=function(t){return we.rect(e,t)},r},"note"),Ee=T(t=>t?" "+t:"","formatClass"),Te=T((t,e)=>`${e||"node default"}${Ee(t.classes)} ${Ee(t.class)}`,"getClassesFromNode"),De=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e,void 0),!0),s=a.width+e.padding+(a.height+e.padding),i=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];I.info("Question main (Circle)");const n=Le(r,s,s,i);return n.attr("style",e.style),Se(e,n),e.intersect=function(t){return I.warn("Intersect called"),we.polygon(e,i,t)},r},"question"),$e=T((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}];return r.insert("polygon",":first-child").attr("points",a.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(t){return we.circle(e,14,t)},r},"choice"),ve=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e,void 0),!0),s=e.positioned?e.height:a.height+e.padding,i=s/4,n=e.positioned?e.width:a.width+2*i+e.padding,o=[{x:i,y:0},{x:n-i,y:0},{x:n,y:-s/2},{x:n-i,y:-s},{x:i,y:-s},{x:0,y:-s/2}],c=Le(r,n,s,o);return c.attr("style",e.style),Se(e,c),e.intersect=function(t){return we.polygon(e,o,t)},r},"hexagon"),Ie=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,void 0,!0),s=a.height+2*e.padding,i=s/2,n=a.width+2*i+e.padding,o=e.positioned&&(e.widthInColumns??1)>1&&e.width>n?e.width:n,c=ce(e.directions,a,e,o),l=Le(r,o,s,c);return l.attr("style",e.style),Se(e,l),e.intersect=function(t){return we.polygon(e,c,t)},r},"block_arrow"),Ne=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e,void 0),!0),s=a.width+e.padding,i=a.height+e.padding,n=[{x:-i/2,y:0},{x:s,y:0},{x:s,y:-i},{x:-i/2,y:-i},{x:0,y:-i/2}];return Le(r,s,i,n).attr("style",e.style),e.width=s+i,e.height=i,e.intersect=function(t){return we.polygon(e,n,t)},r},"rect_left_inv_arrow"),Ce=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e),!0),s=a.width+e.padding,i=a.height+e.padding,n=[{x:-2*i/6,y:0},{x:s-i/6,y:0},{x:s+2*i/6,y:-i},{x:i/6,y:-i}],o=Le(r,s,i,n);return o.attr("style",e.style),Se(e,o),e.intersect=function(t){return we.polygon(e,n,t)},r},"lean_right"),Be=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e,void 0),!0),s=a.width+e.padding,i=a.height+e.padding,n=[{x:2*i/6,y:0},{x:s+i/6,y:0},{x:s-2*i/6,y:-i},{x:-i/6,y:-i}],o=Le(r,s,i,n);return o.attr("style",e.style),Se(e,o),e.intersect=function(t){return we.polygon(e,n,t)},r},"lean_left"),Oe=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e,void 0),!0),s=a.width+e.padding,i=a.height+e.padding,n=[{x:-2*i/6,y:0},{x:s+2*i/6,y:0},{x:s-i/6,y:-i},{x:i/6,y:-i}],o=Le(r,s,i,n);return o.attr("style",e.style),Se(e,o),e.intersect=function(t){return we.polygon(e,n,t)},r},"trapezoid"),Re=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e,void 0),!0),s=a.width+e.padding,i=a.height+e.padding,n=[{x:i/6,y:0},{x:s-i/6,y:0},{x:s+2*i/6,y:-i},{x:-2*i/6,y:-i}],o=Le(r,s,i,n);return o.attr("style",e.style),Se(e,o),e.intersect=function(t){return we.polygon(e,n,t)},r},"inv_trapezoid"),ze=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e,void 0),!0),s=a.width+e.padding,i=a.height+e.padding,n=[{x:0,y:0},{x:s+i/2,y:0},{x:s,y:-i/2},{x:s+i/2,y:-i},{x:0,y:-i}],o=Le(r,s,i,n);return o.attr("style",e.style),Se(e,o),e.intersect=function(t){return we.polygon(e,n,t)},r},"rect_right_inv_arrow"),Ae=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e,void 0),!0),s=a.width+e.padding,i=s/2,n=i/(2.5+s/50),o=a.height+n+e.padding,c="M 0,"+n+" a "+i+","+n+" 0,0,0 "+s+" 0 a "+i+","+n+" 0,0,0 "+-s+" 0 l 0,"+o+" a "+i+","+n+" 0,0,0 "+s+" 0 l 0,"+-o,l=r.attr("label-offset-y",n).insert("path",":first-child").attr("style",e.style).attr("d",c).attr("transform","translate("+-s/2+","+-(o/2+n)+")");return Se(e,l),e.intersect=function(t){const r=we.rect(e,t),a=r.x-e.x;if(0!=i&&(Math.abs(a)<e.width/2||Math.abs(a)==e.width/2&&Math.abs(r.y-e.y)>e.height/2-n)){let s=n*n*(1-a*a/(i*i));0!=s&&(s=Math.sqrt(s)),s=n-s,t.y-e.y>0&&(s=-s),r.y+=s}return r},r},"cylinder"),Me=T(async(t,e)=>{const{shapeSvg:r,bbox:a,halfPadding:s}=await ke(t,e,"node "+e.classes+" "+e.class,!0),i=r.insert("rect",":first-child"),n=e.positioned?e.width:a.width+e.padding,o=e.positioned?e.height:a.height+e.padding,c=e.positioned?-n/2:-a.width/2-s,l=e.positioned?-o/2:-a.height/2-s;if(i.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",c).attr("y",l).attr("width",n).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(Ye(i,e.props.borders,n,o),t.delete("borders")),t.forEach(t=>{I.warn(`Unknown node property ${t}`)})}return Se(e,i),e.intersect=function(t){return we.rect(e,t)},r},"rect"),Pe=T(async(t,e)=>{const{shapeSvg:r,bbox:a,halfPadding:s}=await ke(t,e,"node "+e.classes,!0),i=r.insert("rect",":first-child"),n=e.positioned?e.width:a.width+e.padding,o=e.positioned?e.height:a.height+e.padding,c=e.positioned?-n/2:-a.width/2-s,l=e.positioned?-o/2:-a.height/2-s;if(i.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",c).attr("y",l).attr("width",n).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(Ye(i,e.props.borders,n,o),t.delete("borders")),t.forEach(t=>{I.warn(`Unknown node property ${t}`)})}return Se(e,i),e.intersect=function(t){return we.rect(e,t)},r},"composite"),je=T(async(t,e)=>{const{shapeSvg:r}=await ke(t,e,"label",!0);I.trace("Classes = ",e.class);const a=r.insert("rect",":first-child");if(a.attr("width",0).attr("height",0),r.attr("class","label edgeLabel"),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(Ye(a,e.props.borders,0,0),t.delete("borders")),t.forEach(t=>{I.warn(`Unknown node property ${t}`)})}return Se(e,a),e.intersect=function(t){return we.rect(e,t)},r},"labelRect");function Ye(t,e,r,a){const s=[],i=T(t=>{s.push(t,0)},"addBorder"),n=T(t=>{s.push(0,t)},"skipBorder");e.includes("t")?(I.debug("add top border"),i(r)):n(r),e.includes("r")?(I.debug("add right border"),i(a)):n(a),e.includes("b")?(I.debug("add bottom border"),i(r)):n(r),e.includes("l")?(I.debug("add left border"),i(a)):n(a),t.attr("stroke-dasharray",s.join(" "))}T(Ye,"applyNodePropertyBorders");var Fe=T(async(t,e)=>{let r;r=e.classes?"node "+e.classes:"node default";const a=t.insert("g").attr("class",r).attr("id",e.domId||e.id),s=a.insert("rect",":first-child"),i=a.insert("line"),n=a.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let c="";c="object"==typeof o?o[0]:o,I.info("Label text abc79",c,o,"object"==typeof o);const l=await qt(n,c,e.labelStyle,!0,!0);let d={width:0,height:0};if(z(O())){const t=l.children[0],e=$(l);d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}I.info("Text 2",o);const h=o.slice(1,o.length);let g=l.getBBox();const u=await qt(n,h.join?h.join("<br/>"):h,e.labelStyle,!0,!0);if(z(O())){const t=u.children[0],e=$(u);d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}const y=e.padding/2;return $(u).attr("transform","translate( "+(d.width>g.width?0:(g.width-d.width)/2)+", "+(g.height+y+5)+")"),$(l).attr("transform","translate( "+(d.width<g.width?0:-(g.width-d.width)/2)+", 0)"),d=n.node().getBBox(),n.attr("transform","translate("+-d.width/2+", "+(-d.height/2-y+3)+")"),s.attr("class","outer title-state").attr("x",-d.width/2-y).attr("y",-d.height/2-y).attr("width",d.width+e.padding).attr("height",d.height+e.padding),i.attr("class","divider").attr("x1",-d.width/2-y).attr("x2",d.width/2+y).attr("y1",-d.height/2-y+g.height+y).attr("y2",-d.height/2-y+g.height+y),Se(e,s),e.intersect=function(t){return we.rect(e,t)},a},"rectWithTitle"),We=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e,void 0),!0),s=a.height+e.padding,i=a.width+s/4+e.padding,n=r.insert("rect",":first-child").attr("style",e.style).attr("rx",s/2).attr("ry",s/2).attr("x",-i/2).attr("y",-s/2).attr("width",i).attr("height",s);return Se(e,n),e.intersect=function(t){return we.rect(e,t)},r},"stadium"),Xe=T(async(t,e)=>{const{shapeSvg:r,bbox:a,halfPadding:s}=await ke(t,e,Te(e,void 0),!0),i=r.insert("circle",":first-child");return i.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+s).attr("width",a.width+e.padding).attr("height",a.height+e.padding),I.info("Circle main"),Se(e,i),e.intersect=function(t){return I.info("Circle intersect",e,a.width/2+s,t),we.circle(e,a.width/2+s,t)},r},"circle"),He=T(async(t,e)=>{const{shapeSvg:r,bbox:a,halfPadding:s}=await ke(t,e,Te(e,void 0),!0),i=r.insert("g",":first-child"),n=i.insert("circle"),o=i.insert("circle");return i.attr("class",e.class),n.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+s+5).attr("width",a.width+e.padding+10).attr("height",a.height+e.padding+10),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+s).attr("width",a.width+e.padding).attr("height",a.height+e.padding),I.info("DoubleCircle main"),Se(e,n),e.intersect=function(t){return I.info("DoubleCircle intersect",e,a.width/2+s+5,t),we.circle(e,a.width/2+s+5,t)},r},"doublecircle"),Ue=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e,void 0),!0),s=a.width+e.padding,i=a.height+e.padding,n=[{x:0,y:0},{x:s,y:0},{x:s,y:-i},{x:0,y:-i},{x:0,y:0},{x:-8,y:0},{x:s+8,y:0},{x:s+8,y:-i},{x:-8,y:-i},{x:-8,y:0}],o=Le(r,s,i,n);return o.attr("style",e.style),Se(e,o),e.intersect=function(t){return we.polygon(e,n,t)},r},"subroutine"),Ke=T((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a=r.insert("circle",":first-child");return a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),Se(e,a),e.intersect=function(t){return we.circle(e,7,t)},r},"start"),qe=T((t,e,r)=>{const a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let s=70,i=10;"LR"===r&&(s=10,i=70);const n=a.append("rect").attr("x",-1*s/2).attr("y",-1*i/2).attr("width",s).attr("height",i).attr("class","fork-join");return Se(e,n),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return we.rect(e,t)},a},"forkJoin"),Ze={rhombus:De,composite:Pe,question:De,rect:Me,labelRect:je,rectWithTitle:Fe,choice:$e,circle:Xe,doublecircle:He,stadium:We,hexagon:ve,block_arrow:Ie,rect_left_inv_arrow:Ne,lean_right:Ce,lean_left:Be,trapezoid:Oe,inv_trapezoid:Re,rect_right_inv_arrow:ze,cylinder:Ae,start:Ke,end:T((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a=r.insert("circle",":first-child"),s=r.insert("circle",":first-child");return s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),a.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),Se(e,s),e.intersect=function(t){return we.circle(e,7,t)},r},"end"),note:_e,subroutine:Ue,fork:qe,join:qe,class_box:T(async(t,e)=>{const r=e.padding/2;let a;a=e.classes?"node "+e.classes:"node default";const s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),i=s.insert("rect",":first-child"),n=s.insert("line"),o=s.insert("line");let c=0,l=4;const d=s.insert("g").attr("class","label");let h=0;const g=e.classData.annotations?.[0],u=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",y=await qt(d,u,e.labelStyle,!0,!0);let p=y.getBBox();if(z(O())){const t=y.children[0],e=$(y);p=t.getBoundingClientRect(),e.attr("width",p.width),e.attr("height",p.height)}e.classData.annotations[0]&&(l+=p.height+4,c+=p.width);let x=e.classData.label;void 0!==e.classData.type&&""!==e.classData.type&&(z(O())?x+="<"+e.classData.type+">":x+="<"+e.classData.type+">");const b=await qt(d,x,e.labelStyle,!0,!0);$(b).attr("class","classTitle");let f=b.getBBox();if(z(O())){const t=b.children[0],e=$(b);f=t.getBoundingClientRect(),e.attr("width",f.width),e.attr("height",f.height)}l+=f.height+4,f.width>c&&(c=f.width);const m=[];e.classData.members.forEach(async t=>{const r=t.getDisplayDetails();let a=r.displayText;z(O())&&(a=a.replace(/</g,"<").replace(/>/g,">"));const s=await qt(d,a,r.cssStyle?r.cssStyle:e.labelStyle,!0,!0);let i=s.getBBox();if(z(O())){const t=s.children[0],e=$(s);i=t.getBoundingClientRect(),e.attr("width",i.width),e.attr("height",i.height)}i.width>c&&(c=i.width),l+=i.height+4,m.push(s)}),l+=8;const w=[];if(e.classData.methods.forEach(async t=>{const r=t.getDisplayDetails();let a=r.displayText;z(O())&&(a=a.replace(/</g,"<").replace(/>/g,">"));const s=await qt(d,a,r.cssStyle?r.cssStyle:e.labelStyle,!0,!0);let i=s.getBBox();if(z(O())){const t=s.children[0],e=$(s);i=t.getBoundingClientRect(),e.attr("width",i.width),e.attr("height",i.height)}i.width>c&&(c=i.width),l+=i.height+4,w.push(s)}),l+=8,g){let t=(c-p.width)/2;$(y).attr("transform","translate( "+(-1*c/2+t)+", "+-1*l/2+")"),h=p.height+4}let k=(c-f.width)/2;return $(b).attr("transform","translate( "+(-1*c/2+k)+", "+(-1*l/2+h)+")"),h+=f.height+4,n.attr("class","divider").attr("x1",-c/2-r).attr("x2",c/2+r).attr("y1",-l/2-r+8+h).attr("y2",-l/2-r+8+h),h+=8,m.forEach(t=>{$(t).attr("transform","translate( "+-c/2+", "+(-1*l/2+h+4)+")");const e=t?.getBBox();h+=(e?.height??0)+4}),h+=8,o.attr("class","divider").attr("x1",-c/2-r).attr("x2",c/2+r).attr("y1",-l/2-r+8+h).attr("y2",-l/2-r+8+h),h+=8,w.forEach(t=>{$(t).attr("transform","translate( "+-c/2+", "+(-1*l/2+h)+")");const e=t?.getBBox();h+=(e?.height??0)+4}),i.attr("style",e.style).attr("class","outer title-state").attr("x",-c/2-r).attr("y",-l/2-r).attr("width",c+e.padding).attr("height",l+e.padding),Se(e,i),e.intersect=function(t){return we.rect(e,t)},s},"class_box")},Ve={},Ge=T(async(t,e,r)=>{let a,s;if(e.link){let i;"sandbox"===O().securityLevel?i="_top":e.linkTarget&&(i=e.linkTarget||"_blank"),a=t.insert("svg:a").attr("xlink:href",e.link).attr("target",i),s=await Ze[e.shape](a,e,r)}else s=await Ze[e.shape](t,e,r),a=s;return e.tooltip&&s.attr("title",e.tooltip),e.class&&s.attr("class","node default "+e.class),Ve[e.id]=a,e.haveCallback&&Ve[e.id].attr("class",Ve[e.id].attr("class")+" clickable"),a},"insertNode"),Je=T(t=>{const e=Ve[t.id];I.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r},"positionNode");function Qe(t,e,r=!1){const a=t;let s="default";(a?.classes?.length||0)>0&&(s=(a?.classes??[]).join(" ")),s+=" flowchart-label";let i,n=0,o="";switch(a.type){case"round":n=5,o="rect";break;case"composite":n=0,o="composite",i=0;break;case"square":case"group":default:o="rect";break;case"diamond":o="question";break;case"hexagon":o="hexagon";break;case"block_arrow":o="block_arrow";break;case"odd":case"rect_left_inv_arrow":o="rect_left_inv_arrow";break;case"lean_right":o="lean_right";break;case"lean_left":o="lean_left";break;case"trapezoid":o="trapezoid";break;case"inv_trapezoid":o="inv_trapezoid";break;case"circle":o="circle";break;case"ellipse":o="ellipse";break;case"stadium":o="stadium";break;case"subroutine":o="subroutine";break;case"cylinder":o="cylinder";break;case"doublecircle":o="doublecircle"}const c=F(a?.styles??[]),l=a.label,d=a.size??{width:0,height:0,x:0,y:0},h=e.getDiagramId();return{labelStyle:c.labelStyle,shape:o,labelText:l,rx:n,ry:n,class:s,style:c.style,id:a.id,domId:h?`${h}-${a.id}`:a.id,directions:a.directions,width:d.width,height:d.height,x:d.x,y:d.y,positioned:r,intersect:void 0,type:a.type,padding:i??D()?.block?.padding??0,widthInColumns:a.widthInColumns??1}}async function tr(t,e,r){const a=Qe(e,r,!1);if("group"===a.type)return;const s=D(),i=await Ge(t,a,{config:s}),n=i.node().getBBox(),o=r.getBlock(a.id);o.size={width:n.width,height:n.height,x:0,y:0,node:i},r.setBlock(o),i.remove()}async function er(t,e,r){const a=Qe(e,r,!0);if("space"!==r.getBlock(a.id).type){const r=D();await Ge(t,a,{config:r}),e.intersect=a?.intersect,Je(a)}}async function rr(t,e,r,a){for(const s of e)await a(t,s,r),s.children&&await rr(t,s.children,r,a)}async function ar(t,e,r){await rr(t,e,r,tr)}async function sr(t,e,r){await rr(t,e,r,er)}async function ir(t,e,r,a,s){const i=new U({multigraph:!0,compound:!0});i.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const t of r)t.size&&i.setNode(t.id,{width:t.size.width,height:t.size.height,intersect:t.intersect});for(const r of e)if(r.start&&r.end){const e=a.getBlock(r.start),n=a.getBlock(r.end);if(e?.size&&n?.size){const a=e.size,o=n.size,c=[{x:a.x,y:a.y},{x:a.x+(o.x-a.x)/2,y:a.y+(o.y-a.y)/2},{x:o.x,y:o.y}],l=s?`${s}-${r.id}`:r.id,d=`${"thick"===r.thickness?"edge-thickness-thick":"edge-thickness-normal"} ${"dotted"===r.pattern?"edge-pattern-dotted":"edge-pattern-solid"} flowchart-link LS-a1 LE-b1`;ne(t,{v:r.start,w:r.end,name:l},{...r,id:l,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:c,classes:d},void 0,"block",i,s),r.label&&(await te(t,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:c,classes:d}),re({...r,x:c[1].x,y:c[1].y},{originalPath:c}))}}}T(Qe,"getNodeFromBlock"),T(tr,"calculateBlockSize"),T(er,"insertBlockPositioned"),T(rr,"performOperations"),T(ar,"calculateBlockSizes"),T(sr,"insertBlocks"),T(ir,"insertEdges");var nr=T(function(t,e){return e.db.getClasses()},"getClasses"),or={parser:Q,db:Rt,renderer:{draw:T(async function(t,e,r,a){const{securityLevel:s,block:i}=D(),n=a.db;let o;n.setDiagramId(e),"sandbox"===s&&(o=$("#i"+e));const c=$("sandbox"===s?o.nodes()[0].contentDocument.body:"body"),l="sandbox"===s?c.select(`[id="${e}"]`):$(`[id="${e}"]`);jt(l,["point","circle","cross"],a.type,e);const d=n.getBlocks(),h=n.getBlocksFlat(),g=n.getEdges(),u=l.insert("g").attr("class","block");await ar(u,d,n);const y=Kt(n);if(await sr(u,d,n),await ir(u,g,h,n,e),y){const t=y,e=Math.max(1,Math.round(t.width/t.height*.125)),r=t.height+e+10,a=t.width+10,{useMaxWidth:s}=i;v(l,r,a,!!s),I.debug("Here Bounds",y,t),l.attr("viewBox",`${t.x-5} ${t.y-5} ${t.width+10} ${t.height+10}`)}},"draw"),getClasses:nr},styles:At};export{or as diagram};
|
|
1
|
+
import{g as t}from"./chunk-FMBD7UC4-C_QBV__I.js";import{ac as e,Y as r,ad as a,aO as s,aN as i,aQ as n,aP as o,aM as c,aK as l,aH as d,au as h,ao as g,an as u,aj as y,a8 as p,a7 as x,a9 as b,I as f,H as m,A as w,h as k,z as S,d as L,e as _,c as E,a as T,N as D,aA as $,w as v,ai as I,n as N,ay as C,T as B,O,a0 as R,R as z,x as A,u as M,X as P,aT as j,s as Y,W as F,az as W,D as X,v as H}from"./mermaid.core-EsBL2ECN.js";import{G as U}from"./graph-ByvXLzfz.js";import{c as K}from"./channel-B3QafhkE.js";import{A as q,l as Z}from"./string-CQk_HvWX.js";import"./index-MXDpbG5L.js";import"react/jsx-runtime";import"react";import"./ViewModuleIcon-CBJGd2NB.js";import"./index-P3Cb0cjc.js";import"./settings-DgLs6IK_.js";import"./enums.js";import"./date-D28INXpp.js";import"./time-BHcZPeyw.js";import"./contest--aeYKKxf.js";import"./worksheet-BBAH_yZC.js";import"motion/react";import"react-dom";import"./index-Dwi3ag-n.js";import"swr";import"@ably/spaces";import"@ably/spaces/react";import"ably";import"ably/liveobjects";import"ably/react";import"@ably/spaces/dist/mjs/react";import"./purify.es-J-_UhghA.js";import"./isSymbol-BuOnvf7n.js";import"./isUndefined-DFy0_ZQT.js";function V(t){if(e(t))return t;const T=r(t);if(!function(t){switch(r(t)){case E:case _:case L:case S:case k:case w:case m:case f:case b:case x:case p:case y:case u:case g:case h:case d:case l:case c:case o:case n:case i:case s:return!0;default:return!1}}(t))return{};if(D=t,Array.isArray(D)){const e=Array.from(t);return t.length>0&&"string"==typeof t[0]&&Object.hasOwn(t,"index")&&(e.index=t.index,e.input=t.input),e}var D;if(a(t)){const e=t;return new(0,e.constructor)(e.buffer,e.byteOffset,e.length)}if("[object ArrayBuffer]"===T)return new ArrayBuffer(t.byteLength);if("[object DataView]"===T){const e=t,r=e.buffer,a=e.byteOffset,s=e.byteLength,i=new ArrayBuffer(s),n=new Uint8Array(r,a,s);return new Uint8Array(i).set(n),new DataView(i)}if("[object Boolean]"===T||"[object Number]"===T||"[object String]"===T){const e=new(0,t.constructor)(t.valueOf());return"[object String]"===T?function(t,e){const r=e.valueOf().length;for(const a in e)Object.hasOwn(e,a)&&(Number.isNaN(Number(a))||Number(a)>=r)&&(t[a]=e[a])}(e,t):G(e,t),e}if("[object Date]"===T)return new Date(Number(t));if("[object RegExp]"===T){const e=t,r=new RegExp(e.source,e.flags);return r.lastIndex=e.lastIndex,r}if("[object Symbol]"===T)return Object(Symbol.prototype.valueOf.call(t));if("[object Map]"===T){const e=t,r=new Map;return e.forEach((t,e)=>{r.set(e,t)}),r}if("[object Set]"===T){const e=t,r=new Set;return e.forEach(t=>{r.add(t)}),r}if("[object Arguments]"===T){const e=t,r={};return G(r,e),r.length=e.length,r[Symbol.iterator]=e[Symbol.iterator],r}const $={};return function(t,e){const r=Object.getPrototypeOf(e);null!==r&&"function"==typeof e.constructor&&Object.setPrototypeOf(t,r)}($,t),G($,t),function(t,e){const r=Object.getOwnPropertySymbols(e);for(let a=0;a<r.length;a++){const s=r[a];Object.prototype.propertyIsEnumerable.call(e,s)&&(t[s]=e[s])}}($,t),$}function G(t,e){for(const r in e)Object.hasOwn(e,r)&&(t[r]=e[r])}var J=function(){var t=T(function(t,e,r,a){for(r=r||{},a=t.length;a--;r[t[a]]=e);return r},"o"),e=[1,15],r=[1,7],a=[1,13],s=[1,14],i=[1,19],n=[1,16],o=[1,17],c=[1,18],l=[8,30],d=[8,10,21,28,29,30,31,39,43,46],h=[1,23],g=[1,24],u=[8,10,15,16,21,28,29,30,31,39,43,46],y=[8,10,15,16,21,27,28,29,30,31,39,43,46],p=[1,49],x={trace:T(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:T(function(t,e,r,a,s,i,n){var o=i.length-1;switch(s){case 4:a.getLogger().debug("Rule: separator (NL) ");break;case 5:a.getLogger().debug("Rule: separator (Space) ");break;case 6:a.getLogger().debug("Rule: separator (EOF) ");break;case 7:a.getLogger().debug("Rule: hierarchy: ",i[o-1]),a.setHierarchy(i[o-1]);break;case 8:a.getLogger().debug("Stop NL ");break;case 9:a.getLogger().debug("Stop EOF ");break;case 10:a.getLogger().debug("Stop NL2 ");break;case 11:a.getLogger().debug("Stop EOF2 ");break;case 12:a.getLogger().debug("Rule: statement: ",i[o]),"number"==typeof i[o].length?this.$=i[o]:this.$=[i[o]];break;case 13:a.getLogger().debug("Rule: statement #2: ",i[o-1]),this.$=[i[o-1]].concat(i[o]);break;case 14:a.getLogger().debug("Rule: link: ",i[o],t),this.$={edgeTypeStr:i[o],label:""};break;case 15:a.getLogger().debug("Rule: LABEL link: ",i[o-3],i[o-1],i[o]),this.$={edgeTypeStr:i[o],label:i[o-1]};break;case 18:const e=parseInt(i[o]),r=a.generateId();this.$={id:r,type:"space",label:"",width:e,children:[]};break;case 23:a.getLogger().debug("Rule: (nodeStatement link node) ",i[o-2],i[o-1],i[o]," typestr: ",i[o-1].edgeTypeStr);const s=a.edgeStrToEdgeData(i[o-1].edgeTypeStr),n=a.edgeStrToEdgeStartData(i[o-1].edgeTypeStr),c=a.edgeStrToThickness(i[o-1].edgeTypeStr),l=a.edgeStrToPattern(i[o-1].edgeTypeStr);this.$=[{id:i[o-2].id,label:i[o-2].label,type:i[o-2].type,directions:i[o-2].directions},{id:i[o-2].id+"-"+i[o].id,start:i[o-2].id,end:i[o].id,label:i[o-1].label,type:"edge",thickness:c,pattern:l,directions:i[o].directions,arrowTypeEnd:s,arrowTypeStart:n},{id:i[o].id,label:i[o].label,type:a.typeStr2Type(i[o].typeStr),directions:i[o].directions}];break;case 24:a.getLogger().debug("Rule: nodeStatement (abc88 node size) ",i[o-1],i[o]),this.$={id:i[o-1].id,label:i[o-1].label,type:a.typeStr2Type(i[o-1].typeStr),directions:i[o-1].directions,widthInColumns:parseInt(i[o],10)};break;case 25:a.getLogger().debug("Rule: nodeStatement (node) ",i[o]),this.$={id:i[o].id,label:i[o].label,type:a.typeStr2Type(i[o].typeStr),directions:i[o].directions,widthInColumns:1};break;case 26:a.getLogger().debug("APA123",this?this:"na"),a.getLogger().debug("COLUMNS: ",i[o]),this.$={type:"column-setting",columns:"auto"===i[o]?-1:parseInt(i[o])};break;case 27:a.getLogger().debug("Rule: id-block statement : ",i[o-2],i[o-1]),a.generateId(),this.$={...i[o-2],type:"composite",children:i[o-1]};break;case 28:a.getLogger().debug("Rule: blockStatement : ",i[o-2],i[o-1],i[o]);const d=a.generateId();this.$={id:d,type:"composite",label:"",children:i[o-1]};break;case 29:a.getLogger().debug("Rule: node (NODE_ID separator): ",i[o]),this.$={id:i[o]};break;case 30:a.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",i[o-1],i[o]),this.$={id:i[o-1],label:i[o].label,typeStr:i[o].typeStr,directions:i[o].directions};break;case 31:a.getLogger().debug("Rule: dirList: ",i[o]),this.$=[i[o]];break;case 32:a.getLogger().debug("Rule: dirList: ",i[o-1],i[o]),this.$=[i[o-1]].concat(i[o]);break;case 33:a.getLogger().debug("Rule: nodeShapeNLabel: ",i[o-2],i[o-1],i[o]),this.$={typeStr:i[o-2]+i[o],label:i[o-1]};break;case 34:a.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",i[o-3],i[o-2]," #3:",i[o-1],i[o]),this.$={typeStr:i[o-3]+i[o],label:i[o-2],directions:i[o-1]};break;case 35:case 36:this.$={type:"classDef",id:i[o-1].trim(),css:i[o].trim()};break;case 37:this.$={type:"applyClass",id:i[o-1].trim(),styleClass:i[o].trim()};break;case 38:this.$={type:"applyStyles",id:i[o-1].trim(),stylesStr:i[o].trim()}}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:e,11:3,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:s,31:i,39:n,43:o,46:c},{8:[1,20]},t(l,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:e,21:r,28:a,29:s,31:i,39:n,43:o,46:c}),t(d,[2,16],{14:22,15:h,16:g}),t(d,[2,17]),t(d,[2,18]),t(d,[2,19]),t(d,[2,20]),t(d,[2,21]),t(d,[2,22]),t(u,[2,25],{27:[1,25]}),t(d,[2,26]),{19:26,26:12,31:i},{10:e,11:27,13:4,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:s,31:i,39:n,43:o,46:c},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},t(y,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},t(l,[2,13]),{26:35,31:i},{31:[2,14]},{17:[1,36]},t(u,[2,24]),{10:e,11:37,13:4,14:22,15:h,16:g,19:5,20:6,21:r,22:8,23:9,24:10,25:11,26:12,28:a,29:s,31:i,39:n,43:o,46:c},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},t(y,[2,30]),{18:[1,43]},{18:[1,44]},t(u,[2,23]),{18:[1,45]},{30:[1,46]},t(d,[2,28]),t(d,[2,35]),t(d,[2,36]),t(d,[2,37]),t(d,[2,38]),{36:[1,47]},{33:48,34:p},{15:[1,50]},t(d,[2,27]),t(y,[2,33]),{38:[1,51]},{33:52,34:p,38:[2,31]},{31:[2,15]},t(y,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:T(function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)},"parseError"),parse:T(function(t){var e=this,r=[0],a=[],s=[null],i=[],n=this.table,o="",c=0,l=0,d=i.slice.call(arguments,1),h=Object.create(this.lexer),g={yy:{}};for(var u in this.yy)Object.prototype.hasOwnProperty.call(this.yy,u)&&(g.yy[u]=this.yy[u]);h.setInput(t,g.yy),g.yy.lexer=h,g.yy.parser=this,void 0===h.yylloc&&(h.yylloc={});var y=h.yylloc;i.push(y);var p=h.options&&h.options.ranges;function x(){var t;return"number"!=typeof(t=a.pop()||h.lex()||1)&&(t instanceof Array&&(t=(a=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof g.yy.parseError?this.parseError=g.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,T(function(t){r.length=r.length-2*t,s.length=s.length-t,i.length=i.length-t},"popStack"),T(x,"lex");for(var b,f,m,w,k,S,L,_,E={};;){if(f=r[r.length-1],this.defaultActions[f]?m=this.defaultActions[f]:(null==b&&(b=x()),m=n[f]&&n[f][b]),void 0===m||!m.length||!m[0]){var D="";for(k in _=[],n[f])this.terminals_[k]&&k>2&&_.push("'"+this.terminals_[k]+"'");D=h.showPosition?"Parse error on line "+(c+1)+":\n"+h.showPosition()+"\nExpecting "+_.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(c+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:y,expected:_})}if(m[0]instanceof Array&&m.length>1)throw new Error("Parse Error: multiple actions possible at state: "+f+", token: "+b);switch(m[0]){case 1:r.push(b),s.push(h.yytext),i.push(h.yylloc),r.push(m[1]),b=null,l=h.yyleng,o=h.yytext,c=h.yylineno,y=h.yylloc;break;case 2:if(S=this.productions_[m[1]][1],E.$=s[s.length-S],E._$={first_line:i[i.length-(S||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(S||1)].first_column,last_column:i[i.length-1].last_column},p&&(E._$.range=[i[i.length-(S||1)].range[0],i[i.length-1].range[1]]),void 0!==(w=this.performAction.apply(E,[o,l,c,g.yy,m[1],s,i].concat(d))))return w;S&&(r=r.slice(0,-1*S*2),s=s.slice(0,-1*S),i=i.slice(0,-1*S)),r.push(this.productions_[m[1]][0]),s.push(E.$),i.push(E._$),L=n[r[r.length-2]][r[r.length-1]],r.push(L);break;case 3:return!0}}return!0},"parse")},b=function(){return{EOF:1,parseError:T(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:T(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:T(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:T(function(t){var e=t.length,r=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 a=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),r.length-1&&(this.yylineno-=r.length-1);var s=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:r?(r.length===a.length?this.yylloc.first_column:0)+a[a.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},"unput"),more:T(function(){return this._more=!0,this},"more"),reject:T(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:T(function(t){this.unput(this.match.slice(t))},"less"),pastInput:T(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:T(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:T(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:T(function(t,e){var r,a,s;if(this.options.backtrack_lexer&&(s={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&&(s.yylloc.range=this.yylloc.range.slice(0))),(a=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=a.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:a?a[a.length-1].length-a[a.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],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var i in s)this[i]=s[i];return!1}return!1},"test_match"),next:T(function(){if(this.done)return this.EOF;var t,e,r,a;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),i=0;i<s.length;i++)if((r=this._input.match(this.rules[s[i]]))&&(!e||r[0].length>e[0].length)){if(e=r,a=i,this.options.backtrack_lexer){if(!1!==(t=this.test_match(r,s[i])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[a]))&&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:T(function(){var t=this.next();return t||this.lex()},"lex"),begin:T(function(t){this.conditionStack.push(t)},"begin"),popState:T(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:T(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:T(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:T(function(t){this.begin(t)},"pushState"),stateStackSize:T(function(){return this.conditionStack.length},"stateStackSize"),options:{},performAction:T(function(t,e,r,a){switch(r){case 0:return t.getLogger().debug("Found block-beta"),10;case 1:return t.getLogger().debug("Found id-block"),29;case 2:return t.getLogger().debug("Found block"),10;case 3:t.getLogger().debug(".",e.yytext);break;case 4:t.getLogger().debug("_",e.yytext);break;case 5:return 5;case 6:return e.yytext=-1,28;case 7:return e.yytext=e.yytext.replace(/columns\s+/,""),t.getLogger().debug("COLUMNS (LEX)",e.yytext),28;case 8:case 76:case 77:case 99:this.pushState("md_string");break;case 9:return"MD_STR";case 10:case 34:case 79:this.popState();break;case 11:this.pushState("string");break;case 12:t.getLogger().debug("LEX: POPPING STR:",e.yytext),this.popState();break;case 13:return t.getLogger().debug("LEX: STR end:",e.yytext),"STR";case 14:return e.yytext=e.yytext.replace(/space\:/,""),t.getLogger().debug("SPACE NUM (LEX)",e.yytext),21;case 15:return e.yytext="1",t.getLogger().debug("COLUMNS (LEX)",e.yytext),21;case 16:return 42;case 17:return"LINKSTYLE";case 18:return"INTERPOLATE";case 19:return this.pushState("CLASSDEF"),39;case 20:return this.popState(),this.pushState("CLASSDEFID"),"DEFAULT_CLASSDEF_ID";case 21:return this.popState(),this.pushState("CLASSDEFID"),40;case 22:return this.popState(),41;case 23:return this.pushState("CLASS"),43;case 24:return this.popState(),this.pushState("CLASS_STYLE"),44;case 25:return this.popState(),45;case 26:return this.pushState("STYLE_STMNT"),46;case 27:return this.popState(),this.pushState("STYLE_DEFINITION"),47;case 28:return this.popState(),48;case 29:return this.pushState("acc_title"),"acc_title";case 30:return this.popState(),"acc_title_value";case 31:return this.pushState("acc_descr"),"acc_descr";case 32:return this.popState(),"acc_descr_value";case 33:this.pushState("acc_descr_multiline");break;case 35:return"acc_descr_multiline_value";case 36:return 30;case 37:case 38:case 40:case 41:case 44:return this.popState(),t.getLogger().debug("Lex: (("),"NODE_DEND";case 39:return this.popState(),t.getLogger().debug("Lex: ))"),"NODE_DEND";case 42:return this.popState(),t.getLogger().debug("Lex: (-"),"NODE_DEND";case 43:return this.popState(),t.getLogger().debug("Lex: -)"),"NODE_DEND";case 45:return this.popState(),t.getLogger().debug("Lex: ]]"),"NODE_DEND";case 46:return this.popState(),t.getLogger().debug("Lex: ("),"NODE_DEND";case 47:return this.popState(),t.getLogger().debug("Lex: ])"),"NODE_DEND";case 48:case 49:return this.popState(),t.getLogger().debug("Lex: /]"),"NODE_DEND";case 50:return this.popState(),t.getLogger().debug("Lex: )]"),"NODE_DEND";case 51:return this.popState(),t.getLogger().debug("Lex: )"),"NODE_DEND";case 52:return this.popState(),t.getLogger().debug("Lex: ]>"),"NODE_DEND";case 53:return this.popState(),t.getLogger().debug("Lex: ]"),"NODE_DEND";case 54:return t.getLogger().debug("Lexa: -)"),this.pushState("NODE"),35;case 55:return t.getLogger().debug("Lexa: (-"),this.pushState("NODE"),35;case 56:return t.getLogger().debug("Lexa: ))"),this.pushState("NODE"),35;case 57:case 59:case 60:case 61:case 64:return t.getLogger().debug("Lexa: )"),this.pushState("NODE"),35;case 58:return t.getLogger().debug("Lex: ((("),this.pushState("NODE"),35;case 62:return t.getLogger().debug("Lexc: >"),this.pushState("NODE"),35;case 63:return t.getLogger().debug("Lexa: (["),this.pushState("NODE"),35;case 65:case 66:case 67:case 68:case 69:case 70:case 71:return this.pushState("NODE"),35;case 72:return t.getLogger().debug("Lexa: ["),this.pushState("NODE"),35;case 73:return this.pushState("BLOCK_ARROW"),t.getLogger().debug("LEX ARR START"),37;case 74:return t.getLogger().debug("Lex: NODE_ID",e.yytext),31;case 75:return t.getLogger().debug("Lex: EOF",e.yytext),8;case 78:return"NODE_DESCR";case 80:t.getLogger().debug("Lex: Starting string"),this.pushState("string");break;case 81:t.getLogger().debug("LEX ARR: Starting string"),this.pushState("string");break;case 82:return t.getLogger().debug("LEX: NODE_DESCR:",e.yytext),"NODE_DESCR";case 83:t.getLogger().debug("LEX POPPING"),this.popState();break;case 84:t.getLogger().debug("Lex: =>BAE"),this.pushState("ARROW_DIR");break;case 85:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (right): dir:",e.yytext),"DIR";case 86:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (left):",e.yytext),"DIR";case 87:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (x):",e.yytext),"DIR";case 88:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (y):",e.yytext),"DIR";case 89:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (up):",e.yytext),"DIR";case 90:return e.yytext=e.yytext.replace(/^,\s*/,""),t.getLogger().debug("Lex (down):",e.yytext),"DIR";case 91:return e.yytext="]>",t.getLogger().debug("Lex (ARROW_DIR end):",e.yytext),this.popState(),this.popState(),"BLOCK_ARROW_END";case 92:return t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 93:case 94:case 95:return t.getLogger().debug("Lex: LINK",e.yytext),15;case 96:case 97:case 98:return t.getLogger().debug("Lex: START_LINK",e.yytext),this.pushState("LLABEL"),16;case 100:return t.getLogger().debug("Lex: Starting string"),this.pushState("string"),"LINK_LABEL";case 101:return this.popState(),t.getLogger().debug("Lex: LINK","#"+e.yytext+"#"),15;case 102:case 103:return this.popState(),t.getLogger().debug("Lex: LINK",e.yytext),15;case 104:return t.getLogger().debug("Lex: COLON",e.yytext),e.yytext=e.yytext.slice(1),27}},"anonymous"),rules:[/^(?:block-beta\b)/,/^(?:block:)/,/^(?:block\b)/,/^(?:[\s]+)/,/^(?:[\n]+)/,/^(?:((\u000D\u000A)|(\u000A)))/,/^(?:columns\s+auto\b)/,/^(?:columns\s+[\d]+)/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]*)/,/^(?:space[:]\d+)/,/^(?:space\b)/,/^(?:default\b)/,/^(?:linkStyle\b)/,/^(?:interpolate\b)/,/^(?:classDef\s+)/,/^(?:DEFAULT\s+)/,/^(?:\w+\s+)/,/^(?:[^\n]*)/,/^(?:class\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:style\s+)/,/^(?:(\w+)+((,\s*\w+)*))/,/^(?:[^\n]*)/,/^(?:accTitle\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*:\s*)/,/^(?:(?!\n||)*[^\n]*)/,/^(?:accDescr\s*\{\s*)/,/^(?:[\}])/,/^(?:[^\}]*)/,/^(?:end\b\s*)/,/^(?:\(\(\()/,/^(?:\)\)\))/,/^(?:[\)]\))/,/^(?:\}\})/,/^(?:\})/,/^(?:\(-)/,/^(?:-\))/,/^(?:\(\()/,/^(?:\]\])/,/^(?:\()/,/^(?:\]\))/,/^(?:\\\])/,/^(?:\/\])/,/^(?:\)\])/,/^(?:[\)])/,/^(?:\]>)/,/^(?:[\]])/,/^(?:-\))/,/^(?:\(-)/,/^(?:\)\))/,/^(?:\))/,/^(?:\(\(\()/,/^(?:\(\()/,/^(?:\{\{)/,/^(?:\{)/,/^(?:>)/,/^(?:\(\[)/,/^(?:\()/,/^(?:\[\[)/,/^(?:\[\|)/,/^(?:\[\()/,/^(?:\)\)\))/,/^(?:\[\\)/,/^(?:\[\/)/,/^(?:\[\\)/,/^(?:\[)/,/^(?:<\[)/,/^(?:[^\(\[\n\-\)\{\}\s\<\>:=]+)/,/^(?:$)/,/^(?:["][`])/,/^(?:["][`])/,/^(?:[^`"]+)/,/^(?:[`]["])/,/^(?:["])/,/^(?:["])/,/^(?:[^"]+)/,/^(?:["])/,/^(?:\]>\s*\()/,/^(?:,?\s*right\s*)/,/^(?:,?\s*left\s*)/,/^(?:,?\s*x\s*)/,/^(?:,?\s*y\s*)/,/^(?:,?\s*up\s*)/,/^(?:,?\s*down\s*)/,/^(?:\)\s*)/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?:\s*~~[\~]+\s*)/,/^(?:\s*[xo<]?--\s*)/,/^(?:\s*[xo<]?==\s*)/,/^(?:\s*[xo<]?-\.\s*)/,/^(?:["][`])/,/^(?:["])/,/^(?:\s*[xo<]?--+[-xo>]\s*)/,/^(?:\s*[xo<]?==+[=xo>]\s*)/,/^(?:\s*[xo<]?-?\.+-[xo>]?\s*)/,/^(?::\d+)/],conditions:{STYLE_DEFINITION:{rules:[28],inclusive:!1},STYLE_STMNT:{rules:[27],inclusive:!1},CLASSDEFID:{rules:[22],inclusive:!1},CLASSDEF:{rules:[20,21],inclusive:!1},CLASS_STYLE:{rules:[25],inclusive:!1},CLASS:{rules:[24],inclusive:!1},LLABEL:{rules:[99,100,101,102,103],inclusive:!1},ARROW_DIR:{rules:[85,86,87,88,89,90,91],inclusive:!1},BLOCK_ARROW:{rules:[76,81,84],inclusive:!1},NODE:{rules:[37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,77,80],inclusive:!1},md_string:{rules:[9,10,78,79],inclusive:!1},space:{rules:[],inclusive:!1},string:{rules:[12,13,82,83],inclusive:!1},acc_descr_multiline:{rules:[34,35],inclusive:!1},acc_descr:{rules:[32],inclusive:!1},acc_title:{rules:[30],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,8,11,14,15,16,17,18,19,23,26,29,31,33,36,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,92,93,94,95,96,97,98,104],inclusive:!0}}}}();function f(){this.yy={}}return x.lexer=b,T(f,"Parser"),f.prototype=x,x.Parser=f,new f}();J.parser=J;var Q=J,tt=new Map,et=[],rt=new Map,at="color",st="fill",it=O(),nt=new Map,ot="",ct=T(t=>Y.sanitizeText(t,it),"sanitizeText"),lt=T(function(t,e=""){let r=nt.get(t);r||(r={id:t,styles:[],textStyles:[]},nt.set(t,r)),null!=e&&e.split(",").forEach(t=>{const e=t.replace(/([^;]*);/,"$1").trim();if(RegExp(at).exec(t)){const t=e.replace(st,"bgFill").replace(at,st);r.textStyles.push(t)}r.styles.push(e)})},"addStyleClass"),dt=T(function(t,e=""){const r=tt.get(t);null!=e&&(r.styles=e.split(","))},"addStyle2Node"),ht=T(function(t,e){t.split(",").forEach(function(t){let r=tt.get(t);if(void 0===r){const e=t.trim();r={id:e,type:"na",children:[]},tt.set(e,r)}r.classes||(r.classes=[]),r.classes.push(e)})},"setCssClass"),gt=T((t,e)=>{const r=t.flat(),a=[],s=r.find(t=>"column-setting"===t?.type),i=s?.columns??-1;for(const t of r)if("number"==typeof i&&i>0&&"column-setting"!==t.type&&"number"==typeof t.widthInColumns&&t.widthInColumns>i&&I.warn(`Block ${t.id} width ${t.widthInColumns} exceeds configured column width ${i}`),t.label&&(t.label=ct(t.label)),"classDef"!==t.type)if("applyClass"!==t.type)if("applyStyles"!==t.type)if("column-setting"===t.type)e.columns=t.columns??-1;else if("edge"===t.type){const e=(rt.get(t.id)??0)+1;rt.set(t.id,e),t.id=e+"-"+t.id,et.push(t)}else{t.label||("composite"===t.type?t.label="":t.label=t.id);const e=tt.get(t.id);if(void 0===e?tt.set(t.id,t):("na"!==t.type&&(e.type=t.type),t.label!==t.id&&(e.label=t.label)),t.children&>(t.children,t),"space"===t.type){const e=t.width??1;for(let r=0;r<e;r++){const e=V(t);e.id=e.id+"-"+r,tt.set(e.id,e),a.push(e)}}else void 0===e&&a.push(t)}else t?.stylesStr&&dt(t.id,t?.stylesStr);else ht(t.id,t?.styleClass??"");else lt(t.id,t.css);e.children=a},"populateBlockDatabase"),ut=[],yt={id:"root",type:"composite",children:[],columns:-1},pt=T(()=>{I.debug("Clear called"),N(),yt={id:"root",type:"composite",children:[],columns:-1},tt=new Map([["root",yt]]),ut=[],nt=new Map,et=[],rt=new Map,ot=""},"clear");function xt(t){switch(I.debug("typeStr2Type",t),t){case"[]":return"square";case"()":return I.debug("we have a round"),"round";case"(())":return"circle";case">]":return"rect_left_inv_arrow";case"{}":return"diamond";case"{{}}":return"hexagon";case"([])":return"stadium";case"[[]]":return"subroutine";case"[()]":return"cylinder";case"((()))":return"doublecircle";case"[//]":return"lean_right";case"[\\\\]":return"lean_left";case"[/\\]":return"trapezoid";case"[\\/]":return"inv_trapezoid";case"<[]>":return"block_arrow";default:return"na"}}function bt(t){return I.debug("typeStr2Type",t),"=="===t?"thick":"normal"}function ft(t){switch(t.trim().slice(-1)){case"x":return"arrow_cross";case"o":return"arrow_circle";case">":return"arrow_point";default:return""}}function mt(t){switch(t.trim().charAt(0)){case"x":return"arrow_cross";case"o":return"arrow_circle";case"<":return"arrow_point";default:return"arrow_open"}}function wt(t){return t.includes("==")?"thick":"normal"}function kt(t){return t.includes(".-")?"dotted":"solid"}T(xt,"typeStr2Type"),T(bt,"edgeTypeStr2Type"),T(ft,"edgeStrToEdgeData"),T(mt,"edgeStrToEdgeStartData"),T(wt,"edgeStrToThickness"),T(kt,"edgeStrToPattern");var St=0,Lt=T(()=>(St++,"id-"+Math.random().toString(36).substr(2,12)+"-"+St),"generateId"),_t=T(t=>{yt.children=t,gt(t,yt),ut=yt.children},"setHierarchy"),Et=T(t=>{const e=tt.get(t);return e?e.columns?e.columns:e.children?e.children.length:-1:-1},"getColumns"),Tt=T(()=>[...tt.values()],"getBlocksFlat"),Dt=T(()=>ut||[],"getBlocks"),$t=T(()=>et,"getEdges"),vt=T(t=>tt.get(t),"getBlock"),It=T(t=>{tt.set(t.id,t)},"setBlock"),Nt=T(t=>{ot=t},"setDiagramId"),Ct=T(()=>ot,"getDiagramId"),Bt=T(()=>I,"getLogger"),Ot=T(function(){return nt},"getClasses"),Rt={getConfig:T(()=>D().block,"getConfig"),typeStr2Type:xt,edgeTypeStr2Type:bt,edgeStrToEdgeData:ft,edgeStrToEdgeStartData:mt,edgeStrToThickness:wt,edgeStrToPattern:kt,getLogger:Bt,getBlocksFlat:Tt,getBlocks:Dt,getEdges:$t,setHierarchy:_t,getBlock:vt,setBlock:It,getColumns:Et,getClasses:Ot,clear:pt,generateId:Lt,setDiagramId:Nt,getDiagramId:Ct},zt=T((t,e)=>{const r=K,a=r(t,"r"),s=r(t,"g"),i=r(t,"b");return C(a,s,i,e)},"fade"),At=T(e=>`.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,p {\n color: ${e.titleColor};\n }\n\n\n\n .label text,span,p {\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: 1px;\n }\n .flowchart-label text {\n text-anchor: middle;\n }\n // .flowchart-label .text-outer-tspan {\n // text-anchor: middle;\n // }\n // .flowchart-label .text-inner-tspan {\n // text-anchor: start;\n // }\n\n .node .label {\n text-align: center;\n }\n .node.clickable {\n cursor: pointer;\n }\n\n .arrowheadPath {\n fill: ${e.arrowheadColor};\n }\n\n .edgePath .path {\n stroke: ${e.lineColor};\n stroke-width: 2.0px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n /*\n * This is for backward compatibility with existing code that didn't\n * add a \`<p>\` around edge labels.\n *\n * TODO: We should probably remove this in a future release.\n */\n p {\n margin: 0;\n padding: 0;\n display: inline;\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: ${e.edgeLabelBackground};\n }\n\n .node .cluster {\n // fill: ${zt(e.mainBkg,.5)};\n fill: ${zt(e.clusterBkg,.5)};\n stroke: ${zt(e.clusterBorder,.2)};\n box-shadow: rgba(50, 50, 93, 0.25) 0px 13px 27px -5px, rgba(0, 0, 0, 0.3) 0px 8px 16px -8px;\n stroke-width: 1px;\n }\n\n .cluster text {\n fill: ${e.titleColor};\n }\n\n .cluster span,p {\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 .flowchartTitleText {\n text-anchor: middle;\n font-size: 18px;\n fill: ${e.textColor};\n }\n ${t()}\n`,"getStyles"),Mt=T((t,e,r,a)=>{e.forEach(e=>{Pt[e](t,r,a)})},"insertMarkers"),Pt={extension:T((t,e,r)=>{I.trace("Making markers for ",r),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionStart").attr("class","marker extension "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 1,7 L18,13 V 1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-extensionEnd").attr("class","marker extension "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 1,1 V 13 L18,7 Z")},"extension"),composition:T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionStart").attr("class","marker composition "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-compositionEnd").attr("class","marker composition "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"composition"),aggregation:T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationStart").attr("class","marker aggregation "+e).attr("refX",18).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-aggregationEnd").attr("class","marker aggregation "+e).attr("refX",1).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L1,7 L9,1 Z")},"aggregation"),dependency:T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyStart").attr("class","marker dependency "+e).attr("refX",6).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("path").attr("d","M 5,7 L9,13 L1,7 L9,1 Z"),t.append("defs").append("marker").attr("id",r+"_"+e+"-dependencyEnd").attr("class","marker dependency "+e).attr("refX",13).attr("refY",7).attr("markerWidth",20).attr("markerHeight",28).attr("orient","auto").append("path").attr("d","M 18,7 L9,13 L14,7 L9,1 Z")},"dependency"),lollipop:T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopStart").attr("class","marker lollipop "+e).attr("refX",13).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6),t.append("defs").append("marker").attr("id",r+"_"+e+"-lollipopEnd").attr("class","marker lollipop "+e).attr("refX",1).attr("refY",7).attr("markerWidth",190).attr("markerHeight",240).attr("orient","auto").append("circle").attr("stroke","black").attr("fill","transparent").attr("cx",7).attr("cy",7).attr("r",6)},"lollipop"),point:T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-pointEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",6).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-pointStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",4.5).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 0 5 L 10 10 L 10 0 z").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"point"),circle:T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-circleEnd").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",11).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-circleStart").attr("class","marker "+e).attr("viewBox","0 0 10 10").attr("refX",-1).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("circle").attr("cx","5").attr("cy","5").attr("r","5").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0")},"circle"),cross:T((t,e,r)=>{t.append("marker").attr("id",r+"_"+e+"-crossEnd").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",12).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0"),t.append("marker").attr("id",r+"_"+e+"-crossStart").attr("class","marker cross "+e).attr("viewBox","0 0 11 11").attr("refX",-1).attr("refY",5.2).attr("markerUnits","userSpaceOnUse").attr("markerWidth",11).attr("markerHeight",11).attr("orient","auto").append("path").attr("d","M 1,1 l 9,9 M 10,1 l -9,9").attr("class","arrowMarkerPath").style("stroke-width",2).style("stroke-dasharray","1,0")},"cross"),barb:T((t,e,r)=>{t.append("defs").append("marker").attr("id",r+"_"+e+"-barbEnd").attr("refX",19).attr("refY",7).attr("markerWidth",20).attr("markerHeight",14).attr("markerUnits","strokeWidth").attr("orient","auto").append("path").attr("d","M 19,7 L9,13 L14,7 L9,1 Z")},"barb")},jt=Mt,Yt=O()?.block?.padding??8;function Ft(t,e){if(0===t||!Number.isInteger(t))throw new Error("Columns must be an integer !== 0.");if(e<0||!Number.isInteger(e))throw new Error("Position must be a non-negative integer."+e);if(t<0)return{px:e,py:0};if(1===t)return{px:0,py:e};return{px:e%t,py:Math.floor(e/t)}}T(Ft,"calculateBlockPosition");var Wt=T(t=>{let e=0,r=0;for(const a of t.children){const{width:t,height:s,x:i,y:n}=a.size??{width:0,height:0,x:0,y:0};if(I.debug("getMaxChildSize abc95 child:",a.id,"width:",t,"height:",s,"x:",i,"y:",n,a.type),"space"===a.type)continue;const o=t/(a.widthInColumns??1);o>e&&(e=o),s>r&&(r=s)}return{width:e,height:r}},"getMaxChildSize");function Xt(t,e,r=0,a=0){I.debug("setBlockSizes abc95 (start)",t.id,t?.size?.x,"block width =",t?.size,"siblingWidth",r),t?.size?.width||(t.size={width:r,height:a,x:0,y:0});let s=0,i=0;if(t.children?.length>0){for(const r of t.children)Xt(r,e);const n=Wt(t);s=n.width,i=n.height,I.debug("setBlockSizes abc95 maxWidth of",t.id,":s children is ",s,i);for(const e of t.children)e.size&&(I.debug(`abc95 Setting size of children of ${t.id} id=${e.id} ${s} ${i} ${JSON.stringify(e.size)}`),e.size.width=s*(e.widthInColumns??1)+Yt*((e.widthInColumns??1)-1),e.size.height=i,e.size.x=0,e.size.y=0,I.debug(`abc95 updating size of ${t.id} children child:${e.id} maxWidth:${s} maxHeight:${i}`));for(const r of t.children)Xt(r,e,s,i);const o=t.columns??-1;let c=0;for(const e of t.children)c+=e.widthInColumns??1;let l=t.children.length;o>0&&o<c&&(l=o);const d=Math.ceil(c/l);let h=l*(s+Yt)+Yt,g=d*(i+Yt)+Yt;if(h<r){I.debug(`Detected to small sibling: abc95 ${t.id} siblingWidth ${r} siblingHeight ${a} width ${h}`),h=r,g=a;const e=(r-l*Yt-Yt)/l,n=(a-d*Yt-Yt)/d;I.debug("Size indata abc88",t.id,"childWidth",e,"maxWidth",s),I.debug("Size indata abc88",t.id,"childHeight",n,"maxHeight",i),I.debug("Size indata abc88 xSize",l,"padding",Yt);for(const r of t.children)r.size&&(r.size.width=e,r.size.height=n,r.size.x=0,r.size.y=0)}if(I.debug(`abc95 (finale calc) ${t.id} xSize ${l} ySize ${d} columns ${o}${t.children.length} width=${Math.max(h,t.size?.width||0)}`),h<(t?.size?.width||0)){h=t?.size?.width||0;const e=o>0?Math.min(t.children.length,o):t.children.length;if(e>0){const r=(h-e*Yt-Yt)/e;I.debug("abc95 (growing to fit) width",t.id,h,t.size?.width,r);for(const e of t.children)e.size&&(e.size.width=r)}}t.size={width:h,height:g,x:0,y:0}}I.debug("setBlockSizes abc94 (done)",t.id,t?.size?.x,t?.size?.width,t?.size?.y,t?.size?.height)}function Ht(t,e){I.debug(`abc85 layout blocks (=>layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`);const r=t.columns??-1;if(I.debug("layoutBlocks columns abc95",t.id,"=>",r,t),t.children&&t.children.length>0){const e=t?.children[0]?.size?.width??0,a=t.children.length*e+(t.children.length-1)*Yt;I.debug("widthOfChildren 88",a,"posX");const s=new Map;{let e=0;for(const a of t.children){if(!a.size)continue;const{py:t}=Ft(r,e),i=s.get(t)??0;a.size.height>i&&s.set(t,a.size.height);let n=a?.widthInColumns??1;r>0&&(n=Math.min(n,r-e%r)),e+=n}}const i=new Map;{let t=0;const e=[...s.keys()].sort((t,e)=>t-e);for(const r of e)i.set(r,t),t+=(s.get(r)??0)+Yt}let n=0;I.debug("abc91 block?.size?.x",t.id,t?.size?.x);let o=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-Yt,c=0;for(const e of t.children){const a=t;if(!e.size)continue;const{width:l,height:d}=e.size,{px:h,py:g}=Ft(r,n);if(g!=c&&(c=g,o=t?.size?.x?t?.size?.x+(-t?.size?.width/2||0):-Yt,I.debug("New row in layout for block",t.id," and child ",e.id,c)),I.debug(`abc89 layout blocks (child) id: ${e.id} Pos: ${n} (px, py) ${h},${g} (${a?.size?.x},${a?.size?.y}) parent: ${a.id} width: ${l}${Yt}`),a.size){const t=l/2;e.size.x=o+Yt+t,I.debug(`abc91 layout blocks (calc) px, pyid:${e.id} startingPos=X${o} new startingPosX${e.size.x} ${t} padding=${Yt} width=${l} halfWidth=${t} => x:${e.size.x} y:${e.size.y} ${e.widthInColumns} (width * (child?.w || 1)) / 2 ${l*(e?.widthInColumns??1)/2}`),o=e.size.x+t;const r=i.get(g)??0,n=s.get(g)??d;e.size.y=a.size.y-a.size.height/2+r+n/2+Yt,I.debug(`abc88 layout blocks (calc) px, pyid:${e.id}startingPosX${o}${Yt}${t}=>x:${e.size.x}y:${e.size.y}${e.widthInColumns}(width * (child?.w || 1)) / 2${l*(e?.widthInColumns??1)/2}`)}e.children&&Ht(e);let u=e?.widthInColumns??1;r>0&&(u=Math.min(u,r-n%r)),n+=u,I.debug("abc88 columnsPos",e,n)}}I.debug(`layout blocks (<==layoutBlocks) ${t.id} x: ${t?.size?.x} y: ${t?.size?.y} width: ${t?.size?.width}`)}function Ut(t,{minX:e,minY:r,maxX:a,maxY:s}={minX:0,minY:0,maxX:0,maxY:0}){if(t.size&&"root"!==t.id){const{x:i,y:n,width:o,height:c}=t.size;i-o/2<e&&(e=i-o/2),n-c/2<r&&(r=n-c/2),i+o/2>a&&(a=i+o/2),n+c/2>s&&(s=n+c/2)}if(t.children)for(const i of t.children)({minX:e,minY:r,maxX:a,maxY:s}=Ut(i,{minX:e,minY:r,maxX:a,maxY:s}));return{minX:e,minY:r,maxX:a,maxY:s}}function Kt(t){const e=t.getBlock("root");if(!e)return;Xt(e,t,0,0),Ht(e),I.debug("getBlocks",JSON.stringify(e,null,2));const{minX:r,minY:a,maxX:s,maxY:i}=Ut(e);return{x:r,y:a,width:s-r,height:i-a}}T(Xt,"setBlockSizes"),T(Ht,"layoutBlocks"),T(Ut,"findBounds"),T(Kt,"layout");var qt=T(async(t,e,r,a=!1,s=!1)=>{let i=e||"";"object"==typeof i&&(i=i[0]);const n=O(),o=z(n);return await A(t,i,{style:r,isTitle:a,useHtmlLabels:o,markdown:!1,isNode:s,width:Number.POSITIVE_INFINITY},n)},"createLabel"),Zt=T((t,e,r,a,s)=>{e.arrowTypeStart&&Gt(t,"start",e.arrowTypeStart,r,a,s),e.arrowTypeEnd&&Gt(t,"end",e.arrowTypeEnd,r,a,s)},"addEdgeMarkers"),Vt={arrow_cross:"cross",arrow_point:"point",arrow_barb:"barb",arrow_circle:"circle",aggregation:"aggregation",extension:"extension",composition:"composition",dependency:"dependency",lollipop:"lollipop"},Gt=T((t,e,r,a,s,i)=>{const n=Vt[r];if(!n)return void I.warn(`Unknown arrow type: ${r}`);const o="start"===e?"Start":"End";t.attr(`marker-${e}`,`url(${a}#${s}_${i}-${n}${o})`)},"addEdgeMarker"),Jt={},Qt={},te=T(async(t,e)=>{const r=O(),a=z(r),s=t.insert("g").attr("class","edgeLabel"),i=s.insert("g").attr("class","label"),n="markdown"===e.labelType,o=await A(t,e.label,{style:e.labelStyle,useHtmlLabels:a,addSvgBackground:n,isNode:!1,markdown:n,width:n?void 0:Number.POSITIVE_INFINITY},r);i.node().appendChild(o);let c,l=o.getBBox(),d=l;if(a){const t=o.children[0],e=$(o);l=t.getBoundingClientRect(),d=l,e.attr("width",l.width),e.attr("height",l.height)}else{const t=$(o).select("text").node();t&&"function"==typeof t.getBBox&&(d=t.getBBox())}if(i.attr("transform",M(d,a)),Jt[e.id]=s,e.width=l.width,e.height=l.height,e.startLabelLeft){const r=t.insert("g").attr("class","edgeTerminals"),s=r.insert("g").attr("class","inner"),i=await qt(s,e.startLabelLeft,e.labelStyle);c=i;let n=i.getBBox();if(a){const t=i.children[0],e=$(i);n=t.getBoundingClientRect(),e.attr("width",n.width),e.attr("height",n.height)}s.attr("transform",M(n,a)),Qt[e.id]||(Qt[e.id]={}),Qt[e.id].startLeft=r,ee(c,e.startLabelLeft)}if(e.startLabelRight){const r=t.insert("g").attr("class","edgeTerminals"),s=r.insert("g").attr("class","inner"),i=await qt(s,e.startLabelRight,e.labelStyle);c=i;let n=i.getBBox();if(a){const t=i.children[0],e=$(i);n=t.getBoundingClientRect(),e.attr("width",n.width),e.attr("height",n.height)}s.attr("transform",M(n,a)),Qt[e.id]||(Qt[e.id]={}),Qt[e.id].startRight=r,ee(c,e.startLabelRight)}if(e.endLabelLeft){const r=t.insert("g").attr("class","edgeTerminals"),s=r.insert("g").attr("class","inner"),i=await qt(r,e.endLabelLeft,e.labelStyle);c=i;let n=i.getBBox();if(a){const t=i.children[0],e=$(i);n=t.getBoundingClientRect(),e.attr("width",n.width),e.attr("height",n.height)}s.attr("transform",M(n,a)),Qt[e.id]||(Qt[e.id]={}),Qt[e.id].endLeft=r,ee(c,e.endLabelLeft)}if(e.endLabelRight){const r=t.insert("g").attr("class","edgeTerminals"),s=r.insert("g").attr("class","inner"),i=await qt(r,e.endLabelRight,e.labelStyle);c=i;let n=i.getBBox();if(a){const t=i.children[0],e=$(i);n=t.getBoundingClientRect(),e.attr("width",n.width),e.attr("height",n.height)}s.attr("transform",M(n,a)),Qt[e.id]||(Qt[e.id]={}),Qt[e.id].endRight=r,ee(c,e.endLabelRight)}return o},"insertEdgeLabel");function ee(t,e){z(O())&&t&&(t.style.width=9*e.length+"px",t.style.height="12px")}T(ee,"setTerminalWidth");var re=T((t,e)=>{I.debug("Moving label abc88 ",t.id,t.label,Jt[t.id],e);let r=e.updatedPath?e.updatedPath:e.originalPath;const a=O(),{subGraphTitleTotalMargin:s}=P(a);if(t.label){const a=Jt[t.id];let i=t.x,n=t.y;if(r){const a=j.calcLabelPosition(r);I.debug("Moving label "+t.label+" from (",i,",",n,") to (",a.x,",",a.y,") abc88"),e.updatedPath&&(i=a.x,n=a.y)}a.attr("transform",`translate(${i}, ${n+s/2})`)}if(t.startLabelLeft){const e=Qt[t.id].startLeft;let a=t.x,s=t.y;if(r){const e=j.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_left",r);a=e.x,s=e.y}e.attr("transform",`translate(${a}, ${s})`)}if(t.startLabelRight){const e=Qt[t.id].startRight;let a=t.x,s=t.y;if(r){const e=j.calcTerminalLabelPosition(t.arrowTypeStart?10:0,"start_right",r);a=e.x,s=e.y}e.attr("transform",`translate(${a}, ${s})`)}if(t.endLabelLeft){const e=Qt[t.id].endLeft;let a=t.x,s=t.y;if(r){const e=j.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_left",r);a=e.x,s=e.y}e.attr("transform",`translate(${a}, ${s})`)}if(t.endLabelRight){const e=Qt[t.id].endRight;let a=t.x,s=t.y;if(r){const e=j.calcTerminalLabelPosition(t.arrowTypeEnd?10:0,"end_right",r);a=e.x,s=e.y}e.attr("transform",`translate(${a}, ${s})`)}},"positionEdgeLabel"),ae=T((t,e)=>{const r=t.x,a=t.y,s=Math.abs(e.x-r),i=Math.abs(e.y-a),n=t.width/2,o=t.height/2;return s>=n||i>=o},"outsideNode"),se=T((t,e,r)=>{I.debug(`intersection calc abc89:\n outsidePoint: ${JSON.stringify(e)}\n insidePoint : ${JSON.stringify(r)}\n node : x:${t.x} y:${t.y} w:${t.width} h:${t.height}`);const a=t.x,s=t.y,i=Math.abs(a-r.x),n=t.width/2;let o=r.x<e.x?n-i:n+i;const c=t.height/2,l=Math.abs(e.y-r.y),d=Math.abs(e.x-r.x);if(Math.abs(s-e.y)*n>Math.abs(a-e.x)*c){let t=r.y<e.y?e.y-c-s:s-c-e.y;o=d*t/l;const a={x:r.x<e.x?r.x+o:r.x-d+o,y:r.y<e.y?r.y+l-t:r.y-l+t};return 0===o&&(a.x=e.x,a.y=e.y),0===d&&(a.x=e.x),0===l&&(a.y=e.y),I.debug(`abc89 topp/bott calc, Q ${l}, q ${t}, R ${d}, r ${o}`,a),a}{o=r.x<e.x?e.x-n-a:a-n-e.x;let t=l*o/d,s=r.x<e.x?r.x+d-o:r.x-d+o,i=r.y<e.y?r.y+t:r.y-t;return I.debug(`sides calc abc89, Q ${l}, q ${t}, R ${d}, r ${o}`,{_x:s,_y:i}),0===o&&(s=e.x,i=e.y),0===d&&(s=e.x),0===l&&(i=e.y),{x:s,y:i}}},"intersection"),ie=T((t,e)=>{I.debug("abc88 cutPathAtIntersect",t,e);let r=[],a=t[0],s=!1;return t.forEach(t=>{if(ae(e,t)||s)a=t,s||r.push(t);else{const i=se(e,a,t);let n=!1;r.forEach(t=>{n=n||t.x===i.x&&t.y===i.y}),r.some(t=>t.x===i.x&&t.y===i.y)||r.push(i),s=!0}}),r},"cutPathAtIntersect"),ne=T(function(t,e,r,a,s,i,n){let o=r.points;I.debug("abc88 InsertEdge: edge=",r,"e=",e);let c=!1;const l=i.node(e.v);var d=i.node(e.w);d?.intersect&&l?.intersect&&(o=o.slice(1,r.points.length-1),o.unshift(l.intersect(o[0])),o.push(d.intersect(o[o.length-1]))),r.toCluster&&(I.debug("to cluster abc88",a[r.toCluster]),o=ie(r.points,a[r.toCluster].node),c=!0),r.fromCluster&&(I.debug("from cluster abc88",a[r.fromCluster]),o=ie(o.reverse(),a[r.fromCluster].node).reverse(),c=!0);const h=o.filter(t=>!Number.isNaN(t.y));let g=Z;!r.curve||"graph"!==s&&"flowchart"!==s||(g=r.curve);const{x:u,y:y}=B(r),p=q().x(u).y(y).curve(g);let x;switch(r.thickness){case"normal":x="edge-thickness-normal";break;case"thick":case"invisible":x="edge-thickness-thick";break;default:x=""}switch(r.pattern){case"solid":x+=" edge-pattern-solid";break;case"dotted":x+=" edge-pattern-dotted";break;case"dashed":x+=" edge-pattern-dashed"}const b=t.append("path").attr("d",p(h)).attr("id",r.id).attr("class"," "+x+(r.classes?" "+r.classes:"")).attr("style",r.style);let f="";(O().flowchart.arrowMarkerAbsolute||O().state.arrowMarkerAbsolute)&&(f=R(!0)),Zt(b,r,f,n,s);let m={};return c&&(m.updatedPath=o),m.originalPath=r.points,m},"insertEdge"),oe=T(t=>{const e=new Set;for(const r of t)switch(r){case"x":e.add("right"),e.add("left");break;case"y":e.add("up"),e.add("down");break;default:e.add(r)}return e},"expandAndDeduplicateDirections"),ce=T((t,e,r,a)=>{const s=oe(t),i=e.height+2*r.padding,n=i/2,o=a??e.width+2*n+r.padding,c=r.padding/2;return s.has("right")&&s.has("left")&&s.has("up")&&s.has("down")?[{x:0,y:0},{x:n,y:0},{x:o/2,y:2*c},{x:o-n,y:0},{x:o,y:0},{x:o,y:-i/3},{x:o+2*c,y:-i/2},{x:o,y:-2*i/3},{x:o,y:-i},{x:o-n,y:-i},{x:o/2,y:-i-2*c},{x:n,y:-i},{x:0,y:-i},{x:0,y:-2*i/3},{x:-2*c,y:-i/2},{x:0,y:-i/3}]:s.has("right")&&s.has("left")&&s.has("up")?[{x:n,y:0},{x:o-n,y:0},{x:o,y:-i/2},{x:o-n,y:-i},{x:n,y:-i},{x:0,y:-i/2}]:s.has("right")&&s.has("left")&&s.has("down")?[{x:0,y:0},{x:n,y:-i},{x:o-n,y:-i},{x:o,y:0}]:s.has("right")&&s.has("up")&&s.has("down")?[{x:0,y:0},{x:o,y:-n},{x:o,y:-i+n},{x:0,y:-i}]:s.has("left")&&s.has("up")&&s.has("down")?[{x:o,y:0},{x:0,y:-n},{x:0,y:-i+n},{x:o,y:-i}]:s.has("right")&&s.has("left")?[{x:n,y:0},{x:n,y:-c},{x:o-n,y:-c},{x:o-n,y:0},{x:o,y:-i/2},{x:o-n,y:-i},{x:o-n,y:-i+c},{x:n,y:-i+c},{x:n,y:-i},{x:0,y:-i/2}]:s.has("up")&&s.has("down")?[{x:o/2,y:0},{x:0,y:-c},{x:n,y:-c},{x:n,y:-i+c},{x:0,y:-i+c},{x:o/2,y:-i},{x:o,y:-i+c},{x:o-n,y:-i+c},{x:o-n,y:-c},{x:o,y:-c}]:s.has("right")&&s.has("up")?[{x:0,y:0},{x:o,y:-n},{x:0,y:-i}]:s.has("right")&&s.has("down")?[{x:0,y:0},{x:o,y:0},{x:0,y:-i}]:s.has("left")&&s.has("up")?[{x:o,y:0},{x:0,y:-n},{x:o,y:-i}]:s.has("left")&&s.has("down")?[{x:o,y:0},{x:0,y:0},{x:o,y:-i}]:s.has("right")?[{x:n,y:-c},{x:n,y:-c},{x:o-n,y:-c},{x:o-n,y:0},{x:o,y:-i/2},{x:o-n,y:-i},{x:o-n,y:-i+c},{x:n,y:-i+c},{x:n,y:-i+c}]:s.has("left")?[{x:n,y:0},{x:n,y:-c},{x:o-n,y:-c},{x:o-n,y:-i+c},{x:n,y:-i+c},{x:n,y:-i},{x:0,y:-i/2}]:s.has("up")?[{x:n,y:-c},{x:n,y:-i+c},{x:0,y:-i+c},{x:o/2,y:-i},{x:o,y:-i+c},{x:o-n,y:-i+c},{x:o-n,y:-c}]:s.has("down")?[{x:o/2,y:0},{x:0,y:-c},{x:n,y:-c},{x:n,y:-i+c},{x:o-n,y:-i+c},{x:o-n,y:-c},{x:o,y:-c}]:[{x:0,y:0}]},"getArrowPoints");function le(t,e){return t.intersect(e)}T(le,"intersectNode");var de=le;function he(t,e,r,a){var s=t.x,i=t.y,n=s-a.x,o=i-a.y,c=Math.sqrt(e*e*o*o+r*r*n*n),l=Math.abs(e*r*n/c);a.x<s&&(l=-l);var d=Math.abs(e*r*o/c);return a.y<i&&(d=-d),{x:s+l,y:i+d}}T(he,"intersectEllipse");var ge=he;function ue(t,e,r){return ge(t,e,e,r)}T(ue,"intersectCircle");var ye=ue;function pe(t,e,r,a){var s,i,n,o,c,l,d,h,g,u,y,p,x;if(s=e.y-t.y,n=t.x-e.x,c=e.x*t.y-t.x*e.y,g=s*r.x+n*r.y+c,u=s*a.x+n*a.y+c,!(0!==g&&0!==u&&xe(g,u)||(i=a.y-r.y,o=r.x-a.x,l=a.x*r.y-r.x*a.y,d=i*t.x+o*t.y+l,h=i*e.x+o*e.y+l,0!==d&&0!==h&&xe(d,h)||0===(y=s*o-i*n))))return p=Math.abs(y/2),{x:(x=n*l-o*c)<0?(x-p)/y:(x+p)/y,y:(x=i*c-s*l)<0?(x-p)/y:(x+p)/y}}function xe(t,e){return t*e>0}T(pe,"intersectLine"),T(xe,"sameSign");var be=pe,fe=me;function me(t,e,r){var a=t.x,s=t.y,i=[],n=Number.POSITIVE_INFINITY,o=Number.POSITIVE_INFINITY;"function"==typeof e.forEach?e.forEach(function(t){n=Math.min(n,t.x),o=Math.min(o,t.y)}):(n=Math.min(n,e.x),o=Math.min(o,e.y));for(var c=a-t.width/2-n,l=s-t.height/2-o,d=0;d<e.length;d++){var h=e[d],g=e[d<e.length-1?d+1:0],u=be(t,r,{x:c+h.x,y:l+h.y},{x:c+g.x,y:l+g.y});u&&i.push(u)}return i.length?(i.length>1&&i.sort(function(t,e){var a=t.x-r.x,s=t.y-r.y,i=Math.sqrt(a*a+s*s),n=e.x-r.x,o=e.y-r.y,c=Math.sqrt(n*n+o*o);return i<c?-1:i===c?0:1}),i[0]):t}T(me,"intersectPolygon");var we={node:de,circle:ye,ellipse:ge,polygon:fe,rect:T((t,e)=>{var r,a,s=t.x,i=t.y,n=e.x-s,o=e.y-i,c=t.width/2,l=t.height/2;return Math.abs(o)*c>Math.abs(n)*l?(o<0&&(l=-l),r=0===o?0:l*n/o,a=l):(n<0&&(c=-c),r=c,a=0===n?0:c*o/n),{x:s+r,y:i+a}},"intersectRect")},ke=T(async(t,e,r,a)=>{const s=O();let i;const n=e.useHtmlLabels||z(s);i=r||"node default";const o=t.insert("g").attr("class",i).attr("id",e.domId||e.id),c=o.insert("g").attr("class","label").attr("style",e.labelStyle);let l,d;l=void 0===e.labelText?"":"string"==typeof e.labelText?e.labelText:e.labelText[0],d="markdown"===e.labelType?A(c,W(X(l),s),{useHtmlLabels:n,width:e.width||s.flowchart.wrappingWidth,classes:"markdown-node-label"},s):await qt(c,W(X(l),s),e.labelStyle,!1,a);let h=d.getBBox();const g=e.padding/2;if(z(s)){const t=d.children[0],e=$(d);await H(t,l),h=t.getBoundingClientRect(),e.attr("width",h.width),e.attr("height",h.height)}return n?c.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"):c.attr("transform","translate(0, "+-h.height/2+")"),e.centerLabel&&c.attr("transform","translate("+-h.width/2+", "+-h.height/2+")"),c.insert("rect",":first-child"),{shapeSvg:o,bbox:h,halfPadding:g,label:c}},"labelHelper"),Se=T((t,e)=>{const r=e.node().getBBox();t.width=r.width,t.height=r.height},"updateNodeBounds");function Le(t,e,r,a){return t.insert("polygon",":first-child").attr("points",a.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","label-container").attr("transform","translate("+-e/2+","+r/2+")")}T(Le,"insertPolygonShape");var _e=T(async(t,e)=>{e.useHtmlLabels||z(O())||(e.centerLabel=!0);const{shapeSvg:r,bbox:a,halfPadding:s}=await ke(t,e,"node "+e.classes,!0);I.info("Classes = ",e.classes);const i=r.insert("rect",":first-child");return i.attr("rx",e.rx).attr("ry",e.ry).attr("x",-a.width/2-s).attr("y",-a.height/2-s).attr("width",a.width+e.padding).attr("height",a.height+e.padding),Se(e,i),e.intersect=function(t){return we.rect(e,t)},r},"note"),Ee=T(t=>t?" "+t:"","formatClass"),Te=T((t,e)=>`${e||"node default"}${Ee(t.classes)} ${Ee(t.class)}`,"getClassesFromNode"),De=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e,void 0),!0),s=a.width+e.padding+(a.height+e.padding),i=[{x:s/2,y:0},{x:s,y:-s/2},{x:s/2,y:-s},{x:0,y:-s/2}];I.info("Question main (Circle)");const n=Le(r,s,s,i);return n.attr("style",e.style),Se(e,n),e.intersect=function(t){return I.warn("Intersect called"),we.polygon(e,i,t)},r},"question"),$e=T((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a=[{x:0,y:14},{x:14,y:0},{x:0,y:-14},{x:-14,y:0}];return r.insert("polygon",":first-child").attr("points",a.map(function(t){return t.x+","+t.y}).join(" ")).attr("class","state-start").attr("r",7).attr("width",28).attr("height",28),e.width=28,e.height=28,e.intersect=function(t){return we.circle(e,14,t)},r},"choice"),ve=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e,void 0),!0),s=e.positioned?e.height:a.height+e.padding,i=s/4,n=e.positioned?e.width:a.width+2*i+e.padding,o=[{x:i,y:0},{x:n-i,y:0},{x:n,y:-s/2},{x:n-i,y:-s},{x:i,y:-s},{x:0,y:-s/2}],c=Le(r,n,s,o);return c.attr("style",e.style),Se(e,c),e.intersect=function(t){return we.polygon(e,o,t)},r},"hexagon"),Ie=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,void 0,!0),s=a.height+2*e.padding,i=s/2,n=a.width+2*i+e.padding,o=e.positioned&&(e.widthInColumns??1)>1&&e.width>n?e.width:n,c=ce(e.directions,a,e,o),l=Le(r,o,s,c);return l.attr("style",e.style),Se(e,l),e.intersect=function(t){return we.polygon(e,c,t)},r},"block_arrow"),Ne=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e,void 0),!0),s=a.width+e.padding,i=a.height+e.padding,n=[{x:-i/2,y:0},{x:s,y:0},{x:s,y:-i},{x:-i/2,y:-i},{x:0,y:-i/2}];return Le(r,s,i,n).attr("style",e.style),e.width=s+i,e.height=i,e.intersect=function(t){return we.polygon(e,n,t)},r},"rect_left_inv_arrow"),Ce=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e),!0),s=a.width+e.padding,i=a.height+e.padding,n=[{x:-2*i/6,y:0},{x:s-i/6,y:0},{x:s+2*i/6,y:-i},{x:i/6,y:-i}],o=Le(r,s,i,n);return o.attr("style",e.style),Se(e,o),e.intersect=function(t){return we.polygon(e,n,t)},r},"lean_right"),Be=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e,void 0),!0),s=a.width+e.padding,i=a.height+e.padding,n=[{x:2*i/6,y:0},{x:s+i/6,y:0},{x:s-2*i/6,y:-i},{x:-i/6,y:-i}],o=Le(r,s,i,n);return o.attr("style",e.style),Se(e,o),e.intersect=function(t){return we.polygon(e,n,t)},r},"lean_left"),Oe=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e,void 0),!0),s=a.width+e.padding,i=a.height+e.padding,n=[{x:-2*i/6,y:0},{x:s+2*i/6,y:0},{x:s-i/6,y:-i},{x:i/6,y:-i}],o=Le(r,s,i,n);return o.attr("style",e.style),Se(e,o),e.intersect=function(t){return we.polygon(e,n,t)},r},"trapezoid"),Re=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e,void 0),!0),s=a.width+e.padding,i=a.height+e.padding,n=[{x:i/6,y:0},{x:s-i/6,y:0},{x:s+2*i/6,y:-i},{x:-2*i/6,y:-i}],o=Le(r,s,i,n);return o.attr("style",e.style),Se(e,o),e.intersect=function(t){return we.polygon(e,n,t)},r},"inv_trapezoid"),ze=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e,void 0),!0),s=a.width+e.padding,i=a.height+e.padding,n=[{x:0,y:0},{x:s+i/2,y:0},{x:s,y:-i/2},{x:s+i/2,y:-i},{x:0,y:-i}],o=Le(r,s,i,n);return o.attr("style",e.style),Se(e,o),e.intersect=function(t){return we.polygon(e,n,t)},r},"rect_right_inv_arrow"),Ae=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e,void 0),!0),s=a.width+e.padding,i=s/2,n=i/(2.5+s/50),o=a.height+n+e.padding,c="M 0,"+n+" a "+i+","+n+" 0,0,0 "+s+" 0 a "+i+","+n+" 0,0,0 "+-s+" 0 l 0,"+o+" a "+i+","+n+" 0,0,0 "+s+" 0 l 0,"+-o,l=r.attr("label-offset-y",n).insert("path",":first-child").attr("style",e.style).attr("d",c).attr("transform","translate("+-s/2+","+-(o/2+n)+")");return Se(e,l),e.intersect=function(t){const r=we.rect(e,t),a=r.x-e.x;if(0!=i&&(Math.abs(a)<e.width/2||Math.abs(a)==e.width/2&&Math.abs(r.y-e.y)>e.height/2-n)){let s=n*n*(1-a*a/(i*i));0!=s&&(s=Math.sqrt(s)),s=n-s,t.y-e.y>0&&(s=-s),r.y+=s}return r},r},"cylinder"),Me=T(async(t,e)=>{const{shapeSvg:r,bbox:a,halfPadding:s}=await ke(t,e,"node "+e.classes+" "+e.class,!0),i=r.insert("rect",":first-child"),n=e.positioned?e.width:a.width+e.padding,o=e.positioned?e.height:a.height+e.padding,c=e.positioned?-n/2:-a.width/2-s,l=e.positioned?-o/2:-a.height/2-s;if(i.attr("class","basic label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",c).attr("y",l).attr("width",n).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(Ye(i,e.props.borders,n,o),t.delete("borders")),t.forEach(t=>{I.warn(`Unknown node property ${t}`)})}return Se(e,i),e.intersect=function(t){return we.rect(e,t)},r},"rect"),Pe=T(async(t,e)=>{const{shapeSvg:r,bbox:a,halfPadding:s}=await ke(t,e,"node "+e.classes,!0),i=r.insert("rect",":first-child"),n=e.positioned?e.width:a.width+e.padding,o=e.positioned?e.height:a.height+e.padding,c=e.positioned?-n/2:-a.width/2-s,l=e.positioned?-o/2:-a.height/2-s;if(i.attr("class","basic cluster composite label-container").attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("x",c).attr("y",l).attr("width",n).attr("height",o),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(Ye(i,e.props.borders,n,o),t.delete("borders")),t.forEach(t=>{I.warn(`Unknown node property ${t}`)})}return Se(e,i),e.intersect=function(t){return we.rect(e,t)},r},"composite"),je=T(async(t,e)=>{const{shapeSvg:r}=await ke(t,e,"label",!0);I.trace("Classes = ",e.class);const a=r.insert("rect",":first-child");if(a.attr("width",0).attr("height",0),r.attr("class","label edgeLabel"),e.props){const t=new Set(Object.keys(e.props));e.props.borders&&(Ye(a,e.props.borders,0,0),t.delete("borders")),t.forEach(t=>{I.warn(`Unknown node property ${t}`)})}return Se(e,a),e.intersect=function(t){return we.rect(e,t)},r},"labelRect");function Ye(t,e,r,a){const s=[],i=T(t=>{s.push(t,0)},"addBorder"),n=T(t=>{s.push(0,t)},"skipBorder");e.includes("t")?(I.debug("add top border"),i(r)):n(r),e.includes("r")?(I.debug("add right border"),i(a)):n(a),e.includes("b")?(I.debug("add bottom border"),i(r)):n(r),e.includes("l")?(I.debug("add left border"),i(a)):n(a),t.attr("stroke-dasharray",s.join(" "))}T(Ye,"applyNodePropertyBorders");var Fe=T(async(t,e)=>{let r;r=e.classes?"node "+e.classes:"node default";const a=t.insert("g").attr("class",r).attr("id",e.domId||e.id),s=a.insert("rect",":first-child"),i=a.insert("line"),n=a.insert("g").attr("class","label"),o=e.labelText.flat?e.labelText.flat():e.labelText;let c="";c="object"==typeof o?o[0]:o,I.info("Label text abc79",c,o,"object"==typeof o);const l=await qt(n,c,e.labelStyle,!0,!0);let d={width:0,height:0};if(z(O())){const t=l.children[0],e=$(l);d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}I.info("Text 2",o);const h=o.slice(1,o.length);let g=l.getBBox();const u=await qt(n,h.join?h.join("<br/>"):h,e.labelStyle,!0,!0);if(z(O())){const t=u.children[0],e=$(u);d=t.getBoundingClientRect(),e.attr("width",d.width),e.attr("height",d.height)}const y=e.padding/2;return $(u).attr("transform","translate( "+(d.width>g.width?0:(g.width-d.width)/2)+", "+(g.height+y+5)+")"),$(l).attr("transform","translate( "+(d.width<g.width?0:-(g.width-d.width)/2)+", 0)"),d=n.node().getBBox(),n.attr("transform","translate("+-d.width/2+", "+(-d.height/2-y+3)+")"),s.attr("class","outer title-state").attr("x",-d.width/2-y).attr("y",-d.height/2-y).attr("width",d.width+e.padding).attr("height",d.height+e.padding),i.attr("class","divider").attr("x1",-d.width/2-y).attr("x2",d.width/2+y).attr("y1",-d.height/2-y+g.height+y).attr("y2",-d.height/2-y+g.height+y),Se(e,s),e.intersect=function(t){return we.rect(e,t)},a},"rectWithTitle"),We=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e,void 0),!0),s=a.height+e.padding,i=a.width+s/4+e.padding,n=r.insert("rect",":first-child").attr("style",e.style).attr("rx",s/2).attr("ry",s/2).attr("x",-i/2).attr("y",-s/2).attr("width",i).attr("height",s);return Se(e,n),e.intersect=function(t){return we.rect(e,t)},r},"stadium"),Xe=T(async(t,e)=>{const{shapeSvg:r,bbox:a,halfPadding:s}=await ke(t,e,Te(e,void 0),!0),i=r.insert("circle",":first-child");return i.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+s).attr("width",a.width+e.padding).attr("height",a.height+e.padding),I.info("Circle main"),Se(e,i),e.intersect=function(t){return I.info("Circle intersect",e,a.width/2+s,t),we.circle(e,a.width/2+s,t)},r},"circle"),He=T(async(t,e)=>{const{shapeSvg:r,bbox:a,halfPadding:s}=await ke(t,e,Te(e,void 0),!0),i=r.insert("g",":first-child"),n=i.insert("circle"),o=i.insert("circle");return i.attr("class",e.class),n.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+s+5).attr("width",a.width+e.padding+10).attr("height",a.height+e.padding+10),o.attr("style",e.style).attr("rx",e.rx).attr("ry",e.ry).attr("r",a.width/2+s).attr("width",a.width+e.padding).attr("height",a.height+e.padding),I.info("DoubleCircle main"),Se(e,n),e.intersect=function(t){return I.info("DoubleCircle intersect",e,a.width/2+s+5,t),we.circle(e,a.width/2+s+5,t)},r},"doublecircle"),Ue=T(async(t,e)=>{const{shapeSvg:r,bbox:a}=await ke(t,e,Te(e,void 0),!0),s=a.width+e.padding,i=a.height+e.padding,n=[{x:0,y:0},{x:s,y:0},{x:s,y:-i},{x:0,y:-i},{x:0,y:0},{x:-8,y:0},{x:s+8,y:0},{x:s+8,y:-i},{x:-8,y:-i},{x:-8,y:0}],o=Le(r,s,i,n);return o.attr("style",e.style),Se(e,o),e.intersect=function(t){return we.polygon(e,n,t)},r},"subroutine"),Ke=T((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a=r.insert("circle",":first-child");return a.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),Se(e,a),e.intersect=function(t){return we.circle(e,7,t)},r},"start"),qe=T((t,e,r)=>{const a=t.insert("g").attr("class","node default").attr("id",e.domId||e.id);let s=70,i=10;"LR"===r&&(s=10,i=70);const n=a.append("rect").attr("x",-1*s/2).attr("y",-1*i/2).attr("width",s).attr("height",i).attr("class","fork-join");return Se(e,n),e.height=e.height+e.padding/2,e.width=e.width+e.padding/2,e.intersect=function(t){return we.rect(e,t)},a},"forkJoin"),Ze={rhombus:De,composite:Pe,question:De,rect:Me,labelRect:je,rectWithTitle:Fe,choice:$e,circle:Xe,doublecircle:He,stadium:We,hexagon:ve,block_arrow:Ie,rect_left_inv_arrow:Ne,lean_right:Ce,lean_left:Be,trapezoid:Oe,inv_trapezoid:Re,rect_right_inv_arrow:ze,cylinder:Ae,start:Ke,end:T((t,e)=>{const r=t.insert("g").attr("class","node default").attr("id",e.domId||e.id),a=r.insert("circle",":first-child"),s=r.insert("circle",":first-child");return s.attr("class","state-start").attr("r",7).attr("width",14).attr("height",14),a.attr("class","state-end").attr("r",5).attr("width",10).attr("height",10),Se(e,s),e.intersect=function(t){return we.circle(e,7,t)},r},"end"),note:_e,subroutine:Ue,fork:qe,join:qe,class_box:T(async(t,e)=>{const r=e.padding/2;let a;a=e.classes?"node "+e.classes:"node default";const s=t.insert("g").attr("class",a).attr("id",e.domId||e.id),i=s.insert("rect",":first-child"),n=s.insert("line"),o=s.insert("line");let c=0,l=4;const d=s.insert("g").attr("class","label");let h=0;const g=e.classData.annotations?.[0],u=e.classData.annotations[0]?"«"+e.classData.annotations[0]+"»":"",y=await qt(d,u,e.labelStyle,!0,!0);let p=y.getBBox();if(z(O())){const t=y.children[0],e=$(y);p=t.getBoundingClientRect(),e.attr("width",p.width),e.attr("height",p.height)}e.classData.annotations[0]&&(l+=p.height+4,c+=p.width);let x=e.classData.label;void 0!==e.classData.type&&""!==e.classData.type&&(z(O())?x+="<"+e.classData.type+">":x+="<"+e.classData.type+">");const b=await qt(d,x,e.labelStyle,!0,!0);$(b).attr("class","classTitle");let f=b.getBBox();if(z(O())){const t=b.children[0],e=$(b);f=t.getBoundingClientRect(),e.attr("width",f.width),e.attr("height",f.height)}l+=f.height+4,f.width>c&&(c=f.width);const m=[];e.classData.members.forEach(async t=>{const r=t.getDisplayDetails();let a=r.displayText;z(O())&&(a=a.replace(/</g,"<").replace(/>/g,">"));const s=await qt(d,a,r.cssStyle?r.cssStyle:e.labelStyle,!0,!0);let i=s.getBBox();if(z(O())){const t=s.children[0],e=$(s);i=t.getBoundingClientRect(),e.attr("width",i.width),e.attr("height",i.height)}i.width>c&&(c=i.width),l+=i.height+4,m.push(s)}),l+=8;const w=[];if(e.classData.methods.forEach(async t=>{const r=t.getDisplayDetails();let a=r.displayText;z(O())&&(a=a.replace(/</g,"<").replace(/>/g,">"));const s=await qt(d,a,r.cssStyle?r.cssStyle:e.labelStyle,!0,!0);let i=s.getBBox();if(z(O())){const t=s.children[0],e=$(s);i=t.getBoundingClientRect(),e.attr("width",i.width),e.attr("height",i.height)}i.width>c&&(c=i.width),l+=i.height+4,w.push(s)}),l+=8,g){let t=(c-p.width)/2;$(y).attr("transform","translate( "+(-1*c/2+t)+", "+-1*l/2+")"),h=p.height+4}let k=(c-f.width)/2;return $(b).attr("transform","translate( "+(-1*c/2+k)+", "+(-1*l/2+h)+")"),h+=f.height+4,n.attr("class","divider").attr("x1",-c/2-r).attr("x2",c/2+r).attr("y1",-l/2-r+8+h).attr("y2",-l/2-r+8+h),h+=8,m.forEach(t=>{$(t).attr("transform","translate( "+-c/2+", "+(-1*l/2+h+4)+")");const e=t?.getBBox();h+=(e?.height??0)+4}),h+=8,o.attr("class","divider").attr("x1",-c/2-r).attr("x2",c/2+r).attr("y1",-l/2-r+8+h).attr("y2",-l/2-r+8+h),h+=8,w.forEach(t=>{$(t).attr("transform","translate( "+-c/2+", "+(-1*l/2+h)+")");const e=t?.getBBox();h+=(e?.height??0)+4}),i.attr("style",e.style).attr("class","outer title-state").attr("x",-c/2-r).attr("y",-l/2-r).attr("width",c+e.padding).attr("height",l+e.padding),Se(e,i),e.intersect=function(t){return we.rect(e,t)},s},"class_box")},Ve={},Ge=T(async(t,e,r)=>{let a,s;if(e.link){let i;"sandbox"===O().securityLevel?i="_top":e.linkTarget&&(i=e.linkTarget||"_blank"),a=t.insert("svg:a").attr("xlink:href",e.link).attr("target",i),s=await Ze[e.shape](a,e,r)}else s=await Ze[e.shape](t,e,r),a=s;return e.tooltip&&s.attr("title",e.tooltip),e.class&&s.attr("class","node default "+e.class),Ve[e.id]=a,e.haveCallback&&Ve[e.id].attr("class",Ve[e.id].attr("class")+" clickable"),a},"insertNode"),Je=T(t=>{const e=Ve[t.id];I.trace("Transforming node",t.diff,t,"translate("+(t.x-t.width/2-5)+", "+t.width/2+")");const r=t.diff||0;return t.clusterNode?e.attr("transform","translate("+(t.x+r-t.width/2)+", "+(t.y-t.height/2-8)+")"):e.attr("transform","translate("+t.x+", "+t.y+")"),r},"positionNode");function Qe(t,e,r=!1){const a=t;let s="default";(a?.classes?.length||0)>0&&(s=(a?.classes??[]).join(" ")),s+=" flowchart-label";let i,n=0,o="";switch(a.type){case"round":n=5,o="rect";break;case"composite":n=0,o="composite",i=0;break;case"square":case"group":default:o="rect";break;case"diamond":o="question";break;case"hexagon":o="hexagon";break;case"block_arrow":o="block_arrow";break;case"odd":case"rect_left_inv_arrow":o="rect_left_inv_arrow";break;case"lean_right":o="lean_right";break;case"lean_left":o="lean_left";break;case"trapezoid":o="trapezoid";break;case"inv_trapezoid":o="inv_trapezoid";break;case"circle":o="circle";break;case"ellipse":o="ellipse";break;case"stadium":o="stadium";break;case"subroutine":o="subroutine";break;case"cylinder":o="cylinder";break;case"doublecircle":o="doublecircle"}const c=F(a?.styles??[]),l=a.label,d=a.size??{width:0,height:0,x:0,y:0},h=e.getDiagramId();return{labelStyle:c.labelStyle,shape:o,labelText:l,rx:n,ry:n,class:s,style:c.style,id:a.id,domId:h?`${h}-${a.id}`:a.id,directions:a.directions,width:d.width,height:d.height,x:d.x,y:d.y,positioned:r,intersect:void 0,type:a.type,padding:i??D()?.block?.padding??0,widthInColumns:a.widthInColumns??1}}async function tr(t,e,r){const a=Qe(e,r,!1);if("group"===a.type)return;const s=D(),i=await Ge(t,a,{config:s}),n=i.node().getBBox(),o=r.getBlock(a.id);o.size={width:n.width,height:n.height,x:0,y:0,node:i},r.setBlock(o),i.remove()}async function er(t,e,r){const a=Qe(e,r,!0);if("space"!==r.getBlock(a.id).type){const r=D();await Ge(t,a,{config:r}),e.intersect=a?.intersect,Je(a)}}async function rr(t,e,r,a){for(const s of e)await a(t,s,r),s.children&&await rr(t,s.children,r,a)}async function ar(t,e,r){await rr(t,e,r,tr)}async function sr(t,e,r){await rr(t,e,r,er)}async function ir(t,e,r,a,s){const i=new U({multigraph:!0,compound:!0});i.setGraph({rankdir:"TB",nodesep:10,ranksep:10,marginx:8,marginy:8});for(const t of r)t.size&&i.setNode(t.id,{width:t.size.width,height:t.size.height,intersect:t.intersect});for(const r of e)if(r.start&&r.end){const e=a.getBlock(r.start),n=a.getBlock(r.end);if(e?.size&&n?.size){const a=e.size,o=n.size,c=[{x:a.x,y:a.y},{x:a.x+(o.x-a.x)/2,y:a.y+(o.y-a.y)/2},{x:o.x,y:o.y}],l=s?`${s}-${r.id}`:r.id,d=`${"thick"===r.thickness?"edge-thickness-thick":"edge-thickness-normal"} ${"dotted"===r.pattern?"edge-pattern-dotted":"edge-pattern-solid"} flowchart-link LS-a1 LE-b1`;ne(t,{v:r.start,w:r.end,name:l},{...r,id:l,arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:c,classes:d},void 0,"block",i,s),r.label&&(await te(t,{...r,label:r.label,labelStyle:"stroke: #333; stroke-width: 1.5px;fill:none;",arrowTypeEnd:r.arrowTypeEnd,arrowTypeStart:r.arrowTypeStart,points:c,classes:d}),re({...r,x:c[1].x,y:c[1].y},{originalPath:c}))}}}T(Qe,"getNodeFromBlock"),T(tr,"calculateBlockSize"),T(er,"insertBlockPositioned"),T(rr,"performOperations"),T(ar,"calculateBlockSizes"),T(sr,"insertBlocks"),T(ir,"insertEdges");var nr=T(function(t,e){return e.db.getClasses()},"getClasses"),or={parser:Q,db:Rt,renderer:{draw:T(async function(t,e,r,a){const{securityLevel:s,block:i}=D(),n=a.db;let o;n.setDiagramId(e),"sandbox"===s&&(o=$("#i"+e));const c=$("sandbox"===s?o.nodes()[0].contentDocument.body:"body"),l="sandbox"===s?c.select(`[id="${e}"]`):$(`[id="${e}"]`);jt(l,["point","circle","cross"],a.type,e);const d=n.getBlocks(),h=n.getBlocksFlat(),g=n.getEdges(),u=l.insert("g").attr("class","block");await ar(u,d,n);const y=Kt(n);if(await sr(u,d,n),await ir(u,g,h,n,e),y){const t=y,e=Math.max(1,Math.round(t.width/t.height*.125)),r=t.height+e+10,a=t.width+10,{useMaxWidth:s}=i;v(l,r,a,!!s),I.debug("Here Bounds",y,t),l.attr("viewBox",`${t.x-5} ${t.y-5} ${t.width+10} ${t.height+10}`)}},"draw"),getClasses:nr},styles:At};export{or as diagram};
|