function createDiagram(e,n){let t="#fillArrows: true \n#lineWidth: 2\n#fill:white\n#background: white\n#acyclicer: greedy\n#ranker: tight-tree\n#.error: fill=#ffe0e0\n#.warning: fill=#fff3e0\n";return e.forEach(i=>{let r=i.position.replaceAll("||","").substring(1,i.position.length-1).split("|"),l=i.positionIndex.substring(1,i.positionIndex.length).split("|"),a=i.positionType.substring(1,i.positionType.length).split("|");r.forEach((s,o)=>{if(r.length>0&&""!=l[o]&&a.length==r.length&&null!=s&&""!=s){let g,p,c="",f=e[l[o]-1]?.icon||"";("Switch"==a[o]||"If"==a[o]||"Scope"==a[o]||"Foreach"==a[o]||"Until"==a[o])&&"Internal"!=i.positionInfo?p="--:>":(p="->",c=i.branch);let y=e[parseInt(l[o])-1],h="";if(y&&y?.parent!="root"){h="^";let u=y.nested.split("|");u.forEach(n=>{h+=e[parseInt(n)-1]?.name+">"}),h=h.substring(0,h.length-1)}let d="data";oSettings.customFlagsOnDiagram&&y?.flags.length>0&&(JSON.stringify(y.flags).includes("Warning")&&(d="warning"),JSON.stringify(y.flags).includes("Error")&&(d="error")),"Switch"==a[o]||"If"==a[o]?g="\n[<"+d+">"+s.replace(/[":\[|{}()\]]+/g,"")+"$"+f+h+"]"+p+" "+c:"Foreach"==a[o]||"Until"==a[o]||"Scope"==a[o]||"Terminate"==a[o]?g="\n[<"+d+">"+s.replace(/[":\[|{}()\]]+/g,"")+"$"+f+h+"]"+p:"trigger"==s.replace(/[":\[|{}()\]]+/g,"")?g="\n[\xbb"+n.name.replace(/[":\[|{}()\]]+/g,"")+"$"+n.icon+"]"+p:y.type.includes("Variable")||a[o].includes("Variable")?g="\n[<"+d+">"+s.replace(/[":\[|{}()\]]+/g,"")+"$"+f+h+"]"+p:y.type.includes("Compose")||a[o].includes("Compose")?g="\n[<"+d+">"+s.replace(/[":\[|{}()\]]+/g,"")+"$"+f+h+"]"+p:"Table"==a[o]||"ParseJson"==a[o]||"Select"==a[o]||"Join"==a[o]||"Query"==a[o]||"Expression"==a[o]?g="\n[<+"+d+">"+s.replace(/[":\[|{}()\]]+/g,"")+"$"+f+h+"]"+p:(a[o],g="\n[<"+d+">"+s.replace(/[":\[|{}()\]]+/g,"")+"$"+f+h+"]"+p);let m="";if("root"!=i.parent){m="^";let b=i.nested.split("|");b.forEach(n=>{m+=e[parseInt(n)-1]?.name+">"}),m=m.substring(0,m.length-1)}let _="";oSettings.customFlagsOnDiagram&&i.flags?.length>0&&(JSON.stringify(i.flags).includes("Warning")&&(_="warning"),JSON.stringify(i.flags).includes("Error")&&(_="error")),"Switch"==i.type||"If"==i.type||"Foreach"==i.type||"Until"==i.type||"Scope"==i.type||"Terminate"==i.type||i.type.includes("Variable")||i.type.includes("Compose")||"Table"==i.type||"ParseJson"==i.type||"Select"==i.type||"Join"==i.type||"Query"==i.type||i.type,t+=g=g+"[<"+_+">"+i.name.replace(/[":\[|{}()\]]+/g,"")+"$"+i.icon+m+"]"}})}),t}