@logan-jun/cd1-rag-chat 0.3.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (58) hide show
  1. package/dist/assets/arc-scm8MMJs.js +1 -0
  2. package/dist/assets/architectureDiagram-3BPJPVTR-B4HnSePg.js +36 -0
  3. package/dist/assets/blockDiagram-GPEHLZMM-Br570MCp.js +132 -0
  4. package/dist/assets/c4Diagram-AAUBKEIU-DkTSnj0d.js +10 -0
  5. package/dist/assets/channel-DiZdOJ9B.js +1 -0
  6. package/dist/assets/chunk-2J33WTMH-CrTr9xzl.js +1 -0
  7. package/dist/assets/chunk-4BX2VUAB-D0wgG8xH.js +1 -0
  8. package/dist/assets/chunk-55IACEB6-Duov_Htw.js +1 -0
  9. package/dist/assets/chunk-727SXJPM-DDvX-nhe.js +206 -0
  10. package/dist/assets/chunk-AQP2D5EJ-09XyW5jk.js +231 -0
  11. package/dist/assets/chunk-FMBD7UC4-C8_DpYrt.js +15 -0
  12. package/dist/assets/chunk-ND2GUHAM-BeN_xln2.js +1 -0
  13. package/dist/assets/chunk-QZHKN3VN-vOMf7cyc.js +1 -0
  14. package/dist/assets/classDiagram-4FO5ZUOK-DDDJcc4H.js +1 -0
  15. package/dist/assets/classDiagram-v2-Q7XG4LA2-DDDJcc4H.js +1 -0
  16. package/dist/assets/cose-bilkent-S5V4N54A-pK2cAyHP.js +1 -0
  17. package/dist/assets/cytoscape.esm-C6a136cz.js +331 -0
  18. package/dist/assets/dagre-BM42HDAG-kL6GF6jg.js +4 -0
  19. package/dist/assets/defaultLocale-CrowFXzY.js +1 -0
  20. package/dist/assets/diagram-2AECGRRQ-dykDFI_K.js +43 -0
  21. package/dist/assets/diagram-5GNKFQAL-WJvXRiuM.js +10 -0
  22. package/dist/assets/diagram-KO2AKTUF-D2favLYT.js +3 -0
  23. package/dist/assets/diagram-LMA3HP47-CXVuETL_.js +24 -0
  24. package/dist/assets/diagram-OG6HWLK6-BcJzKfoj.js +24 -0
  25. package/dist/assets/erDiagram-TEJ5UH35-thR4lGNd.js +85 -0
  26. package/dist/assets/flowDiagram-I6XJVG4X-BxfwGe_r.js +162 -0
  27. package/dist/assets/ganttDiagram-6RSMTGT7-fwLip5Nh.js +292 -0
  28. package/dist/assets/gitGraphDiagram-PVQCEYII-D-oFePm0.js +106 -0
  29. package/dist/assets/graph-BB0J4w4c.js +1 -0
  30. package/dist/assets/index-CbSmh0fl.js +86 -0
  31. package/dist/assets/index-DDQloFPo.css +1 -0
  32. package/dist/assets/infoDiagram-5YYISTIA-D4MiRb75.js +2 -0
  33. package/dist/assets/init-Gi6I4Gst.js +1 -0
  34. package/dist/assets/ishikawaDiagram-YF4QCWOH-BXo0XBC7.js +70 -0
  35. package/dist/assets/journeyDiagram-JHISSGLW-CqScJnKj.js +139 -0
  36. package/dist/assets/kanban-definition-UN3LZRKU-MV47OAPx.js +89 -0
  37. package/dist/assets/katex-DOa3rsiF.js +257 -0
  38. package/dist/assets/layout-X4aHIIHH.js +1 -0
  39. package/dist/assets/linear-DLYnUT7M.js +1 -0
  40. package/dist/assets/mermaid.core-DuagT3S2.js +307 -0
  41. package/dist/assets/mindmap-definition-RKZ34NQL-HJXV2iNz.js +96 -0
  42. package/dist/assets/ordinal-Cboi1Yqb.js +1 -0
  43. package/dist/assets/pieDiagram-4H26LBE5-BVHq2F8U.js +30 -0
  44. package/dist/assets/quadrantDiagram-W4KKPZXB-BUPck4BP.js +7 -0
  45. package/dist/assets/requirementDiagram-4Y6WPE33-DQl89ON9.js +84 -0
  46. package/dist/assets/sankeyDiagram-5OEKKPKP-DD5N52ZQ.js +40 -0
  47. package/dist/assets/sequenceDiagram-3UESZ5HK-zctcDLCC.js +162 -0
  48. package/dist/assets/stateDiagram-AJRCARHV-Vyn0aDZv.js +1 -0
  49. package/dist/assets/stateDiagram-v2-BHNVJYJU-BY6pmmBt.js +1 -0
  50. package/dist/assets/timeline-definition-PNZ67QCA-1XNXDgjy.js +120 -0
  51. package/dist/assets/vennDiagram-CIIHVFJN-DZ1fF_Rg.js +34 -0
  52. package/dist/assets/wardley-L42UT6IY-DsEWk1n9.js +173 -0
  53. package/dist/assets/wardleyDiagram-YWT4CUSO-CpQIM9KB.js +78 -0
  54. package/dist/assets/xychartDiagram-2RQKCTM6-CIryoW2U.js +7 -0
  55. package/dist/index.html +2 -2
  56. package/package.json +18 -4
  57. package/dist/assets/index-Bp_ymGdi.js +0 -89
  58. package/dist/assets/index-D4hGefa4.css +0 -1
@@ -0,0 +1 @@
1
+ .sm-root{font-size:14px;line-height:1.65;color:#1a1a1a;word-wrap:break-word}.sm-root p{margin:0 0 10px}.sm-root p:last-child{margin-bottom:0}.sm-root h1,.sm-root h2,.sm-root h3,.sm-root h4{margin:16px 0 8px;font-weight:700;line-height:1.3}.sm-root h1{font-size:18px}.sm-root h2{font-size:16px}.sm-root h3{font-size:15px}.sm-root ul,.sm-root ol{padding-left:22px;margin:6px 0 10px}.sm-root li{margin-bottom:3px}.sm-root strong{font-weight:700}.sm-root em{font-style:italic}.sm-root :not(pre)>code{background:#f3f4f6;padding:1px 6px;border-radius:4px;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,monospace;font-size:12.5px;color:#d63b30}.sm-root .code-card{margin:12px 0;border:1px solid #e5e5e5;border-radius:8px;overflow:hidden;background:#fff}.sm-root .code-head{display:flex;align-items:center;justify-content:space-between;padding:6px 12px;background:#f7f7f7;border-bottom:1px solid #e5e5e5}.sm-root .code-lang{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:11px;font-weight:600;letter-spacing:.4px;text-transform:uppercase;color:#ff7461}.sm-root .code-copy{display:inline-flex;align-items:center;gap:5px;background:transparent;border:1px solid transparent;color:#666;font:inherit;font-size:11px;padding:3px 8px;border-radius:4px;cursor:pointer;transition:all .15s}.sm-root .code-copy:hover{background:#fff;color:#1a1a1a;border-color:#d0d0d0}.sm-root .code-copy.is-copied{color:#16a34a;border-color:transparent}.sm-root .code-copy svg{display:block}.sm-root .code-body{background:#fafafa;color:#1a1a1a;padding:12px 14px;margin:0;overflow-x:auto;font-family:ui-monospace,SFMono-Regular,SF Mono,Menlo,monospace;font-size:12.5px;line-height:1.55;white-space:pre}.sm-root .code-body code{background:transparent;color:inherit;padding:0;font:inherit}.sm-root .code-body::-webkit-scrollbar{height:6px}.sm-root .code-body::-webkit-scrollbar-track{background:#f0f0f0}.sm-root .code-body::-webkit-scrollbar-thumb{background:#ccc;border-radius:3px}.sm-root .code-body::-webkit-scrollbar-thumb:hover{background:#ff7461}.sm-root table{border-collapse:collapse;margin:12px 0;font-size:13px;width:100%;background:#fff}.sm-root thead th{text-align:left;font-weight:700;font-size:12px;color:#1a1a1a;padding:10px 14px;background:#fff;border-bottom:2px solid #ff7461}.sm-root tbody td{padding:9px 14px;color:#1a1a1a;background:#fff;border-bottom:1px solid #f0f0f0}.sm-root tbody tr:last-child td{border-bottom:0}.sm-root .mermaid{background:#fff;border:1px solid #e5e5e5;border-radius:8px;padding:12px;margin:12px 0;text-align:center;overflow-x:auto;font-family:ui-monospace,SFMono-Regular,monospace;font-size:12px;color:#888}.sm-root .mermaid svg{max-width:100%;height:auto}.sm-root .mermaid-capture{position:absolute;top:8px;right:8px;width:28px;height:28px;display:inline-flex;align-items:center;justify-content:center;background:#fff;border:1px solid #e5e5e5;border-radius:6px;color:#666;cursor:pointer;padding:0;opacity:0;transition:opacity .15s,color .15s,border-color .15s,background .15s;box-shadow:0 1px 3px #0000000f}.sm-root .mermaid:hover .mermaid-capture{opacity:1}.sm-root .mermaid-capture:hover{color:#ff7461;border-color:#ff7461}.sm-root .mermaid-capture.is-busy{opacity:1;color:#999;cursor:progress}.sm-root .mermaid-capture.is-success{opacity:1;color:#16a34a;border-color:#16a34a}.sm-root .mermaid-capture.is-error{opacity:1;color:#dc2626;border-color:#dc2626}.sm-root blockquote{border-left:3px solid #ff7461;padding:0 0 0 12px;margin:10px 0;color:#555}.sm-root a{color:#ff7461;text-decoration:none}.sm-root a:hover{text-decoration:underline}.sm-root hr{border:0;border-top:1px solid #e5e5e5;margin:16px 0}.cl-root[data-v-4145e81e]{margin-top:12px;border-top:1px dashed #e5e5e5;padding-top:10px}.cl-toggle[data-v-4145e81e]{display:inline-flex;align-items:center;gap:8px;background:transparent;border:0;padding:4px 0;cursor:pointer;font:inherit;font-size:12px;color:#1a1a1a}.cl-toggle[data-v-4145e81e]:hover{color:#ff7461}.cl-chev[data-v-4145e81e]{display:inline-block;font-size:10px;color:#ff7461;transition:transform .18s;transform-origin:center}.cl-chev-open[data-v-4145e81e]{transform:rotate(90deg)}.cl-toggle-label[data-v-4145e81e]{font-weight:600}.cl-toggle-hint[data-v-4145e81e]{color:#999;font-size:11px}.cl-list[data-v-4145e81e]{display:grid;gap:8px;margin-top:10px}.cl-card[data-v-4145e81e]{background:#fafafa;border:1px solid #e5e5e5;border-left:3px solid #ff7461;border-radius:6px;padding:10px 12px}.cl-card-head[data-v-4145e81e]{display:flex;align-items:center;gap:6px;font-size:13px}.cl-idx[data-v-4145e81e]{color:#ff7461;font-weight:700}.cl-title[data-v-4145e81e]{flex:1;color:#1a1a1a;font-weight:600}.cl-score[data-v-4145e81e]{color:#999;font-size:11px;font-family:ui-monospace,monospace}.cl-meta[data-v-4145e81e]{margin-top:2px;font-size:11px;color:#999}.cl-preview[data-v-4145e81e]{margin-top:6px;font-size:12px;color:#555;line-height:1.5;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.cl-fade-enter-active[data-v-4145e81e],.cl-fade-leave-active[data-v-4145e81e]{transition:opacity .15s,transform .15s}.cl-fade-enter-from[data-v-4145e81e],.cl-fade-leave-to[data-v-4145e81e]{opacity:0;transform:translateY(-4px)}.sh-root[data-v-0f419351]{display:flex;flex-direction:column;gap:4px;margin-bottom:10px}.sh-line[data-v-0f419351]{display:inline-flex;align-items:center;gap:8px;font-size:12px;color:#1a1a1a;transition:opacity .4s,color .4s}.sh-fade[data-v-0f419351]{opacity:.4;color:#888}.sh-icon[data-v-0f419351]{display:inline-flex;align-items:center;justify-content:center;width:18px;height:18px;border-radius:50%;background:#fff5f3;color:#ff7461;flex-shrink:0}.sh-fade .sh-icon[data-v-0f419351]{background:#f5f5f5;color:#aaa}.sh-dot[data-v-0f419351]{width:6px;height:6px;border-radius:50%;background:#ff7461;display:inline-block}.sh-text[data-v-0f419351]{line-height:1.3}.mi-row[data-v-0f90ce16]{display:flex;gap:12px;padding:14px 0}.mi-user[data-v-0f90ce16]{justify-content:flex-end}.mi-avatar[data-v-0f90ce16]{width:32px;height:32px;border-radius:8px;flex-shrink:0;display:flex;align-items:center;justify-content:center;color:#fff;background:linear-gradient(135deg,#ff7461,#ff9686);box-shadow:0 2px 8px #ff746159}.mi-avatar svg[data-v-0f90ce16]{width:20px;height:20px;display:block}.mi-body[data-v-0f90ce16]{flex:1;min-width:0}.mi-body-user[data-v-0f90ce16]{flex:0 1 auto;max-width:75%;display:flex;justify-content:flex-end}.mi-role[data-v-0f90ce16]{font-size:11px;font-weight:700;color:#999;text-transform:uppercase;letter-spacing:.5px;margin-bottom:6px}.mi-bubble-user[data-v-0f90ce16]{background:#fff;color:#1a1a1a;border:2px solid #ff7461;padding:10px 14px;border-radius:16px 16px 4px;font-size:14px;line-height:1.55;white-space:pre-wrap;word-wrap:break-word}.mi-tool-processing[data-v-0f90ce16]{display:inline-flex;align-items:center;gap:6px;font-size:12px;color:#ff7461;padding:4px 0;margin-bottom:8px}.mi-tool-processing span[data-v-0f90ce16]{width:5px;height:5px;border-radius:50%;background:#ff7461;animation:mi-bounce-0f90ce16 1.4s infinite ease-in-out both}.mi-tool-processing span[data-v-0f90ce16]:nth-child(2){animation-delay:.16s}.mi-tool-processing span[data-v-0f90ce16]:nth-child(3){animation-delay:.32s}.mi-tool-processing em[data-v-0f90ce16]{font-style:normal;color:#999;margin-left:4px}.mi-typing[data-v-0f90ce16]{display:inline-flex;gap:4px;padding:4px 0}.mi-typing span[data-v-0f90ce16]{width:6px;height:6px;border-radius:50%;background:#ff7461;animation:mi-bounce-0f90ce16 1.4s infinite ease-in-out both}.mi-typing span[data-v-0f90ce16]:nth-child(2){animation-delay:.16s}.mi-typing span[data-v-0f90ce16]:nth-child(3){animation-delay:.32s}@keyframes mi-bounce-0f90ce16{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}.mi-error[data-v-0f90ce16]{margin-top:8px;padding:8px 10px;background:#fef2f2;color:#dc2626;border-left:3px solid #dc2626;border-radius:4px;font-size:12px}.ci-root[data-v-1e9a4d7b]{padding:12px 20px 16px;background:#fff}.ci-box[data-v-1e9a4d7b]{position:relative;display:flex;gap:8px;align-items:center;border:1px solid #e5e5e5;border-radius:10px;padding:10px 10px 10px 14px;background:#fafafa;transition:border-color .15s}.ci-box[data-v-1e9a4d7b]:focus-within{border-color:#ff7461;background:#fff}.ci-box textarea[data-v-1e9a4d7b]{flex:1;border:0;background:transparent;resize:none;font:inherit;font-size:14px;color:#1a1a1a;outline:none;line-height:1.5;max-height:200px}.ci-send[data-v-1e9a4d7b]{border:0;background:#ff7461;color:#fff;font-weight:600;font-size:13px;padding:8px 16px;border-radius:8px;cursor:pointer;font-family:inherit}.ci-send[data-v-1e9a4d7b]:hover:not(:disabled){background:#e85d4a}.ci-send[data-v-1e9a4d7b]:disabled{background:#ccc;cursor:not-allowed}.hp-root[data-v-3db415ee]{display:flex;flex-direction:column;background:#fff;border:1px solid #ececec;border-radius:12px;box-shadow:0 1px 2px #00000008,0 6px 16px #0000000d;height:100%;overflow:hidden}.hp-head[data-v-3db415ee]{display:flex;align-items:center;justify-content:space-between;padding:14px 18px;border-bottom:1px solid #f0f0f0;flex-shrink:0}.hp-title[data-v-3db415ee]{font-size:13px;font-weight:700;color:#1a1a1a;letter-spacing:.3px}.hp-clear[data-v-3db415ee]{border:0;background:transparent;color:#999;font:inherit;font-size:11px;cursor:pointer;padding:2px 4px}.hp-clear[data-v-3db415ee]:hover{color:#ff7461}.hp-empty[data-v-3db415ee]{padding:28px 16px;text-align:center;color:#999;font-size:12px}.hp-list[data-v-3db415ee]{list-style:none;padding:8px;margin:0;overflow-y:auto;flex:1}.hp-item[data-v-3db415ee]{position:relative;padding:10px 34px 10px 12px;border-radius:8px;cursor:pointer;margin-bottom:2px;transition:background .15s}.hp-item[data-v-3db415ee]:hover{background:#fafafa}.hp-item-active[data-v-3db415ee]{background:#fff5f3;box-shadow:inset 3px 0 #ff7461}.hp-item-title[data-v-3db415ee]{font-size:13px;color:#1a1a1a;line-height:1.35;font-weight:500;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}.hp-item-meta[data-v-3db415ee]{display:flex;align-items:center;gap:5px;margin-top:3px;font-size:11px;color:#999}.hp-del[data-v-3db415ee]{position:absolute;top:6px;right:6px;width:20px;height:20px;border:0;background:transparent;color:#ccc;font-size:16px;line-height:1;cursor:pointer;border-radius:4px;opacity:0;transition:opacity .15s,color .15s}.hp-item:hover .hp-del[data-v-3db415ee]{opacity:1}.hp-del[data-v-3db415ee]:hover{color:#ff7461;background:#fff5f3}@font-face{font-family:Pretendard;font-weight:400;font-style:normal;font-display:swap;src:url(./fonts/Pretendard-Regular.woff2) format("woff2")}@font-face{font-family:Pretendard;font-weight:700;font-style:normal;font-display:swap;src:url(./fonts/Pretendard-Bold.woff2) format("woff2")}:root{font-family:Pretendard,SFProDisplay,AppleSDGothicNeo,SF Pro Text,Spoqa Han Sans Neo,Noto Sans,Helvetica Neue,Helvetica,Arial,sans-serif;color-scheme:light}*{box-sizing:border-box}html,body,#app{height:100%;width:100%;margin:0;padding:0}body{background:#fff;color:#1a1a1a}.cp-root{display:flex;flex-direction:column;height:100vh;width:100vw;padding:20px;background:#fff;overflow:hidden}.cp-actions{position:absolute;top:1px;right:14px;z-index:5;display:flex;flex-direction:column;gap:6px}.cp-icon-btn{width:36px;height:36px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #e5e5e5;background:#fff;color:#1a1a1a;border-radius:8px;cursor:pointer;transition:all .15s;box-shadow:0 1px 3px #0000000a;padding:0}.cp-icon-btn:hover{border-color:#ff7461;color:#ff7461}.cp-icon-btn[aria-pressed=true]{background:#fff5f3;border-color:#ff7461;color:#ff7461}.cp-body{flex:1;display:grid;grid-template-columns:1fr auto;min-height:0;overflow:hidden}.cp-chat{display:flex;flex-direction:column;min-width:0;min-height:0;overflow:hidden;position:relative;padding-right:80px}.cp-history{width:400px;min-width:400px}.cp-main{flex:1;min-height:0;overflow-y:auto;padding:0 20px;background:#fff}.cp-empty{height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;padding:40px 20px}.cp-empty-title{font-size:22px;font-weight:700;color:#1a1a1a;margin-bottom:6px}.cp-empty-sub{color:#666;font-size:14px;margin:0 0 24px}.cp-suggestions{display:grid;grid-template-columns:1fr 1fr;gap:8px;max-width:520px;width:100%}.cp-sug{border:1px solid #e5e5e5;background:#fafafa;color:#1a1a1a;padding:10px 14px;border-radius:10px;font-size:13px;text-align:left;cursor:pointer;font-family:inherit;transition:all .15s}.cp-sug:hover:not(:disabled){border-color:#ff7461;background:#ffe6e1}.cp-sug:disabled{opacity:.5;cursor:not-allowed}.cp-list{padding:8px 0;max-width:100%;margin:0 auto}@media (max-width: 900px){.cp-history{width:320px;min-width:320px}}@media (max-width: 640px){.cp-body{grid-template-columns:1fr}.cp-history{position:absolute;right:0;top:0;bottom:0;width:85vw;max-width:400px;z-index:10;box-shadow:-4px 0 12px #00000014}}
@@ -0,0 +1,2 @@
1
+ import{b as e,aE as s,b0 as o,F as i}from"./mermaid.core-DuagT3S2.js";import{p as g}from"./wardley-L42UT6IY-DsEWk1n9.js";import"./index-CbSmh0fl.js";var p={parse:e(async r=>{const a=await g("info",r);s.debug(a)},"parse")},v={version:"11.15.0"},d=e(()=>v.version,"getVersion"),m={getVersion:d},c=e((r,a,n)=>{s.debug(`rendering info diagram
2
+ `+r);const t=o(a);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw"),f={draw:c},_={parser:p,db:m,renderer:f};export{_ as diagram};
@@ -0,0 +1 @@
1
+ function t(e,a){switch(arguments.length){case 0:break;case 1:this.range(e);break;default:this.range(a).domain(e);break}return this}export{t as i};
@@ -0,0 +1,70 @@
1
+ import{b as l,a4 as ot,aN as ut,b0 as dt,l as yt,t as ft,z as pt,b4 as it,a2 as gt,b2 as kt,a1 as mt,b1 as wt,a6 as _t,F as bt}from"./mermaid.core-DuagT3S2.js";import"./index-CbSmh0fl.js";var tt=function(){var e=l(function(T,t,s,i){for(s=s||{},i=T.length;i--;s[T[i]]=t);return s},"o"),o=[1,4],a=[1,14],n=[1,12],r=[1,13],y=[6,7,8],f=[1,20],u=[1,18],w=[1,19],h=[6,7,11],x=[1,6,13,14],k=[1,23],g=[1,24],S=[1,6,7,11,13,14],O={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:l(function(t,s,i,d,p,c,$){var b=c.length-1;switch(p){case 6:case 7:return d;case 15:d.addNode(c[b-1].length,c[b].trim());break;case 16:d.addNode(0,c[b].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:o},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:o},{6:a,7:[1,10],9:9,12:11,13:n,14:r},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:a,12:15,13:n,14:r},{6:a,9:16,12:11,13:n,14:r},{6:f,7:u,10:17,11:w},e(h,[2,18],{14:[1,21]}),e(h,[2,16]),e(h,[2,17]),{6:f,7:u,10:22,11:w},{1:[2,7],6:a,12:15,13:n,14:r},e(x,[2,14],{7:k,11:g}),e(S,[2,8]),e(S,[2,9]),e(S,[2,10]),e(h,[2,15]),e(x,[2,13],{7:k,11:g}),e(S,[2,11]),e(S,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:l(function(t){var s=this,i=[0],d=[],p=[null],c=[],$=this.table,b="",v=0,M=0,E=2,L=1,N=c.slice.call(arguments,1),m=Object.create(this.lexer),V={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(V.yy[z]=this.yy[z]);m.setInput(t,V.yy),V.yy.lexer=m,V.yy.parser=this,typeof m.yylloc=="undefined"&&(m.yylloc={});var j=m.yylloc;c.push(j);var X=m.options&&m.options.ranges;typeof V.yy.parseError=="function"?this.parseError=V.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Y(B){i.length=i.length-2*B,p.length=p.length-B,c.length=c.length-B}l(Y,"popStack");function Z(){var B;return B=d.pop()||m.lex()||L,typeof B!="number"&&(B instanceof Array&&(d=B,B=d.pop()),B=s.symbols_[B]||B),B}l(Z,"lex");for(var A,F,_,P,D={},W,C,et,K;;){if(F=i[i.length-1],this.defaultActions[F]?_=this.defaultActions[F]:((A===null||typeof A=="undefined")&&(A=Z()),_=$[F]&&$[F][A]),typeof _=="undefined"||!_.length||!_[0]){var Q="";K=[];for(W in $[F])this.terminals_[W]&&W>E&&K.push("'"+this.terminals_[W]+"'");m.showPosition?Q="Parse error on line "+(v+1)+`:
2
+ `+m.showPosition()+`
3
+ Expecting `+K.join(", ")+", got '"+(this.terminals_[A]||A)+"'":Q="Parse error on line "+(v+1)+": Unexpected "+(A==L?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(Q,{text:m.match,token:this.terminals_[A]||A,line:m.yylineno,loc:j,expected:K})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+F+", token: "+A);switch(_[0]){case 1:i.push(A),p.push(m.yytext),c.push(m.yylloc),i.push(_[1]),A=null,M=m.yyleng,b=m.yytext,v=m.yylineno,j=m.yylloc;break;case 2:if(C=this.productions_[_[1]][1],D.$=p[p.length-C],D._$={first_line:c[c.length-(C||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(C||1)].first_column,last_column:c[c.length-1].last_column},X&&(D._$.range=[c[c.length-(C||1)].range[0],c[c.length-1].range[1]]),P=this.performAction.apply(D,[b,M,v,V.yy,_[1],p,c].concat(N)),typeof P!="undefined")return P;C&&(i=i.slice(0,-1*C*2),p=p.slice(0,-1*C),c=c.slice(0,-1*C)),i.push(this.productions_[_[1]][0]),p.push(D.$),c.push(D._$),et=$[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},R=function(){var T={EOF:1,parseError:l(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:l(function(t,s){return this.yy=s||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:l(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(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:l(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var d=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),i.length-1&&(this.yylineno-=i.length-1);var p=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:i?(i.length===d.length?this.yylloc.first_column:0)+d[d.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return 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).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:l(function(t){this.unput(this.match.slice(t))},"less"),pastInput:l(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:l(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:l(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
5
+ `+s+"^"},"showPosition"),test_match:l(function(t,s){var i,d,p;if(this.options.backtrack_lexer&&(p={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&&(p.yylloc.range=this.yylloc.range.slice(0))),d=t[0].match(/(?:\r\n?|\n).*/g),d&&(this.yylineno+=d.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:d?d[d.length-1].length-d[d.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],i=this.performAction.call(this,this.yy,this,s,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),i)return i;if(this._backtrack){for(var c in p)this[c]=p[c];return!1}return!1},"test_match"),next:l(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,s,i,d;this._more||(this.yytext="",this.match="");for(var p=this._currentRules(),c=0;c<p.length;c++)if(i=this._input.match(this.rules[p[c]]),i&&(!s||i[0].length>s[0].length)){if(s=i,d=c,this.options.backtrack_lexer){if(t=this.test_match(i,p[c]),t!==!1)return t;if(this._backtrack){s=!1;continue}else return!1}else if(!this.options.flex)break}return s?(t=this.test_match(s,p[d]),t!==!1?t:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:l(function(){var s=this.next();return s||this.lex()},"lex"),begin:l(function(s){this.conditionStack.push(s)},"begin"),popState:l(function(){var s=this.conditionStack.length-1;return s>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:l(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:l(function(s){return s=this.conditionStack.length-1-Math.abs(s||0),s>=0?this.conditionStack[s]:"INITIAL"},"topState"),pushState:l(function(s){this.begin(s)},"pushState"),stateStackSize:l(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:l(function(s,i,d,p){switch(d){case 0:return 6;case 1:return 8;case 2:return 8;case 3:return 6;case 4:return 7;case 5:return 13;case 6:return 14;case 7:return 11}},"anonymous"),rules:[/^(?:\s*%%.*)/i,/^(?:ishikawa-beta\b)/i,/^(?:ishikawa\b)/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[\s]+)/i,/^(?:[^\n]+)/i,/^(?:$)/i],conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7],inclusive:!0}}};return T}();O.lexer=R;function I(){this.yy={}}return l(I,"Parser"),I.prototype=O,O.Parser=I,new I}();tt.parser=tt;var xt=tt,U,vt=(U=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,ft()}getRoot(){return this.root}addNode(o,a){var u;const n=pt.sanitizeText(a,ot());if(!this.root){this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],it(n);return}(u=this.baseLevel)!=null||(this.baseLevel=o);let r=o-this.baseLevel+1;for(r<=0&&(r=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=r;)this.stack.pop();const y=this.stack[this.stack.length-1].node,f={text:n,children:[]};y.children.push(f),this.stack.push({level:r,node:f})}getAccTitle(){return gt()}setAccTitle(o){kt(o)}getAccDescription(){return mt()}setAccDescription(o){wt(o)}getDiagramTitle(){return _t()}setDiagramTitle(o){it(o)}},l(U,"IshikawaDB"),U),St=14,H=250,$t=30,Et=60,At=5,ht=82*Math.PI/180,st=Math.cos(ht),nt=Math.sin(ht),at=l((e,o,a)=>{const n=e.node().getBBox(),r=n.width+o*2,y=n.height+o*2;bt(e,y,r,a),e.attr("viewBox",`${n.x-o} ${n.y-o} ${r} ${y}`)},"applyPaddedViewBox"),It=l((e,o,a,n)=>{var V,z,j,X,Y,Z,A,F;const y=n.db.getRoot();if(!y)return;const f=ot(),{look:u,handDrawnSeed:w,themeVariables:h}=f,x=(V=ut(f.fontSize)[0])!=null?V:St,k=u==="handDrawn",g=(z=y.children)!=null?z:[],S=(X=(j=f.ishikawa)==null?void 0:j.diagramPadding)!=null?X:20,O=(Z=(Y=f.ishikawa)==null?void 0:Y.useMaxWidth)!=null?Z:!1,R=dt(o),I=R.append("g").attr("class","ishikawa"),T=k?yt.svg(R.node()):void 0,t=T?{roughSvg:T,seed:w!=null?w:0,lineColor:(A=h==null?void 0:h.lineColor)!=null?A:"#333",fillColor:(F=h==null?void 0:h.mainBkg)!=null?F:"#fff"}:void 0,s=`ishikawa-arrow-${o}`;k||I.append("defs").append("marker").attr("id",s).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 Z").attr("class","ishikawa-arrow");let i=0,d=H;const p=k?void 0:G(I,i,d,i,d,"ishikawa-spine");if(Lt(I,i,d,y.text,x,t),!g.length){k&&G(I,i,d,i,d,"ishikawa-spine",t),at(R,S,O);return}i-=20;const c=g.filter((_,P)=>P%2===0),$=g.filter((_,P)=>P%2===1),b=rt(c),v=rt($),M=b.total+v.total;let E=H,L=H;if(M>0){const _=H*2,P=H*.3;E=Math.max(P,_*(b.total/M)),L=Math.max(P,_*(v.total/M))}const N=x*2;E=Math.max(E,b.max*N),L=Math.max(L,v.max*N),d=Math.max(E,H),p&&p.attr("y1",d).attr("y2",d),I.select(".ishikawa-head-group").attr("transform",`translate(0,${d})`);const m=Math.ceil(g.length/2);for(let _=0;_<m;_++){const P=I.append("g").attr("class","ishikawa-pair");for(const[D,W,C]of[[g[_*2],-1,E],[g[_*2+1],1,L]])D&&Nt(P,D,i,d,W,C,x,t);i=P.selectAll("text").nodes().reduce((D,W)=>Math.min(D,W.getBBox().x),1/0)}if(k)G(I,i,d,0,d,"ishikawa-spine",t);else{p.attr("x1",i);const _=`url(#${s})`;I.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",_)}at(R,S,O)},"draw"),rt=l(e=>{const o=l(a=>a.children.reduce((n,r)=>n+1+o(r),0),"countDescendants");return e.reduce((a,n)=>{const r=o(n);return a.total+=r,a.max=Math.max(a.max,r),a},{total:0,max:0})},"sideStats"),Lt=l((e,o,a,n,r,y)=>{const f=Math.max(6,Math.floor(110/(r*.6))),u=e.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${o},${a})`),w=q(u,ct(n,f),0,0,"ishikawa-head-label","start",r),h=w.node().getBBox(),x=Math.max(60,h.width+6),k=Math.max(40,h.height*2+40),g=`M 0 ${-k/2} L 0 ${k/2} Q ${x*2.4} 0 0 ${-k/2} Z`;if(y){const S=y.roughSvg.path(g,{roughness:1.5,seed:y.seed,fill:y.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:y.lineColor,strokeWidth:2});u.insert(()=>S,":first-child").attr("class","ishikawa-head")}else u.insert("path",":first-child").attr("class","ishikawa-head").attr("d",g);w.attr("transform",`translate(${(x-h.width)/2-h.x+3},${-h.y-h.height/2})`)},"drawHead"),Tt=l((e,o)=>{const a=[],n=[],r=l((y,f,u)=>{var h;const w=o===-1?[...y].reverse():y;for(const x of w){const k=a.length,g=(h=x.children)!=null?h:[];a.push({depth:u,text:ct(x.text,15),parentIndex:f,childCount:g.length}),u%2===0?(n.push(k),g.length&&r(g,k,u+1)):(g.length&&r(g,k,u+1),n.push(k))}},"walk");return r(e,-1,2),{entries:a,yOrder:n}},"flattenTree"),Mt=l((e,o,a,n,r,y,f)=>{const u=e.append("g").attr("class","ishikawa-label-group"),h=q(u,o,a,n+11*r,"ishikawa-label cause","middle",y).node().getBBox();if(f){const x=f.roughSvg.rectangle(h.x-20,h.y-2,h.width+40,h.height+4,{roughness:1.5,seed:f.seed,fill:f.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:f.lineColor,strokeWidth:2});u.insert(()=>x,":first-child").attr("class","ishikawa-label-box")}else u.insert("rect",":first-child").attr("class","ishikawa-label-box").attr("x",h.x-20).attr("y",h.y-2).attr("width",h.width+40).attr("height",h.height+4)},"drawCauseLabel"),J=l((e,o,a,n,r,y)=>{const f=Math.sqrt(n*n+r*r);if(f===0)return;const u=n/f,w=r/f,h=6,x=-w*h,k=u*h,g=o,S=a,O=`M ${g} ${S} L ${g-u*h*2+x} ${S-w*h*2+k} L ${g-u*h*2-x} ${S-w*h*2-k} Z`,R=y.roughSvg.path(O,{roughness:1,seed:y.seed,fill:y.lineColor,fillStyle:"solid",stroke:y.lineColor,strokeWidth:1});e.append(()=>R)},"drawArrowMarker"),Nt=l((e,o,a,n,r,y,f,u)=>{var p;const w=(p=o.children)!=null?p:[],h=y*(w.length?1:.2),x=-st*h,k=nt*h*r,g=a+x,S=n+k;if(G(e,a,n,g,S,"ishikawa-branch",u),u&&J(e,a,n,a-g,n-S,u),Mt(e,o.text,g,S,r,f,u),!w.length)return;const{entries:O,yOrder:R}=Tt(w,r),I=O.length,T=new Array(I);for(const[c,$]of R.entries())T[$]=n+k*((c+1)/(I+1));const t=new Map;t.set(-1,{x0:a,y0:n,x1:g,y1:S,childCount:w.length,childrenDrawn:0});const s=-st,i=nt*r,d=r<0?"ishikawa-label up":"ishikawa-label down";for(const[c,$]of O.entries()){const b=T[c],v=t.get($.parentIndex),M=e.append("g").attr("class","ishikawa-sub-group");let E=0,L=0,N=0;if($.depth%2===0){const m=v.y1-v.y0;E=lt(v.x0,v.x1,m?(b-v.y0)/m:.5),L=b,N=E-($.childCount>0?Et+$.childCount*At:$t),G(M,E,b,N,b,"ishikawa-sub-branch",u),u&&J(M,E,b,1,0,u),q(M,$.text,N,b,"ishikawa-label align","end",f)}else{const m=v.childrenDrawn++;E=lt(v.x0,v.x1,(v.childCount-m)/(v.childCount+1)),L=v.y0,N=E+s*((b-L)/i),G(M,E,L,N,b,"ishikawa-sub-branch",u),u&&J(M,E,L,E-N,L-b,u),q(M,$.text,N,b,d,"end",f)}$.childCount>0&&t.set(c,{x0:E,y0:L,x1:N,y1:b,childCount:$.childCount,childrenDrawn:0})}},"drawBranch"),Pt=l(e=>e.split(/<br\s*\/?>|\n/),"splitLines"),ct=l((e,o)=>{if(e.length<=o)return e;const a=[];for(const n of e.split(/\s+/)){const r=a.length-1;r>=0&&a[r].length+1+n.length<=o?a[r]+=" "+n:a.push(n)}return a.join(`
7
+ `)},"wrapText"),q=l((e,o,a,n,r,y,f)=>{const u=Pt(o),w=f*1.05,h=e.append("text").attr("class",r).attr("text-anchor",y).attr("x",a).attr("y",n-(u.length-1)*w/2);for(const[x,k]of u.entries())h.append("tspan").attr("x",a).attr("dy",x===0?0:w).text(k);return h},"drawMultilineText"),lt=l((e,o,a)=>e+(o-e)*a,"lerp"),G=l((e,o,a,n,r,y,f)=>{if(f){const u=f.roughSvg.line(o,a,n,r,{roughness:1.5,seed:f.seed,stroke:f.lineColor,strokeWidth:2});e.append(()=>u).attr("class",y);return}return e.append("line").attr("class",y).attr("x1",o).attr("y1",a).attr("x2",n).attr("y2",r)},"drawLine"),Bt={draw:It},Ot=l(e=>`
8
+ .ishikawa .ishikawa-spine,
9
+ .ishikawa .ishikawa-branch,
10
+ .ishikawa .ishikawa-sub-branch {
11
+ stroke: ${e.lineColor};
12
+ stroke-width: 2;
13
+ fill: none;
14
+ }
15
+
16
+ .ishikawa .ishikawa-sub-branch {
17
+ stroke-width: 1;
18
+ }
19
+
20
+ .ishikawa .ishikawa-arrow {
21
+ fill: ${e.lineColor};
22
+ }
23
+
24
+ .ishikawa .ishikawa-head {
25
+ fill: ${e.mainBkg};
26
+ stroke: ${e.lineColor};
27
+ stroke-width: 2;
28
+ }
29
+
30
+ .ishikawa .ishikawa-label-box {
31
+ fill: ${e.mainBkg};
32
+ stroke: ${e.lineColor};
33
+ stroke-width: 2;
34
+ }
35
+
36
+ .ishikawa text {
37
+ font-family: ${e.fontFamily};
38
+ font-size: ${e.fontSize};
39
+ fill: ${e.textColor};
40
+ }
41
+
42
+ .ishikawa .ishikawa-head-label {
43
+ font-weight: 600;
44
+ text-anchor: middle;
45
+ dominant-baseline: middle;
46
+ font-size: 14px;
47
+ }
48
+
49
+ .ishikawa .ishikawa-label {
50
+ text-anchor: end;
51
+ }
52
+
53
+ .ishikawa .ishikawa-label.cause {
54
+ text-anchor: middle;
55
+ dominant-baseline: middle;
56
+ }
57
+
58
+ .ishikawa .ishikawa-label.align {
59
+ text-anchor: end;
60
+ dominant-baseline: middle;
61
+ }
62
+
63
+ .ishikawa .ishikawa-label.up {
64
+ dominant-baseline: baseline;
65
+ }
66
+
67
+ .ishikawa .ishikawa-label.down {
68
+ dominant-baseline: hanging;
69
+ }
70
+ `,"getStyles"),Dt=Ot,Vt={parser:xt,get db(){return new vt},renderer:Bt,styles:Dt};export{Vt as diagram};
@@ -0,0 +1,139 @@
1
+ import{g as gt}from"./chunk-FMBD7UC4-C8_DpYrt.js";import{d as mt,g as lt,f as xt,e as kt}from"./chunk-ND2GUHAM-BeN_xln2.js";import{a1 as _t,b1 as vt,a2 as bt,b2 as wt,a6 as Tt,b4 as St,b as s,a4 as R,a$ as G,F as $t,t as Mt}from"./mermaid.core-DuagT3S2.js";import{d as it}from"./arc-scm8MMJs.js";import"./index-CbSmh0fl.js";var U=function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],y=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,u,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:u.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),u.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),u.setAccDescription(this.$);break;case 12:u.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:u.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:y,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:y,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],u=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc=="undefined"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=u.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(u=w,w=u.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b=="undefined")&&(b=tt()),T=v[A]&&v[A][b]),typeof T=="undefined"||!T.length||!T[0]){var X="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?X="Parse error on line "+(C+1)+`:
2
+ `+_.showPosition()+`
3
+ Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":X="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(X,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q!="undefined")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,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:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var u=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),l.length-1&&(this.yylineno-=l.length-1);var d=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:l?(l.length===u.length?this.yylloc.first_column:0)+u[u.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return 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).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
5
+ `+n+"^"},"showPosition"),test_match:s(function(r,n){var l,u,d;if(this.options.backtrack_lexer&&(d={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&&(d.yylloc.range=this.yylloc.range.slice(0))),u=r[0].match(/(?:\r\n?|\n).*/g),u&&(this.yylineno+=u.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:u?u[u.length-1].length-u[u.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,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(r[0].length),this.matched+=r[0],l=this.performAction.call(this,this.yy,this,n,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),l)return l;if(this._backtrack){for(var c in d)this[c]=d[c];return!1}return!1},"test_match"),next:s(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,n,l,u;this._more||(this.yytext="",this.match="");for(var d=this._currentRules(),c=0;c<d.length;c++)if(l=this._input.match(this.rules[d[c]]),l&&(!n||l[0].length>n[0].length)){if(n=l,u=c,this.options.backtrack_lexer){if(r=this.test_match(l,d[c]),r!==!1)return r;if(this._backtrack){n=!1;continue}else return!1}else if(!this.options.flex)break}return n?(r=this.test_match(n,d[u]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:s(function(){var n=this.next();return n||this.lex()},"lex"),begin:s(function(n){this.conditionStack.push(n)},"begin"),popState:s(function(){var n=this.conditionStack.length-1;return n>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:s(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:s(function(n){return n=this.conditionStack.length-1-Math.abs(n||0),n>=0?this.conditionStack[n]:"INITIAL"},"topState"),pushState:s(function(n){this.begin(n)},"pushState"),stateStackSize:s(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:s(function(n,l,u,d){switch(u){case 0:break;case 1:break;case 2:return 10;case 3:break;case 4:break;case 5:return 4;case 6:return 11;case 7:return this.begin("acc_title"),12;case 8:return this.popState(),"acc_title_value";case 9:return this.begin("acc_descr"),14;case 10:return this.popState(),"acc_descr_value";case 11:this.begin("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 17;case 15:return 18;case 16:return 19;case 17:return":";case 18:return 6;case 19:return"INVALID"}},"anonymous"),rules:[/^(?:%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:[\n]+)/i,/^(?:\s+)/i,/^(?:#[^\n]*)/i,/^(?:journey\b)/i,/^(?:title\s[^#\n;]+)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:[\}])/i,/^(?:[^\}]*)/i,/^(?:section\s[^#:\n;]+)/i,/^(?:[^#:\n;]+)/i,/^(?::[^#\n;]+)/i,/^(?::)/i,/^(?:$)/i,/^(?:.)/i],conditions:{acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},INITIAL:{rules:[0,1,2,3,4,5,6,7,9,11,14,15,16,17,18,19],inclusive:!0}}};return h}();g.lexer=m;function x(){this.yy={}}return s(x,"Parser"),x.prototype=g,g.Parser=x,new x}();U.parser=U;var Et=U,V="",J=[],L=[],B=[],Ct=s(function(){J.length=0,L.length=0,V="",B.length=0,Mt()},"clear"),Pt=s(function(t){V=t,J.push(t)},"addSection"),It=s(function(){return J},"getSections"),At=s(function(){let t=rt();const e=100;let a=0;for(;!t&&a<e;)t=rt(),a++;return L.push(...B),L},"getTasks"),Ft=s(function(){const t=[];return L.forEach(a=>{a.people&&t.push(...a.people)}),[...new Set(t)].sort()},"updateActors"),Vt=s(function(t,e){const a=e.substr(1).split(":");let f=0,i=[];a.length===1?(f=Number(a[0]),i=[]):(f=Number(a[0]),i=a[1].split(","));const y=i.map(o=>o.trim()),p={section:V,type:V,people:y,task:t,score:f};B.push(p)},"addTask"),Rt=s(function(t){const e={section:V,type:V,description:t,task:t,classes:[]};L.push(e)},"addTaskOrg"),rt=s(function(){const t=s(function(a){return B[a].processed},"compileTask");let e=!0;for(const[a,f]of B.entries())t(a),e=e&&f.processed;return e},"compileTasks"),Lt=s(function(){return Ft()},"getActors"),nt={getConfig:s(()=>R().journey,"getConfig"),clear:Ct,setDiagramTitle:St,getDiagramTitle:Tt,setAccTitle:wt,getAccTitle:bt,setAccDescription:vt,getAccDescription:_t,addSection:Pt,getSections:It,getTasks:At,addTask:Vt,addTaskOrg:Rt,getActors:Lt},Bt=s(t=>`.label {
7
+ font-family: ${t.fontFamily};
8
+ color: ${t.textColor};
9
+ }
10
+ .mouth {
11
+ stroke: #666;
12
+ }
13
+
14
+ line {
15
+ stroke: ${t.textColor}
16
+ }
17
+
18
+ .legend {
19
+ fill: ${t.textColor};
20
+ font-family: ${t.fontFamily};
21
+ }
22
+
23
+ .label text {
24
+ fill: #333;
25
+ }
26
+ .label {
27
+ color: ${t.textColor}
28
+ }
29
+
30
+ .face {
31
+ ${t.faceColor?`fill: ${t.faceColor}`:"fill: #FFF8DC"};
32
+ stroke: #999;
33
+ }
34
+
35
+ .node rect,
36
+ .node circle,
37
+ .node ellipse,
38
+ .node polygon,
39
+ .node path {
40
+ fill: ${t.mainBkg};
41
+ stroke: ${t.nodeBorder};
42
+ stroke-width: 1px;
43
+ }
44
+
45
+ .node .label {
46
+ text-align: center;
47
+ }
48
+ .node.clickable {
49
+ cursor: pointer;
50
+ }
51
+
52
+ .arrowheadPath {
53
+ fill: ${t.arrowheadColor};
54
+ }
55
+
56
+ .edgePath .path {
57
+ stroke: ${t.lineColor};
58
+ stroke-width: 1.5px;
59
+ }
60
+
61
+ .flowchart-link {
62
+ stroke: ${t.lineColor};
63
+ fill: none;
64
+ }
65
+
66
+ .edgeLabel {
67
+ background-color: ${t.edgeLabelBackground};
68
+ rect {
69
+ opacity: 0.5;
70
+ }
71
+ text-align: center;
72
+ }
73
+
74
+ .cluster rect {
75
+ }
76
+
77
+ .cluster text {
78
+ fill: ${t.titleColor};
79
+ }
80
+
81
+ div.mermaidTooltip {
82
+ position: absolute;
83
+ text-align: center;
84
+ max-width: 200px;
85
+ padding: 2px;
86
+ font-family: ${t.fontFamily};
87
+ font-size: 12px;
88
+ background: ${t.tertiaryColor};
89
+ border: 1px solid ${t.border2};
90
+ border-radius: 2px;
91
+ pointer-events: none;
92
+ z-index: 100;
93
+ }
94
+
95
+ .task-type-0, .section-type-0 {
96
+ ${t.fillType0?`fill: ${t.fillType0}`:""};
97
+ }
98
+ .task-type-1, .section-type-1 {
99
+ ${t.fillType0?`fill: ${t.fillType1}`:""};
100
+ }
101
+ .task-type-2, .section-type-2 {
102
+ ${t.fillType0?`fill: ${t.fillType2}`:""};
103
+ }
104
+ .task-type-3, .section-type-3 {
105
+ ${t.fillType0?`fill: ${t.fillType3}`:""};
106
+ }
107
+ .task-type-4, .section-type-4 {
108
+ ${t.fillType0?`fill: ${t.fillType4}`:""};
109
+ }
110
+ .task-type-5, .section-type-5 {
111
+ ${t.fillType0?`fill: ${t.fillType5}`:""};
112
+ }
113
+ .task-type-6, .section-type-6 {
114
+ ${t.fillType0?`fill: ${t.fillType6}`:""};
115
+ }
116
+ .task-type-7, .section-type-7 {
117
+ ${t.fillType0?`fill: ${t.fillType7}`:""};
118
+ }
119
+
120
+ .actor-0 {
121
+ ${t.actor0?`fill: ${t.actor0}`:""};
122
+ }
123
+ .actor-1 {
124
+ ${t.actor1?`fill: ${t.actor1}`:""};
125
+ }
126
+ .actor-2 {
127
+ ${t.actor2?`fill: ${t.actor2}`:""};
128
+ }
129
+ .actor-3 {
130
+ ${t.actor3?`fill: ${t.actor3}`:""};
131
+ }
132
+ .actor-4 {
133
+ ${t.actor4?`fill: ${t.actor4}`:""};
134
+ }
135
+ .actor-5 {
136
+ ${t.actor5?`fill: ${t.actor5}`:""};
137
+ }
138
+ ${gt()}
139
+ `,"getStyles"),jt=Bt,K=s(function(t,e){return kt(t,e)},"drawRect"),Nt=s(function(t,e){const f=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",15).attr("stroke-width",2).attr("overflow","visible"),i=t.append("g");i.append("circle").attr("cx",e.cx-15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),i.append("circle").attr("cx",e.cx+15/3).attr("cy",e.cy-15/3).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666");function y(g){const m=it().startAngle(Math.PI/2).endAngle(3*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}s(y,"smile");function p(g){const m=it().startAngle(3*Math.PI/2).endAngle(5*(Math.PI/2)).innerRadius(7.5).outerRadius(6.8181818181818175);g.append("path").attr("class","mouth").attr("d",m).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}s(p,"sad");function o(g){g.append("line").attr("class","mouth").attr("stroke",2).attr("x1",e.cx-5).attr("y1",e.cy+7).attr("x2",e.cx+5).attr("y2",e.cy+7).attr("class","mouth").attr("stroke-width","1px").attr("stroke","#666")}return s(o,"ambivalent"),e.score>3?y(i):e.score<3?p(i):o(i),f},"drawFace"),ot=s(function(t,e){const a=t.append("circle");return a.attr("cx",e.cx),a.attr("cy",e.cy),a.attr("class","actor-"+e.pos),a.attr("fill",e.fill),a.attr("stroke",e.stroke),a.attr("r",e.r),a.class!==void 0&&a.attr("class",a.class),e.title!==void 0&&a.append("title").text(e.title),a},"drawCircle"),ct=s(function(t,e){return xt(t,e)},"drawText"),zt=s(function(t,e){function a(i,y,p,o,g){return i+","+y+" "+(i+p)+","+y+" "+(i+p)+","+(y+o-g)+" "+(i+p-g*1.2)+","+(y+o)+" "+i+","+(y+o)}s(a,"genPoints");const f=t.append("polygon");f.attr("points",a(e.x,e.y,50,20,7)),f.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,ct(t,e)},"drawLabel"),Wt=s(function(t,e,a){const f=t.append("g"),i=lt();i.x=e.x,i.y=e.y,i.fill=e.fill,i.width=a.width*e.taskCount+a.diagramMarginX*(e.taskCount-1),i.height=a.height,i.class="journey-section section-type-"+e.num,i.rx=3,i.ry=3,K(f,i),ht(a)(e.text,f,i.x,i.y,i.width,i.height,{class:"journey-section section-type-"+e.num},a,e.colour)},"drawSection"),Z=-1,Ot=s(function(t,e,a,f){const i=e.x+a.width/2,y=t.append("g");Z++;const p=300+5*30;y.append("line").attr("id",f+"-task"+Z).attr("x1",i).attr("y1",e.y).attr("x2",i).attr("y2",p).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),Nt(y,{cx:i,cy:300+(5-e.score)*30,score:e.score});const o=lt();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=a.width,o.height=a.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,K(y,o);let g=e.x+14;e.people.forEach(m=>{const x=e.actors[m].color,h={cx:g,cy:e.y,r:7,fill:x,stroke:"#000",title:m,pos:e.actors[m].position};ot(y,h),g+=10}),ht(a)(e.task,y,o.x,o.y,o.width,o.height,{class:"task"},a,e.colour)},"drawTask"),Yt=s(function(t,e){mt(t,e)},"drawBackgroundRect"),ht=function(){function t(i,y,p,o,g,m,x,h){const r=y.append("text").attr("x",p+g/2).attr("y",o+m/2+5).style("font-color",h).style("text-anchor","middle").text(i);f(r,x)}s(t,"byText");function e(i,y,p,o,g,m,x,h,r){const{taskFontSize:n,taskFontFamily:l}=h,u=i.split(/<br\s*\/?>/gi);for(let d=0;d<u.length;d++){const c=d*n-n*(u.length-1)/2,v=y.append("text").attr("x",p+g/2).attr("y",o).attr("fill",r).style("text-anchor","middle").style("font-size",n).style("font-family",l);v.append("tspan").attr("x",p+g/2).attr("dy",c).text(u[d]),v.attr("y",o+m/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),f(v,x)}}s(e,"byTspan");function a(i,y,p,o,g,m,x,h){const r=y.append("switch"),l=r.append("foreignObject").attr("x",p).attr("y",o).attr("width",g).attr("height",m).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");l.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(i),e(i,r,p,o,g,m,x,h),f(l,x)}s(a,"byFo");function f(i,y){for(const p in y)p in y&&i.attr(p,y[p])}return s(f,"_setTextAttrs"),function(i){return i.textPlacement==="fo"?a:i.textPlacement==="old"?t:e}}(),qt=s(function(t,e){Z=-1,t.append("defs").append("marker").attr("id",e+"-arrowhead").attr("refX",5).attr("refY",2).attr("markerWidth",6).attr("markerHeight",4).attr("orient","auto").append("path").attr("d","M 0,0 V 4 L6,2 Z")},"initGraphics"),j={drawRect:K,drawCircle:ot,drawSection:Wt,drawText:ct,drawLabel:zt,drawTask:Ot,drawBackgroundRect:Yt,initGraphics:qt},Xt=s(function(t){Object.keys(t).forEach(function(a){$[a]=t[a]})},"setConf"),E={},W=0;function ut(t){const e=R().journey,a=e.maxLabelWidth;W=0;let f=60;Object.keys(E).forEach(i=>{const y=E[i].color,p={cx:20,cy:f,r:7,fill:y,stroke:"#000",pos:E[i].position};j.drawCircle(t,p);let o=t.append("text").attr("visibility","hidden").text(i);const g=o.node().getBoundingClientRect().width;o.remove();let m=[];if(g<=a)m=[i];else{const x=i.split(" ");let h="";o=t.append("text").attr("visibility","hidden"),x.forEach(r=>{const n=h?`${h} ${r}`:r;if(o.text(n),o.node().getBoundingClientRect().width>a){if(h&&m.push(h),h=r,o.text(r),o.node().getBoundingClientRect().width>a){let u="";for(const d of r)u+=d,o.text(u+"-"),o.node().getBoundingClientRect().width>a&&(m.push(u.slice(0,-1)+"-"),u=d);h=u}}else h=n}),h&&m.push(h),o.remove()}m.forEach((x,h)=>{var u;const r={x:40,y:f+7+h*20,fill:"#666",text:x,textMargin:(u=e.boxTextMargin)!=null?u:5},l=j.drawText(t,r).node().getBoundingClientRect().width;l>W&&l>e.leftMargin-l&&(W=l)}),f+=Math.max(20,m.length*20)})}s(ut,"drawActorLegend");var $=R().journey,P=0,Gt=s(function(t,e,a,f){const i=R(),y=i.journey.titleColor,p=i.journey.titleFontSize,o=i.journey.titleFontFamily,g=i.securityLevel;let m;g==="sandbox"&&(m=G("#i"+e));const x=g==="sandbox"?G(m.nodes()[0].contentDocument.body):G("body");S.init();const h=x.select("#"+e);j.initGraphics(h,e);const r=f.db.getTasks(),n=f.db.getDiagramTitle(),l=f.db.getActors();for(const C in E)delete E[C];let u=0;l.forEach(C=>{E[C]={color:$.actorColours[u%$.actorColours.length],position:u},u++}),ut(h),P=$.leftMargin+W,S.insert(0,0,P,Object.keys(E).length*50),Ht(h,r,0,e);const d=S.getBounds();n&&h.append("text").text(n).attr("x",P).attr("font-size",p).attr("font-weight","bold").attr("y",25).attr("fill",y).attr("font-family",o);const c=d.stopy-d.starty+2*$.diagramMarginY,v=P+d.stopx+2*$.diagramMarginX;$t(h,c,v,$.useMaxWidth),h.append("line").attr("x1",P).attr("y1",$.height*4).attr("x2",v-P-4).attr("y2",$.height*4).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const k=n?70:0;h.attr("viewBox",`${d.startx} -25 ${v} ${c+k}`),h.attr("preserveAspectRatio","xMinYMin meet"),h.attr("height",c+k+25)},"draw"),S={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:s(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:s(function(t,e,a,f){t[e]===void 0?t[e]=a:t[e]=f(a,t[e])},"updateVal"),updateBounds:s(function(t,e,a,f){const i=R().journey,y=this;let p=0;function o(g){return s(function(x){p++;const h=y.sequenceItems.length-p+1;y.updateVal(x,"starty",e-h*i.boxMargin,Math.min),y.updateVal(x,"stopy",f+h*i.boxMargin,Math.max),y.updateVal(S.data,"startx",t-h*i.boxMargin,Math.min),y.updateVal(S.data,"stopx",a+h*i.boxMargin,Math.max),g!=="activation"&&(y.updateVal(x,"startx",t-h*i.boxMargin,Math.min),y.updateVal(x,"stopx",a+h*i.boxMargin,Math.max),y.updateVal(S.data,"starty",e-h*i.boxMargin,Math.min),y.updateVal(S.data,"stopy",f+h*i.boxMargin,Math.max))},"updateItemBounds")}s(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:s(function(t,e,a,f){const i=Math.min(t,a),y=Math.max(t,a),p=Math.min(e,f),o=Math.max(e,f);this.updateVal(S.data,"startx",i,Math.min),this.updateVal(S.data,"starty",p,Math.min),this.updateVal(S.data,"stopx",y,Math.max),this.updateVal(S.data,"stopy",o,Math.max),this.updateBounds(i,p,y,o)},"insert"),bumpVerticalPos:s(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:s(function(){return this.verticalPos},"getVerticalPos"),getBounds:s(function(){return this.data},"getBounds")},H=$.sectionFills,st=$.sectionColours,Ht=s(function(t,e,a,f){const i=R().journey;let y="";const p=i.height*2+i.diagramMarginY,o=a+p;let g=0,m="#CCC",x="black",h=0;for(const[r,n]of e.entries()){if(y!==n.section){m=H[g%H.length],h=g%H.length,x=st[g%st.length];let u=0;const d=n.section;for(let v=r;v<e.length&&e[v].section==d;v++)u=u+1;const c={x:r*i.taskMargin+r*i.width+P,y:50,text:n.section,fill:m,num:h,colour:x,taskCount:u};j.drawSection(t,c,i),y=n.section,g++}const l=n.people.reduce((u,d)=>(E[d]&&(u[d]=E[d]),u),{});n.x=r*i.taskMargin+r*i.width+P,n.y=o,n.width=i.diagramMarginX,n.height=i.diagramMarginY,n.colour=x,n.fill=m,n.num=h,n.actors=l,j.drawTask(t,n,i,f),S.insert(n.x,n.y,n.x+n.width+i.taskMargin,300+5*30)}},"drawTasks"),at={setConf:Xt,draw:Gt},Dt={parser:Et,db:nt,renderer:at,styles:jt,init:s(t=>{at.setConf(t.journey),nt.clear()},"init")};export{Dt as diagram};
@@ -0,0 +1,89 @@
1
+ import{b as c,aE as ne,a4 as z,b0 as fe,al as ye,ao as be,aR as me,b7 as Ee,T as J,aZ as G,aD as ke,J as _e,av as Se,aA as le,M as ce}from"./mermaid.core-DuagT3S2.js";import{g as Ne}from"./chunk-FMBD7UC4-C8_DpYrt.js";import"./index-CbSmh0fl.js";var ee=function(){var e=c(function(d,s,t,a){for(t=t||{},a=d.length;a--;t[d[a]]=s);return t},"o"),p=[1,4],f=[1,13],r=[1,12],m=[1,15],_=[1,16],u=[1,20],y=[1,19],D=[6,7,8],g=[1,26],O=[1,24],L=[1,25],E=[6,7,11],I=[1,31],i=[6,7,11,24],V=[1,6,13,16,17,20,23],M=[1,35],U=[1,36],w=[1,6,7,11,13,16,17,20,23],j=[1,38],B={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,t,a,l,h,n,T){var o=n.length-1;switch(h){case 6:case 7:return l;case 8:l.getLogger().trace("Stop NL ");break;case 9:l.getLogger().trace("Stop EOF ");break;case 11:l.getLogger().trace("Stop NL2 ");break;case 12:l.getLogger().trace("Stop EOF2 ");break;case 15:l.getLogger().info("Node: ",n[o-1].id),l.addNode(n[o-2].length,n[o-1].id,n[o-1].descr,n[o-1].type,n[o]);break;case 16:l.getLogger().info("Node: ",n[o].id),l.addNode(n[o-1].length,n[o].id,n[o].descr,n[o].type);break;case 17:l.getLogger().trace("Icon: ",n[o]),l.decorateNode({icon:n[o]});break;case 18:case 23:l.decorateNode({class:n[o]});break;case 19:l.getLogger().trace("SPACELIST");break;case 20:l.getLogger().trace("Node: ",n[o-1].id),l.addNode(0,n[o-1].id,n[o-1].descr,n[o-1].type,n[o]);break;case 21:l.getLogger().trace("Node: ",n[o].id),l.addNode(0,n[o].id,n[o].descr,n[o].type);break;case 22:l.decorateNode({icon:n[o]});break;case 27:l.getLogger().trace("node found ..",n[o-2]),this.$={id:n[o-1],descr:n[o-1],type:l.getType(n[o-2],n[o])};break;case 28:this.$={id:n[o],descr:n[o],type:0};break;case 29:l.getLogger().trace("node found ..",n[o-3]),this.$={id:n[o-3],descr:n[o-1],type:l.getType(n[o-2],n[o])};break;case 30:this.$=n[o-1]+n[o];break;case 31:this.$=n[o];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:p},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:p},{6:f,7:[1,10],9:9,12:11,13:r,14:14,16:m,17:_,18:17,19:18,20:u,23:y},e(D,[2,3]),{1:[2,2]},e(D,[2,4]),e(D,[2,5]),{1:[2,6],6:f,12:21,13:r,14:14,16:m,17:_,18:17,19:18,20:u,23:y},{6:f,9:22,12:11,13:r,14:14,16:m,17:_,18:17,19:18,20:u,23:y},{6:g,7:O,10:23,11:L},e(E,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:u,23:y}),e(E,[2,19]),e(E,[2,21],{15:30,24:I}),e(E,[2,22]),e(E,[2,23]),e(i,[2,25]),e(i,[2,26]),e(i,[2,28],{20:[1,32]}),{21:[1,33]},{6:g,7:O,10:34,11:L},{1:[2,7],6:f,12:21,13:r,14:14,16:m,17:_,18:17,19:18,20:u,23:y},e(V,[2,14],{7:M,11:U}),e(w,[2,8]),e(w,[2,9]),e(w,[2,10]),e(E,[2,16],{15:37,24:I}),e(E,[2,17]),e(E,[2,18]),e(E,[2,20],{24:j}),e(i,[2,31]),{21:[1,39]},{22:[1,40]},e(V,[2,13],{7:M,11:U}),e(w,[2,11]),e(w,[2,12]),e(E,[2,15],{24:j}),e(i,[2,30]),{22:[1,41]},e(i,[2,27]),e(i,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,t){if(t.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=t,a}},"parseError"),parse:c(function(s){var t=this,a=[0],l=[],h=[null],n=[],T=this.table,o="",H=0,W=0,ue=2,re=1,ge=n.slice.call(arguments,1),k=Object.create(this.lexer),R={yy:{}};for(var Z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Z)&&(R.yy[Z]=this.yy[Z]);k.setInput(s,R.yy),R.yy.lexer=k,R.yy.parser=this,typeof k.yylloc=="undefined"&&(k.yylloc={});var q=k.yylloc;n.push(q);var de=k.options&&k.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(N){a.length=a.length-2*N,h.length=h.length-N,n.length=n.length-N}c(pe,"popStack");function ae(){var N;return N=l.pop()||k.lex()||re,typeof N!="number"&&(N instanceof Array&&(l=N,N=l.pop()),N=t.symbols_[N]||N),N}c(ae,"lex");for(var S,P,x,Q,F={},K,C,oe,Y;;){if(P=a[a.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((S===null||typeof S=="undefined")&&(S=ae()),x=T[P]&&T[P][S]),typeof x=="undefined"||!x.length||!x[0]){var $="";Y=[];for(K in T[P])this.terminals_[K]&&K>ue&&Y.push("'"+this.terminals_[K]+"'");k.showPosition?$="Parse error on line "+(H+1)+`:
2
+ `+k.showPosition()+`
3
+ Expecting `+Y.join(", ")+", got '"+(this.terminals_[S]||S)+"'":$="Parse error on line "+(H+1)+": Unexpected "+(S==re?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError($,{text:k.match,token:this.terminals_[S]||S,line:k.yylineno,loc:q,expected:Y})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+S);switch(x[0]){case 1:a.push(S),h.push(k.yytext),n.push(k.yylloc),a.push(x[1]),S=null,W=k.yyleng,o=k.yytext,H=k.yylineno,q=k.yylloc;break;case 2:if(C=this.productions_[x[1]][1],F.$=h[h.length-C],F._$={first_line:n[n.length-(C||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(C||1)].first_column,last_column:n[n.length-1].last_column},de&&(F._$.range=[n[n.length-(C||1)].range[0],n[n.length-1].range[1]]),Q=this.performAction.apply(F,[o,W,H,R.yy,x[1],h,n].concat(ge)),typeof Q!="undefined")return Q;C&&(a=a.slice(0,-1*C*2),h=h.slice(0,-1*C),n=n.slice(0,-1*C)),a.push(this.productions_[x[1]][0]),h.push(F.$),n.push(F._$),oe=T[a[a.length-2]][a[a.length-1]],a.push(oe);break;case 3:return!0}}return!0},"parse")},X=function(){var d={EOF:1,parseError:c(function(t,a){if(this.yy.parser)this.yy.parser.parseError(t,a);else throw new Error(t)},"parseError"),setInput:c(function(s,t){return this.yy=t||this.yy||{},this._input=s,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:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var t=s.match(/(?:\r\n?|\n).*/g);return t?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:c(function(s){var t=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-t),this.offset-=t;var l=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),a.length-1&&(this.yylineno-=a.length-1);var h=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:a?(a.length===l.length?this.yylloc.first_column:0)+l[l.length-a.length].length-a[0].length:this.yylloc.first_column-t},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-t]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return 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).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:c(function(s){this.unput(this.match.slice(s))},"less"),pastInput:c(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var s=this.pastInput(),t=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
5
+ `+t+"^"},"showPosition"),test_match:c(function(s,t){var a,l,h;if(this.options.backtrack_lexer&&(h={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&&(h.yylloc.range=this.yylloc.range.slice(0))),l=s[0].match(/(?:\r\n?|\n).*/g),l&&(this.yylineno+=l.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:l?l[l.length-1].length-l[l.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+s[0].length},this.yytext+=s[0],this.match+=s[0],this.matches=s,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(s[0].length),this.matched+=s[0],a=this.performAction.call(this,this.yy,this,t,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),a)return a;if(this._backtrack){for(var n in h)this[n]=h[n];return!1}return!1},"test_match"),next:c(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var s,t,a,l;this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),n=0;n<h.length;n++)if(a=this._input.match(this.rules[h[n]]),a&&(!t||a[0].length>t[0].length)){if(t=a,l=n,this.options.backtrack_lexer){if(s=this.test_match(a,h[n]),s!==!1)return s;if(this._backtrack){t=!1;continue}else return!1}else if(!this.options.flex)break}return t?(s=this.test_match(t,h[l]),s!==!1?s:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:c(function(){var t=this.next();return t||this.lex()},"lex"),begin:c(function(t){this.conditionStack.push(t)},"begin"),popState:c(function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:c(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:c(function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:c(function(t){this.begin(t)},"pushState"),stateStackSize:c(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:c(function(t,a,l,h){switch(l){case 0:return this.pushState("shapeData"),a.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const n=/\n\s*/g;return a.yytext=a.yytext.replace(n,"<br/>"),24;case 4:return 24;case 5:this.popState();break;case 6:return t.getLogger().trace("Found comment",a.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;case 10:this.popState();break;case 11:t.getLogger().trace("Begin icon"),this.begin("ICON");break;case 12:return t.getLogger().trace("SPACELINE"),6;case 13:return 7;case 14:return 16;case 15:t.getLogger().trace("end icon"),this.popState();break;case 16:return t.getLogger().trace("Exploding node"),this.begin("NODE"),20;case 17:return t.getLogger().trace("Cloud"),this.begin("NODE"),20;case 18:return t.getLogger().trace("Explosion Bang"),this.begin("NODE"),20;case 19:return t.getLogger().trace("Cloud Bang"),this.begin("NODE"),20;case 20:return this.begin("NODE"),20;case 21:return this.begin("NODE"),20;case 22:return this.begin("NODE"),20;case 23:return this.begin("NODE"),20;case 24:return 13;case 25:return 23;case 26:return 11;case 27:this.begin("NSTR2");break;case 28:return"NODE_DESCR";case 29:this.popState();break;case 30:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return t.getLogger().trace("description:",a.yytext),"NODE_DESCR";case 32:this.popState();break;case 33:return this.popState(),t.getLogger().trace("node end ))"),"NODE_DEND";case 34:return this.popState(),t.getLogger().trace("node end )"),"NODE_DEND";case 35:return this.popState(),t.getLogger().trace("node end ...",a.yytext),"NODE_DEND";case 36:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 37:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 38:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 39:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 40:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 41:return t.getLogger().trace("Long description:",a.yytext),21;case 42:return t.getLogger().trace("Long description:",a.yytext),21}},"anonymous"),rules:[/^(?:@\{)/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^\"]+)/i,/^(?:[^}^"]+)/i,/^(?:\})/i,/^(?:\s*%%.*)/i,/^(?:kanban\b)/i,/^(?::::)/i,/^(?:.+)/i,/^(?:\n)/i,/^(?:::icon\()/i,/^(?:[\s]+[\n])/i,/^(?:[\n]+)/i,/^(?:[^\)]+)/i,/^(?:\))/i,/^(?:-\))/i,/^(?:\(-)/i,/^(?:\)\))/i,/^(?:\))/i,/^(?:\(\()/i,/^(?:\{\{)/i,/^(?:\()/i,/^(?:\[)/i,/^(?:[\s]+)/i,/^(?:[^\(\[\n\)\{\}@]+)/i,/^(?:$)/i,/^(?:["][`])/i,/^(?:[^`"]+)/i,/^(?:[`]["])/i,/^(?:["])/i,/^(?:[^"]+)/i,/^(?:["])/i,/^(?:[\)]\))/i,/^(?:[\)])/i,/^(?:[\]])/i,/^(?:\}\})/i,/^(?:\(-)/i,/^(?:-\))/i,/^(?:\(\()/i,/^(?:\()/i,/^(?:[^\)\]\(\}]+)/i,/^(?:.+(?!\(\())/i],conditions:{shapeDataEndBracket:{rules:[],inclusive:!1},shapeDataStr:{rules:[2,3],inclusive:!1},shapeData:{rules:[1,4,5],inclusive:!1},CLASS:{rules:[9,10],inclusive:!1},ICON:{rules:[14,15],inclusive:!1},NSTR2:{rules:[28,29],inclusive:!1},NSTR:{rules:[31,32],inclusive:!1},NODE:{rules:[27,30,33,34,35,36,37,38,39,40,41,42],inclusive:!1},INITIAL:{rules:[0,6,7,8,11,12,13,16,17,18,19,20,21,22,23,24,25,26],inclusive:!0}}};return d}();B.lexer=X;function A(){this.yy={}}return c(A,"Parser"),A.prototype=B,B.Parser=A,new A}();ee.parser=ee;var xe=ee,v=[],se=[],te=0,ie={},ve=c(()=>{v=[],se=[],te=0,ie={}},"clear"),De=c(e=>{if(v.length===0)return null;const p=v[0].level;let f=null;for(let r=v.length-1;r>=0;r--)if(v[r].level===p&&!f&&(f=v[r]),v[r].level<p)throw new Error('Items without section detected, found section ("'+v[r].label+'")');return e===(f==null?void 0:f.level)?null:f},"getSection"),he=c(function(){return se},"getSections"),Le=c(function(){var m,_;const e=[],p=[],f=he(),r=z();for(const u of f){const y={id:u.id,label:G((m=u.label)!=null?m:"",r),labelType:"markdown",isGroup:!0,ticket:u.ticket,shape:"kanbanSection",level:u.level,look:r.look};p.push(y);const D=v.filter(g=>g.parentId===u.id);for(const g of D){const O={id:g.id,parentId:u.id,label:G((_=g.label)!=null?_:"",r),labelType:"markdown",isGroup:!1,ticket:g==null?void 0:g.ticket,priority:g==null?void 0:g.priority,assigned:g==null?void 0:g.assigned,icon:g==null?void 0:g.icon,shape:"kanbanItem",level:g.level,rx:5,ry:5,cssStyles:["text-align: left"]};p.push(O)}}return{nodes:p,edges:e,other:{},config:z()}},"getData"),Oe=c((e,p,f,r,m)=>{var g,O,L,E;const _=z();let u=(O=(g=_.mindmap)==null?void 0:g.padding)!=null?O:J.mindmap.padding;switch(r){case b.ROUNDED_RECT:case b.RECT:case b.HEXAGON:u*=2}const y={id:G(p,_)||"kbn"+te++,level:e,label:G(f,_),width:(E=(L=_.mindmap)==null?void 0:L.maxNodeWidth)!=null?E:J.mindmap.maxNodeWidth,padding:u,isGroup:!1};if(m!==void 0){let I;m.includes(`
7
+ `)?I=m+`
8
+ `:I=`{
9
+ `+m+`
10
+ }`;const i=ke(I,{schema:_e});if(i.shape&&(i.shape!==i.shape.toLowerCase()||i.shape.includes("_")))throw new Error(`No such shape: ${i.shape}. Shape names should be lowercase.`);i!=null&&i.shape&&i.shape==="kanbanItem"&&(y.shape=i==null?void 0:i.shape),i!=null&&i.label&&(y.label=i==null?void 0:i.label),i!=null&&i.icon&&(y.icon=i==null?void 0:i.icon.toString()),i!=null&&i.assigned&&(y.assigned=i==null?void 0:i.assigned.toString()),i!=null&&i.ticket&&(y.ticket=i==null?void 0:i.ticket.toString()),i!=null&&i.priority&&(y.priority=i==null?void 0:i.priority)}const D=De(e);D?y.parentId=D.id||"kbn"+te++:se.push(y),v.push(y)},"addNode"),b={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},Ie=c((e,p)=>{switch(ne.debug("In get type",e,p),e){case"[":return b.RECT;case"(":return p===")"?b.ROUNDED_RECT:b.CLOUD;case"((":return b.CIRCLE;case")":return b.CLOUD;case"))":return b.BANG;case"{{":return b.HEXAGON;default:return b.DEFAULT}},"getType"),Ce=c((e,p)=>{ie[e]=p},"setElementForId"),we=c(e=>{if(!e)return;const p=z(),f=v[v.length-1];e.icon&&(f.icon=G(e.icon,p)),e.class&&(f.cssClasses=G(e.class,p))},"decorateNode"),Ae=c(e=>{switch(e){case b.DEFAULT:return"no-border";case b.RECT:return"rect";case b.ROUNDED_RECT:return"rounded-rect";case b.CIRCLE:return"circle";case b.CLOUD:return"cloud";case b.BANG:return"bang";case b.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),Te=c(()=>ne,"getLogger"),Re=c(e=>ie[e],"getElementById"),Pe={clear:ve,addNode:Oe,getSections:he,getData:Le,nodeType:b,getType:Ie,setElementForId:Ce,decorateNode:we,type2Str:Ae,getLogger:Te,getElementById:Re},Ve=Pe,Be=c(async(e,p,f,r)=>{var M,U,w,j,B,X,A;ne.debug(`Rendering kanban diagram
11
+ `+e);const _=r.db.getData(),u=z();u.htmlLabels=!1;const y=fe(p);for(const d of _.nodes)d.domId=`${p}-${d.id}`;const D=y.append("g");D.attr("class","sections");const g=y.append("g");g.attr("class","items");const O=_.nodes.filter(d=>d.isGroup);let L=0;const E=10,I=[];let i=25;for(const d of O){const s=((M=u==null?void 0:u.kanban)==null?void 0:M.sectionWidth)||200;L=L+1,d.x=s*L+(L-1)*E/2,d.width=s,d.y=0,d.height=s*3,d.rx=5,d.ry=5,d.cssClasses=d.cssClasses+" section-"+L;const t=await ye(D,d);i=Math.max(i,(U=t==null?void 0:t.labelBBox)==null?void 0:U.height),I.push(t)}let V=0;for(const d of O){const s=I[V];V=V+1;const t=((w=u==null?void 0:u.kanban)==null?void 0:w.sectionWidth)||200,a=-t*3/2+i;let l=a;const h=_.nodes.filter(o=>o.parentId===d.id);for(const o of h){if(o.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");o.x=d.x,o.width=t-1.5*E;const W=(await be(g,o,{config:u})).node().getBBox();o.y=l+W.height/2,await me(o),l=o.y+W.height/2+E/2}const n=s.cluster.select("rect"),T=Math.max(l-a+3*E,50)+(i-25);n.attr("height",T)}Ee(void 0,y,(B=(j=u.mindmap)==null?void 0:j.padding)!=null?B:J.kanban.padding,(A=(X=u.mindmap)==null?void 0:X.useMaxWidth)!=null?A:J.kanban.useMaxWidth)},"draw"),Fe={draw:Be},Ge=c(e=>{let p="";for(let r=0;r<e.THEME_COLOR_LIMIT;r++)e["lineColor"+r]=e["lineColor"+r]||e["cScaleInv"+r],Se(e["lineColor"+r])?e["lineColor"+r]=le(e["lineColor"+r],20):e["lineColor"+r]=ce(e["lineColor"+r],20);const f=c((r,m)=>e.darkMode?ce(r,m):le(r,m),"adjuster");for(let r=0;r<e.THEME_COLOR_LIMIT;r++){const m=""+(17-3*r);p+=`
12
+ .section-${r-1} rect, .section-${r-1} path, .section-${r-1} circle, .section-${r-1} polygon, .section-${r-1} path {
13
+ fill: ${f(e["cScale"+r],10)};
14
+ stroke: ${f(e["cScale"+r],10)};
15
+
16
+ }
17
+ .section-${r-1} text {
18
+ fill: ${e["cScaleLabel"+r]};
19
+ }
20
+ .node-icon-${r-1} {
21
+ font-size: 40px;
22
+ color: ${e["cScaleLabel"+r]};
23
+ }
24
+ .section-edge-${r-1}{
25
+ stroke: ${e["cScale"+r]};
26
+ }
27
+ .edge-depth-${r-1}{
28
+ stroke-width: ${m};
29
+ }
30
+ .section-${r-1} line {
31
+ stroke: ${e["cScaleInv"+r]} ;
32
+ stroke-width: 3;
33
+ }
34
+
35
+ .disabled, .disabled circle, .disabled text {
36
+ fill: lightgray;
37
+ }
38
+ .disabled text {
39
+ fill: #efefef;
40
+ }
41
+
42
+ .node rect,
43
+ .node circle,
44
+ .node ellipse,
45
+ .node polygon,
46
+ .node path {
47
+ fill: ${e.background};
48
+ stroke: ${e.nodeBorder};
49
+ stroke-width: 1px;
50
+ }
51
+
52
+ .kanban-ticket-link {
53
+ fill: ${e.background};
54
+ stroke: ${e.nodeBorder};
55
+ text-decoration: underline;
56
+ }
57
+ `}return p},"genSections"),Me=c(e=>`
58
+ .edge {
59
+ stroke-width: 3;
60
+ }
61
+ ${Ge(e)}
62
+ .section-root rect, .section-root path, .section-root circle, .section-root polygon {
63
+ fill: ${e.git0};
64
+ }
65
+ .section-root text {
66
+ fill: ${e.gitBranchLabel0};
67
+ }
68
+ .icon-container {
69
+ height:100%;
70
+ display: flex;
71
+ justify-content: center;
72
+ align-items: center;
73
+ }
74
+ .edge {
75
+ fill: none;
76
+ }
77
+ .cluster-label, .label {
78
+ color: ${e.textColor};
79
+ fill: ${e.textColor};
80
+ }
81
+ .kanban-label {
82
+ dy: 1em;
83
+ alignment-baseline: middle;
84
+ text-anchor: middle;
85
+ dominant-baseline: middle;
86
+ text-align: center;
87
+ }
88
+ ${Ne()}
89
+ `,"getStyles"),Ue=Me,ze={db:Ve,renderer:Fe,parser:xe,styles:Ue};export{ze as diagram};