@juki-team/base-ui 1.4.129 → 1.4.131

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 (79) hide show
  1. package/dist/esm/{BarChart-BnEygCik.js → BarChart-BrncFZqv.js} +1 -1
  2. package/dist/esm/{CartesianChart-46JvJlt2.js → CartesianChart-DiEsv39t.js} +1 -1
  3. package/dist/esm/{ChangePasswordModal-W7o3d5xv.js → ChangePasswordModal-CvWtkjrN.js} +1 -1
  4. package/dist/esm/{CodeEditor-btUZu2Dy.js → CodeEditor-DACpjrsU.js} +1 -1
  5. package/dist/esm/{DataGrid-C-1PcbQ9.js → DataGrid-JAYAjywD.js} +1 -1
  6. package/dist/esm/{DataViewer-DdoMfhBT.js → DataViewer-Dlia2oSB.js} +1 -1
  7. package/dist/esm/{DrawerView-C59g89Qq.js → DrawerView-BblFUJEi.js} +1 -1
  8. package/dist/esm/{ExcalidrawButton-7RauNqcW.js → ExcalidrawButton-Bd8SBhas.js} +1 -1
  9. package/dist/esm/{GraphvizViewer-Cdd3s9Pz.js → GraphvizViewer-C1mAE7rX.js} +1 -1
  10. package/dist/esm/{ImageLoaderCropper-By7-NpjH.js → ImageLoaderCropper-C3Cx6O53.js} +1 -1
  11. package/dist/esm/{InputCellPhoneNumber-BoliLbve.js → InputCellPhoneNumber-CKYa10bN.js} +1 -1
  12. package/dist/esm/{InputColor-B6fjWGPV.js → InputColor-Z0jOOs3H.js} +1 -1
  13. package/dist/esm/{LineChart-yzQzjap8.js → LineChart-EhYBGR13.js} +1 -1
  14. package/dist/esm/{MdMath-DcAukZc5.js → MdMath-nccHUbMO.js} +1 -1
  15. package/dist/esm/{MdMathEditor-Ckf7tXlp.js → MdMathEditor-CqVpGAmF.js} +1 -1
  16. package/dist/esm/{Popover-DOgPkWfK.js → Popover-Dd5soClw.js} +2 -2
  17. package/dist/esm/{SlideDeck-yImvO_hq.js → SlideDeck-ls4Av4B6.js} +1 -1
  18. package/dist/esm/{TableOfContents-KP3dhzIR.js → TableOfContents-s2uXSPqs.js} +1 -1
  19. package/dist/esm/{Tooltip-CQx5RC2x.js → Tooltip-DkuB7dhH.js} +1 -1
  20. package/dist/esm/{UserCodeEditor-DVycUyoi.js → UserCodeEditor-ouwZZtsS.js} +2 -2
  21. package/dist/esm/{VirtualizedRowsFixed-CJRctik-.js → VirtualizedRowsFixed-B2F4OHWB.js} +1 -1
  22. package/dist/esm/{WorksheetAsSlides-33duB_50.js → WorksheetAsSlides-DERDrU2H.js} +1 -1
  23. package/dist/esm/{WorksheetBodies-Ptk1_moK.js → WorksheetBodies-CV7eAr61.js} +1 -1
  24. package/dist/esm/{WorksheetContents-WKXb5Uk4.js → WorksheetContents-Lm-_CdZ2.js} +1 -1
  25. package/dist/esm/{WorksheetEditor-z9ucL22I.js → WorksheetEditor-bWlxdb29.js} +1 -1
  26. package/dist/esm/{WorksheetNode-DdlERlmz.js → WorksheetNode-DEOXUEQe.js} +1 -1
  27. package/dist/esm/{WorksheetViewer-C8lplKFc.js → WorksheetViewer-lBAniTnA.js} +1 -1
  28. package/dist/esm/{architectureDiagram-3BPJPVTR-mkUe-O1b.js → architectureDiagram-3BPJPVTR-CTb5ayIp.js} +1 -1
  29. package/dist/esm/{blockDiagram-GPEHLZMM-DI6f452i.js → blockDiagram-GPEHLZMM-D4uFUU-G.js} +1 -1
  30. package/dist/esm/{c4Diagram-AAUBKEIU-CprJ4eDK.js → c4Diagram-AAUBKEIU-CAZLWuPq.js} +1 -1
  31. package/dist/esm/channel-D5EOmDMD.js +1 -0
  32. package/dist/esm/{chunk-2J33WTMH-CRrW12Q1.js → chunk-2J33WTMH-HhOFj0bf.js} +1 -1
  33. package/dist/esm/{chunk-4BX2VUAB-DP1enpjM.js → chunk-4BX2VUAB-CEdoBw7_.js} +1 -1
  34. package/dist/esm/{chunk-55IACEB6-Qy7BShb8.js → chunk-55IACEB6-aJ-Std67.js} +1 -1
  35. package/dist/esm/{chunk-727SXJPM-DCaL4Ssn.js → chunk-727SXJPM-CR7TtBVZ.js} +1 -1
  36. package/dist/esm/{chunk-AQP2D5EJ-MvQ9vOa8.js → chunk-AQP2D5EJ-K2Leo-fb.js} +1 -1
  37. package/dist/esm/{chunk-FMBD7UC4-C_QBV__I.js → chunk-FMBD7UC4-a15wpTbq.js} +1 -1
  38. package/dist/esm/{chunk-ND2GUHAM-Cz6MG9Ip.js → chunk-ND2GUHAM-3yBxVPAC.js} +1 -1
  39. package/dist/esm/{chunk-QZHKN3VN-CNeKC3i9.js → chunk-QZHKN3VN-BQxiWiUu.js} +1 -1
  40. package/dist/esm/{classDiagram-4FO5ZUOK-CIl1HCsD.js → classDiagram-4FO5ZUOK-Bp3azMO2.js} +1 -1
  41. package/dist/esm/{classDiagram-v2-Q7XG4LA2-CIl1HCsD.js → classDiagram-v2-Q7XG4LA2-Bp3azMO2.js} +1 -1
  42. package/dist/esm/{contest--aeYKKxf.js → contest-D0dFHHYS.js} +1 -1
  43. package/dist/esm/{cose-bilkent-S5V4N54A-BU_DfNnH.js → cose-bilkent-S5V4N54A-CF9x8P1X.js} +1 -1
  44. package/dist/esm/{dagre-BM42HDAG-B0jhlami.js → dagre-BM42HDAG-oa0J1DaE.js} +1 -1
  45. package/dist/esm/{diagram-2AECGRRQ-BoG6bCz0.js → diagram-2AECGRRQ-BuuG-RoB.js} +1 -1
  46. package/dist/esm/{diagram-5GNKFQAL-CmPEF4Gb.js → diagram-5GNKFQAL-CZujtOen.js} +1 -1
  47. package/dist/esm/{diagram-KO2AKTUF-otFu6fY1.js → diagram-KO2AKTUF-0KbELqZI.js} +1 -1
  48. package/dist/esm/{diagram-LMA3HP47-BNvQPERF.js → diagram-LMA3HP47-DVhy52x2.js} +1 -1
  49. package/dist/esm/{diagram-OG6HWLK6-GT5ck18c.js → diagram-OG6HWLK6-BBVpceTq.js} +1 -1
  50. package/dist/esm/{erDiagram-TEJ5UH35-DOTojUvv.js → erDiagram-TEJ5UH35-BHbfbqIk.js} +1 -1
  51. package/dist/esm/{flowDiagram-I6XJVG4X-DMNWQIoP.js → flowDiagram-I6XJVG4X-BaMVJs2u.js} +1 -1
  52. package/dist/esm/{ganttDiagram-6RSMTGT7-UueSCT2P.js → ganttDiagram-6RSMTGT7-DOUe8voF.js} +1 -1
  53. package/dist/esm/{gitGraphDiagram-PVQCEYII-BMejzE3B.js → gitGraphDiagram-PVQCEYII-Dyj0XEJk.js} +1 -1
  54. package/dist/esm/helpers.js +1 -1
  55. package/dist/esm/{index-2vw3cISu.js → index-BCzXl-MX.js} +1 -1
  56. package/dist/esm/index-DGfNHv1x.js +2 -0
  57. package/dist/esm/{infoDiagram-5YYISTIA-BSxjrZJf.js → infoDiagram-5YYISTIA-Boua4Tr8.js} +1 -1
  58. package/dist/esm/{ishikawaDiagram-YF4QCWOH-B2-9liDF.js → ishikawaDiagram-YF4QCWOH-BS_A_XBz.js} +1 -1
  59. package/dist/esm/{journeyDiagram-JHISSGLW-DBQd4ic_.js → journeyDiagram-JHISSGLW-YyjHX0yV.js} +1 -1
  60. package/dist/esm/{kanban-definition-UN3LZRKU-DFolGaRv.js → kanban-definition-UN3LZRKU-CcKCIal8.js} +1 -1
  61. package/dist/esm/main.js +1 -1
  62. package/dist/esm/{mermaid.core-EsBL2ECN.js → mermaid.core-QpTfboNw.js} +1 -1
  63. package/dist/esm/{mindmap-definition-RKZ34NQL-BIQZzlCy.js → mindmap-definition-RKZ34NQL-DjxxY08j.js} +1 -1
  64. package/dist/esm/{pieDiagram-4H26LBE5-DZBAcvRC.js → pieDiagram-4H26LBE5-Bu-BmZ8n.js} +1 -1
  65. package/dist/esm/{quadrantDiagram-W4KKPZXB-b5MVV3Rk.js → quadrantDiagram-W4KKPZXB-fK1bxThQ.js} +1 -1
  66. package/dist/esm/{requirementDiagram-4Y6WPE33-CLn9X-PZ.js → requirementDiagram-4Y6WPE33-D-96v_3q.js} +1 -1
  67. package/dist/esm/{sankeyDiagram-5OEKKPKP-D4-b_g7U.js → sankeyDiagram-5OEKKPKP-ZTvdQYzE.js} +1 -1
  68. package/dist/esm/{sequenceDiagram-3UESZ5HK-CCdY9Q3W.js → sequenceDiagram-3UESZ5HK-BFEtohrX.js} +1 -1
  69. package/dist/esm/{stateDiagram-AJRCARHV-BSMAHoem.js → stateDiagram-AJRCARHV-DWxVmIWt.js} +1 -1
  70. package/dist/esm/{stateDiagram-v2-BHNVJYJU-BeJ_O1Tl.js → stateDiagram-v2-BHNVJYJU-DnOatqpE.js} +1 -1
  71. package/dist/esm/{timeline-definition-PNZ67QCA-o-UlOwfU.js → timeline-definition-PNZ67QCA-FvMo_PxT.js} +1 -1
  72. package/dist/esm/{types-TNt9NcVE.js → types-DG_vw3We.js} +1 -1
  73. package/dist/esm/{vennDiagram-CIIHVFJN-CySj1ueN.js → vennDiagram-CIIHVFJN-DzI_A9Cl.js} +1 -1
  74. package/dist/esm/{wardleyDiagram-YWT4CUSO-B7YSHlE3.js → wardleyDiagram-YWT4CUSO-ClMyoKY9.js} +1 -1
  75. package/dist/esm/{xychartDiagram-2RQKCTM6-D6EqpoC5.js → xychartDiagram-2RQKCTM6-Cy92WO7L.js} +1 -1
  76. package/dist/module-types/src/components/helpers/problem.d.ts +11 -0
  77. package/package.json +3 -3
  78. package/dist/esm/channel-B3QafhkE.js +0 -1
  79. package/dist/esm/index-MXDpbG5L.js +0 -2
@@ -1 +1 @@
1
- import{a as t,ai as r,aB as e,w as s}from"./mermaid.core-EsBL2ECN.js";import{p as i}from"./wardley-L42UT6IY-Bn2xZ99U.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"./string-CQk_HvWX.js";var a="11.15.0",o={parser:{parse:t(async t=>{const e=await i("info",t);r.debug(e)},"parse")},db:{getVersion:t(()=>a,"getVersion")},renderer:{draw:t((t,i,a)=>{r.debug("rendering info diagram\n"+t);const o=e(i);s(o,100,400,!0);o.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${a}`)},"draw")}};export{o as diagram};
1
+ import{a as t,ai as r,aB as e,w as s}from"./mermaid.core-QpTfboNw.js";import{p as i}from"./wardley-L42UT6IY-Bn2xZ99U.js";import"./index-DGfNHv1x.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-D0dFHHYS.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"./string-CQk_HvWX.js";var a="11.15.0",o={parser:{parse:t(async t=>{const e=await i("info",t);r.debug(e)},"parse")},db:{getVersion:t(()=>a,"getVersion")},renderer:{draw:t((t,i,a)=>{r.debug("rendering info diagram\n"+t);const o=e(i);s(o,100,400,!0);o.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${a}`)},"draw")}};export{o as diagram};
@@ -1 +1 @@
1
- import{a as t,O as i,ap as e,aB as n,g as s,n as a,s as r,aF as o,M as h,aD as l,L as c,aC as u,P as d,w as p}from"./mermaid.core-EsBL2ECN.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"./string-CQk_HvWX.js";var y=function(){var i=t(function(t,i,e,n){for(e=e||{},n=t.length;n--;e[t[n]]=i);return e},"o"),e=[1,4],n=[1,14],s=[1,12],a=[1,13],r=[6,7,8],o=[1,20],h=[1,18],l=[1,19],c=[6,7,11],u=[1,6,13,14],d=[1,23],p=[1,24],y=[1,6,7,11,13,14],g={trace:t(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:t(function(t,i,e,n,s,a,r){var o=a.length-1;switch(s){case 6:case 7:return n;case 15:n.addNode(a[o-1].length,a[o].trim());break;case 16:n.addNode(0,a[o].trim())}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:n,7:[1,10],9:9,12:11,13:s,14:a},i(r,[2,3]),{1:[2,2]},i(r,[2,4]),i(r,[2,5]),{1:[2,6],6:n,12:15,13:s,14:a},{6:n,9:16,12:11,13:s,14:a},{6:o,7:h,10:17,11:l},i(c,[2,18],{14:[1,21]}),i(c,[2,16]),i(c,[2,17]),{6:o,7:h,10:22,11:l},{1:[2,7],6:n,12:15,13:s,14:a},i(u,[2,14],{7:d,11:p}),i(y,[2,8]),i(y,[2,9]),i(y,[2,10]),i(c,[2,15]),i(u,[2,13],{7:d,11:p}),i(y,[2,11]),i(y,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(t,i){if(!i.recoverable){var e=new Error(t);throw e.hash=i,e}this.trace(t)},"parseError"),parse:t(function(i){var e=this,n=[0],s=[],a=[null],r=[],o=this.table,h="",l=0,c=0,u=r.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(p.yy[y]=this.yy[y]);d.setInput(i,p.yy),p.yy.lexer=d,p.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;r.push(g);var f=d.options&&d.options.ranges;function m(){var t;return"number"!=typeof(t=s.pop()||d.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t(function(t){n.length=n.length-2*t,a.length=a.length-t,r.length=r.length-t},"popStack"),t(m,"lex");for(var k,w,x,b,_,v,S,$,I={};;){if(w=n[n.length-1],this.defaultActions[w]?x=this.defaultActions[w]:(null==k&&(k=m()),x=o[w]&&o[w][k]),void 0===x||!x.length||!x[0]){var E="";for(_ in $=[],o[w])this.terminals_[_]&&_>2&&$.push("'"+this.terminals_[_]+"'");E=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+$.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==k?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(E,{text:d.match,token:this.terminals_[k]||k,line:d.yylineno,loc:g,expected:$})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+w+", token: "+k);switch(x[0]){case 1:n.push(k),a.push(d.yytext),r.push(d.yylloc),n.push(x[1]),k=null,c=d.yyleng,h=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(v=this.productions_[x[1]][1],I.$=a[a.length-v],I._$={first_line:r[r.length-(v||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(v||1)].first_column,last_column:r[r.length-1].last_column},f&&(I._$.range=[r[r.length-(v||1)].range[0],r[r.length-1].range[1]]),void 0!==(b=this.performAction.apply(I,[h,c,l,p.yy,x[1],a,r].concat(u))))return b;v&&(n=n.slice(0,-1*v*2),a=a.slice(0,-1*v),r=r.slice(0,-1*v)),n.push(this.productions_[x[1]][0]),a.push(I.$),r.push(I._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0},"parse")},f=function(){return{EOF:1,parseError:t(function(t,i){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,i)},"parseError"),setInput:t(function(t,i){return this.yy=i||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 i=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var n=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),e.length-1&&(this.yylineno-=e.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:e?(e.length===n.length?this.yylloc.first_column:0)+n[n.length-e.length].length-e[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-i]),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(),i=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"},"showPosition"),test_match:t(function(t,i){var e,n,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))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.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],e=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var a in s)this[a]=s[a];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;var t,i,e,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),a=0;a<s.length;a++)if((e=this._input.match(this.rules[s[a]]))&&(!i||e[0].length>i[0].length)){if(i=e,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,s[a])))return t;if(this._backtrack){i=!1;continue}return!1}if(!this.options.flex)break}return i?!1!==(t=this.test_match(i,s[n]))&&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:{"case-insensitive":!0},performAction:t(function(t,i,e,n){switch(e){case 0:case 3:return 6;case 1:case 2:return 8;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}}}}();function m(){this.yy={}}return g.lexer=f,t(m,"Parser"),m.prototype=g,g.Parser=m,new m}();y.parser=y;var g=y,f=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{t(this,"IshikawaDB")}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,a()}getRoot(){return this.root}addNode(t,e){const n=r.sanitizeText(e,i());if(!this.root)return this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],void o(n);this.baseLevel??=t;let s=t-this.baseLevel+1;for(s<=0&&(s=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=s;)this.stack.pop();const a={text:n,children:[]};this.stack[this.stack.length-1].node.children.push(a),this.stack.push({level:s,node:a})}getAccTitle(){return h()}setAccTitle(t){l(t)}getAccDescription(){return c()}setAccDescription(t){u(t)}getDiagramTitle(){return d()}setDiagramTitle(t){o(t)}},m=250,k=82*Math.PI/180,w=Math.cos(k),x=Math.sin(k),b=t((t,i,e)=>{const n=t.node().getBBox(),s=n.width+2*i,a=n.height+2*i;p(t,a,s,e),t.attr("viewBox",`${n.x-i} ${n.y-i} ${s} ${a}`)},"applyPaddedViewBox"),_=t((t,a,r,o)=>{const h=o.db.getRoot();if(!h)return;const l=i(),{look:c,handDrawnSeed:u,themeVariables:d}=l,p=e(l.fontSize)[0]??14,y="handDrawn"===c,g=h.children??[],f=l.ishikawa?.diagramPadding??20,k=l.ishikawa?.useMaxWidth??!1,w=n(a),x=w.append("g").attr("class","ishikawa"),_=y?s.svg(w.node()):void 0,$=_?{roughSvg:_,seed:u??0,lineColor:d?.lineColor??"#333",fillColor:d?.mainBkg??"#fff"}:void 0,I=`ishikawa-arrow-${a}`;y||x.append("defs").append("marker").attr("id",I).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 E=0,C=m;const M=y?void 0:P(x,E,C,E,C,"ishikawa-spine");if(S(x,E,C,h.text,p,$),!g.length)return y&&P(x,E,C,E,C,"ishikawa-spine",$),void b(w,f,k);E-=20;const j=g.filter((t,i)=>i%2==0),L=g.filter((t,i)=>i%2==1),T=v(j),B=v(L),N=T.total+B.total;let O=m,D=m;if(N>0){const t=500,i=75;O=Math.max(i,t*(T.total/N)),D=Math.max(i,t*(B.total/N))}const W=2*p;O=Math.max(O,T.max*W),D=Math.max(D,B.max*W),C=Math.max(O,m),M&&M.attr("y1",C).attr("y2",C),x.select(".ishikawa-head-group").attr("transform",`translate(0,${C})`);const z=Math.ceil(g.length/2);for(let t=0;t<z;t++){const i=x.append("g").attr("class","ishikawa-pair");for(const[e,n,s]of[[g[2*t],-1,O],[g[2*t+1],1,D]])e&&A(i,e,E,C,n,s,p,$);E=i.selectAll("text").nodes().reduce((t,i)=>Math.min(t,i.getBBox().x),1/0)}if(y)P(x,E,C,0,C,"ishikawa-spine",$);else{M.attr("x1",E);const t=`url(#${I})`;x.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",t)}b(w,f,k)},"draw"),v=t(i=>{const e=t(t=>t.children.reduce((t,i)=>t+1+e(i),0),"countDescendants");return i.reduce((t,i)=>{const n=e(i);return t.total+=n,t.max=Math.max(t.max,n),t},{total:0,max:0})},"sideStats"),S=t((t,i,e,n,s,a)=>{const r=Math.max(6,Math.floor(110/(.6*s))),o=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${i},${e})`),h=j(o,M(n,r),0,0,"ishikawa-head-label","start",s),l=h.node().getBBox(),c=Math.max(60,l.width+6),u=Math.max(40,2*l.height+40),d=`M 0 ${-u/2} L 0 ${u/2} Q ${2.4*c} 0 0 ${-u/2} Z`;if(a){const t=a.roughSvg.path(d,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});o.insert(()=>t,":first-child").attr("class","ishikawa-head")}else o.insert("path",":first-child").attr("class","ishikawa-head").attr("d",d);h.attr("transform",`translate(${(c-l.width)/2-l.x+3},${-l.y-l.height/2})`)},"drawHead"),$=t((i,e)=>{const n=[],s=[],a=t((t,i,r)=>{const o=-1===e?[...t].reverse():t;for(const t of o){const e=n.length,o=t.children??[];n.push({depth:r,text:M(t.text,15),parentIndex:i,childCount:o.length}),r%2==0?(s.push(e),o.length&&a(o,e,r+1)):(o.length&&a(o,e,r+1),s.push(e))}},"walk");return a(i,-1,2),{entries:n,yOrder:s}},"flattenTree"),I=t((t,i,e,n,s,a,r)=>{const o=t.append("g").attr("class","ishikawa-label-group"),h=j(o,i,e,n+11*s,"ishikawa-label cause","middle",a).node().getBBox();if(r){const t=r.roughSvg.rectangle(h.x-20,h.y-2,h.width+40,h.height+4,{roughness:1.5,seed:r.seed,fill:r.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:r.lineColor,strokeWidth:2});o.insert(()=>t,":first-child").attr("class","ishikawa-label-box")}else o.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"),E=t((t,i,e,n,s,a)=>{const r=Math.sqrt(n*n+s*s);if(0===r)return;const o=n/r,h=s/r,l=6*-h,c=6*o,u=`M ${i} ${e} L ${i-6*o*2+l} ${e-6*h*2+c} L ${i-6*o*2-l} ${e-6*h*2-c} Z`,d=a.roughSvg.path(u,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});t.append(()=>d)},"drawArrowMarker"),A=t((t,i,e,n,s,a,r,o)=>{const h=i.children??[],l=a*(h.length?1:.2),c=x*l*s,u=e+-w*l,d=n+c;if(P(t,e,n,u,d,"ishikawa-branch",o),o&&E(t,e,n,e-u,n-d,o),I(t,i.text,u,d,s,r,o),!h.length)return;const{entries:p,yOrder:y}=$(h,s),g=p.length,f=new Array(g);for(const[t,i]of y.entries())f[i]=n+c*((t+1)/(g+1));const m=new Map;m.set(-1,{x0:e,y0:n,x1:u,y1:d,childCount:h.length,childrenDrawn:0});const k=-w,b=x*s,_=s<0?"ishikawa-label up":"ishikawa-label down";for(const[i,e]of p.entries()){const n=f[i],s=m.get(e.parentIndex),a=t.append("g").attr("class","ishikawa-sub-group");let h=0,l=0,c=0;if(e.depth%2==0){const t=s.y1-s.y0;h=L(s.x0,s.x1,t?(n-s.y0)/t:.5),l=n,c=h-(e.childCount>0?60+5*e.childCount:30),P(a,h,n,c,n,"ishikawa-sub-branch",o),o&&E(a,h,n,1,0,o),j(a,e.text,c,n,"ishikawa-label align","end",r)}else{const t=s.childrenDrawn++;h=L(s.x0,s.x1,(s.childCount-t)/(s.childCount+1)),l=s.y0,c=h+k*((n-l)/b),P(a,h,l,c,n,"ishikawa-sub-branch",o),o&&E(a,h,l,h-c,l-n,o),j(a,e.text,c,n,_,"end",r)}e.childCount>0&&m.set(i,{x0:h,y0:l,x1:c,y1:n,childCount:e.childCount,childrenDrawn:0})}},"drawBranch"),C=t(t=>t.split(/<br\s*\/?>|\n/),"splitLines"),M=t((t,i)=>{if(t.length<=i)return t;const e=[];for(const n of t.split(/\s+/)){const t=e.length-1;t>=0&&e[t].length+1+n.length<=i?e[t]+=" "+n:e.push(n)}return e.join("\n")},"wrapText"),j=t((t,i,e,n,s,a,r)=>{const o=C(i),h=1.05*r,l=t.append("text").attr("class",s).attr("text-anchor",a).attr("x",e).attr("y",n-(o.length-1)*h/2);for(const[t,i]of o.entries())l.append("tspan").attr("x",e).attr("dy",0===t?0:h).text(i);return l},"drawMultilineText"),L=t((t,i,e)=>t+(i-t)*e,"lerp"),P=t((t,i,e,n,s,a,r)=>{if(r){const o=r.roughSvg.line(i,e,n,s,{roughness:1.5,seed:r.seed,stroke:r.lineColor,strokeWidth:2});return void t.append(()=>o).attr("class",a)}return t.append("line").attr("class",a).attr("x1",i).attr("y1",e).attr("x2",n).attr("y2",s)},"drawLine"),T={draw:_},B=t(t=>`\n.ishikawa .ishikawa-spine,\n.ishikawa .ishikawa-branch,\n.ishikawa .ishikawa-sub-branch {\n stroke: ${t.lineColor};\n stroke-width: 2;\n fill: none;\n}\n\n.ishikawa .ishikawa-sub-branch {\n stroke-width: 1;\n}\n\n.ishikawa .ishikawa-arrow {\n fill: ${t.lineColor};\n}\n\n.ishikawa .ishikawa-head {\n fill: ${t.mainBkg};\n stroke: ${t.lineColor};\n stroke-width: 2;\n}\n\n.ishikawa .ishikawa-label-box {\n fill: ${t.mainBkg};\n stroke: ${t.lineColor};\n stroke-width: 2;\n}\n\n.ishikawa text {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n fill: ${t.textColor};\n}\n\n.ishikawa .ishikawa-head-label {\n font-weight: 600;\n text-anchor: middle;\n dominant-baseline: middle;\n font-size: 14px;\n}\n\n.ishikawa .ishikawa-label {\n text-anchor: end;\n}\n\n.ishikawa .ishikawa-label.cause {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n\n.ishikawa .ishikawa-label.align {\n text-anchor: end;\n dominant-baseline: middle;\n}\n\n.ishikawa .ishikawa-label.up {\n dominant-baseline: baseline;\n}\n\n.ishikawa .ishikawa-label.down {\n dominant-baseline: hanging;\n}\n`,"getStyles"),N={parser:g,get db(){return new f},renderer:T,styles:B};export{N as diagram};
1
+ import{a as t,O as i,ap as e,aB as n,g as s,n as a,s as r,aF as o,M as h,aD as l,L as c,aC as u,P as d,w as p}from"./mermaid.core-QpTfboNw.js";import"./index-DGfNHv1x.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-D0dFHHYS.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"./string-CQk_HvWX.js";var y=function(){var i=t(function(t,i,e,n){for(e=e||{},n=t.length;n--;e[t[n]]=i);return e},"o"),e=[1,4],n=[1,14],s=[1,12],a=[1,13],r=[6,7,8],o=[1,20],h=[1,18],l=[1,19],c=[6,7,11],u=[1,6,13,14],d=[1,23],p=[1,24],y=[1,6,7,11,13,14],g={trace:t(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:t(function(t,i,e,n,s,a,r){var o=a.length-1;switch(s){case 6:case 7:return n;case 15:n.addNode(a[o-1].length,a[o].trim());break;case 16:n.addNode(0,a[o].trim())}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:n,7:[1,10],9:9,12:11,13:s,14:a},i(r,[2,3]),{1:[2,2]},i(r,[2,4]),i(r,[2,5]),{1:[2,6],6:n,12:15,13:s,14:a},{6:n,9:16,12:11,13:s,14:a},{6:o,7:h,10:17,11:l},i(c,[2,18],{14:[1,21]}),i(c,[2,16]),i(c,[2,17]),{6:o,7:h,10:22,11:l},{1:[2,7],6:n,12:15,13:s,14:a},i(u,[2,14],{7:d,11:p}),i(y,[2,8]),i(y,[2,9]),i(y,[2,10]),i(c,[2,15]),i(u,[2,13],{7:d,11:p}),i(y,[2,11]),i(y,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(t,i){if(!i.recoverable){var e=new Error(t);throw e.hash=i,e}this.trace(t)},"parseError"),parse:t(function(i){var e=this,n=[0],s=[],a=[null],r=[],o=this.table,h="",l=0,c=0,u=r.slice.call(arguments,1),d=Object.create(this.lexer),p={yy:{}};for(var y in this.yy)Object.prototype.hasOwnProperty.call(this.yy,y)&&(p.yy[y]=this.yy[y]);d.setInput(i,p.yy),p.yy.lexer=d,p.yy.parser=this,void 0===d.yylloc&&(d.yylloc={});var g=d.yylloc;r.push(g);var f=d.options&&d.options.ranges;function m(){var t;return"number"!=typeof(t=s.pop()||d.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof p.yy.parseError?this.parseError=p.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t(function(t){n.length=n.length-2*t,a.length=a.length-t,r.length=r.length-t},"popStack"),t(m,"lex");for(var k,w,x,b,_,v,S,$,I={};;){if(w=n[n.length-1],this.defaultActions[w]?x=this.defaultActions[w]:(null==k&&(k=m()),x=o[w]&&o[w][k]),void 0===x||!x.length||!x[0]){var E="";for(_ in $=[],o[w])this.terminals_[_]&&_>2&&$.push("'"+this.terminals_[_]+"'");E=d.showPosition?"Parse error on line "+(l+1)+":\n"+d.showPosition()+"\nExpecting "+$.join(", ")+", got '"+(this.terminals_[k]||k)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==k?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(E,{text:d.match,token:this.terminals_[k]||k,line:d.yylineno,loc:g,expected:$})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+w+", token: "+k);switch(x[0]){case 1:n.push(k),a.push(d.yytext),r.push(d.yylloc),n.push(x[1]),k=null,c=d.yyleng,h=d.yytext,l=d.yylineno,g=d.yylloc;break;case 2:if(v=this.productions_[x[1]][1],I.$=a[a.length-v],I._$={first_line:r[r.length-(v||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(v||1)].first_column,last_column:r[r.length-1].last_column},f&&(I._$.range=[r[r.length-(v||1)].range[0],r[r.length-1].range[1]]),void 0!==(b=this.performAction.apply(I,[h,c,l,p.yy,x[1],a,r].concat(u))))return b;v&&(n=n.slice(0,-1*v*2),a=a.slice(0,-1*v),r=r.slice(0,-1*v)),n.push(this.productions_[x[1]][0]),a.push(I.$),r.push(I._$),S=o[n[n.length-2]][n[n.length-1]],n.push(S);break;case 3:return!0}}return!0},"parse")},f=function(){return{EOF:1,parseError:t(function(t,i){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,i)},"parseError"),setInput:t(function(t,i){return this.yy=i||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 i=t.length,e=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var n=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),e.length-1&&(this.yylineno-=e.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:e?(e.length===n.length?this.yylloc.first_column:0)+n[n.length-e.length].length-e[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[s[0],s[0]+this.yyleng-i]),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(),i=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"},"showPosition"),test_match:t(function(t,i){var e,n,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))),(n=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.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],e=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),e)return e;if(this._backtrack){for(var a in s)this[a]=s[a];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;var t,i,e,n;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),a=0;a<s.length;a++)if((e=this._input.match(this.rules[s[a]]))&&(!i||e[0].length>i[0].length)){if(i=e,n=a,this.options.backtrack_lexer){if(!1!==(t=this.test_match(e,s[a])))return t;if(this._backtrack){i=!1;continue}return!1}if(!this.options.flex)break}return i?!1!==(t=this.test_match(i,s[n]))&&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:{"case-insensitive":!0},performAction:t(function(t,i,e,n){switch(e){case 0:case 3:return 6;case 1:case 2:return 8;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}}}}();function m(){this.yy={}}return g.lexer=f,t(m,"Parser"),m.prototype=g,g.Parser=m,new m}();y.parser=y;var g=y,f=class{constructor(){this.stack=[],this.clear=this.clear.bind(this),this.addNode=this.addNode.bind(this),this.getRoot=this.getRoot.bind(this)}static{t(this,"IshikawaDB")}clear(){this.root=void 0,this.stack=[],this.baseLevel=void 0,a()}getRoot(){return this.root}addNode(t,e){const n=r.sanitizeText(e,i());if(!this.root)return this.root={text:n,children:[]},this.stack=[{level:0,node:this.root}],void o(n);this.baseLevel??=t;let s=t-this.baseLevel+1;for(s<=0&&(s=1);this.stack.length>1&&this.stack[this.stack.length-1].level>=s;)this.stack.pop();const a={text:n,children:[]};this.stack[this.stack.length-1].node.children.push(a),this.stack.push({level:s,node:a})}getAccTitle(){return h()}setAccTitle(t){l(t)}getAccDescription(){return c()}setAccDescription(t){u(t)}getDiagramTitle(){return d()}setDiagramTitle(t){o(t)}},m=250,k=82*Math.PI/180,w=Math.cos(k),x=Math.sin(k),b=t((t,i,e)=>{const n=t.node().getBBox(),s=n.width+2*i,a=n.height+2*i;p(t,a,s,e),t.attr("viewBox",`${n.x-i} ${n.y-i} ${s} ${a}`)},"applyPaddedViewBox"),_=t((t,a,r,o)=>{const h=o.db.getRoot();if(!h)return;const l=i(),{look:c,handDrawnSeed:u,themeVariables:d}=l,p=e(l.fontSize)[0]??14,y="handDrawn"===c,g=h.children??[],f=l.ishikawa?.diagramPadding??20,k=l.ishikawa?.useMaxWidth??!1,w=n(a),x=w.append("g").attr("class","ishikawa"),_=y?s.svg(w.node()):void 0,$=_?{roughSvg:_,seed:u??0,lineColor:d?.lineColor??"#333",fillColor:d?.mainBkg??"#fff"}:void 0,I=`ishikawa-arrow-${a}`;y||x.append("defs").append("marker").attr("id",I).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 E=0,C=m;const M=y?void 0:P(x,E,C,E,C,"ishikawa-spine");if(S(x,E,C,h.text,p,$),!g.length)return y&&P(x,E,C,E,C,"ishikawa-spine",$),void b(w,f,k);E-=20;const j=g.filter((t,i)=>i%2==0),L=g.filter((t,i)=>i%2==1),T=v(j),B=v(L),N=T.total+B.total;let O=m,D=m;if(N>0){const t=500,i=75;O=Math.max(i,t*(T.total/N)),D=Math.max(i,t*(B.total/N))}const W=2*p;O=Math.max(O,T.max*W),D=Math.max(D,B.max*W),C=Math.max(O,m),M&&M.attr("y1",C).attr("y2",C),x.select(".ishikawa-head-group").attr("transform",`translate(0,${C})`);const z=Math.ceil(g.length/2);for(let t=0;t<z;t++){const i=x.append("g").attr("class","ishikawa-pair");for(const[e,n,s]of[[g[2*t],-1,O],[g[2*t+1],1,D]])e&&A(i,e,E,C,n,s,p,$);E=i.selectAll("text").nodes().reduce((t,i)=>Math.min(t,i.getBBox().x),1/0)}if(y)P(x,E,C,0,C,"ishikawa-spine",$);else{M.attr("x1",E);const t=`url(#${I})`;x.selectAll("line.ishikawa-branch, line.ishikawa-sub-branch").attr("marker-start",t)}b(w,f,k)},"draw"),v=t(i=>{const e=t(t=>t.children.reduce((t,i)=>t+1+e(i),0),"countDescendants");return i.reduce((t,i)=>{const n=e(i);return t.total+=n,t.max=Math.max(t.max,n),t},{total:0,max:0})},"sideStats"),S=t((t,i,e,n,s,a)=>{const r=Math.max(6,Math.floor(110/(.6*s))),o=t.append("g").attr("class","ishikawa-head-group").attr("transform",`translate(${i},${e})`),h=j(o,M(n,r),0,0,"ishikawa-head-label","start",s),l=h.node().getBBox(),c=Math.max(60,l.width+6),u=Math.max(40,2*l.height+40),d=`M 0 ${-u/2} L 0 ${u/2} Q ${2.4*c} 0 0 ${-u/2} Z`;if(a){const t=a.roughSvg.path(d,{roughness:1.5,seed:a.seed,fill:a.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:a.lineColor,strokeWidth:2});o.insert(()=>t,":first-child").attr("class","ishikawa-head")}else o.insert("path",":first-child").attr("class","ishikawa-head").attr("d",d);h.attr("transform",`translate(${(c-l.width)/2-l.x+3},${-l.y-l.height/2})`)},"drawHead"),$=t((i,e)=>{const n=[],s=[],a=t((t,i,r)=>{const o=-1===e?[...t].reverse():t;for(const t of o){const e=n.length,o=t.children??[];n.push({depth:r,text:M(t.text,15),parentIndex:i,childCount:o.length}),r%2==0?(s.push(e),o.length&&a(o,e,r+1)):(o.length&&a(o,e,r+1),s.push(e))}},"walk");return a(i,-1,2),{entries:n,yOrder:s}},"flattenTree"),I=t((t,i,e,n,s,a,r)=>{const o=t.append("g").attr("class","ishikawa-label-group"),h=j(o,i,e,n+11*s,"ishikawa-label cause","middle",a).node().getBBox();if(r){const t=r.roughSvg.rectangle(h.x-20,h.y-2,h.width+40,h.height+4,{roughness:1.5,seed:r.seed,fill:r.fillColor,fillStyle:"hachure",fillWeight:2.5,hachureGap:5,stroke:r.lineColor,strokeWidth:2});o.insert(()=>t,":first-child").attr("class","ishikawa-label-box")}else o.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"),E=t((t,i,e,n,s,a)=>{const r=Math.sqrt(n*n+s*s);if(0===r)return;const o=n/r,h=s/r,l=6*-h,c=6*o,u=`M ${i} ${e} L ${i-6*o*2+l} ${e-6*h*2+c} L ${i-6*o*2-l} ${e-6*h*2-c} Z`,d=a.roughSvg.path(u,{roughness:1,seed:a.seed,fill:a.lineColor,fillStyle:"solid",stroke:a.lineColor,strokeWidth:1});t.append(()=>d)},"drawArrowMarker"),A=t((t,i,e,n,s,a,r,o)=>{const h=i.children??[],l=a*(h.length?1:.2),c=x*l*s,u=e+-w*l,d=n+c;if(P(t,e,n,u,d,"ishikawa-branch",o),o&&E(t,e,n,e-u,n-d,o),I(t,i.text,u,d,s,r,o),!h.length)return;const{entries:p,yOrder:y}=$(h,s),g=p.length,f=new Array(g);for(const[t,i]of y.entries())f[i]=n+c*((t+1)/(g+1));const m=new Map;m.set(-1,{x0:e,y0:n,x1:u,y1:d,childCount:h.length,childrenDrawn:0});const k=-w,b=x*s,_=s<0?"ishikawa-label up":"ishikawa-label down";for(const[i,e]of p.entries()){const n=f[i],s=m.get(e.parentIndex),a=t.append("g").attr("class","ishikawa-sub-group");let h=0,l=0,c=0;if(e.depth%2==0){const t=s.y1-s.y0;h=L(s.x0,s.x1,t?(n-s.y0)/t:.5),l=n,c=h-(e.childCount>0?60+5*e.childCount:30),P(a,h,n,c,n,"ishikawa-sub-branch",o),o&&E(a,h,n,1,0,o),j(a,e.text,c,n,"ishikawa-label align","end",r)}else{const t=s.childrenDrawn++;h=L(s.x0,s.x1,(s.childCount-t)/(s.childCount+1)),l=s.y0,c=h+k*((n-l)/b),P(a,h,l,c,n,"ishikawa-sub-branch",o),o&&E(a,h,l,h-c,l-n,o),j(a,e.text,c,n,_,"end",r)}e.childCount>0&&m.set(i,{x0:h,y0:l,x1:c,y1:n,childCount:e.childCount,childrenDrawn:0})}},"drawBranch"),C=t(t=>t.split(/<br\s*\/?>|\n/),"splitLines"),M=t((t,i)=>{if(t.length<=i)return t;const e=[];for(const n of t.split(/\s+/)){const t=e.length-1;t>=0&&e[t].length+1+n.length<=i?e[t]+=" "+n:e.push(n)}return e.join("\n")},"wrapText"),j=t((t,i,e,n,s,a,r)=>{const o=C(i),h=1.05*r,l=t.append("text").attr("class",s).attr("text-anchor",a).attr("x",e).attr("y",n-(o.length-1)*h/2);for(const[t,i]of o.entries())l.append("tspan").attr("x",e).attr("dy",0===t?0:h).text(i);return l},"drawMultilineText"),L=t((t,i,e)=>t+(i-t)*e,"lerp"),P=t((t,i,e,n,s,a,r)=>{if(r){const o=r.roughSvg.line(i,e,n,s,{roughness:1.5,seed:r.seed,stroke:r.lineColor,strokeWidth:2});return void t.append(()=>o).attr("class",a)}return t.append("line").attr("class",a).attr("x1",i).attr("y1",e).attr("x2",n).attr("y2",s)},"drawLine"),T={draw:_},B=t(t=>`\n.ishikawa .ishikawa-spine,\n.ishikawa .ishikawa-branch,\n.ishikawa .ishikawa-sub-branch {\n stroke: ${t.lineColor};\n stroke-width: 2;\n fill: none;\n}\n\n.ishikawa .ishikawa-sub-branch {\n stroke-width: 1;\n}\n\n.ishikawa .ishikawa-arrow {\n fill: ${t.lineColor};\n}\n\n.ishikawa .ishikawa-head {\n fill: ${t.mainBkg};\n stroke: ${t.lineColor};\n stroke-width: 2;\n}\n\n.ishikawa .ishikawa-label-box {\n fill: ${t.mainBkg};\n stroke: ${t.lineColor};\n stroke-width: 2;\n}\n\n.ishikawa text {\n font-family: ${t.fontFamily};\n font-size: ${t.fontSize};\n fill: ${t.textColor};\n}\n\n.ishikawa .ishikawa-head-label {\n font-weight: 600;\n text-anchor: middle;\n dominant-baseline: middle;\n font-size: 14px;\n}\n\n.ishikawa .ishikawa-label {\n text-anchor: end;\n}\n\n.ishikawa .ishikawa-label.cause {\n text-anchor: middle;\n dominant-baseline: middle;\n}\n\n.ishikawa .ishikawa-label.align {\n text-anchor: end;\n dominant-baseline: middle;\n}\n\n.ishikawa .ishikawa-label.up {\n dominant-baseline: baseline;\n}\n\n.ishikawa .ishikawa-label.down {\n dominant-baseline: hanging;\n}\n`,"getStyles"),N={parser:g,get db(){return new f},renderer:T,styles:B};export{N as diagram};
@@ -1 +1 @@
1
- import{g as t}from"./chunk-FMBD7UC4-C_QBV__I.js";import{d as e,g as n,f as i,e as s}from"./chunk-ND2GUHAM-Cz6MG9Ip.js";import{L as r,aC as a,M as o,aD as l,P as c,aF as h,a as u,O as p,aA as y,w as d,n as f}from"./mermaid.core-EsBL2ECN.js";import{d as g}from"./arc-BalHlvik.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"./string-CQk_HvWX.js";var m=function(){var t=u(function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},"o"),e=[6,8,10,11,12,14,16,17,18],n=[1,9],i=[1,10],s=[1,11],r=[1,12],a=[1,13],o=[1,14],l={trace:u(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:u(function(t,e,n,i,s,r,a){var o=r.length-1;switch(s){case 1:return r[o-1];case 2:case 6:case 7:this.$=[];break;case 3:r[o-1].push(r[o]),this.$=r[o-1];break;case 4:case 5:this.$=r[o];break;case 8:i.setDiagramTitle(r[o].substr(6)),this.$=r[o].substr(6);break;case 9:this.$=r[o].trim(),i.setAccTitle(this.$);break;case 10:case 11:this.$=r[o].trim(),i.setAccDescription(this.$);break;case 12:i.addSection(r[o].substr(8)),this.$=r[o].substr(8);break;case 13:i.addTask(r[o-1],r[o]),this.$="task"}},"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:n,12:i,14:s,16:r,17:a,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:n,12:i,14:s,16:r,17:a,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:u(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:u(function(t){var e=this,n=[0],i=[],s=[null],r=[],a=this.table,o="",l=0,c=0,h=r.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(y.yy[d]=this.yy[d]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var f=p.yylloc;r.push(f);var g=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=i.pop()||p.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,u(function(t){n.length=n.length-2*t,s.length=s.length-t,r.length=r.length-t},"popStack"),u(m,"lex");for(var x,k,_,b,w,v,$,M,T={};;){if(k=n[n.length-1],this.defaultActions[k]?_=this.defaultActions[k]:(null==x&&(x=m()),_=a[k]&&a[k][x]),void 0===_||!_.length||!_[0]){var j="";for(w in M=[],a[k])this.terminals_[w]&&w>2&&M.push("'"+this.terminals_[w]+"'");j=p.showPosition?"Parse error on line "+(l+1)+":\n"+p.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==x?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(j,{text:p.match,token:this.terminals_[x]||x,line:p.yylineno,loc:f,expected:M})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+x);switch(_[0]){case 1:n.push(x),s.push(p.yytext),r.push(p.yylloc),n.push(_[1]),x=null,c=p.yyleng,o=p.yytext,l=p.yylineno,f=p.yylloc;break;case 2:if(v=this.productions_[_[1]][1],T.$=s[s.length-v],T._$={first_line:r[r.length-(v||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(v||1)].first_column,last_column:r[r.length-1].last_column},g&&(T._$.range=[r[r.length-(v||1)].range[0],r[r.length-1].range[1]]),void 0!==(b=this.performAction.apply(T,[o,c,l,y.yy,_[1],s,r].concat(h))))return b;v&&(n=n.slice(0,-1*v*2),s=s.slice(0,-1*v),r=r.slice(0,-1*v)),n.push(this.productions_[_[1]][0]),s.push(T.$),r.push(T._$),$=a[n[n.length-2]][n[n.length-1]],n.push($);break;case 3:return!0}}return!0},"parse")},c=function(){return{EOF:1,parseError:u(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:u(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:u(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:u(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[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:u(function(){return this._more=!0,this},"more"),reject:u(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:u(function(t){this.unput(this.match.slice(t))},"less"),pastInput:u(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:u(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:u(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:u(function(t,e){var n,i,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))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1},"test_match"),next:u(function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((n=this._input.match(this.rules[s[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:u(function(){var t=this.next();return t||this.lex()},"lex"),begin:u(function(t){this.conditionStack.push(t)},"begin"),popState:u(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:u(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:u(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:u(function(t){this.begin(t)},"pushState"),stateStackSize:u(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:u(function(t,e,n,i){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 10;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}}}}();function h(){this.yy={}}return l.lexer=c,u(h,"Parser"),h.prototype=l,l.Parser=h,new h}();m.parser=m;var x=m,k="",_=[],b=[],w=[],v=u(function(){_.length=0,b.length=0,k="",w.length=0,f()},"clear"),$=u(function(t){k=t,_.push(t)},"addSection"),M=u(function(){return _},"getSections"),T=u(function(){let t=E();let e=0;for(;!t&&e<100;)t=E(),e++;return b.push(...w),b},"getTasks"),j=u(function(){const t=[];b.forEach(e=>{e.people&&t.push(...e.people)});return[...new Set(t)].sort()},"updateActors"),S=u(function(t,e){const n=e.substr(1).split(":");let i=0,s=[];1===n.length?(i=Number(n[0]),s=[]):(i=Number(n[0]),s=n[1].split(","));const r=s.map(t=>t.trim()),a={section:k,type:k,people:r,task:t,score:i};w.push(a)},"addTask"),C=u(function(t){const e={section:k,type:k,description:t,task:t,classes:[]};b.push(e)},"addTaskOrg"),E=u(function(){const t=u(function(t){return w[t].processed},"compileTask");let e=!0;for(const[n,i]of w.entries())t(n),e=e&&i.processed;return e},"compileTasks"),A=u(function(){return j()},"getActors"),I={getConfig:u(()=>p().journey,"getConfig"),clear:v,setDiagramTitle:h,getDiagramTitle:c,setAccTitle:l,getAccTitle:o,setAccDescription:a,getAccDescription:r,addSection:$,getSections:M,getTasks:T,addTask:S,addTaskOrg:C,getActors:A},P=u(e=>`.label {\n font-family: ${e.fontFamily};\n color: ${e.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${e.textColor}\n }\n\n .legend {\n fill: ${e.textColor};\n font-family: ${e.fontFamily};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${e.textColor}\n }\n\n .face {\n ${e.faceColor?`fill: ${e.faceColor}`:"fill: #FFF8DC"};\n stroke: #999;\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\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: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${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 .task-type-0, .section-type-0 {\n ${e.fillType0?`fill: ${e.fillType0}`:""};\n }\n .task-type-1, .section-type-1 {\n ${e.fillType0?`fill: ${e.fillType1}`:""};\n }\n .task-type-2, .section-type-2 {\n ${e.fillType0?`fill: ${e.fillType2}`:""};\n }\n .task-type-3, .section-type-3 {\n ${e.fillType0?`fill: ${e.fillType3}`:""};\n }\n .task-type-4, .section-type-4 {\n ${e.fillType0?`fill: ${e.fillType4}`:""};\n }\n .task-type-5, .section-type-5 {\n ${e.fillType0?`fill: ${e.fillType5}`:""};\n }\n .task-type-6, .section-type-6 {\n ${e.fillType0?`fill: ${e.fillType6}`:""};\n }\n .task-type-7, .section-type-7 {\n ${e.fillType0?`fill: ${e.fillType7}`:""};\n }\n\n .actor-0 {\n ${e.actor0?`fill: ${e.actor0}`:""};\n }\n .actor-1 {\n ${e.actor1?`fill: ${e.actor1}`:""};\n }\n .actor-2 {\n ${e.actor2?`fill: ${e.actor2}`:""};\n }\n .actor-3 {\n ${e.actor3?`fill: ${e.actor3}`:""};\n }\n .actor-4 {\n ${e.actor4?`fill: ${e.actor4}`:""};\n }\n .actor-5 {\n ${e.actor5?`fill: ${e.actor5}`:""};\n }\n ${t()}\n`,"getStyles"),F=u(function(t,e){return s(t,e)},"drawRect"),V=u(function(t,e){const n=15,i=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",n).attr("stroke-width",2).attr("overflow","visible"),s=t.append("g");function r(t){const i=g().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",i).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function a(t){const i=g().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",i).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function o(t){t.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.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),s.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),u(r,"smile"),u(a,"sad"),u(o,"ambivalent"),e.score>3?r(s):e.score<3?a(s):o(s),i},"drawFace"),B=u(function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n},"drawCircle"),L=u(function(t,e){return i(t,e)},"drawText"),D=u(function(t,e){function n(t,e,n,i,s){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+i-s)+" "+(t+n-1.2*s)+","+(e+i)+" "+t+","+(e+i)}u(n,"genPoints");const i=t.append("polygon");i.attr("points",n(e.x,e.y,50,20,7)),i.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,L(t,e)},"drawLabel"),O=u(function(t,e,i){const s=t.append("g"),r=n();r.x=e.x,r.y=e.y,r.fill=e.fill,r.width=i.width*e.taskCount+i.diagramMarginX*(e.taskCount-1),r.height=i.height,r.class="journey-section section-type-"+e.num,r.rx=3,r.ry=3,F(s,r),Y(i)(e.text,s,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+e.num},i,e.colour)},"drawSection"),R=-1,N=u(function(t,e,i,s){const r=e.x+i.width/2,a=t.append("g");R++;a.append("line").attr("id",s+"-task"+R).attr("x1",r).attr("y1",e.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),V(a,{cx:r,cy:300+30*(5-e.score),score:e.score});const o=n();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=i.width,o.height=i.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,F(a,o);let l=e.x+14;e.people.forEach(t=>{const n=e.actors[t].color,i={cx:l,cy:e.y,r:7,fill:n,stroke:"#000",title:t,pos:e.actors[t].position};B(a,i),l+=10}),Y(i)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},i,e.colour)},"drawTask"),z=u(function(t,n){e(t,n)},"drawBackgroundRect"),Y=function(){function t(t,e,n,s,r,a,o,l){i(e.append("text").attr("x",n+r/2).attr("y",s+a/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function e(t,e,n,s,r,a,o,l,c){const{taskFontSize:h,taskFontFamily:u}=l,p=t.split(/<br\s*\/?>/gi);for(let t=0;t<p.length;t++){const l=t*h-h*(p.length-1)/2,y=e.append("text").attr("x",n+r/2).attr("y",s).attr("fill",c).style("text-anchor","middle").style("font-size",h).style("font-family",u);y.append("tspan").attr("x",n+r/2).attr("dy",l).text(p[t]),y.attr("y",s+a/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(y,o)}}function n(t,n,s,r,a,o,l,c){const h=n.append("switch"),u=h.append("foreignObject").attr("x",s).attr("y",r).attr("width",a).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,s,r,a,o,l,c),i(u,l)}function i(t,e){for(const n in e)n in e&&t.attr(n,e[n])}return u(t,"byText"),u(e,"byTspan"),u(n,"byFo"),u(i,"_setTextAttrs"),function(i){return"fo"===i.textPlacement?n:"old"===i.textPlacement?t:e}}(),W={drawRect:F,drawCircle:B,drawSection:O,drawText:L,drawLabel:D,drawTask:N,drawBackgroundRect:z,initGraphics:u(function(t,e){R=-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")},q=u(function(t){Object.keys(t).forEach(function(e){H[e]=t[e]})},"setConf"),G={},U=0;function X(t){const e=p().journey,n=e.maxLabelWidth;U=0;let i=60;Object.keys(G).forEach(s=>{const r=G[s].color,a={cx:20,cy:i,r:7,fill:r,stroke:"#000",pos:G[s].position};W.drawCircle(t,a);let o=t.append("text").attr("visibility","hidden").text(s);const l=o.node().getBoundingClientRect().width;o.remove();let c=[];if(l<=n)c=[s];else{const e=s.split(" ");let i="";o=t.append("text").attr("visibility","hidden"),e.forEach(t=>{const e=i?`${i} ${t}`:t;o.text(e);if(o.node().getBoundingClientRect().width>n){if(i&&c.push(i),i=t,o.text(t),o.node().getBoundingClientRect().width>n){let e="";for(const i of t)e+=i,o.text(e+"-"),o.node().getBoundingClientRect().width>n&&(c.push(e.slice(0,-1)+"-"),e=i);i=e}}else i=e}),i&&c.push(i),o.remove()}c.forEach((n,s)=>{const r={x:40,y:i+7+20*s,fill:"#666",text:n,textMargin:e.boxTextMargin??5},a=W.drawText(t,r).node().getBoundingClientRect().width;a>U&&a>e.leftMargin-a&&(U=a)}),i+=Math.max(20,20*c.length)})}u(X,"drawActorLegend");var H=p().journey,Z=0,J=u(function(t,e,n,i){const s=p(),r=s.journey.titleColor,a=s.journey.titleFontSize,o=s.journey.titleFontFamily,l=s.securityLevel;let c;"sandbox"===l&&(c=y("#i"+e));const h=y("sandbox"===l?c.nodes()[0].contentDocument.body:"body");K.init();const u=h.select("#"+e);W.initGraphics(u,e);const f=i.db.getTasks(),g=i.db.getDiagramTitle(),m=i.db.getActors();for(const t in G)delete G[t];let x=0;m.forEach(t=>{G[t]={color:H.actorColours[x%H.actorColours.length],position:x},x++}),X(u),Z=H.leftMargin+U,K.insert(0,0,Z,50*Object.keys(G).length),et(u,f,0,e);const k=K.getBounds();g&&u.append("text").text(g).attr("x",Z).attr("font-size",a).attr("font-weight","bold").attr("y",25).attr("fill",r).attr("font-family",o);const _=k.stopy-k.starty+2*H.diagramMarginY,b=Z+k.stopx+2*H.diagramMarginX;d(u,_,b,H.useMaxWidth),u.append("line").attr("x1",Z).attr("y1",4*H.height).attr("x2",b-Z-4).attr("y2",4*H.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const w=g?70:0;u.attr("viewBox",`${k.startx} -25 ${b} ${_+w}`),u.attr("preserveAspectRatio","xMinYMin meet"),u.attr("height",_+w+25)},"draw"),K={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:u(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:u(function(t,e,n,i){void 0===t[e]?t[e]=n:t[e]=i(n,t[e])},"updateVal"),updateBounds:u(function(t,e,n,i){const s=p().journey,r=this;let a=0;function o(o){return u(function(l){a++;const c=r.sequenceItems.length-a+1;r.updateVal(l,"starty",e-c*s.boxMargin,Math.min),r.updateVal(l,"stopy",i+c*s.boxMargin,Math.max),r.updateVal(K.data,"startx",t-c*s.boxMargin,Math.min),r.updateVal(K.data,"stopx",n+c*s.boxMargin,Math.max),"activation"!==o&&(r.updateVal(l,"startx",t-c*s.boxMargin,Math.min),r.updateVal(l,"stopx",n+c*s.boxMargin,Math.max),r.updateVal(K.data,"starty",e-c*s.boxMargin,Math.min),r.updateVal(K.data,"stopy",i+c*s.boxMargin,Math.max))},"updateItemBounds")}u(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:u(function(t,e,n,i){const s=Math.min(t,n),r=Math.max(t,n),a=Math.min(e,i),o=Math.max(e,i);this.updateVal(K.data,"startx",s,Math.min),this.updateVal(K.data,"starty",a,Math.min),this.updateVal(K.data,"stopx",r,Math.max),this.updateVal(K.data,"stopy",o,Math.max),this.updateBounds(s,a,r,o)},"insert"),bumpVerticalPos:u(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:u(function(){return this.verticalPos},"getVerticalPos"),getBounds:u(function(){return this.data},"getBounds")},Q=H.sectionFills,tt=H.sectionColours,et=u(function(t,e,n,i){const s=p().journey;let r="";const a=n+(2*s.height+s.diagramMarginY);let o=0,l="#CCC",c="black",h=0;for(const[n,u]of e.entries()){if(r!==u.section){l=Q[o%Q.length],h=o%Q.length,c=tt[o%tt.length];let i=0;const a=u.section;for(let t=n;t<e.length&&e[t].section==a;t++)i+=1;const p={x:n*s.taskMargin+n*s.width+Z,y:50,text:u.section,fill:l,num:h,colour:c,taskCount:i};W.drawSection(t,p,s),r=u.section,o++}const p=u.people.reduce((t,e)=>(G[e]&&(t[e]=G[e]),t),{});u.x=n*s.taskMargin+n*s.width+Z,u.y=a,u.width=s.diagramMarginX,u.height=s.diagramMarginY,u.colour=c,u.fill=l,u.num=h,u.actors=p,W.drawTask(t,u,s,i),K.insert(u.x,u.y,u.x+u.width+s.taskMargin,450)}},"drawTasks"),nt={setConf:q,draw:J},it={parser:x,db:I,renderer:nt,styles:P,init:u(t=>{nt.setConf(t.journey),I.clear()},"init")};export{it as diagram};
1
+ import{g as t}from"./chunk-FMBD7UC4-a15wpTbq.js";import{d as e,g as n,f as i,e as s}from"./chunk-ND2GUHAM-3yBxVPAC.js";import{L as r,aC as a,M as o,aD as l,P as c,aF as h,a as u,O as p,aA as y,w as d,n as f}from"./mermaid.core-QpTfboNw.js";import{d as g}from"./arc-BalHlvik.js";import"./index-DGfNHv1x.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-D0dFHHYS.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"./string-CQk_HvWX.js";var m=function(){var t=u(function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},"o"),e=[6,8,10,11,12,14,16,17,18],n=[1,9],i=[1,10],s=[1,11],r=[1,12],a=[1,13],o=[1,14],l={trace:u(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:u(function(t,e,n,i,s,r,a){var o=r.length-1;switch(s){case 1:return r[o-1];case 2:case 6:case 7:this.$=[];break;case 3:r[o-1].push(r[o]),this.$=r[o-1];break;case 4:case 5:this.$=r[o];break;case 8:i.setDiagramTitle(r[o].substr(6)),this.$=r[o].substr(6);break;case 9:this.$=r[o].trim(),i.setAccTitle(this.$);break;case 10:case 11:this.$=r[o].trim(),i.setAccDescription(this.$);break;case 12:i.addSection(r[o].substr(8)),this.$=r[o].substr(8);break;case 13:i.addTask(r[o-1],r[o]),this.$="task"}},"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:n,12:i,14:s,16:r,17:a,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:n,12:i,14:s,16:r,17:a,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:u(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:u(function(t){var e=this,n=[0],i=[],s=[null],r=[],a=this.table,o="",l=0,c=0,h=r.slice.call(arguments,1),p=Object.create(this.lexer),y={yy:{}};for(var d in this.yy)Object.prototype.hasOwnProperty.call(this.yy,d)&&(y.yy[d]=this.yy[d]);p.setInput(t,y.yy),y.yy.lexer=p,y.yy.parser=this,void 0===p.yylloc&&(p.yylloc={});var f=p.yylloc;r.push(f);var g=p.options&&p.options.ranges;function m(){var t;return"number"!=typeof(t=i.pop()||p.lex()||1)&&(t instanceof Array&&(t=(i=t).pop()),t=e.symbols_[t]||t),t}"function"==typeof y.yy.parseError?this.parseError=y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,u(function(t){n.length=n.length-2*t,s.length=s.length-t,r.length=r.length-t},"popStack"),u(m,"lex");for(var x,k,_,b,w,v,$,M,T={};;){if(k=n[n.length-1],this.defaultActions[k]?_=this.defaultActions[k]:(null==x&&(x=m()),_=a[k]&&a[k][x]),void 0===_||!_.length||!_[0]){var j="";for(w in M=[],a[k])this.terminals_[w]&&w>2&&M.push("'"+this.terminals_[w]+"'");j=p.showPosition?"Parse error on line "+(l+1)+":\n"+p.showPosition()+"\nExpecting "+M.join(", ")+", got '"+(this.terminals_[x]||x)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==x?"end of input":"'"+(this.terminals_[x]||x)+"'"),this.parseError(j,{text:p.match,token:this.terminals_[x]||x,line:p.yylineno,loc:f,expected:M})}if(_[0]instanceof Array&&_.length>1)throw new Error("Parse Error: multiple actions possible at state: "+k+", token: "+x);switch(_[0]){case 1:n.push(x),s.push(p.yytext),r.push(p.yylloc),n.push(_[1]),x=null,c=p.yyleng,o=p.yytext,l=p.yylineno,f=p.yylloc;break;case 2:if(v=this.productions_[_[1]][1],T.$=s[s.length-v],T._$={first_line:r[r.length-(v||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(v||1)].first_column,last_column:r[r.length-1].last_column},g&&(T._$.range=[r[r.length-(v||1)].range[0],r[r.length-1].range[1]]),void 0!==(b=this.performAction.apply(T,[o,c,l,y.yy,_[1],s,r].concat(h))))return b;v&&(n=n.slice(0,-1*v*2),s=s.slice(0,-1*v),r=r.slice(0,-1*v)),n.push(this.productions_[_[1]][0]),s.push(T.$),r.push(T._$),$=a[n[n.length-2]][n[n.length-1]],n.push($);break;case 3:return!0}}return!0},"parse")},c=function(){return{EOF:1,parseError:u(function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},"parseError"),setInput:u(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:u(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:u(function(t){var e=t.length,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[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:u(function(){return this._more=!0,this},"more"),reject:u(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:u(function(t){this.unput(this.match.slice(t))},"less"),pastInput:u(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:u(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:u(function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},"showPosition"),test_match:u(function(t,e){var n,i,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))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1},"test_match"),next:u(function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((n=this._input.match(this.rules[s[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:u(function(){var t=this.next();return t||this.lex()},"lex"),begin:u(function(t){this.conditionStack.push(t)},"begin"),popState:u(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:u(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:u(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:u(function(t){this.begin(t)},"pushState"),stateStackSize:u(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:u(function(t,e,n,i){switch(n){case 0:case 1:case 3:case 4:break;case 2:return 10;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}}}}();function h(){this.yy={}}return l.lexer=c,u(h,"Parser"),h.prototype=l,l.Parser=h,new h}();m.parser=m;var x=m,k="",_=[],b=[],w=[],v=u(function(){_.length=0,b.length=0,k="",w.length=0,f()},"clear"),$=u(function(t){k=t,_.push(t)},"addSection"),M=u(function(){return _},"getSections"),T=u(function(){let t=E();let e=0;for(;!t&&e<100;)t=E(),e++;return b.push(...w),b},"getTasks"),j=u(function(){const t=[];b.forEach(e=>{e.people&&t.push(...e.people)});return[...new Set(t)].sort()},"updateActors"),S=u(function(t,e){const n=e.substr(1).split(":");let i=0,s=[];1===n.length?(i=Number(n[0]),s=[]):(i=Number(n[0]),s=n[1].split(","));const r=s.map(t=>t.trim()),a={section:k,type:k,people:r,task:t,score:i};w.push(a)},"addTask"),C=u(function(t){const e={section:k,type:k,description:t,task:t,classes:[]};b.push(e)},"addTaskOrg"),E=u(function(){const t=u(function(t){return w[t].processed},"compileTask");let e=!0;for(const[n,i]of w.entries())t(n),e=e&&i.processed;return e},"compileTasks"),A=u(function(){return j()},"getActors"),I={getConfig:u(()=>p().journey,"getConfig"),clear:v,setDiagramTitle:h,getDiagramTitle:c,setAccTitle:l,getAccTitle:o,setAccDescription:a,getAccDescription:r,addSection:$,getSections:M,getTasks:T,addTask:S,addTaskOrg:C,getActors:A},P=u(e=>`.label {\n font-family: ${e.fontFamily};\n color: ${e.textColor};\n }\n .mouth {\n stroke: #666;\n }\n\n line {\n stroke: ${e.textColor}\n }\n\n .legend {\n fill: ${e.textColor};\n font-family: ${e.fontFamily};\n }\n\n .label text {\n fill: #333;\n }\n .label {\n color: ${e.textColor}\n }\n\n .face {\n ${e.faceColor?`fill: ${e.faceColor}`:"fill: #FFF8DC"};\n stroke: #999;\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\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: 1.5px;\n }\n\n .flowchart-link {\n stroke: ${e.lineColor};\n fill: none;\n }\n\n .edgeLabel {\n background-color: ${e.edgeLabelBackground};\n rect {\n opacity: 0.5;\n }\n text-align: center;\n }\n\n .cluster rect {\n }\n\n .cluster text {\n fill: ${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 .task-type-0, .section-type-0 {\n ${e.fillType0?`fill: ${e.fillType0}`:""};\n }\n .task-type-1, .section-type-1 {\n ${e.fillType0?`fill: ${e.fillType1}`:""};\n }\n .task-type-2, .section-type-2 {\n ${e.fillType0?`fill: ${e.fillType2}`:""};\n }\n .task-type-3, .section-type-3 {\n ${e.fillType0?`fill: ${e.fillType3}`:""};\n }\n .task-type-4, .section-type-4 {\n ${e.fillType0?`fill: ${e.fillType4}`:""};\n }\n .task-type-5, .section-type-5 {\n ${e.fillType0?`fill: ${e.fillType5}`:""};\n }\n .task-type-6, .section-type-6 {\n ${e.fillType0?`fill: ${e.fillType6}`:""};\n }\n .task-type-7, .section-type-7 {\n ${e.fillType0?`fill: ${e.fillType7}`:""};\n }\n\n .actor-0 {\n ${e.actor0?`fill: ${e.actor0}`:""};\n }\n .actor-1 {\n ${e.actor1?`fill: ${e.actor1}`:""};\n }\n .actor-2 {\n ${e.actor2?`fill: ${e.actor2}`:""};\n }\n .actor-3 {\n ${e.actor3?`fill: ${e.actor3}`:""};\n }\n .actor-4 {\n ${e.actor4?`fill: ${e.actor4}`:""};\n }\n .actor-5 {\n ${e.actor5?`fill: ${e.actor5}`:""};\n }\n ${t()}\n`,"getStyles"),F=u(function(t,e){return s(t,e)},"drawRect"),V=u(function(t,e){const n=15,i=t.append("circle").attr("cx",e.cx).attr("cy",e.cy).attr("class","face").attr("r",n).attr("stroke-width",2).attr("overflow","visible"),s=t.append("g");function r(t){const i=g().startAngle(Math.PI/2).endAngle(Math.PI/2*3).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",i).attr("transform","translate("+e.cx+","+(e.cy+2)+")")}function a(t){const i=g().startAngle(3*Math.PI/2).endAngle(Math.PI/2*5).innerRadius(7.5).outerRadius(n/2.2);t.append("path").attr("class","mouth").attr("d",i).attr("transform","translate("+e.cx+","+(e.cy+7)+")")}function o(t){t.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.append("circle").attr("cx",e.cx-5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),s.append("circle").attr("cx",e.cx+5).attr("cy",e.cy-5).attr("r",1.5).attr("stroke-width",2).attr("fill","#666").attr("stroke","#666"),u(r,"smile"),u(a,"sad"),u(o,"ambivalent"),e.score>3?r(s):e.score<3?a(s):o(s),i},"drawFace"),B=u(function(t,e){const n=t.append("circle");return n.attr("cx",e.cx),n.attr("cy",e.cy),n.attr("class","actor-"+e.pos),n.attr("fill",e.fill),n.attr("stroke",e.stroke),n.attr("r",e.r),void 0!==n.class&&n.attr("class",n.class),void 0!==e.title&&n.append("title").text(e.title),n},"drawCircle"),L=u(function(t,e){return i(t,e)},"drawText"),D=u(function(t,e){function n(t,e,n,i,s){return t+","+e+" "+(t+n)+","+e+" "+(t+n)+","+(e+i-s)+" "+(t+n-1.2*s)+","+(e+i)+" "+t+","+(e+i)}u(n,"genPoints");const i=t.append("polygon");i.attr("points",n(e.x,e.y,50,20,7)),i.attr("class","labelBox"),e.y=e.y+e.labelMargin,e.x=e.x+.5*e.labelMargin,L(t,e)},"drawLabel"),O=u(function(t,e,i){const s=t.append("g"),r=n();r.x=e.x,r.y=e.y,r.fill=e.fill,r.width=i.width*e.taskCount+i.diagramMarginX*(e.taskCount-1),r.height=i.height,r.class="journey-section section-type-"+e.num,r.rx=3,r.ry=3,F(s,r),Y(i)(e.text,s,r.x,r.y,r.width,r.height,{class:"journey-section section-type-"+e.num},i,e.colour)},"drawSection"),R=-1,N=u(function(t,e,i,s){const r=e.x+i.width/2,a=t.append("g");R++;a.append("line").attr("id",s+"-task"+R).attr("x1",r).attr("y1",e.y).attr("x2",r).attr("y2",450).attr("class","task-line").attr("stroke-width","1px").attr("stroke-dasharray","4 2").attr("stroke","#666"),V(a,{cx:r,cy:300+30*(5-e.score),score:e.score});const o=n();o.x=e.x,o.y=e.y,o.fill=e.fill,o.width=i.width,o.height=i.height,o.class="task task-type-"+e.num,o.rx=3,o.ry=3,F(a,o);let l=e.x+14;e.people.forEach(t=>{const n=e.actors[t].color,i={cx:l,cy:e.y,r:7,fill:n,stroke:"#000",title:t,pos:e.actors[t].position};B(a,i),l+=10}),Y(i)(e.task,a,o.x,o.y,o.width,o.height,{class:"task"},i,e.colour)},"drawTask"),z=u(function(t,n){e(t,n)},"drawBackgroundRect"),Y=function(){function t(t,e,n,s,r,a,o,l){i(e.append("text").attr("x",n+r/2).attr("y",s+a/2+5).style("font-color",l).style("text-anchor","middle").text(t),o)}function e(t,e,n,s,r,a,o,l,c){const{taskFontSize:h,taskFontFamily:u}=l,p=t.split(/<br\s*\/?>/gi);for(let t=0;t<p.length;t++){const l=t*h-h*(p.length-1)/2,y=e.append("text").attr("x",n+r/2).attr("y",s).attr("fill",c).style("text-anchor","middle").style("font-size",h).style("font-family",u);y.append("tspan").attr("x",n+r/2).attr("dy",l).text(p[t]),y.attr("y",s+a/2).attr("dominant-baseline","central").attr("alignment-baseline","central"),i(y,o)}}function n(t,n,s,r,a,o,l,c){const h=n.append("switch"),u=h.append("foreignObject").attr("x",s).attr("y",r).attr("width",a).attr("height",o).attr("position","fixed").append("xhtml:div").style("display","table").style("height","100%").style("width","100%");u.append("div").attr("class","label").style("display","table-cell").style("text-align","center").style("vertical-align","middle").text(t),e(t,h,s,r,a,o,l,c),i(u,l)}function i(t,e){for(const n in e)n in e&&t.attr(n,e[n])}return u(t,"byText"),u(e,"byTspan"),u(n,"byFo"),u(i,"_setTextAttrs"),function(i){return"fo"===i.textPlacement?n:"old"===i.textPlacement?t:e}}(),W={drawRect:F,drawCircle:B,drawSection:O,drawText:L,drawLabel:D,drawTask:N,drawBackgroundRect:z,initGraphics:u(function(t,e){R=-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")},q=u(function(t){Object.keys(t).forEach(function(e){H[e]=t[e]})},"setConf"),G={},U=0;function X(t){const e=p().journey,n=e.maxLabelWidth;U=0;let i=60;Object.keys(G).forEach(s=>{const r=G[s].color,a={cx:20,cy:i,r:7,fill:r,stroke:"#000",pos:G[s].position};W.drawCircle(t,a);let o=t.append("text").attr("visibility","hidden").text(s);const l=o.node().getBoundingClientRect().width;o.remove();let c=[];if(l<=n)c=[s];else{const e=s.split(" ");let i="";o=t.append("text").attr("visibility","hidden"),e.forEach(t=>{const e=i?`${i} ${t}`:t;o.text(e);if(o.node().getBoundingClientRect().width>n){if(i&&c.push(i),i=t,o.text(t),o.node().getBoundingClientRect().width>n){let e="";for(const i of t)e+=i,o.text(e+"-"),o.node().getBoundingClientRect().width>n&&(c.push(e.slice(0,-1)+"-"),e=i);i=e}}else i=e}),i&&c.push(i),o.remove()}c.forEach((n,s)=>{const r={x:40,y:i+7+20*s,fill:"#666",text:n,textMargin:e.boxTextMargin??5},a=W.drawText(t,r).node().getBoundingClientRect().width;a>U&&a>e.leftMargin-a&&(U=a)}),i+=Math.max(20,20*c.length)})}u(X,"drawActorLegend");var H=p().journey,Z=0,J=u(function(t,e,n,i){const s=p(),r=s.journey.titleColor,a=s.journey.titleFontSize,o=s.journey.titleFontFamily,l=s.securityLevel;let c;"sandbox"===l&&(c=y("#i"+e));const h=y("sandbox"===l?c.nodes()[0].contentDocument.body:"body");K.init();const u=h.select("#"+e);W.initGraphics(u,e);const f=i.db.getTasks(),g=i.db.getDiagramTitle(),m=i.db.getActors();for(const t in G)delete G[t];let x=0;m.forEach(t=>{G[t]={color:H.actorColours[x%H.actorColours.length],position:x},x++}),X(u),Z=H.leftMargin+U,K.insert(0,0,Z,50*Object.keys(G).length),et(u,f,0,e);const k=K.getBounds();g&&u.append("text").text(g).attr("x",Z).attr("font-size",a).attr("font-weight","bold").attr("y",25).attr("fill",r).attr("font-family",o);const _=k.stopy-k.starty+2*H.diagramMarginY,b=Z+k.stopx+2*H.diagramMarginX;d(u,_,b,H.useMaxWidth),u.append("line").attr("x1",Z).attr("y1",4*H.height).attr("x2",b-Z-4).attr("y2",4*H.height).attr("stroke-width",4).attr("stroke","black").attr("marker-end","url(#"+e+"-arrowhead)");const w=g?70:0;u.attr("viewBox",`${k.startx} -25 ${b} ${_+w}`),u.attr("preserveAspectRatio","xMinYMin meet"),u.attr("height",_+w+25)},"draw"),K={data:{startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},verticalPos:0,sequenceItems:[],init:u(function(){this.sequenceItems=[],this.data={startx:void 0,stopx:void 0,starty:void 0,stopy:void 0},this.verticalPos=0},"init"),updateVal:u(function(t,e,n,i){void 0===t[e]?t[e]=n:t[e]=i(n,t[e])},"updateVal"),updateBounds:u(function(t,e,n,i){const s=p().journey,r=this;let a=0;function o(o){return u(function(l){a++;const c=r.sequenceItems.length-a+1;r.updateVal(l,"starty",e-c*s.boxMargin,Math.min),r.updateVal(l,"stopy",i+c*s.boxMargin,Math.max),r.updateVal(K.data,"startx",t-c*s.boxMargin,Math.min),r.updateVal(K.data,"stopx",n+c*s.boxMargin,Math.max),"activation"!==o&&(r.updateVal(l,"startx",t-c*s.boxMargin,Math.min),r.updateVal(l,"stopx",n+c*s.boxMargin,Math.max),r.updateVal(K.data,"starty",e-c*s.boxMargin,Math.min),r.updateVal(K.data,"stopy",i+c*s.boxMargin,Math.max))},"updateItemBounds")}u(o,"updateFn"),this.sequenceItems.forEach(o())},"updateBounds"),insert:u(function(t,e,n,i){const s=Math.min(t,n),r=Math.max(t,n),a=Math.min(e,i),o=Math.max(e,i);this.updateVal(K.data,"startx",s,Math.min),this.updateVal(K.data,"starty",a,Math.min),this.updateVal(K.data,"stopx",r,Math.max),this.updateVal(K.data,"stopy",o,Math.max),this.updateBounds(s,a,r,o)},"insert"),bumpVerticalPos:u(function(t){this.verticalPos=this.verticalPos+t,this.data.stopy=this.verticalPos},"bumpVerticalPos"),getVerticalPos:u(function(){return this.verticalPos},"getVerticalPos"),getBounds:u(function(){return this.data},"getBounds")},Q=H.sectionFills,tt=H.sectionColours,et=u(function(t,e,n,i){const s=p().journey;let r="";const a=n+(2*s.height+s.diagramMarginY);let o=0,l="#CCC",c="black",h=0;for(const[n,u]of e.entries()){if(r!==u.section){l=Q[o%Q.length],h=o%Q.length,c=tt[o%tt.length];let i=0;const a=u.section;for(let t=n;t<e.length&&e[t].section==a;t++)i+=1;const p={x:n*s.taskMargin+n*s.width+Z,y:50,text:u.section,fill:l,num:h,colour:c,taskCount:i};W.drawSection(t,p,s),r=u.section,o++}const p=u.people.reduce((t,e)=>(G[e]&&(t[e]=G[e]),t),{});u.x=n*s.taskMargin+n*s.width+Z,u.y=a,u.width=s.diagramMarginX,u.height=s.diagramMarginY,u.colour=c,u.fill=l,u.num=h,u.actors=p,W.drawTask(t,u,s,i),K.insert(u.x,u.y,u.x+u.width+s.taskMargin,450)}},"drawTasks"),nt={setConf:q,draw:J},it={parser:x,db:I,renderer:nt,styles:P,init:u(t=>{nt.setConf(t.journey),I.clear()},"init")};export{it as diagram};
@@ -1 +1 @@
1
- import{a as t,ai as e,O as n,aB as i,a3 as s,a6 as r,as as o,aI as a,F as c,az as l,ah as h,J as u,aa as g,af as d,y as p}from"./mermaid.core-EsBL2ECN.js";import{g as y}from"./chunk-FMBD7UC4-C_QBV__I.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"./string-CQk_HvWX.js";var m=function(){var e=t(function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},"o"),n=[1,4],i=[1,13],s=[1,12],r=[1,15],o=[1,16],a=[1,20],c=[1,19],l=[6,7,8],h=[1,26],u=[1,24],g=[1,25],d=[6,7,11],p=[1,31],y=[6,7,11,24],m=[1,6,13,16,17,20,23],f=[1,35],b=[1,36],_=[1,6,7,11,13,16,17,20,23],k=[1,38],E={trace:t(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:t(function(t,e,n,i,s,r,o){var a=r.length-1;switch(s){case 6:case 7:return i;case 8:i.getLogger().trace("Stop NL ");break;case 9:i.getLogger().trace("Stop EOF ");break;case 11:i.getLogger().trace("Stop NL2 ");break;case 12:i.getLogger().trace("Stop EOF2 ");break;case 15:i.getLogger().info("Node: ",r[a-1].id),i.addNode(r[a-2].length,r[a-1].id,r[a-1].descr,r[a-1].type,r[a]);break;case 16:i.getLogger().info("Node: ",r[a].id),i.addNode(r[a-1].length,r[a].id,r[a].descr,r[a].type);break;case 17:i.getLogger().trace("Icon: ",r[a]),i.decorateNode({icon:r[a]});break;case 18:case 23:i.decorateNode({class:r[a]});break;case 19:i.getLogger().trace("SPACELIST");break;case 20:i.getLogger().trace("Node: ",r[a-1].id),i.addNode(0,r[a-1].id,r[a-1].descr,r[a-1].type,r[a]);break;case 21:i.getLogger().trace("Node: ",r[a].id),i.addNode(0,r[a].id,r[a].descr,r[a].type);break;case 22:i.decorateNode({icon:r[a]});break;case 27:i.getLogger().trace("node found ..",r[a-2]),this.$={id:r[a-1],descr:r[a-1],type:i.getType(r[a-2],r[a])};break;case 28:this.$={id:r[a],descr:r[a],type:0};break;case 29:i.getLogger().trace("node found ..",r[a-3]),this.$={id:r[a-3],descr:r[a-1],type:i.getType(r[a-2],r[a])};break;case 30:this.$=r[a-1]+r[a];break;case 31:this.$=r[a]}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:i,7:[1,10],9:9,12:11,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:c},e(l,[2,3]),{1:[2,2]},e(l,[2,4]),e(l,[2,5]),{1:[2,6],6:i,12:21,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:c},{6:i,9:22,12:11,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:c},{6:h,7:u,10:23,11:g},e(d,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:a,23:c}),e(d,[2,19]),e(d,[2,21],{15:30,24:p}),e(d,[2,22]),e(d,[2,23]),e(y,[2,25]),e(y,[2,26]),e(y,[2,28],{20:[1,32]}),{21:[1,33]},{6:h,7:u,10:34,11:g},{1:[2,7],6:i,12:21,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:c},e(m,[2,14],{7:f,11:b}),e(_,[2,8]),e(_,[2,9]),e(_,[2,10]),e(d,[2,16],{15:37,24:p}),e(d,[2,17]),e(d,[2,18]),e(d,[2,20],{24:k}),e(y,[2,31]),{21:[1,39]},{22:[1,40]},e(m,[2,13],{7:f,11:b}),e(_,[2,11]),e(_,[2,12]),e(d,[2,15],{24:k}),e(y,[2,30]),{22:[1,41]},e(y,[2,27]),e(y,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:t(function(e){var n=this,i=[0],s=[],r=[null],o=[],a=this.table,c="",l=0,h=0,u=o.slice.call(arguments,1),g=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);g.setInput(e,d.yy),d.yy.lexer=g,d.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;o.push(y);var m=g.options&&g.options.ranges;function f(){var t;return"number"!=typeof(t=s.pop()||g.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t(function(t){i.length=i.length-2*t,r.length=r.length-t,o.length=o.length-t},"popStack"),t(f,"lex");for(var b,_,k,E,S,x,N,D,L={};;){if(_=i[i.length-1],this.defaultActions[_]?k=this.defaultActions[_]:(null==b&&(b=f()),k=a[_]&&a[_][b]),void 0===k||!k.length||!k[0]){var I="";for(S in D=[],a[_])this.terminals_[S]&&S>2&&D.push("'"+this.terminals_[S]+"'");I=g.showPosition?"Parse error on line "+(l+1)+":\n"+g.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(I,{text:g.match,token:this.terminals_[b]||b,line:g.yylineno,loc:y,expected:D})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(k[0]){case 1:i.push(b),r.push(g.yytext),o.push(g.yylloc),i.push(k[1]),b=null,h=g.yyleng,c=g.yytext,l=g.yylineno,y=g.yylloc;break;case 2:if(x=this.productions_[k[1]][1],L.$=r[r.length-x],L._$={first_line:o[o.length-(x||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(x||1)].first_column,last_column:o[o.length-1].last_column},m&&(L._$.range=[o[o.length-(x||1)].range[0],o[o.length-1].range[1]]),void 0!==(E=this.performAction.apply(L,[c,h,l,d.yy,k[1],r,o].concat(u))))return E;x&&(i=i.slice(0,-1*x*2),r=r.slice(0,-1*x),o=o.slice(0,-1*x)),i.push(this.productions_[k[1]][0]),r.push(L.$),o.push(L._$),N=a[i[i.length-2]][i[i.length-1]],i.push(N);break;case 3:return!0}}return!0},"parse")},S=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,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[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 n,i,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))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((n=this._input.match(this.rules[s[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex: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:{"case-insensitive":!0},performAction:t(function(t,e,n,i){switch(n){case 0:return this.pushState("shapeData"),e.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const n=/\n\s*/g;return e.yytext=e.yytext.replace(n,"<br/>"),24;case 4:return 24;case 5:case 10:case 29:case 32:this.popState();break;case 6:return t.getLogger().trace("Found comment",e.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;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:case 21:case 22: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 30:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return t.getLogger().trace("description:",e.yytext),"NODE_DESCR";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 ...",e.yytext),"NODE_DEND";case 36:case 39:case 40:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 37:case 38:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 41:case 42:return t.getLogger().trace("Long description:",e.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}}}}();function x(){this.yy={}}return E.lexer=S,t(x,"Parser"),x.prototype=E,E.Parser=x,new x}();m.parser=m;var f=m,b=[],_=[],k=0,E={},S=t(()=>{b=[],_=[],k=0,E={}},"clear"),x=t(t=>{if(0===b.length)return null;const e=b[0].level;let n=null;for(let t=b.length-1;t>=0;t--)if(b[t].level!==e||n||(n=b[t]),b[t].level<e)throw new Error('Items without section detected, found section ("'+b[t].label+'")');return t===n?.level?null:n},"getSection"),N=t(function(){return _},"getSections"),D=t(function(){const t=[],e=N(),i=n();for(const n of e){const e={id:n.id,label:l(n.label??"",i),labelType:"markdown",isGroup:!0,ticket:n.ticket,shape:"kanbanSection",level:n.level,look:i.look};t.push(e);const s=b.filter(t=>t.parentId===n.id);for(const e of s){const s={id:e.id,parentId:n.id,label:l(e.label??"",i),labelType:"markdown",isGroup:!1,ticket:e?.ticket,priority:e?.priority,assigned:e?.assigned,icon:e?.icon,shape:"kanbanItem",level:e.level,rx:5,ry:5,cssStyles:["text-align: left"]};t.push(s)}}return{nodes:t,edges:[],other:{},config:n()}},"getData"),L=t((t,e,i,s,r)=>{const o=n();let a=o.mindmap?.padding??c.mindmap.padding;switch(s){case I.ROUNDED_RECT:case I.RECT:case I.HEXAGON:a*=2}const g={id:l(e,o)||"kbn"+k++,level:t,label:l(i,o),width:o.mindmap?.maxNodeWidth??c.mindmap.maxNodeWidth,padding:a,isGroup:!1};if(void 0!==r){let t;t=r.includes("\n")?r+"\n":"{\n"+r+"\n}";const e=h(t,{schema:u});if(e.shape&&(e.shape!==e.shape.toLowerCase()||e.shape.includes("_")))throw new Error(`No such shape: ${e.shape}. Shape names should be lowercase.`);e?.shape&&"kanbanItem"===e.shape&&(g.shape=e?.shape),e?.label&&(g.label=e?.label),e?.icon&&(g.icon=e?.icon.toString()),e?.assigned&&(g.assigned=e?.assigned.toString()),e?.ticket&&(g.ticket=e?.ticket.toString()),e?.priority&&(g.priority=e?.priority)}const d=x(t);d?g.parentId=d.id||"kbn"+k++:_.push(g),b.push(g)},"addNode"),I={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},O={clear:S,addNode:L,getSections:N,getData:D,nodeType:I,getType:t((t,n)=>{switch(e.debug("In get type",t,n),t){case"[":return I.RECT;case"(":return")"===n?I.ROUNDED_RECT:I.CLOUD;case"((":return I.CIRCLE;case")":return I.CLOUD;case"))":return I.BANG;case"{{":return I.HEXAGON;default:return I.DEFAULT}},"getType"),setElementForId:t((t,e)=>{E[t]=e},"setElementForId"),decorateNode:t(t=>{if(!t)return;const e=n(),i=b[b.length-1];t.icon&&(i.icon=l(t.icon,e)),t.class&&(i.cssClasses=l(t.class,e))},"decorateNode"),type2Str:t(t=>{switch(t){case I.DEFAULT:return"no-border";case I.RECT:return"rect";case I.ROUNDED_RECT:return"rounded-rect";case I.CIRCLE:return"circle";case I.CLOUD:return"cloud";case I.BANG:return"bang";case I.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),getLogger:t(()=>e,"getLogger"),getElementById:t(t=>E[t],"getElementById")},C={draw:t(async(t,l,h,u)=>{e.debug("Rendering kanban diagram\n"+t);const g=u.db.getData(),d=n();d.htmlLabels=!1;const p=i(l);for(const t of g.nodes)t.domId=`${l}-${t.id}`;const y=p.append("g");y.attr("class","sections");const m=p.append("g");m.attr("class","items");const f=g.nodes.filter(t=>t.isGroup);let b=0;const _=[];let k=25;for(const t of f){const e=d?.kanban?.sectionWidth||200;b+=1,t.x=e*b+10*(b-1)/2,t.width=e,t.y=0,t.height=3*e,t.rx=5,t.ry=5,t.cssClasses=t.cssClasses+" section-"+b;const n=await s(y,t);k=Math.max(k,n?.labelBBox?.height),_.push(n)}let E=0;for(const t of f){const e=_[E];E+=1;const n=d?.kanban?.sectionWidth||200,i=3*-n/2+k;let s=i;const a=g.nodes.filter(e=>e.parentId===t.id);for(const e of a){if(e.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");e.x=t.x,e.width=n-15;const i=(await r(m,e,{config:d})).node().getBBox();e.y=s+i.height/2,await o(e),s=e.y+i.height/2+5}const c=e.cluster.select("rect"),l=Math.max(s-i+30,50)+(k-25);c.attr("height",l)}a(void 0,p,d.mindmap?.padding??c.kanban.padding,d.mindmap?.useMaxWidth??c.kanban.useMaxWidth)},"draw")},v=t(e=>{let n="";for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e["lineColor"+t]=e["lineColor"+t]||e["cScaleInv"+t],g(e["lineColor"+t])?e["lineColor"+t]=d(e["lineColor"+t],20):e["lineColor"+t]=p(e["lineColor"+t],20);const i=t((t,n)=>e.darkMode?p(t,n):d(t,n),"adjuster");for(let t=0;t<e.THEME_COLOR_LIMIT;t++){const s=""+(17-3*t);n+=`\n .section-${t-1} rect, .section-${t-1} path, .section-${t-1} circle, .section-${t-1} polygon, .section-${t-1} path {\n fill: ${i(e["cScale"+t],10)};\n stroke: ${i(e["cScale"+t],10)};\n\n }\n .section-${t-1} text {\n fill: ${e["cScaleLabel"+t]};\n }\n .node-icon-${t-1} {\n font-size: 40px;\n color: ${e["cScaleLabel"+t]};\n }\n .section-edge-${t-1}{\n stroke: ${e["cScale"+t]};\n }\n .edge-depth-${t-1}{\n stroke-width: ${s};\n }\n .section-${t-1} line {\n stroke: ${e["cScaleInv"+t]} ;\n stroke-width: 3;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.background};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n\n .kanban-ticket-link {\n fill: ${e.background};\n stroke: ${e.nodeBorder};\n text-decoration: underline;\n }\n `}return n},"genSections"),w={db:O,renderer:C,parser:f,styles:t(t=>`\n .edge {\n stroke-width: 3;\n }\n ${v(t)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .cluster-label, .label {\n color: ${t.textColor};\n fill: ${t.textColor};\n }\n .kanban-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n ${y()}\n`,"getStyles")};export{w as diagram};
1
+ import{a as t,ai as e,O as n,aB as i,a3 as s,a6 as r,as as o,aI as a,F as c,az as l,ah as h,J as u,aa as g,af as d,y as p}from"./mermaid.core-QpTfboNw.js";import{g as y}from"./chunk-FMBD7UC4-a15wpTbq.js";import"./index-DGfNHv1x.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-D0dFHHYS.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"./string-CQk_HvWX.js";var m=function(){var e=t(function(t,e,n,i){for(n=n||{},i=t.length;i--;n[t[i]]=e);return n},"o"),n=[1,4],i=[1,13],s=[1,12],r=[1,15],o=[1,16],a=[1,20],c=[1,19],l=[6,7,8],h=[1,26],u=[1,24],g=[1,25],d=[6,7,11],p=[1,31],y=[6,7,11,24],m=[1,6,13,16,17,20,23],f=[1,35],b=[1,36],_=[1,6,7,11,13,16,17,20,23],k=[1,38],E={trace:t(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:t(function(t,e,n,i,s,r,o){var a=r.length-1;switch(s){case 6:case 7:return i;case 8:i.getLogger().trace("Stop NL ");break;case 9:i.getLogger().trace("Stop EOF ");break;case 11:i.getLogger().trace("Stop NL2 ");break;case 12:i.getLogger().trace("Stop EOF2 ");break;case 15:i.getLogger().info("Node: ",r[a-1].id),i.addNode(r[a-2].length,r[a-1].id,r[a-1].descr,r[a-1].type,r[a]);break;case 16:i.getLogger().info("Node: ",r[a].id),i.addNode(r[a-1].length,r[a].id,r[a].descr,r[a].type);break;case 17:i.getLogger().trace("Icon: ",r[a]),i.decorateNode({icon:r[a]});break;case 18:case 23:i.decorateNode({class:r[a]});break;case 19:i.getLogger().trace("SPACELIST");break;case 20:i.getLogger().trace("Node: ",r[a-1].id),i.addNode(0,r[a-1].id,r[a-1].descr,r[a-1].type,r[a]);break;case 21:i.getLogger().trace("Node: ",r[a].id),i.addNode(0,r[a].id,r[a].descr,r[a].type);break;case 22:i.decorateNode({icon:r[a]});break;case 27:i.getLogger().trace("node found ..",r[a-2]),this.$={id:r[a-1],descr:r[a-1],type:i.getType(r[a-2],r[a])};break;case 28:this.$={id:r[a],descr:r[a],type:0};break;case 29:i.getLogger().trace("node found ..",r[a-3]),this.$={id:r[a-3],descr:r[a-1],type:i.getType(r[a-2],r[a])};break;case 30:this.$=r[a-1]+r[a];break;case 31:this.$=r[a]}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:n},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:n},{6:i,7:[1,10],9:9,12:11,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:c},e(l,[2,3]),{1:[2,2]},e(l,[2,4]),e(l,[2,5]),{1:[2,6],6:i,12:21,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:c},{6:i,9:22,12:11,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:c},{6:h,7:u,10:23,11:g},e(d,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:a,23:c}),e(d,[2,19]),e(d,[2,21],{15:30,24:p}),e(d,[2,22]),e(d,[2,23]),e(y,[2,25]),e(y,[2,26]),e(y,[2,28],{20:[1,32]}),{21:[1,33]},{6:h,7:u,10:34,11:g},{1:[2,7],6:i,12:21,13:s,14:14,16:r,17:o,18:17,19:18,20:a,23:c},e(m,[2,14],{7:f,11:b}),e(_,[2,8]),e(_,[2,9]),e(_,[2,10]),e(d,[2,16],{15:37,24:p}),e(d,[2,17]),e(d,[2,18]),e(d,[2,20],{24:k}),e(y,[2,31]),{21:[1,39]},{22:[1,40]},e(m,[2,13],{7:f,11:b}),e(_,[2,11]),e(_,[2,12]),e(d,[2,15],{24:k}),e(y,[2,30]),{22:[1,41]},e(y,[2,27]),e(y,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:t(function(t,e){if(!e.recoverable){var n=new Error(t);throw n.hash=e,n}this.trace(t)},"parseError"),parse:t(function(e){var n=this,i=[0],s=[],r=[null],o=[],a=this.table,c="",l=0,h=0,u=o.slice.call(arguments,1),g=Object.create(this.lexer),d={yy:{}};for(var p in this.yy)Object.prototype.hasOwnProperty.call(this.yy,p)&&(d.yy[p]=this.yy[p]);g.setInput(e,d.yy),d.yy.lexer=g,d.yy.parser=this,void 0===g.yylloc&&(g.yylloc={});var y=g.yylloc;o.push(y);var m=g.options&&g.options.ranges;function f(){var t;return"number"!=typeof(t=s.pop()||g.lex()||1)&&(t instanceof Array&&(t=(s=t).pop()),t=n.symbols_[t]||t),t}"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,t(function(t){i.length=i.length-2*t,r.length=r.length-t,o.length=o.length-t},"popStack"),t(f,"lex");for(var b,_,k,E,S,x,N,D,L={};;){if(_=i[i.length-1],this.defaultActions[_]?k=this.defaultActions[_]:(null==b&&(b=f()),k=a[_]&&a[_][b]),void 0===k||!k.length||!k[0]){var I="";for(S in D=[],a[_])this.terminals_[S]&&S>2&&D.push("'"+this.terminals_[S]+"'");I=g.showPosition?"Parse error on line "+(l+1)+":\n"+g.showPosition()+"\nExpecting "+D.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(l+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(I,{text:g.match,token:this.terminals_[b]||b,line:g.yylineno,loc:y,expected:D})}if(k[0]instanceof Array&&k.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(k[0]){case 1:i.push(b),r.push(g.yytext),o.push(g.yylloc),i.push(k[1]),b=null,h=g.yyleng,c=g.yytext,l=g.yylineno,y=g.yylloc;break;case 2:if(x=this.productions_[k[1]][1],L.$=r[r.length-x],L._$={first_line:o[o.length-(x||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(x||1)].first_column,last_column:o[o.length-1].last_column},m&&(L._$.range=[o[o.length-(x||1)].range[0],o[o.length-1].range[1]]),void 0!==(E=this.performAction.apply(L,[c,h,l,d.yy,k[1],r,o].concat(u))))return E;x&&(i=i.slice(0,-1*x*2),r=r.slice(0,-1*x),o=o.slice(0,-1*x)),i.push(this.productions_[k[1]][0]),r.push(L.$),o.push(L._$),N=a[i[i.length-2]][i[i.length-1]],i.push(N);break;case 3:return!0}}return!0},"parse")},S=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,n=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),n.length-1&&(this.yylineno-=n.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:n?(n.length===i.length?this.yylloc.first_column:0)+i[i.length-n.length].length-n[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 n,i,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))),(i=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=i.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:i?i[i.length-1].length-i[i.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],n=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),n)return n;if(this._backtrack){for(var r in s)this[r]=s[r];return!1}return!1},"test_match"),next:t(function(){if(this.done)return this.EOF;var t,e,n,i;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var s=this._currentRules(),r=0;r<s.length;r++)if((n=this._input.match(this.rules[s[r]]))&&(!e||n[0].length>e[0].length)){if(e=n,i=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(n,s[r])))return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?!1!==(t=this.test_match(e,s[i]))&&t:""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex: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:{"case-insensitive":!0},performAction:t(function(t,e,n,i){switch(n){case 0:return this.pushState("shapeData"),e.yytext="",24;case 1:return this.pushState("shapeDataStr"),24;case 2:return this.popState(),24;case 3:const n=/\n\s*/g;return e.yytext=e.yytext.replace(n,"<br/>"),24;case 4:return 24;case 5:case 10:case 29:case 32:this.popState();break;case 6:return t.getLogger().trace("Found comment",e.yytext),6;case 7:return 8;case 8:this.begin("CLASS");break;case 9:return this.popState(),17;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:case 21:case 22: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 30:t.getLogger().trace("Starting NSTR"),this.begin("NSTR");break;case 31:return t.getLogger().trace("description:",e.yytext),"NODE_DESCR";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 ...",e.yytext),"NODE_DEND";case 36:case 39:case 40:return this.popState(),t.getLogger().trace("node end (("),"NODE_DEND";case 37:case 38:return this.popState(),t.getLogger().trace("node end (-"),"NODE_DEND";case 41:case 42:return t.getLogger().trace("Long description:",e.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}}}}();function x(){this.yy={}}return E.lexer=S,t(x,"Parser"),x.prototype=E,E.Parser=x,new x}();m.parser=m;var f=m,b=[],_=[],k=0,E={},S=t(()=>{b=[],_=[],k=0,E={}},"clear"),x=t(t=>{if(0===b.length)return null;const e=b[0].level;let n=null;for(let t=b.length-1;t>=0;t--)if(b[t].level!==e||n||(n=b[t]),b[t].level<e)throw new Error('Items without section detected, found section ("'+b[t].label+'")');return t===n?.level?null:n},"getSection"),N=t(function(){return _},"getSections"),D=t(function(){const t=[],e=N(),i=n();for(const n of e){const e={id:n.id,label:l(n.label??"",i),labelType:"markdown",isGroup:!0,ticket:n.ticket,shape:"kanbanSection",level:n.level,look:i.look};t.push(e);const s=b.filter(t=>t.parentId===n.id);for(const e of s){const s={id:e.id,parentId:n.id,label:l(e.label??"",i),labelType:"markdown",isGroup:!1,ticket:e?.ticket,priority:e?.priority,assigned:e?.assigned,icon:e?.icon,shape:"kanbanItem",level:e.level,rx:5,ry:5,cssStyles:["text-align: left"]};t.push(s)}}return{nodes:t,edges:[],other:{},config:n()}},"getData"),L=t((t,e,i,s,r)=>{const o=n();let a=o.mindmap?.padding??c.mindmap.padding;switch(s){case I.ROUNDED_RECT:case I.RECT:case I.HEXAGON:a*=2}const g={id:l(e,o)||"kbn"+k++,level:t,label:l(i,o),width:o.mindmap?.maxNodeWidth??c.mindmap.maxNodeWidth,padding:a,isGroup:!1};if(void 0!==r){let t;t=r.includes("\n")?r+"\n":"{\n"+r+"\n}";const e=h(t,{schema:u});if(e.shape&&(e.shape!==e.shape.toLowerCase()||e.shape.includes("_")))throw new Error(`No such shape: ${e.shape}. Shape names should be lowercase.`);e?.shape&&"kanbanItem"===e.shape&&(g.shape=e?.shape),e?.label&&(g.label=e?.label),e?.icon&&(g.icon=e?.icon.toString()),e?.assigned&&(g.assigned=e?.assigned.toString()),e?.ticket&&(g.ticket=e?.ticket.toString()),e?.priority&&(g.priority=e?.priority)}const d=x(t);d?g.parentId=d.id||"kbn"+k++:_.push(g),b.push(g)},"addNode"),I={DEFAULT:0,NO_BORDER:0,ROUNDED_RECT:1,RECT:2,CIRCLE:3,CLOUD:4,BANG:5,HEXAGON:6},O={clear:S,addNode:L,getSections:N,getData:D,nodeType:I,getType:t((t,n)=>{switch(e.debug("In get type",t,n),t){case"[":return I.RECT;case"(":return")"===n?I.ROUNDED_RECT:I.CLOUD;case"((":return I.CIRCLE;case")":return I.CLOUD;case"))":return I.BANG;case"{{":return I.HEXAGON;default:return I.DEFAULT}},"getType"),setElementForId:t((t,e)=>{E[t]=e},"setElementForId"),decorateNode:t(t=>{if(!t)return;const e=n(),i=b[b.length-1];t.icon&&(i.icon=l(t.icon,e)),t.class&&(i.cssClasses=l(t.class,e))},"decorateNode"),type2Str:t(t=>{switch(t){case I.DEFAULT:return"no-border";case I.RECT:return"rect";case I.ROUNDED_RECT:return"rounded-rect";case I.CIRCLE:return"circle";case I.CLOUD:return"cloud";case I.BANG:return"bang";case I.HEXAGON:return"hexgon";default:return"no-border"}},"type2Str"),getLogger:t(()=>e,"getLogger"),getElementById:t(t=>E[t],"getElementById")},C={draw:t(async(t,l,h,u)=>{e.debug("Rendering kanban diagram\n"+t);const g=u.db.getData(),d=n();d.htmlLabels=!1;const p=i(l);for(const t of g.nodes)t.domId=`${l}-${t.id}`;const y=p.append("g");y.attr("class","sections");const m=p.append("g");m.attr("class","items");const f=g.nodes.filter(t=>t.isGroup);let b=0;const _=[];let k=25;for(const t of f){const e=d?.kanban?.sectionWidth||200;b+=1,t.x=e*b+10*(b-1)/2,t.width=e,t.y=0,t.height=3*e,t.rx=5,t.ry=5,t.cssClasses=t.cssClasses+" section-"+b;const n=await s(y,t);k=Math.max(k,n?.labelBBox?.height),_.push(n)}let E=0;for(const t of f){const e=_[E];E+=1;const n=d?.kanban?.sectionWidth||200,i=3*-n/2+k;let s=i;const a=g.nodes.filter(e=>e.parentId===t.id);for(const e of a){if(e.isGroup)throw new Error("Groups within groups are not allowed in Kanban diagrams");e.x=t.x,e.width=n-15;const i=(await r(m,e,{config:d})).node().getBBox();e.y=s+i.height/2,await o(e),s=e.y+i.height/2+5}const c=e.cluster.select("rect"),l=Math.max(s-i+30,50)+(k-25);c.attr("height",l)}a(void 0,p,d.mindmap?.padding??c.kanban.padding,d.mindmap?.useMaxWidth??c.kanban.useMaxWidth)},"draw")},v=t(e=>{let n="";for(let t=0;t<e.THEME_COLOR_LIMIT;t++)e["lineColor"+t]=e["lineColor"+t]||e["cScaleInv"+t],g(e["lineColor"+t])?e["lineColor"+t]=d(e["lineColor"+t],20):e["lineColor"+t]=p(e["lineColor"+t],20);const i=t((t,n)=>e.darkMode?p(t,n):d(t,n),"adjuster");for(let t=0;t<e.THEME_COLOR_LIMIT;t++){const s=""+(17-3*t);n+=`\n .section-${t-1} rect, .section-${t-1} path, .section-${t-1} circle, .section-${t-1} polygon, .section-${t-1} path {\n fill: ${i(e["cScale"+t],10)};\n stroke: ${i(e["cScale"+t],10)};\n\n }\n .section-${t-1} text {\n fill: ${e["cScaleLabel"+t]};\n }\n .node-icon-${t-1} {\n font-size: 40px;\n color: ${e["cScaleLabel"+t]};\n }\n .section-edge-${t-1}{\n stroke: ${e["cScale"+t]};\n }\n .edge-depth-${t-1}{\n stroke-width: ${s};\n }\n .section-${t-1} line {\n stroke: ${e["cScaleInv"+t]} ;\n stroke-width: 3;\n }\n\n .disabled, .disabled circle, .disabled text {\n fill: lightgray;\n }\n .disabled text {\n fill: #efefef;\n }\n\n .node rect,\n .node circle,\n .node ellipse,\n .node polygon,\n .node path {\n fill: ${e.background};\n stroke: ${e.nodeBorder};\n stroke-width: 1px;\n }\n\n .kanban-ticket-link {\n fill: ${e.background};\n stroke: ${e.nodeBorder};\n text-decoration: underline;\n }\n `}return n},"genSections"),w={db:O,renderer:C,parser:f,styles:t(t=>`\n .edge {\n stroke-width: 3;\n }\n ${v(t)}\n .section-root rect, .section-root path, .section-root circle, .section-root polygon {\n fill: ${t.git0};\n }\n .section-root text {\n fill: ${t.gitBranchLabel0};\n }\n .icon-container {\n height:100%;\n display: flex;\n justify-content: center;\n align-items: center;\n }\n .edge {\n fill: none;\n }\n .cluster-label, .label {\n color: ${t.textColor};\n fill: ${t.textColor};\n }\n .kanban-label {\n dy: 1em;\n alignment-baseline: middle;\n text-anchor: middle;\n dominant-baseline: middle;\n text-align: center;\n }\n ${y()}\n`,"getStyles")};export{w as diagram};
package/dist/esm/main.js CHANGED
@@ -1 +1 @@
1
- "use client";export{A as AiChatPanel,B as BarChart,a as Breadcrumbs,b as Button,c as ButtonAction,d as ButtonLoader,C as CardNotification,e as ChangePasswordModal,f as CheckUnsavedChanges,g as CheckboxList,h as Client,i as CodeEditor,j as CodeViewer,k as Collapse,l as ContestNameLinkField,m as CopyToClipboard,D as DataGrid,n as DataViewer,o as DatePicker,p as DayPicker,q as DetectRequestAnimationFrame,r as Div,s as DocumentCustomMembersContent,t as DocumentMembersButton,u as DocumentMembersContent,v as Drawer,w as DrawerView,E as EditProfileModal,x as EntityCreateLayout,y as EntityLogsModal,z as EntityUpdateLayout,F as ErrorBoundary,G as FetcherLayer,H as Field,I as FieldDate,J as FieldText,K as FirstLoginWrapper,L as FloatToolbar,M as FrozenInformation,N as GraphvizEditor,O as GraphvizEditorModal,P as GraphvizViewer,Q as HelpSection,R as HomeLink,S as HorizontalMenu,T as I18nProvider,U as ImageLoaderCropper,V as ImageProfileModal,W as ImageUploaderButton,X as ImageUploaderModal,Y as InformationPopover,Z as Input,$ as InputCellPhoneNumber,a0 as InputCheckbox,a1 as InputColor,a2 as InputDate,a3 as InputPassword,a4 as InputRadio,a5 as InputSelect,a6 as InputTextArea,a7 as InputToggle,a9 as JukiI18nBridge,aa as JukiLoadingLayout,ab as JukiProviders,ac as LOGO_WORKSHEET_TYPE,ad as LineChart,ae as LinkLastPath,af as LoginModal,ag as LoginUser,ah as MainMenu,ai as MdMath,aj as MdMathEditor,ak as MdMathViewer,al as Modal,am as MonthPicker,an as MultiSelect,ao as MultiSelectSearchable,ap as NewVersionAvailable,as as PageNotFound,at as PagedDataViewer,au as Pagination,av as PawsLoadingLayout,aw as Popover,ax as Portal,ay as PresentationToolButtons,az as ProblemAdminActionsField,aA as ProblemCrawlerField,aB as ProblemInfo,aC as ProblemKeyField,aD as ProblemModeField,aE as ProblemNameLinkField,aF as ProblemNameModalField,aG as ProblemOwnerField,aH as ProblemSelector,aI as ProblemTypeField,aJ as ProblemVerdictTag,aK as ProblemView,aL as ProfileSubmissions,aM as ProgressMultiBar,aN as ProgressSlide,aO as QuietInformation,aP as ResetPasswordModal,aQ as Select,aR as SignUpModal,aS as SlideDeck,aT as SortableItems,aU as SplitModal,aV as SplitPane,aW as SubmissionContestField,aX as SubmissionContestProblemField,aY as SubmissionLanguageField,aZ as SubmissionModal,a_ as SubmissionNicknameField,a$ as SubmissionProblemField,b0 as SubmissionRejudgeButton,b1 as SubmissionRetrieveButton,b2 as SubmissionTimeField,b3 as SubmitView,b4 as T,b5 as Tabs,b6 as TabsInline,b7 as TabsInlineBody,b8 as TabsInlineButton,b9 as TabsInlineButtonLoader,ba as TextArea,bb as TimePicker,bc as Timer,bd as TimerLabeled,be as Tooltip,bf as TwoActionModal,bg as TwoContentCardsLayout,bh as TwoContentLayout,bi as TwoContentSection,bj as UpsolvingInformation,bk as UserChip,bl as UserCodeEditor,bm as UserLoaderLayout,bn as UserMyActiveSessions,bo as UserNicknameLink,bp as UserPreviewModal,bq as UserProfile,br as UserProfileDataContent,bs as UserProfileSettings,bt as UserStoreProvider,bu as UserViewLayout,bv as UsersSelector,bw as VerticalMenu,bx as VirtualizedRowsFixed,by as WelcomeModal,bz as WorksheetAsSlides,bA as WorksheetContents,bB as WorksheetEditor,bC as WorksheetViewer,bD as YearPicker,bO as fetcher,bP as getContestNameHeader,bQ as getContestStatusHeader,bR as getContestTagsHeader,bT as getProblemAdminActionsHeader,bU as getProblemKeyHeader,bV as getProblemModeHeader,bW as getProblemNameHeader,bX as getProblemOwnerHeader,bY as getProblemTagsHeader,bZ as getProblemTypeHeader,b_ as getSubmissionContestHeader,b$ as getSubmissionContestProblemHeader,c0 as getSubmissionDateHeader,c1 as getSubmissionLanguageHeader,c2 as getSubmissionMemoryHeader,c3 as getSubmissionNicknameHeader,c4 as getSubmissionProblemHeader,c5 as getSubmissionRejudgeHeader,c6 as getSubmissionTimeHeader,c7 as getSubmissionVerdictHeader,c8 as getUrlKey,cC as useAblyStore,cD as useAnimationFrameStore,cE as useCheckAndStartServices,cF as useClickOutside,cG as useClientTrackLocation,cH as useDataViewerRequester,cI as useDebounceEffect,cJ as useDict,cK as useEntityDiff,cL as useFetcher,cM as useFocusTrap,cO as useHandleState,cP as useHash,cQ as useI18n,cR as useInjectColorTextHighlight,cS as useInjectFontSize,cT as useInjectTheme,cU as useInterval,cV as useJudge,cW as useJukiNotification,cX as useJukiUser,cY as useJukiUserSettings,cZ as useKeyDown,c_ as useLastPathStore,c$ as useLazyLoadingStore,d0 as useLocale,d1 as useMatchMutate,d2 as useMemoizedArray,d3 as useOverflowDetector,d4 as usePageFocus,d5 as usePageStore,d6 as usePreload,d7 as usePreloadComponents,d8 as usePrevious,d9 as useResizeDetector,da as useRouterStore,db as useSessionStorage,dc as useSoundStore,dd as useStableRef,de as useSubscribe,df as useSyncedState,dg as useT,dh as useTrackCursor,di as useTrackLastPath,dj as useUIStore,dk as useUserStore,dl as useWebsocketStore,dm as useWindowSize}from"./index-MXDpbG5L.js";export{aH as getContestContestantsHeader,aI as getContestDateHeader}from"./ViewModuleIcon-CBJGd2NB.js";import"react/jsx-runtime";import"react";import"./enums.js";import"./index-P3Cb0cjc.js";import"./settings-DgLs6IK_.js";import"./contest--aeYKKxf.js";import"./date-D28INXpp.js";import"./worksheet-BBAH_yZC.js";import"motion/react";import"react-dom";import"./index-Dwi3ag-n.js";import"./time-BHcZPeyw.js";import"swr";import"@ably/spaces";import"@ably/spaces/react";import"ably";import"ably/liveobjects";import"ably/react";import"@ably/spaces/dist/mjs/react";
1
+ "use client";export{A as AiChatPanel,B as BarChart,a as Breadcrumbs,b as Button,c as ButtonAction,d as ButtonLoader,C as CardNotification,e as ChangePasswordModal,f as CheckUnsavedChanges,g as CheckboxList,h as Client,i as CodeEditor,j as CodeViewer,k as Collapse,l as ContestNameLinkField,m as CopyToClipboard,D as DataGrid,n as DataViewer,o as DatePicker,p as DayPicker,q as DetectRequestAnimationFrame,r as Div,s as DocumentCustomMembersContent,t as DocumentMembersButton,u as DocumentMembersContent,v as Drawer,w as DrawerView,E as EditProfileModal,x as EntityCreateLayout,y as EntityLogsModal,z as EntityUpdateLayout,F as ErrorBoundary,G as FetcherLayer,H as Field,I as FieldDate,J as FieldText,K as FirstLoginWrapper,L as FloatToolbar,M as FrozenInformation,N as GraphvizEditor,O as GraphvizEditorModal,P as GraphvizViewer,Q as HelpSection,R as HomeLink,S as HorizontalMenu,T as I18nProvider,U as ImageLoaderCropper,V as ImageProfileModal,W as ImageUploaderButton,X as ImageUploaderModal,Y as InformationPopover,Z as Input,$ as InputCellPhoneNumber,a0 as InputCheckbox,a1 as InputColor,a2 as InputDate,a3 as InputPassword,a4 as InputRadio,a5 as InputSelect,a6 as InputTextArea,a7 as InputToggle,a9 as JukiI18nBridge,aa as JukiLoadingLayout,ab as JukiProviders,ac as LOGO_WORKSHEET_TYPE,ad as LineChart,ae as LinkLastPath,af as LoginModal,ag as LoginUser,ah as MainMenu,ai as MdMath,aj as MdMathEditor,ak as MdMathViewer,al as Modal,am as MonthPicker,an as MultiSelect,ao as MultiSelectSearchable,ap as NewVersionAvailable,as as PageNotFound,at as PagedDataViewer,au as Pagination,av as PawsLoadingLayout,aw as Popover,ax as Portal,ay as PresentationToolButtons,az as ProblemAdminActionsField,aA as ProblemCrawlerField,aB as ProblemInfo,aC as ProblemKeyField,aD as ProblemModeField,aE as ProblemNameLinkField,aF as ProblemNameModalField,aG as ProblemOwnerField,aH as ProblemSelector,aI as ProblemTypeField,aJ as ProblemVerdictTag,aK as ProblemView,aL as ProfileSubmissions,aM as ProgressMultiBar,aN as ProgressSlide,aO as QuietInformation,aP as ResetPasswordModal,aQ as Select,aR as SignUpModal,aS as SlideDeck,aT as SortableItems,aU as SplitModal,aV as SplitPane,aW as SubmissionContestField,aX as SubmissionContestProblemField,aY as SubmissionLanguageField,aZ as SubmissionModal,a_ as SubmissionNicknameField,a$ as SubmissionProblemField,b0 as SubmissionRejudgeButton,b1 as SubmissionRetrieveButton,b2 as SubmissionTimeField,b3 as SubmitView,b4 as T,b5 as Tabs,b6 as TabsInline,b7 as TabsInlineBody,b8 as TabsInlineButton,b9 as TabsInlineButtonLoader,ba as TextArea,bb as TimePicker,bc as Timer,bd as TimerLabeled,be as Tooltip,bf as TwoActionModal,bg as TwoContentCardsLayout,bh as TwoContentLayout,bi as TwoContentSection,bj as UpsolvingInformation,bk as UserChip,bl as UserCodeEditor,bm as UserLoaderLayout,bn as UserMyActiveSessions,bo as UserNicknameLink,bp as UserPreviewModal,bq as UserProfile,br as UserProfileDataContent,bs as UserProfileSettings,bt as UserStoreProvider,bu as UserViewLayout,bv as UsersSelector,bw as VerticalMenu,bx as VirtualizedRowsFixed,by as WelcomeModal,bz as WorksheetAsSlides,bA as WorksheetContents,bB as WorksheetEditor,bC as WorksheetViewer,bD as YearPicker,bO as fetcher,bP as getContestNameHeader,bQ as getContestStatusHeader,bR as getContestTagsHeader,bT as getProblemAdminActionsHeader,bU as getProblemKeyHeader,bV as getProblemModeHeader,bW as getProblemNameHeader,bX as getProblemOwnerHeader,bY as getProblemTagsHeader,bZ as getProblemTypeHeader,b_ as getSubmissionContestHeader,b$ as getSubmissionContestProblemHeader,c0 as getSubmissionDateHeader,c1 as getSubmissionLanguageHeader,c2 as getSubmissionMemoryHeader,c3 as getSubmissionNicknameHeader,c4 as getSubmissionProblemHeader,c5 as getSubmissionRejudgeHeader,c6 as getSubmissionTimeHeader,c7 as getSubmissionVerdictHeader,c8 as getUrlKey,cC as useAblyStore,cD as useAnimationFrameStore,cE as useCheckAndStartServices,cF as useClickOutside,cG as useClientTrackLocation,cH as useDataViewerRequester,cI as useDebounceEffect,cJ as useDict,cK as useEntityDiff,cL as useFetcher,cM as useFocusTrap,cO as useHandleState,cP as useHash,cQ as useI18n,cR as useInjectColorTextHighlight,cS as useInjectFontSize,cT as useInjectTheme,cU as useInterval,cV as useJudge,cW as useJukiNotification,cX as useJukiUser,cY as useJukiUserSettings,cZ as useKeyDown,c_ as useLastPathStore,c$ as useLazyLoadingStore,d0 as useLocale,d1 as useMatchMutate,d2 as useMemoizedArray,d3 as useOverflowDetector,d4 as usePageFocus,d5 as usePageStore,d6 as usePreload,d7 as usePreloadComponents,d8 as usePrevious,d9 as useResizeDetector,da as useRouterStore,db as useSessionStorage,dc as useSoundStore,dd as useStableRef,de as useSubscribe,df as useSyncedState,dg as useT,dh as useTrackCursor,di as useTrackLastPath,dj as useUIStore,dk as useUserStore,dl as useWebsocketStore,dm as useWindowSize}from"./index-DGfNHv1x.js";export{aH as getContestContestantsHeader,aI as getContestDateHeader}from"./ViewModuleIcon-CBJGd2NB.js";import"react/jsx-runtime";import"react";import"./enums.js";import"./index-P3Cb0cjc.js";import"./settings-DgLs6IK_.js";import"./contest-D0dFHHYS.js";import"./date-D28INXpp.js";import"./worksheet-BBAH_yZC.js";import"motion/react";import"react-dom";import"./index-Dwi3ag-n.js";import"./time-BHcZPeyw.js";import"swr";import"@ably/spaces";import"@ably/spaces/react";import"ably";import"ably/liveobjects";import"ably/react";import"@ably/spaces/dist/mjs/react";