@bigduu/lotus 2026.3.9 → 2026.3.20

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 (71) hide show
  1. package/README.md +7 -0
  2. package/dist/assets/App-GrNzEwSI.js +998 -0
  3. package/dist/assets/_basePickBy-B3HOvLI5.js +1 -0
  4. package/dist/assets/_baseUniq-C6qPwTXi.js +1 -0
  5. package/dist/assets/arc-DWuxk_J0.js +1 -0
  6. package/dist/assets/architectureDiagram-VXUJARFQ-CsrWnIJm.js +36 -0
  7. package/dist/assets/blockDiagram-VD42YOAC-eXYml-zi.js +122 -0
  8. package/dist/assets/c4Diagram-YG6GDRKO-B4UNhbcN.js +10 -0
  9. package/dist/assets/channel-D3Y5aOrr.js +1 -0
  10. package/dist/assets/chunk-4BX2VUAB-BHI8UK28.js +1 -0
  11. package/dist/assets/chunk-55IACEB6-DS7V1fBl.js +1 -0
  12. package/dist/assets/chunk-B4BG7PRW-jtKBpnBZ.js +165 -0
  13. package/dist/assets/chunk-DI55MBZ5-la2oPn7S.js +220 -0
  14. package/dist/assets/chunk-FMBD7UC4-BWmMT5qY.js +15 -0
  15. package/dist/assets/chunk-QN33PNHL-BEJslXWO.js +1 -0
  16. package/dist/assets/chunk-QZHKN3VN-Bq498BI9.js +1 -0
  17. package/dist/assets/chunk-TZMSLE5B-Bc3F2cCo.js +1 -0
  18. package/dist/assets/classDiagram-2ON5EDUG-bLgDAyR2.js +1 -0
  19. package/dist/assets/classDiagram-v2-WZHVMYZB-bLgDAyR2.js +1 -0
  20. package/dist/assets/clone-DB5FFFZ8.js +1 -0
  21. package/dist/assets/cose-bilkent-S5V4N54A-5vEWR_Nv.js +1 -0
  22. package/dist/assets/cytoscape.esm-BY7v1xhs.js +331 -0
  23. package/dist/assets/dagre-6UL2VRFP-Co8a7B_w.js +4 -0
  24. package/dist/assets/diagram-PSM6KHXK-zsFKq0TC.js +24 -0
  25. package/dist/assets/diagram-QEK2KX5R-BS_1M6YY.js +43 -0
  26. package/dist/assets/diagram-S2PKOQOG-BGb4KDa2.js +24 -0
  27. package/dist/assets/erDiagram-Q2GNP2WA-BtLuPmLS.js +60 -0
  28. package/dist/assets/flowDiagram-NV44I4VS-DSVoTAvC.js +162 -0
  29. package/dist/assets/ganttDiagram-JELNMOA3-Bm4qhIgP.js +267 -0
  30. package/dist/assets/gitGraphDiagram-V2S2FVAM-JnO8qapO.js +65 -0
  31. package/dist/assets/graph-Ci_4DYzD.js +1 -0
  32. package/dist/assets/html2canvas.esm-CBrSDip1.js +22 -0
  33. package/dist/assets/index-3HRFQqPK.js +36 -0
  34. package/dist/assets/index-DIwjGrG2.js +1 -0
  35. package/dist/assets/index-Drp1Nta9.js +1 -0
  36. package/dist/assets/index-I1zrzkA6.js +1 -0
  37. package/dist/assets/index-WmMCq2d5.js +1 -0
  38. package/dist/assets/index-uQXOtSjQ.js +4 -0
  39. package/dist/assets/{index.es-ksd75ldm.js → index.es-DcXXvK9U.js} +2 -2
  40. package/dist/assets/infoDiagram-HS3SLOUP-C5I1bwn3.js +2 -0
  41. package/dist/assets/journeyDiagram-XKPGCS4Q-DO8cGOfm.js +139 -0
  42. package/dist/assets/jspdf.es.min-D_aHufzU.js +169 -0
  43. package/dist/assets/kanban-definition-3W4ZIXB7-DULrT064.js +89 -0
  44. package/dist/assets/layout-Dcb7s2K1.js +1 -0
  45. package/dist/assets/main-obJgfVN6.js +41 -0
  46. package/dist/assets/mindmap-definition-VGOIOE7T-CmtAMYDz.js +68 -0
  47. package/dist/assets/pieDiagram-ADFJNKIX-BNSLnR75.js +30 -0
  48. package/dist/assets/quadrantDiagram-AYHSOK5B-C84FGDBO.js +7 -0
  49. package/dist/assets/requirementDiagram-UZGBJVZJ-DG1E7PkJ.js +64 -0
  50. package/dist/assets/sankeyDiagram-TZEHDZUN-DGN-BmB1.js +10 -0
  51. package/dist/assets/sequenceDiagram-WL72ISMW-DVO0qsq0.js +145 -0
  52. package/dist/assets/stateDiagram-FKZM4ZOC-D0fHRsRn.js +1 -0
  53. package/dist/assets/stateDiagram-v2-4FDKWEC3-D3KC9QQc.js +1 -0
  54. package/dist/assets/timeline-definition-IT6M3QCI-CaQLEtEh.js +61 -0
  55. package/dist/assets/treemap-GDKQZRPO-B0RpuOqZ.js +160 -0
  56. package/dist/assets/xychartDiagram-PRI3JC2R-DXA11h7K.js +7 -0
  57. package/dist/index.html +82 -8
  58. package/package.json +1 -1
  59. package/dist/assets/index-BVq3nR2i.js +0 -5
  60. package/dist/assets/index-Duac2kP8.js +0 -1
  61. package/dist/assets/index-NorSG5v2.js +0 -1
  62. package/dist/assets/index-tyDAO-Rv.js +0 -1
  63. package/dist/assets/index-xDR7WD86.js +0 -1
  64. package/dist/assets/index-xYaVUSFx.js +0 -1
  65. package/dist/assets/main-D-vCV98n.js +0 -282
  66. package/dist/assets/vendor-chart-hXvGMOW0.js +0 -2558
  67. package/dist/assets/vendor-pdf-6UhwjNJe.js +0 -190
  68. package/dist/assets/vendor-react-BK4ieJpD.js +0 -108
  69. package/dist/assets/vendor-ui-BecvStzI.js +0 -414
  70. /package/dist/assets/{main-CiAWoLS2.css → App-CiAWoLS2.css} +0 -0
  71. /package/dist/assets/{vendor-ui-B6snAd4S.css → main-B6snAd4S.css} +0 -0
@@ -0,0 +1,7 @@
1
+ import{c as gi,g as xi,y as Xt,x as di,d as pi,e as fi,_ as n,l as Nt,U as yi,i as mi,D as bi,Q as Ct,m as Ai,N as Yt,O as wi,X as Ci,Y as Bt,Z as Si,W as Wt,$ as zt}from"./App-GrNzEwSI.js";import"./main-obJgfVN6.js";var mt=function(){var s=n(function(W,r,u,g){for(u=u||{},g=W.length;g--;u[W[g]]=r);return u},"o"),t=[1,10,12,14,16,18,19,21,23],i=[2,6],e=[1,3],a=[1,5],c=[1,6],d=[1,7],m=[1,5,10,12,14,16,18,19,21,23,34,35,36],b=[1,25],P=[1,26],I=[1,28],R=[1,29],L=[1,30],z=[1,31],F=[1,32],D=[1,33],V=[1,34],f=[1,35],C=[1,36],l=[1,37],M=[1,43],B=[1,42],U=[1,47],X=[1,50],h=[1,10,12,14,16,18,19,21,23,34,35,36],k=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],w=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36,41,42,43,44,45,46,47,48,49,50],S=[1,64],$={trace:n(function(){},"trace"),yy:{},symbols_:{error:2,start:3,eol:4,XYCHART:5,chartConfig:6,document:7,CHART_ORIENTATION:8,statement:9,title:10,text:11,X_AXIS:12,parseXAxis:13,Y_AXIS:14,parseYAxis:15,LINE:16,plotData:17,BAR:18,acc_title:19,acc_title_value:20,acc_descr:21,acc_descr_value:22,acc_descr_multiline_value:23,SQUARE_BRACES_START:24,commaSeparatedNumbers:25,SQUARE_BRACES_END:26,NUMBER_WITH_DECIMAL:27,COMMA:28,xAxisData:29,bandData:30,ARROW_DELIMITER:31,commaSeparatedTexts:32,yAxisData:33,NEWLINE:34,SEMI:35,EOF:36,alphaNum:37,STR:38,MD_STR:39,alphaNumToken:40,AMP:41,NUM:42,ALPHA:43,PLUS:44,EQUALS:45,MULT:46,DOT:47,BRKT:48,MINUS:49,UNDERSCORE:50,$accept:0,$end:1},terminals_:{2:"error",5:"XYCHART",8:"CHART_ORIENTATION",10:"title",12:"X_AXIS",14:"Y_AXIS",16:"LINE",18:"BAR",19:"acc_title",20:"acc_title_value",21:"acc_descr",22:"acc_descr_value",23:"acc_descr_multiline_value",24:"SQUARE_BRACES_START",26:"SQUARE_BRACES_END",27:"NUMBER_WITH_DECIMAL",28:"COMMA",31:"ARROW_DELIMITER",34:"NEWLINE",35:"SEMI",36:"EOF",38:"STR",39:"MD_STR",41:"AMP",42:"NUM",43:"ALPHA",44:"PLUS",45:"EQUALS",46:"MULT",47:"DOT",48:"BRKT",49:"MINUS",50:"UNDERSCORE"},productions_:[0,[3,2],[3,3],[3,2],[3,1],[6,1],[7,0],[7,2],[9,2],[9,2],[9,2],[9,2],[9,2],[9,3],[9,2],[9,3],[9,2],[9,2],[9,1],[17,3],[25,3],[25,1],[13,1],[13,2],[13,1],[29,1],[29,3],[30,3],[32,3],[32,1],[15,1],[15,2],[15,1],[33,3],[4,1],[4,1],[4,1],[11,1],[11,1],[11,1],[37,1],[37,2],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1],[40,1]],performAction:n(function(r,u,g,x,A,o,nt){var p=o.length-1;switch(A){case 5:x.setOrientation(o[p]);break;case 9:x.setDiagramTitle(o[p].text.trim());break;case 12:x.setLineData({text:"",type:"text"},o[p]);break;case 13:x.setLineData(o[p-1],o[p]);break;case 14:x.setBarData({text:"",type:"text"},o[p]);break;case 15:x.setBarData(o[p-1],o[p]);break;case 16:this.$=o[p].trim(),x.setAccTitle(this.$);break;case 17:case 18:this.$=o[p].trim(),x.setAccDescription(this.$);break;case 19:this.$=o[p-1];break;case 20:this.$=[Number(o[p-2]),...o[p]];break;case 21:this.$=[Number(o[p])];break;case 22:x.setXAxisTitle(o[p]);break;case 23:x.setXAxisTitle(o[p-1]);break;case 24:x.setXAxisTitle({type:"text",text:""});break;case 25:x.setXAxisBand(o[p]);break;case 26:x.setXAxisRangeData(Number(o[p-2]),Number(o[p]));break;case 27:this.$=o[p-1];break;case 28:this.$=[o[p-2],...o[p]];break;case 29:this.$=[o[p]];break;case 30:x.setYAxisTitle(o[p]);break;case 31:x.setYAxisTitle(o[p-1]);break;case 32:x.setYAxisTitle({type:"text",text:""});break;case 33:x.setYAxisRangeData(Number(o[p-2]),Number(o[p]));break;case 37:this.$={text:o[p],type:"text"};break;case 38:this.$={text:o[p],type:"text"};break;case 39:this.$={text:o[p],type:"markdown"};break;case 40:this.$=o[p];break;case 41:this.$=o[p-1]+""+o[p];break}},"anonymous"),table:[s(t,i,{3:1,4:2,7:4,5:e,34:a,35:c,36:d}),{1:[3]},s(t,i,{4:2,7:4,3:8,5:e,34:a,35:c,36:d}),s(t,i,{4:2,7:4,6:9,3:10,5:e,8:[1,11],34:a,35:c,36:d}),{1:[2,4],9:12,10:[1,13],12:[1,14],14:[1,15],16:[1,16],18:[1,17],19:[1,18],21:[1,19],23:[1,20]},s(m,[2,34]),s(m,[2,35]),s(m,[2,36]),{1:[2,1]},s(t,i,{4:2,7:4,3:21,5:e,34:a,35:c,36:d}),{1:[2,3]},s(m,[2,5]),s(t,[2,7],{4:22,34:a,35:c,36:d}),{11:23,37:24,38:b,39:P,40:27,41:I,42:R,43:L,44:z,45:F,46:D,47:V,48:f,49:C,50:l},{11:39,13:38,24:M,27:B,29:40,30:41,37:24,38:b,39:P,40:27,41:I,42:R,43:L,44:z,45:F,46:D,47:V,48:f,49:C,50:l},{11:45,15:44,27:U,33:46,37:24,38:b,39:P,40:27,41:I,42:R,43:L,44:z,45:F,46:D,47:V,48:f,49:C,50:l},{11:49,17:48,24:X,37:24,38:b,39:P,40:27,41:I,42:R,43:L,44:z,45:F,46:D,47:V,48:f,49:C,50:l},{11:52,17:51,24:X,37:24,38:b,39:P,40:27,41:I,42:R,43:L,44:z,45:F,46:D,47:V,48:f,49:C,50:l},{20:[1,53]},{22:[1,54]},s(h,[2,18]),{1:[2,2]},s(h,[2,8]),s(h,[2,9]),s(k,[2,37],{40:55,41:I,42:R,43:L,44:z,45:F,46:D,47:V,48:f,49:C,50:l}),s(k,[2,38]),s(k,[2,39]),s(w,[2,40]),s(w,[2,42]),s(w,[2,43]),s(w,[2,44]),s(w,[2,45]),s(w,[2,46]),s(w,[2,47]),s(w,[2,48]),s(w,[2,49]),s(w,[2,50]),s(w,[2,51]),s(h,[2,10]),s(h,[2,22],{30:41,29:56,24:M,27:B}),s(h,[2,24]),s(h,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:b,39:P,40:27,41:I,42:R,43:L,44:z,45:F,46:D,47:V,48:f,49:C,50:l},s(h,[2,11]),s(h,[2,30],{33:60,27:U}),s(h,[2,32]),{31:[1,61]},s(h,[2,12]),{17:62,24:X},{25:63,27:S},s(h,[2,14]),{17:65,24:X},s(h,[2,16]),s(h,[2,17]),s(w,[2,41]),s(h,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},s(h,[2,31]),{27:[1,69]},s(h,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},s(h,[2,15]),s(h,[2,26]),s(h,[2,27]),{11:59,32:72,37:24,38:b,39:P,40:27,41:I,42:R,43:L,44:z,45:F,46:D,47:V,48:f,49:C,50:l},s(h,[2,33]),s(h,[2,19]),{25:73,27:S},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:n(function(r,u){if(u.recoverable)this.trace(r);else{var g=new Error(r);throw g.hash=u,g}},"parseError"),parse:n(function(r){var u=this,g=[0],x=[],A=[null],o=[],nt=this.table,p="",lt=0,Et=0,hi=2,It=1,li=o.slice.call(arguments,1),_=Object.create(this.lexer),Y={yy:{}};for(var dt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,dt)&&(Y.yy[dt]=this.yy[dt]);_.setInput(r,Y.yy),Y.yy.lexer=_,Y.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var pt=_.yylloc;o.push(pt);var ci=_.options&&_.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ui(v){g.length=g.length-2*v,A.length=A.length-v,o.length=o.length-v}n(ui,"popStack");function Vt(){var v;return v=x.pop()||_.lex()||It,typeof v!="number"&&(v instanceof Array&&(x=v,v=x.pop()),v=u.symbols_[v]||v),v}n(Vt,"lex");for(var T,H,E,ft,q={},ct,O,Mt,ut;;){if(H=g[g.length-1],this.defaultActions[H]?E=this.defaultActions[H]:((T===null||typeof T>"u")&&(T=Vt()),E=nt[H]&&nt[H][T]),typeof E>"u"||!E.length||!E[0]){var yt="";ut=[];for(ct in nt[H])this.terminals_[ct]&&ct>hi&&ut.push("'"+this.terminals_[ct]+"'");_.showPosition?yt="Parse error on line "+(lt+1)+`:
2
+ `+_.showPosition()+`
3
+ Expecting `+ut.join(", ")+", got '"+(this.terminals_[T]||T)+"'":yt="Parse error on line "+(lt+1)+": Unexpected "+(T==It?"end of input":"'"+(this.terminals_[T]||T)+"'"),this.parseError(yt,{text:_.match,token:this.terminals_[T]||T,line:_.yylineno,loc:pt,expected:ut})}if(E[0]instanceof Array&&E.length>1)throw new Error("Parse Error: multiple actions possible at state: "+H+", token: "+T);switch(E[0]){case 1:g.push(T),A.push(_.yytext),o.push(_.yylloc),g.push(E[1]),T=null,Et=_.yyleng,p=_.yytext,lt=_.yylineno,pt=_.yylloc;break;case 2:if(O=this.productions_[E[1]][1],q.$=A[A.length-O],q._$={first_line:o[o.length-(O||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(O||1)].first_column,last_column:o[o.length-1].last_column},ci&&(q._$.range=[o[o.length-(O||1)].range[0],o[o.length-1].range[1]]),ft=this.performAction.apply(q,[p,Et,lt,Y.yy,E[1],A,o].concat(li)),typeof ft<"u")return ft;O&&(g=g.slice(0,-1*O*2),A=A.slice(0,-1*O),o=o.slice(0,-1*O)),g.push(this.productions_[E[1]][0]),A.push(q.$),o.push(q._$),Mt=nt[g[g.length-2]][g[g.length-1]],g.push(Mt);break;case 3:return!0}}return!0},"parse")},Lt=function(){var W={EOF:1,parseError:n(function(u,g){if(this.yy.parser)this.yy.parser.parseError(u,g);else throw new Error(u)},"parseError"),setInput:n(function(r,u){return this.yy=u||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:n(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var u=r.match(/(?:\r\n?|\n).*/g);return u?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:n(function(r){var u=r.length,g=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-u),this.offset-=u;var x=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),g.length-1&&(this.yylineno-=g.length-1);var A=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:g?(g.length===x.length?this.yylloc.first_column:0)+x[x.length-g.length].length-g[0].length:this.yylloc.first_column-u},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-u]),this.yyleng=this.yytext.length,this},"unput"),more:n(function(){return this._more=!0,this},"more"),reject:n(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:n(function(r){this.unput(this.match.slice(r))},"less"),pastInput:n(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:n(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:n(function(){var r=this.pastInput(),u=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
5
+ `+u+"^"},"showPosition"),test_match:n(function(r,u){var g,x,A;if(this.options.backtrack_lexer&&(A={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&&(A.yylloc.range=this.yylloc.range.slice(0))),x=r[0].match(/(?:\r\n?|\n).*/g),x&&(this.yylineno+=x.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:x?x[x.length-1].length-x[x.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+r[0].length},this.yytext+=r[0],this.match+=r[0],this.matches=r,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(r[0].length),this.matched+=r[0],g=this.performAction.call(this,this.yy,this,u,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),g)return g;if(this._backtrack){for(var o in A)this[o]=A[o];return!1}return!1},"test_match"),next:n(function(){if(this.done)return this.EOF;this._input||(this.done=!0);var r,u,g,x;this._more||(this.yytext="",this.match="");for(var A=this._currentRules(),o=0;o<A.length;o++)if(g=this._input.match(this.rules[A[o]]),g&&(!u||g[0].length>u[0].length)){if(u=g,x=o,this.options.backtrack_lexer){if(r=this.test_match(g,A[o]),r!==!1)return r;if(this._backtrack){u=!1;continue}else return!1}else if(!this.options.flex)break}return u?(r=this.test_match(u,A[x]),r!==!1?r:!1):this._input===""?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+`. Unrecognized text.
6
+ `+this.showPosition(),{text:"",token:null,line:this.yylineno})},"next"),lex:n(function(){var u=this.next();return u||this.lex()},"lex"),begin:n(function(u){this.conditionStack.push(u)},"begin"),popState:n(function(){var u=this.conditionStack.length-1;return u>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:n(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:n(function(u){return u=this.conditionStack.length-1-Math.abs(u||0),u>=0?this.conditionStack[u]:"INITIAL"},"topState"),pushState:n(function(u){this.begin(u)},"pushState"),stateStackSize:n(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:n(function(u,g,x,A){switch(x){case 0:break;case 1:break;case 2:return this.popState(),34;case 3:return this.popState(),34;case 4:return 34;case 5:break;case 6:return 10;case 7:return this.pushState("acc_title"),19;case 8:return this.popState(),"acc_title_value";case 9:return this.pushState("acc_descr"),21;case 10:return this.popState(),"acc_descr_value";case 11:this.pushState("acc_descr_multiline");break;case 12:this.popState();break;case 13:return"acc_descr_multiline_value";case 14:return 5;case 15:return 5;case 16:return 8;case 17:return this.pushState("axis_data"),"X_AXIS";case 18:return this.pushState("axis_data"),"Y_AXIS";case 19:return this.pushState("axis_band_data"),24;case 20:return 31;case 21:return this.pushState("data"),16;case 22:return this.pushState("data"),18;case 23:return this.pushState("data_inner"),24;case 24:return 27;case 25:return this.popState(),26;case 26:this.popState();break;case 27:this.pushState("string");break;case 28:this.popState();break;case 29:return"STR";case 30:return 24;case 31:return 26;case 32:return 43;case 33:return"COLON";case 34:return 44;case 35:return 28;case 36:return 45;case 37:return 46;case 38:return 48;case 39:return 50;case 40:return 47;case 41:return 41;case 42:return 49;case 43:return 42;case 44:break;case 45:return 35;case 46:return 36}},"anonymous"),rules:[/^(?:%%(?!\{)[^\n]*)/i,/^(?:[^\}]%%[^\n]*)/i,/^(?:(\r?\n))/i,/^(?:(\r?\n))/i,/^(?:[\n\r]+)/i,/^(?:%%[^\n]*)/i,/^(?:title\b)/i,/^(?:accTitle\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*:\s*)/i,/^(?:(?!\n||)*[^\n]*)/i,/^(?:accDescr\s*\{\s*)/i,/^(?:\{)/i,/^(?:[^\}]*)/i,/^(?:xychart-beta\b)/i,/^(?:xychart\b)/i,/^(?:(?:vertical|horizontal))/i,/^(?:x-axis\b)/i,/^(?:y-axis\b)/i,/^(?:\[)/i,/^(?:-->)/i,/^(?:line\b)/i,/^(?:bar\b)/i,/^(?:\[)/i,/^(?:[+-]?(?:\d+(?:\.\d+)?|\.\d+))/i,/^(?:\])/i,/^(?:(?:`\) \{ this\.pushState\(md_string\); \}\n<md_string>\(\?:\(\?!`"\)\.\)\+ \{ return MD_STR; \}\n<md_string>\(\?:`))/i,/^(?:["])/i,/^(?:["])/i,/^(?:[^"]*)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:[A-Za-z]+)/i,/^(?::)/i,/^(?:\+)/i,/^(?:,)/i,/^(?:=)/i,/^(?:\*)/i,/^(?:#)/i,/^(?:[\_])/i,/^(?:\.)/i,/^(?:&)/i,/^(?:-)/i,/^(?:[0-9]+)/i,/^(?:\s+)/i,/^(?:;)/i,/^(?:$)/i],conditions:{data_inner:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,24,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},data:{rules:[0,1,3,4,5,6,7,9,11,14,15,16,17,18,21,22,23,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_band_data:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,25,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},axis_data:{rules:[0,1,2,4,5,6,7,9,11,14,15,16,17,18,19,20,21,22,24,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0},acc_descr_multiline:{rules:[12,13],inclusive:!1},acc_descr:{rules:[10],inclusive:!1},acc_title:{rules:[8],inclusive:!1},title:{rules:[],inclusive:!1},md_string:{rules:[],inclusive:!1},string:{rules:[28,29],inclusive:!1},INITIAL:{rules:[0,1,4,5,6,7,9,11,14,15,16,17,18,21,22,26,27,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46],inclusive:!0}}};return W}();$.lexer=Lt;function N(){this.yy={}}return n(N,"Parser"),N.prototype=$,$.Parser=N,new N}();mt.parser=mt;var _i=mt;function bt(s){return s.type==="bar"}n(bt,"isBarPlot");function St(s){return s.type==="band"}n(St,"isBandAxisData");function G(s){return s.type==="linear"}n(G,"isLinearAxisData");var j,Ht=(j=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((c,d)=>Math.max(d.length,c),0)*i,height:i};const e={width:0,height:0},a=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const c of t){const d=Si(a,1,c),m=d?d.width:c.length*i,b=d?d.height:i;e.width=Math.max(e.width,m),e.height=Math.max(e.height,b)}return a.remove(),e}},n(j,"TextDimensionCalculatorWithFont"),j),Ft=.7,Ot=.2,Q,Ut=(Q=class{constructor(t,i,e,a){this.axisConfig=t,this.title=i,this.textDimensionCalculator=e,this.axisThemeConfig=a,this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left",this.showTitle=!1,this.showLabel=!1,this.showTick=!1,this.showAxisLine=!1,this.outerPadding=0,this.titleTextHeight=0,this.labelTextHeight=0,this.range=[0,10],this.boundingRect={x:0,y:0,width:0,height:0},this.axisPosition="left"}setRange(t){this.range=t,this.axisPosition==="left"||this.axisPosition==="right"?this.boundingRect.height=t[1]-t[0]:this.boundingRect.width=t[1]-t[0],this.recalculateScale()}getRange(){return[this.range[0]+this.outerPadding,this.range[1]-this.outerPadding]}setAxisPosition(t){this.axisPosition=t,this.setRange(this.range)}getTickDistance(){const t=this.getRange();return Math.abs(t[0]-t[1])/this.getTickValues().length}getAxisOuterPadding(){return this.outerPadding}getLabelDimension(){return this.textDimensionCalculator.getMaxDimension(this.getTickValues().map(t=>t.toString()),this.axisConfig.labelFontSize)}recalculateOuterPaddingToDrawBar(){Ft*this.getTickDistance()>this.outerPadding*2&&(this.outerPadding=Math.floor(Ft*this.getTickDistance()/2)),this.recalculateScale()}calculateSpaceIfDrawnHorizontally(t){let i=t.height;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),a=Ot*t.width;this.outerPadding=Math.min(e.width/2,a);const c=e.height+this.axisConfig.labelPadding*2;this.labelTextHeight=e.height,c<=i&&(i-=c,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),a=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,a<=i&&(i-=a,this.showTitle=!0)}this.boundingRect.width=t.width,this.boundingRect.height=t.height-i}calculateSpaceIfDrawnVertical(t){let i=t.width;if(this.axisConfig.showAxisLine&&i>this.axisConfig.axisLineWidth&&(i-=this.axisConfig.axisLineWidth,this.showAxisLine=!0),this.axisConfig.showLabel){const e=this.getLabelDimension(),a=Ot*t.height;this.outerPadding=Math.min(e.height/2,a);const c=e.width+this.axisConfig.labelPadding*2;c<=i&&(i-=c,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const e=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),a=e.height+this.axisConfig.titlePadding*2;this.titleTextHeight=e.height,a<=i&&(i-=a,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return this.axisPosition==="left"||this.axisPosition==="right"?this.calculateSpaceIfDrawnVertical(t):this.calculateSpaceIfDrawnHorizontally(t),this.recalculateScale(),{width:this.boundingRect.width,height:this.boundingRect.height}}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}getDrawableElementsForLeftAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.x+this.boundingRect.width-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["left-axis","axisl-line"],data:[{path:`M ${i},${this.boundingRect.y} L ${i},${this.boundingRect.y+this.boundingRect.height} `,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["left-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.boundingRect.x+this.boundingRect.width-(this.showLabel?this.axisConfig.labelPadding:0)-(this.showTick?this.axisConfig.tickLength:0)-(this.showAxisLine?this.axisConfig.axisLineWidth:0),y:this.getScaleValue(i),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"middle",horizontalPos:"right"}))}),this.showTick){const i=this.boundingRect.x+this.boundingRect.width-(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["left-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${i},${this.getScaleValue(e)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(e)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["left-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.axisConfig.titlePadding,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:270,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForBottomAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["bottom-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["bottom-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+this.axisConfig.labelPadding+(this.showTick?this.axisConfig.tickLength:0)+(this.showAxisLine?this.axisConfig.axisLineWidth:0),fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y+(this.showAxisLine?this.axisConfig.axisLineWidth:0);t.push({type:"path",groupTexts:["bottom-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${i} L ${this.getScaleValue(e)},${i+this.axisConfig.tickLength}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["bottom-axis","title"],data:[{text:this.title,x:this.range[0]+(this.range[1]-this.range[0])/2,y:this.boundingRect.y+this.boundingRect.height-this.axisConfig.titlePadding-this.titleTextHeight,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElementsForTopAxis(){const t=[];if(this.showAxisLine){const i=this.boundingRect.y+this.boundingRect.height-this.axisConfig.axisLineWidth/2;t.push({type:"path",groupTexts:["top-axis","axis-line"],data:[{path:`M ${this.boundingRect.x},${i} L ${this.boundingRect.x+this.boundingRect.width},${i}`,strokeFill:this.axisThemeConfig.axisLineColor,strokeWidth:this.axisConfig.axisLineWidth}]})}if(this.showLabel&&t.push({type:"text",groupTexts:["top-axis","label"],data:this.getTickValues().map(i=>({text:i.toString(),x:this.getScaleValue(i),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+this.axisConfig.titlePadding*2:0)+this.axisConfig.labelPadding,fill:this.axisThemeConfig.labelColor,fontSize:this.axisConfig.labelFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}))}),this.showTick){const i=this.boundingRect.y;t.push({type:"path",groupTexts:["top-axis","ticks"],data:this.getTickValues().map(e=>({path:`M ${this.getScaleValue(e)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(e)},${i+this.boundingRect.height-this.axisConfig.tickLength-(this.showAxisLine?this.axisConfig.axisLineWidth:0)}`,strokeFill:this.axisThemeConfig.tickColor,strokeWidth:this.axisConfig.tickWidth}))})}return this.showTitle&&t.push({type:"text",groupTexts:["top-axis","title"],data:[{text:this.title,x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.axisConfig.titlePadding,fill:this.axisThemeConfig.titleColor,fontSize:this.axisConfig.titleFontSize,rotation:0,verticalPos:"top",horizontalPos:"center"}]}),t}getDrawableElements(){if(this.axisPosition==="left")return this.getDrawableElementsForLeftAxis();if(this.axisPosition==="right")throw Error("Drawing of right axis is not implemented");return this.axisPosition==="bottom"?this.getDrawableElementsForBottomAxis():this.axisPosition==="top"?this.getDrawableElementsForTopAxis():[]}},n(Q,"BaseAxis"),Q),K,ki=(K=class extends Ut{constructor(t,i,e,a,c){super(t,a,c,i),this.categories=e,this.scale=Bt().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=Bt().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),Nt.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},n(K,"BandAxis"),K),Z,Ti=(Z=class extends Ut{constructor(t,i,e,a,c){super(t,a,c,i),this.domain=e,this.scale=Wt().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];this.axisPosition==="left"&&t.reverse(),this.scale=Wt().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},n(Z,"LinearAxis"),Z);function At(s,t,i,e){const a=new Ht(e);return St(s)?new ki(t,i,s.categories,s.title,a):new Ti(t,i,[s.min,s.max],s.title,a)}n(At,"getAxis");var J,Ri=(J=class{constructor(t,i,e,a){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=e,this.chartThemeConfig=a,this.boundingRect={x:0,y:0,width:0,height:0},this.showChartTitle=!1}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){const i=this.textDimensionCalculator.getMaxDimension([this.chartData.title],this.chartConfig.titleFontSize),e=Math.max(i.width,t.width),a=i.height+2*this.chartConfig.titlePadding;return i.width<=e&&i.height<=a&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=e,this.boundingRect.height=a,this.showChartTitle=!0),{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){const t=[];return this.showChartTitle&&t.push({groupTexts:["chart-title"],type:"text",data:[{fontSize:this.chartConfig.titleFontSize,text:this.chartData.title,verticalPos:"middle",horizontalPos:"center",x:this.boundingRect.x+this.boundingRect.width/2,y:this.boundingRect.y+this.boundingRect.height/2,fill:this.chartThemeConfig.titleColor,rotation:0}]}),t}},n(J,"ChartTitle"),J);function $t(s,t,i,e){const a=new Ht(e);return new Ri(a,s,t,i)}n($t,"getChartTitleComponent");var tt,Di=(tt=class{constructor(t,i,e,a,c){this.plotData=t,this.xAxis=i,this.yAxis=e,this.orientation=a,this.plotIndex=c}getDrawableElement(){const t=this.plotData.data.map(e=>[this.xAxis.getScaleValue(e[0]),this.yAxis.getScaleValue(e[1])]);let i;return this.orientation==="horizontal"?i=zt().y(e=>e[0]).x(e=>e[1])(t):i=zt().x(e=>e[0]).y(e=>e[1])(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},n(tt,"LinePlot"),tt),it,vi=(it=class{constructor(t,i,e,a,c,d){this.barData=t,this.boundingRect=i,this.xAxis=e,this.yAxis=a,this.orientation=c,this.plotIndex=d}getDrawableElement(){const t=this.barData.data.map(c=>[this.xAxis.getScaleValue(c[0]),this.yAxis.getScaleValue(c[1])]),e=Math.min(this.xAxis.getAxisOuterPadding()*2,this.xAxis.getTickDistance())*(1-.05),a=e/2;return this.orientation==="horizontal"?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(c=>({x:this.boundingRect.x,y:c[0]-a,height:e,width:c[1]-this.boundingRect.x,fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]:[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(c=>({x:c[0]-a,y:c[1],width:e,height:this.boundingRect.y+this.boundingRect.height-c[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},n(it,"BarPlot"),it),et,Pi=(et=class{constructor(t,i,e){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=e,this.boundingRect={x:0,y:0,width:0,height:0}}setAxes(t,i){this.xAxis=t,this.yAxis=i}setBoundingBoxXY(t){this.boundingRect.x=t.x,this.boundingRect.y=t.y}calculateSpace(t){return this.boundingRect.width=t.width,this.boundingRect.height=t.height,{width:this.boundingRect.width,height:this.boundingRect.height}}getDrawableElements(){if(!(this.xAxis&&this.yAxis))throw Error("Axes must be passed to render Plots");const t=[];for(const[i,e]of this.chartData.plots.entries())switch(e.type){case"line":{const a=new Di(e,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...a.getDrawableElement())}break;case"bar":{const a=new vi(e,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...a.getDrawableElement())}break}return t}},n(et,"BasePlot"),et);function qt(s,t,i){return new Pi(s,t,i)}n(qt,"getPlotComponent");var st,Li=(st=class{constructor(t,i,e,a){this.chartConfig=t,this.chartData=i,this.componentStore={title:$t(t,i,e,a),plot:qt(t,i,e),xAxis:At(i.xAxis,t.xAxis,{titleColor:e.xAxisTitleColor,labelColor:e.xAxisLabelColor,tickColor:e.xAxisTickColor,axisLineColor:e.xAxisLineColor},a),yAxis:At(i.yAxis,t.yAxis,{titleColor:e.yAxisTitleColor,labelColor:e.yAxisLabelColor,tickColor:e.yAxisTickColor,axisLineColor:e.yAxisLineColor},a)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,a=0,c=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),d=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),m=this.componentStore.plot.calculateSpace({width:c,height:d});t-=m.width,i-=m.height,m=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),a=m.height,i-=m.height,this.componentStore.xAxis.setAxisPosition("bottom"),m=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=m.height,this.componentStore.yAxis.setAxisPosition("left"),m=this.componentStore.yAxis.calculateSpace({width:t,height:i}),e=m.width,t-=m.width,t>0&&(c+=t,t=0),i>0&&(d+=i,i=0),this.componentStore.plot.calculateSpace({width:c,height:d}),this.componentStore.plot.setBoundingBoxXY({x:e,y:a}),this.componentStore.xAxis.setRange([e,e+c]),this.componentStore.xAxis.setBoundingBoxXY({x:e,y:a+d}),this.componentStore.yAxis.setRange([a,a+d]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:a}),this.chartData.plots.some(b=>bt(b))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,e=0,a=0,c=0,d=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),m=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),b=this.componentStore.plot.calculateSpace({width:d,height:m});t-=b.width,i-=b.height,b=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=b.height,i-=b.height,this.componentStore.xAxis.setAxisPosition("left"),b=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=b.width,a=b.width,this.componentStore.yAxis.setAxisPosition("top"),b=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=b.height,c=e+b.height,t>0&&(d+=t,t=0),i>0&&(m+=i,i=0),this.componentStore.plot.calculateSpace({width:d,height:m}),this.componentStore.plot.setBoundingBoxXY({x:a,y:c}),this.componentStore.yAxis.setRange([a,a+d]),this.componentStore.yAxis.setBoundingBoxXY({x:a,y:e}),this.componentStore.xAxis.setRange([c,c+m]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:c}),this.chartData.plots.some(P=>bt(P))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){this.chartConfig.chartOrientation==="horizontal"?this.calculateHorizontalSpace():this.calculateVerticalSpace()}getDrawableElement(){this.calculateSpace();const t=[];this.componentStore.plot.setAxes(this.componentStore.xAxis,this.componentStore.yAxis);for(const i of Object.values(this.componentStore))t.push(...i.getDrawableElements());return t}},n(st,"Orchestrator"),st),at,Ei=(at=class{static build(t,i,e,a){return new Li(t,i,e,a).getDrawableElement()}},n(at,"XYChartBuilder"),at),ot=0,Gt,rt=Tt(),ht=kt(),y=Rt(),wt=ht.plotColorPalette.split(",").map(s=>s.trim()),gt=!1,_t=!1;function kt(){const s=Ci(),t=Ct();return Yt(s.xyChart,t.themeVariables.xyChart)}n(kt,"getChartDefaultThemeConfig");function Tt(){const s=Ct();return Yt(wi.xyChart,s.xyChart)}n(Tt,"getChartDefaultConfig");function Rt(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}n(Rt,"getChartDefaultData");function xt(s){const t=Ct();return Ai(s.trim(),t)}n(xt,"textSanitizer");function jt(s){Gt=s}n(jt,"setTmpSVGG");function Qt(s){s==="horizontal"?rt.chartOrientation="horizontal":rt.chartOrientation="vertical"}n(Qt,"setOrientation");function Kt(s){y.xAxis.title=xt(s.text)}n(Kt,"setXAxisTitle");function Dt(s,t){y.xAxis={type:"linear",title:y.xAxis.title,min:s,max:t},gt=!0}n(Dt,"setXAxisRangeData");function Zt(s){y.xAxis={type:"band",title:y.xAxis.title,categories:s.map(t=>xt(t.text))},gt=!0}n(Zt,"setXAxisBand");function Jt(s){y.yAxis.title=xt(s.text)}n(Jt,"setYAxisTitle");function ti(s,t){y.yAxis={type:"linear",title:y.yAxis.title,min:s,max:t},_t=!0}n(ti,"setYAxisRangeData");function ii(s){const t=Math.min(...s),i=Math.max(...s),e=G(y.yAxis)?y.yAxis.min:1/0,a=G(y.yAxis)?y.yAxis.max:-1/0;y.yAxis={type:"linear",title:y.yAxis.title,min:Math.min(e,t),max:Math.max(a,i)}}n(ii,"setYAxisRangeFromPlotData");function vt(s){let t=[];if(s.length===0)return t;if(!gt){const i=G(y.xAxis)?y.xAxis.min:1/0,e=G(y.xAxis)?y.xAxis.max:-1/0;Dt(Math.min(i,1),Math.max(e,s.length))}if(_t||ii(s),St(y.xAxis)&&(t=y.xAxis.categories.map((i,e)=>[i,s[e]])),G(y.xAxis)){const i=y.xAxis.min,e=y.xAxis.max,a=(e-i)/(s.length-1),c=[];for(let d=i;d<=e;d+=a)c.push(`${d}`);t=c.map((d,m)=>[d,s[m]])}return t}n(vt,"transformDataWithoutCategory");function Pt(s){return wt[s===0?0:s%wt.length]}n(Pt,"getPlotColorFromPalette");function ei(s,t){const i=vt(t);y.plots.push({type:"line",strokeFill:Pt(ot),strokeWidth:2,data:i}),ot++}n(ei,"setLineData");function si(s,t){const i=vt(t);y.plots.push({type:"bar",fill:Pt(ot),data:i}),ot++}n(si,"setBarData");function ai(){if(y.plots.length===0)throw Error("No Plot to render, please provide a plot with some data");return y.title=Xt(),Ei.build(rt,y,ht,Gt)}n(ai,"getDrawableElem");function ni(){return ht}n(ni,"getChartThemeConfig");function oi(){return rt}n(oi,"getChartConfig");function ri(){return y}n(ri,"getXYChartData");var Ii=n(function(){bi(),ot=0,rt=Tt(),y=Rt(),ht=kt(),wt=ht.plotColorPalette.split(",").map(s=>s.trim()),gt=!1,_t=!1},"clear"),Vi={getDrawableElem:ai,clear:Ii,setAccTitle:fi,getAccTitle:pi,setDiagramTitle:di,getDiagramTitle:Xt,getAccDescription:xi,setAccDescription:gi,setOrientation:Qt,setXAxisTitle:Kt,setXAxisRangeData:Dt,setXAxisBand:Zt,setYAxisTitle:Jt,setYAxisRangeData:ti,setLineData:ei,setBarData:si,setTmpSVGG:jt,getChartThemeConfig:ni,getChartConfig:oi,getXYChartData:ri},Mi=n((s,t,i,e)=>{const a=e.db,c=a.getChartThemeConfig(),d=a.getChartConfig(),m=a.getXYChartData().plots[0].data.map(f=>f[1]);function b(f){return f==="top"?"text-before-edge":"middle"}n(b,"getDominantBaseLine");function P(f){return f==="left"?"start":f==="right"?"end":"middle"}n(P,"getTextAnchor");function I(f){return`translate(${f.x}, ${f.y}) rotate(${f.rotation||0})`}n(I,"getTextTransformation"),Nt.debug(`Rendering xychart chart
7
+ `+s);const R=yi(t),L=R.append("g").attr("class","main"),z=L.append("rect").attr("width",d.width).attr("height",d.height).attr("class","background");mi(R,d.height,d.width,!0),R.attr("viewBox",`0 0 ${d.width} ${d.height}`),z.attr("fill",c.backgroundColor),a.setTmpSVGG(R.append("g").attr("class","mermaid-tmp-group"));const F=a.getDrawableElem(),D={};function V(f){let C=L,l="";for(const[M]of f.entries()){let B=L;M>0&&D[l]&&(B=D[l]),l+=f[M],C=D[l],C||(C=D[l]=B.append("g").attr("class",f[M]))}return C}n(V,"getGroup");for(const f of F){if(f.data.length===0)continue;const C=V(f.groupTexts);switch(f.type){case"rect":if(C.selectAll("rect").data(f.data).enter().append("rect").attr("x",l=>l.x).attr("y",l=>l.y).attr("width",l=>l.width).attr("height",l=>l.height).attr("fill",l=>l.fill).attr("stroke",l=>l.strokeFill).attr("stroke-width",l=>l.strokeWidth),d.showDataLabel)if(d.chartOrientation==="horizontal"){let l=function(h,k){const{data:w,label:S}=h;return k*S.length*M<=w.width-10};n(l,"fitsHorizontally");const M=.7,B=f.data.map((h,k)=>({data:h,label:m[k].toString()})).filter(h=>h.data.width>0&&h.data.height>0),U=B.map(h=>{const{data:k}=h;let w=k.height*.7;for(;!l(h,w)&&w>0;)w-=1;return w}),X=Math.floor(Math.min(...U));C.selectAll("text").data(B).enter().append("text").attr("x",h=>h.data.x+h.data.width-10).attr("y",h=>h.data.y+h.data.height/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","black").attr("font-size",`${X}px`).text(h=>h.label)}else{let l=function(h,k,w){const{data:S,label:$}=h,N=k*$.length*.7,W=S.x+S.width/2,r=W-N/2,u=W+N/2,g=r>=S.x&&u<=S.x+S.width,x=S.y+w+k<=S.y+S.height;return g&&x};n(l,"fitsInBar");const M=10,B=f.data.map((h,k)=>({data:h,label:m[k].toString()})).filter(h=>h.data.width>0&&h.data.height>0),U=B.map(h=>{const{data:k,label:w}=h;let S=k.width/(w.length*.7);for(;!l(h,S,M)&&S>0;)S-=1;return S}),X=Math.floor(Math.min(...U));C.selectAll("text").data(B).enter().append("text").attr("x",h=>h.data.x+h.data.width/2).attr("y",h=>h.data.y+M).attr("text-anchor","middle").attr("dominant-baseline","hanging").attr("fill","black").attr("font-size",`${X}px`).text(h=>h.label)}break;case"text":C.selectAll("text").data(f.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",l=>l.fill).attr("font-size",l=>l.fontSize).attr("dominant-baseline",l=>b(l.verticalPos)).attr("text-anchor",l=>P(l.horizontalPos)).attr("transform",l=>I(l)).text(l=>l.text);break;case"path":C.selectAll("path").data(f.data).enter().append("path").attr("d",l=>l.path).attr("fill",l=>l.fill?l.fill:"none").attr("stroke",l=>l.strokeFill).attr("stroke-width",l=>l.strokeWidth);break}}},"draw"),Bi={draw:Mi},Fi={parser:_i,db:Vi,renderer:Bi};export{Fi as diagram};
package/dist/index.html CHANGED
@@ -2,18 +2,92 @@
2
2
  <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8" />
5
- <link rel="icon" type="image/svg+xml" href="/vite.svg" />
5
+ <link rel="icon" type="image/svg+xml" href="./vite.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Bodhi</title>
8
- <script type="module" crossorigin src="/assets/main-D-vCV98n.js"></script>
9
- <link rel="modulepreload" crossorigin href="/assets/vendor-ui-BecvStzI.js">
10
- <link rel="modulepreload" crossorigin href="/assets/vendor-chart-hXvGMOW0.js">
11
- <link rel="modulepreload" crossorigin href="/assets/vendor-react-BK4ieJpD.js">
12
- <link rel="stylesheet" crossorigin href="/assets/vendor-ui-B6snAd4S.css">
13
- <link rel="stylesheet" crossorigin href="/assets/main-CiAWoLS2.css">
8
+ <script type="module" crossorigin src="./assets/main-obJgfVN6.js"></script>
9
+ <link rel="stylesheet" crossorigin href="./assets/main-B6snAd4S.css">
14
10
  </head>
15
11
 
16
12
  <body>
17
- <div id="root"></div>
13
+ <div id="root">
14
+ <div
15
+ id="boot-status"
16
+ style="
17
+ display:flex;
18
+ align-items:center;
19
+ justify-content:center;
20
+ height:100vh;
21
+ padding:24px;
22
+ font-family:system-ui,-apple-system,Segoe UI,Roboto,Helvetica,Arial,sans-serif;
23
+ color:#0f0f0f;
24
+ background:#f6f6f6;
25
+ "
26
+ >
27
+ Starting Bodhi UI...
28
+ </div>
29
+ </div>
30
+ <script>
31
+ (function () {
32
+ var statusEl = document.getElementById("boot-status");
33
+ var setStatus = function (message) {
34
+ if (!statusEl || !statusEl.isConnected) return;
35
+ statusEl.textContent = message;
36
+ };
37
+ var moduleScript = document.querySelector('script[type="module"][src]');
38
+ var moduleSrc =
39
+ moduleScript && moduleScript.getAttribute("src")
40
+ ? new URL(moduleScript.getAttribute("src"), location.href).href
41
+ : "(missing)";
42
+
43
+ window.__BODHI_BOOT_STATUS__ = {
44
+ setStatus: setStatus,
45
+ };
46
+
47
+ setTimeout(function () {
48
+ setStatus(
49
+ "Bodhi UI is still loading. href=" +
50
+ location.href +
51
+ " module=" +
52
+ moduleSrc,
53
+ );
54
+ }, 5000);
55
+
56
+ window.addEventListener(
57
+ "error",
58
+ function (event) {
59
+ if (event && event.message) {
60
+ var file = event.filename || "(unknown file)";
61
+ var line = event.lineno || 0;
62
+ var col = event.colno || 0;
63
+ setStatus(
64
+ "Startup error: " +
65
+ event.message +
66
+ " at " +
67
+ file +
68
+ ":" +
69
+ line +
70
+ ":" +
71
+ col,
72
+ );
73
+ return;
74
+ }
75
+
76
+ var target = event && event.target;
77
+ if (target && target.tagName === "SCRIPT" && target.src) {
78
+ setStatus("Failed to load script: " + target.src);
79
+ }
80
+ },
81
+ true,
82
+ );
83
+
84
+ window.addEventListener("unhandledrejection", function (event) {
85
+ var reason = event && event.reason;
86
+ var message =
87
+ reason && reason.message ? reason.message : String(reason || "unknown");
88
+ setStatus("Startup error: " + message);
89
+ });
90
+ })();
91
+ </script>
18
92
  </body>
19
93
  </html>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bigduu/lotus",
3
3
  "private": false,
4
- "version": "2026.3.9",
4
+ "version": "2026.3.20",
5
5
  "description": "Standalone Lotus frontend assets for Bodhi shell and web runtime.",
6
6
  "license": "MIT",
7
7
  "repository": {
@@ -1,5 +0,0 @@
1
- import{m as i,a6 as C,a7 as R,r as g,a as E}from"./vendor-react-BK4ieJpD.js";import{aq as f,az as I}from"./vendor-ui-BecvStzI.js";import{n as B,m as x,r as H,o as $}from"./main-D-vCV98n.js";import"./vendor-chart-hXvGMOW0.js";const X=({error:s,className:n,style:a,token:e,onFix:d,isFixing:o,fixError:r})=>{const l=s.split(`
2
-
3
- `);return i.jsxs("div",{className:n,style:{color:e.colorError,padding:`${e.paddingXS}px ${e.paddingSM}px`,fontSize:e.fontSizeSM,background:e.colorErrorBg,borderRadius:e.borderRadiusSM,border:`1px solid ${e.colorErrorBorder}`,margin:`${e.marginXS}px 0`,minHeight:"60px",maxHeight:"120px",display:"flex",flexDirection:"column",alignItems:"flex-start",justifyContent:"flex-start",overflow:"auto",position:"relative",maxWidth:"100%",boxSizing:"border-box",...a},title:`Mermaid Error: ${s}
4
-
5
- Check browser console for detailed error information.`,children:[i.jsxs("div",{style:{display:"flex",alignItems:"center",marginBottom:e.marginXXS},children:[i.jsx("span",{style:{marginRight:e.marginXS,fontSize:"14px",flexShrink:0,lineHeight:1},children:"⚠️"}),i.jsx("span",{style:{fontWeight:600,color:e.colorError},children:"Mermaid Diagram Error"})]}),i.jsx("div",{style:{fontSize:e.fontSizeSM,lineHeight:1.4,wordBreak:"break-word",flex:1,width:"100%"},children:l.map((t,c)=>i.jsx("div",{style:{marginBottom:c<l.length-1?e.marginXS:0,...t.startsWith("💡")?{backgroundColor:e.colorInfoBg,border:`1px solid ${e.colorInfoBorder}`,borderRadius:e.borderRadiusSM,padding:e.paddingXS,marginTop:e.marginXS,color:e.colorInfo,fontWeight:500}:{}},children:t},`${c}-${t.substring(0,12)}`))}),d&&i.jsxs("div",{style:{display:"flex",alignItems:"center",gap:e.marginXS,marginTop:e.marginXS,width:"100%"},children:[i.jsx(f,{size:"small",type:"primary",onClick:d,loading:o,children:"Fix Mermaid"}),r&&i.jsx("span",{style:{color:e.colorError,fontSize:e.fontSizeSM,wordBreak:"break-word",flex:1},children:r})]}),i.jsx("div",{style:{fontSize:e.fontSizeSM,color:e.colorTextSecondary,marginTop:e.marginXS,fontStyle:"italic"},children:"💡 Check browser console (F12) for detailed error information"})]})},W=({svg:s,height:n,isLoading:a,initialScale:e,className:d,style:o,token:r,containerRef:l})=>i.jsxs("div",{ref:l,className:d,style:{textAlign:"center",margin:`${r.marginXS}px 0`,padding:r.padding,background:r.colorBgContainer,borderRadius:r.borderRadiusSM,border:`1px solid ${r.colorBorder}`,overflow:"hidden",height:`${Math.min(n,800)}px`,minHeight:"300px",maxHeight:"80vh",display:"flex",alignItems:"center",justifyContent:"center",position:"relative",willChange:"auto",contain:"layout style paint",...o},children:[a&&i.jsx("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",color:r.colorTextSecondary,fontSize:r.fontSizeSM,zIndex:2},children:"Rendering diagram..."}),i.jsx("div",{style:{width:"100%",height:"100%",opacity:a?0:1,position:"relative"},children:i.jsx(C,{initialScale:e,minScale:.1,maxScale:10,centerOnInit:!0,limitToBounds:!1,wheel:{step:.1},panning:{disabled:!1},pinch:{disabled:!1},doubleClick:{disabled:!1,mode:"zoomIn",step:.5},children:({zoomIn:t,zoomOut:c,resetTransform:m})=>i.jsxs(i.Fragment,{children:[i.jsxs("div",{style:{position:"absolute",top:8,right:8,zIndex:10,display:"flex",flexDirection:"column",gap:4,background:r.colorBgContainer,borderRadius:r.borderRadiusSM,border:`1px solid ${r.colorBorder}`,padding:4,boxShadow:r.boxShadowSecondary},children:[i.jsx(f,{size:"small",type:"text",onClick:()=>t(),style:{fontSize:12,padding:"2px 6px"},children:"+"}),i.jsx(f,{size:"small",type:"text",onClick:()=>c(),style:{fontSize:12,padding:"2px 6px"},children:"-"}),i.jsx(f,{size:"small",type:"text",onClick:()=>m(),style:{fontSize:10,padding:"2px 6px"},children:"⌂"})]}),i.jsx(R,{wrapperStyle:{width:"100%",height:"100%"},contentStyle:{display:"flex",alignItems:"center",justifyContent:"center",width:"100%",height:"100%"},children:i.jsx("div",{style:{display:"inline-block",lineHeight:0},dangerouslySetInnerHTML:{__html:s.replace(/<svg([^>]*)>/,'<svg$1 style="display: block; max-width: 100%; max-height: 100%;">')}})})]})})})]});function T(s){let n=2166136261;for(let a=0;a<s.length;a++)n=(n^s.charCodeAt(a))*16777619;return(n>>>0).toString(36)}const L=(s,n)=>{const a=g.useMemo(()=>B(s),[s]),e=g.useMemo(()=>T(a),[a]),[d,o]=g.useState(()=>{const r=x(e);return r?{svg:r.svg,height:r.height+80,svgWidth:r.width,svgHeight:r.height,error:"",isLoading:!1}:{svg:"",height:200,svgWidth:800,svgHeight:200,error:"",isLoading:n}});return g.useEffect(()=>{const r=x(e);o(r?{svg:r.svg,height:r.height+80,svgWidth:r.width,svgHeight:r.height,error:"",isLoading:!1}:{svg:"",height:200,svgWidth:800,svgHeight:200,error:"",isLoading:!1})},[e]),g.useEffect(()=>{if(x(e))return;let l=!1;return o(t=>({...t,isLoading:!0})),H(e,a).then(t=>{l||o({svg:t.svg,height:t.height+80,svgWidth:t.width,svgHeight:t.height,error:"",isLoading:!1})}).catch(t=>{if(!l){console.error("[MermaidState] Render error:",t);const c=t instanceof Error?t.message:String(t);o(m=>({...m,error:c||"Failed to render Mermaid diagram",isLoading:!1}))}}),()=>{l=!0}},[e,a,n]),{renderState:d,chartKey:e}},{useToken:F}=I,D=E.memo(({chart:s,id:n,className:a,style:e,onFix:d})=>{const{token:o}=F(),r=$(),[l,t]=g.useState(!1),[c,m]=g.useState(""),u=g.useRef(null),{renderState:y}=L(s,!0),{svg:v,height:b,svgWidth:p,error:S,isLoading:M}=y,j=(()=>{const h=r.defaultScale;return p>1200?h*.8:p>800?h*1:h*1.2})(),z=async()=>{if(!(!d||l)){t(!0),m("");try{await d(s)}catch(h){const w=h instanceof Error?h.message:String(h);m(w||"Failed to fix Mermaid diagram")}finally{t(!1)}}};return S?i.jsx(X,{error:S,className:a,style:e,token:o,onFix:d?z:void 0,isFixing:l,fixError:c}):i.jsx(W,{svg:v,height:b,isLoading:M,initialScale:j,className:a,style:e,token:o,containerRef:u})});D.displayName="MermaidChart";export{D as MermaidChart,D as default};
@@ -1 +0,0 @@
1
- import{m as e}from"./vendor-react-BK4ieJpD.js";import{as as x,at as n,ap as s,ar as m,av as a,aq as d,az as p}from"./vendor-ui-BecvStzI.js";import{c as g,d as h}from"./main-D-vCV98n.js";import"./vendor-chart-hXvGMOW0.js";const{Text:l}=m,{useToken:u}=p,b=({files:i,onRemove:c,onClear:o})=>{const{token:r}=u();return i.length===0?null:e.jsx(x,{size:"small",style:{marginBottom:r.marginXS,background:r.colorBgElevated,borderRadius:r.borderRadiusSM,border:`1px solid ${r.colorBorderSecondary}`},bodyStyle:{padding:r.paddingSM},title:e.jsxs(s,{align:"center",size:r.marginXS,children:[e.jsx(h,{}),e.jsx(l,{strong:!0,children:"Attached Files"}),e.jsx(a,{color:"geekblue",children:i.length})]}),extra:o?e.jsx(d,{type:"text",size:"small",onClick:o,children:"Clear All"}):null,children:e.jsx(n,{dataSource:i,renderItem:t=>e.jsx(n.Item,{style:{alignItems:"flex-start",padding:`${r.paddingXS}px 0`},actions:[e.jsx(d,{type:"text",size:"small",icon:e.jsx(g,{}),onClick:()=>c(t.id),children:"Remove"},"remove")],children:e.jsx(n.Item.Meta,{title:e.jsxs(s,{direction:"vertical",size:r.marginXXS,children:[e.jsx(l,{strong:!0,children:t.name}),e.jsxs(s,{size:r.marginXS,children:[e.jsx(a,{children:t.type||"unknown"}),e.jsxs(a,{color:"purple",children:[(t.size/1024).toFixed(1)," KB"]}),e.jsx(a,{color:"cyan",children:t.kind==="text"?"Text":"Binary"})]})]}),description:e.jsx("div",{style:{whiteSpace:"pre-wrap",wordBreak:"break-word",fontFamily:"var(--ant-font-family-code)",background:r.colorFillTertiary,borderRadius:r.borderRadiusSM,padding:r.paddingXS,maxHeight:160,overflowY:"auto"},children:t.preview})})},t.id)})})};export{b as default};
@@ -1 +0,0 @@
1
- var ee=Object.defineProperty;var te=(r,t,s)=>t in r?ee(r,t,{enumerable:!0,configurable:!0,writable:!0,value:s}):r[t]=s;var B=(r,t,s)=>te(r,typeof t!="symbol"?t+"":t,s);import{r as l,m as e}from"./vendor-react-BK4ieJpD.js";import{I as J,w as z,e as se,f as re,g as P,h as ae,i as ie,j as ne,k as le}from"./main-D-vCV98n.js";import{b5 as oe,b6 as ce,az as Y,ar as E,aw as F,ax as L,ap as w,aq as I,b7 as U,as as de,aH as N,ay as R,at as W,aA as T,aG as D,aD as ue,aJ as he}from"./vendor-ui-BecvStzI.js";import"./vendor-chart-hXvGMOW0.js";function O(){return O=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])}return r},O.apply(this,arguments)}const pe=(r,t)=>l.createElement(J,O({},r,{ref:t,icon:oe})),K=l.forwardRef(pe);function G(){return G=Object.assign?Object.assign.bind():function(r){for(var t=1;t<arguments.length;t++){var s=arguments[t];for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(r[i]=s[i])}return r},G.apply(this,arguments)}const ge=(r,t)=>l.createElement(J,G({},r,{ref:t,icon:ce})),X=l.forwardRef(ge),fe=({visible:r,onClose:t,onSelect:s})=>{const{token:i}=Y.useToken(),{Text:a}=E,[n,c]=l.useState(!1),[o,y]=l.useState(""),[f,p]=l.useState(),[k,j]=l.useState([]),[b,x]=l.useState([]);l.useEffect(()=>{r&&m()},[r]);const m=async d=>{c(!0);try{const u=await z.browseFolder(d);y(u.current_path),p(u.parent_path),j(u.folders)}catch(u){console.error("Failed to load directory:",u),F.error("Unable to read folder")}finally{c(!1)}},g=d=>{x([...b,o]),m(d.path)},_=()=>{f&&(x(b.slice(0,-1)),m(f))},C=()=>{x([]),m()},v=()=>{s(o),t()},S=()=>{if(!o)return[];const d=o.split(/[/\\]/).filter(Boolean);return o.startsWith("/")&&d.unshift("/"),d},M=d=>{const V=S().slice(0,d+1).join("/"),$=(o.startsWith("/"),V);m($)};return e.jsx(L,{title:"Select Workspace Folder",open:r,onCancel:t,width:700,footer:null,children:e.jsxs(w,{direction:"vertical",size:"middle",style:{width:"100%"},children:[e.jsxs(w,{children:[e.jsx(I,{icon:e.jsx(X,{}),onClick:C,size:"small",children:"Home"}),e.jsx(I,{icon:e.jsx(se,{}),onClick:_,disabled:!f,size:"small",children:"Parent Directory"}),e.jsx(I,{type:"primary",icon:e.jsx(re,{}),onClick:v,size:"small",children:"Select Current Folder"})]}),e.jsx(U,{children:S().map((d,u)=>e.jsx(U.Item,{children:e.jsx(I,{type:"link",size:"small",onClick:()=>M(u),style:{padding:0},children:d==="/"?e.jsx(X,{}):d})},u))}),e.jsxs(de,{size:"small",styles:{body:{padding:i.paddingXS}},children:[e.jsx(a,{type:"secondary",style:{fontSize:12},children:"Current Path:"})," ",e.jsx(a,{code:!0,children:o})]}),e.jsx(N,{spinning:n,children:k.length===0&&!n?e.jsx(R,{image:R.PRESENTED_IMAGE_SIMPLE,description:e.jsx(a,{type:"secondary",children:"This folder is empty"})}):e.jsx(W,{dataSource:k,style:{maxHeight:400,overflowY:"auto"},renderItem:d=>e.jsx(W.Item,{style:{padding:0},children:e.jsx(I,{type:"text",icon:e.jsx(P,{}),onClick:()=>g(d),style:{width:"100%",textAlign:"left",padding:`${i.paddingXS}px ${i.paddingSM}px`},children:d.name})})})}),e.jsx(a,{type:"secondary",style:{fontSize:12},children:'💡 Tip: Click a folder to enter, click "Select Current Folder" to confirm'})]})})};class xe{constructor(t={}){B(this,"cache",new Map);B(this,"pendingValidations",new Map);B(this,"options");this.options={debounceMs:t.debounceMs??300,cacheTimeoutMs:t.cacheTimeoutMs??5*60*1e3,maxRetries:t.maxRetries??3}}async validateWorkspace(t){if(!t||t.trim().length===0)return{path:"",is_valid:!1,error_message:"Path cannot be empty"};const s=t.trim(),i=this.getCachedResult(s);if(i)return i;const a=this.pendingValidations.get(s);if(a)return a;const n=this.performValidation(s);this.pendingValidations.set(s,n);try{const c=await n;return this.setCachedResult(s,c),c}finally{this.pendingValidations.delete(s)}}validateWorkspaceDebounced(t,s){let i;return i=setTimeout(async()=>{try{const n=await this.validateWorkspace(t);s(n)}catch(n){const c={path:t,is_valid:!1,error_message:n instanceof Error?n.message:"Validation failed"};s(c)}},this.options.debounceMs),()=>{clearTimeout(i)}}clearCache(){this.cache.clear()}getCachedResult(t){const s=this.cache.get(t);return s?Date.now()-s.timestamp>this.options.cacheTimeoutMs?(this.cache.delete(t),null):s.result:null}setCachedResult(t,s){this.cache.set(t,{result:s,timestamp:Date.now()})}async performValidation(t,s=0){try{return await ae.post("workspace/validate",{path:t})}catch(i){if(s<this.options.maxRetries&&this.isRetryableError(i))return await this.delay(Math.pow(2,s)*1e3),this.performValidation(t,s+1);throw i}}isRetryableError(t){return t instanceof Error?t.message.includes("Failed to fetch")||t.message.includes("HTTP error! status: 5"):!1}delay(t){return new Promise(s=>setTimeout(s,t))}async validateMultiplePaths(t){const i=[];for(let a=0;a<t.length;a+=5){const n=t.slice(a,a+5),c=await Promise.all(n.map(o=>this.validateWorkspace(o)));i.push(...c),a+5<t.length&&await this.delay(100)}return i}}const me=new xe,ye=({value:r="",onChange:t,showRecentWorkspaces:s,showSuggestions:i,onValidationChange:a})=>{const[n,c]=l.useState(r),[o,y]=l.useState({isValidating:!1,result:null}),[f,p]=l.useState([]),[k,j]=l.useState(!1),[b,x]=l.useState([]),[m,g]=l.useState(!1),[_,C]=l.useState(!1),v=l.useRef(null),S=l.useRef(null);l.useEffect(()=>{c(r)},[r]),l.useEffect(()=>(s&&M(),i&&d(),()=>{v.current&&v.current.abort(),S.current&&S.current()}),[s,i]);const M=l.useCallback(async()=>{g(!0);try{const h=await z.getRecentWorkspaces();p(h.slice(0,5))}catch(h){console.error("Failed to load recent workspaces:",h),p([])}finally{g(!1)}},[]),d=l.useCallback(async()=>{C(!0);try{const h=await z.getPathSuggestions();x(h.suggestions.slice(0,8))}catch(h){console.error("Failed to load suggestions:",h),x([])}finally{C(!1)}},[]),u=l.useCallback(h=>{c(h),t&&t(h),v.current&&v.current.abort(),S.current&&S.current(),h.trim()?(y({isValidating:!0,result:null}),S.current=me.validateWorkspaceDebounced(h.trim(),Z=>{y({isValidating:!1,result:Z}),a&&a(Z)})):(y({isValidating:!1,result:null}),a&&a(null))},[t,a]),V=l.useCallback(()=>{j(!0)},[]),$=l.useCallback(h=>{u(h),F.success("Folder selected successfully")},[u]),Q=l.useCallback(h=>{u(h)},[u]);return{path:n,validationStatus:o,recentWorkspaces:f,suggestions:b,isLoadingRecent:m,isLoadingSuggestions:_,folderBrowserVisible:k,setFolderBrowserVisible:j,handlePathChange:u,handleBrowseClick:V,handleFolderSelect:$,handleWorkspaceSelect:Q}},{Text:A}=E,je=({show:r,isLoading:t,recentWorkspaces:s,onSelect:i,token:a})=>r?e.jsxs(T,{vertical:!0,gap:a.marginXS,style:{marginTop:a.marginMD},children:[e.jsxs(w,{style:{paddingInline:a.paddingSM},children:[e.jsx(K,{}),e.jsx(A,{strong:!0,children:"Recent Workspaces"})]}),t?e.jsx(T,{justify:"center",style:{padding:a.paddingSM},children:e.jsx(N,{size:"small"})}):s.length===0?e.jsx(R,{description:"No recent workspaces",image:R.PRESENTED_IMAGE_SIMPLE,style:{padding:a.paddingSM}}):e.jsx(W,{size:"small",dataSource:s,style:{paddingInline:a.paddingSM},renderItem:n=>e.jsx(W.Item,{style:{padding:0},children:e.jsx(I,{type:"text",onClick:()=>i(n.path),style:{width:"100%",textAlign:"left",padding:`${a.paddingXS}px 0`,height:"auto"},children:e.jsxs(T,{justify:"space-between",align:"center",style:{width:"100%"},children:[e.jsxs(w,{children:[e.jsx(P,{style:{color:a.colorWarning}}),e.jsx(A,{strong:!0,children:n.workspace_name||n.path.split("/").pop()||"Workspace"})]}),e.jsx(A,{type:"secondary",ellipsis:{tooltip:n.path},style:{fontSize:12,maxWidth:"55%",textAlign:"right"},children:n.path})]})})})})]}):null,{Text:H}=E,Se=(r,t)=>{switch(r.suggestion_type){case"home":return e.jsx(X,{style:{color:t.colorPrimary}});case"documents":case"desktop":case"downloads":return e.jsx(P,{style:{color:t.colorSuccess}});case"recent":return e.jsx(K,{style:{color:t.colorWarning}});default:return e.jsx(P,{})}},we=({show:r,isLoading:t,suggestions:s,onSelect:i,token:a})=>r?e.jsxs(T,{vertical:!0,gap:a.marginXS,style:{marginTop:a.marginMD},children:[e.jsxs(w,{style:{paddingInline:a.paddingSM},children:[e.jsx(P,{}),e.jsx(H,{strong:!0,children:"Suggested Workspaces"})]}),t?e.jsx(T,{justify:"center",style:{padding:a.paddingSM},children:e.jsx(N,{size:"small"})}):s.length===0?e.jsx(R,{description:"No suggestions available",image:R.PRESENTED_IMAGE_SIMPLE,style:{padding:a.paddingSM}}):e.jsx(W,{size:"small",dataSource:s,style:{paddingInline:a.paddingSM},renderItem:n=>e.jsx(W.Item,{style:{padding:0},children:e.jsx(I,{type:"text",onClick:()=>i(n.path),style:{width:"100%",textAlign:"left",padding:`${a.paddingXS}px 0`,height:"auto"},children:e.jsxs(T,{justify:"space-between",align:"center",style:{width:"100%"},children:[e.jsxs(w,{children:[Se(n,a),e.jsx(H,{strong:!0,children:n.name})]}),e.jsx(H,{type:"secondary",ellipsis:{tooltip:n.path},style:{fontSize:12,maxWidth:"55%",textAlign:"right"},children:n.path})]})})})})]}):null,ke=({isValidating:r,result:t,token:s})=>r?e.jsx(ie,{style:{color:s.colorPrimary}}):t?t.is_valid?e.jsx(ne,{style:{color:s.colorSuccess}}):e.jsx(le,{style:{color:s.colorError}}):null,{Text:q}=E,be=({result:r,token:t})=>r?e.jsx("div",{style:{marginTop:t.marginXS},children:r.is_valid?e.jsx(D,{type:"success",message:e.jsxs(w,{children:[e.jsx("span",{children:"Valid Workspace"}),r.workspace_name&&e.jsxs(q,{type:"secondary",children:["(",r.workspace_name,")"]}),r.file_count!==void 0&&e.jsxs(q,{type:"secondary",children:["- ",r.file_count," files"]})]}),showIcon:!0}):e.jsx(D,{type:"error",message:r.error_message||"Invalid workspace path",showIcon:!0})}):null,{Text:ve}=E,Ie=({value:r="",onChange:t,placeholder:s="e.g. /Users/alice/Workspace/MyProject",disabled:i=!1,allowBrowse:a=!0,showRecentWorkspaces:n=!0,showSuggestions:c=!0,onValidationChange:o,className:y,style:f})=>{const{token:p}=Y.useToken(),{path:k,validationStatus:j,recentWorkspaces:b,suggestions:x,isLoadingRecent:m,isLoadingSuggestions:g,folderBrowserVisible:_,setFolderBrowserVisible:C,handlePathChange:v,handleBrowseClick:S,handleFolderSelect:M,handleWorkspaceSelect:d}=ye({value:r,onChange:t,showRecentWorkspaces:n,showSuggestions:c,onValidationChange:o});return e.jsxs("div",{className:y,style:f,children:[e.jsx(ue,{value:k,onChange:u=>v(u.target.value),placeholder:s,disabled:i,size:"middle",style:{width:"100%"},suffix:e.jsx(ke,{isValidating:j.isValidating,result:j.result,token:p}),addonBefore:e.jsxs(w,{children:[e.jsx(P,{}),e.jsx(ve,{children:"Workspace"})]}),addonAfter:a?e.jsx(I,{"aria-label":"Browse folder",title:"Browse folder",icon:e.jsx(P,{}),onClick:S,disabled:i,type:"text",size:"middle",style:{display:"inline-flex",alignItems:"center"}}):void 0}),e.jsx(be,{result:j.result,token:p}),(n||c)&&e.jsxs(e.Fragment,{children:[e.jsx(he,{style:{margin:"16px 0 12px 0"}}),e.jsx(je,{show:n,isLoading:m,recentWorkspaces:b,onSelect:d,token:p}),e.jsx(we,{show:c,isLoading:g,suggestions:x,onSelect:d,token:p})]}),e.jsx(fe,{visible:_,onClose:()=>C(!1),onSelect:M})]})},{Title:Pe}=E,_e=({open:r,initialPath:t="",loading:s=!1,onSubmit:i,onCancel:a})=>{const[n,c]=l.useState(t),[o,y]=l.useState(null),[f,p]=l.useState(!1);l.useEffect(()=>{r&&(c(t),y(null))},[r,t]);const k=g=>{c(g)},j=g=>{y(g)},b=async()=>{if(!n.trim()){F.error("Please enter a workspace path");return}o&&!o.is_valid?L.confirm({title:"Invalid Workspace Path",content:e.jsxs("div",{children:[e.jsx("p",{children:"Potential issues detected with the workspace path:"}),e.jsx("p",{children:o.error_message||"Invalid path"}),e.jsx("p",{children:"Do you still want to save this path?"})]}),okText:"Save Anyway",cancelText:"Cancel",onOk:()=>x()}):x()},x=async()=>{p(!0);try{o!=null&&o.is_valid&&await z.addRecentWorkspace(n.trim(),{workspace_name:o.workspace_name}),i(n.trim())}catch(g){console.error("Failed to save workspace path:",g),F.error("Failed to save workspace path")}finally{p(!1)}},m=!n.trim()||s||f;return e.jsx(L,{open:r,title:e.jsx(w,{children:e.jsx(Pe,{level:4,style:{margin:0},children:"Set Workspace Path"})}),okText:"Save",cancelText:"Cancel",onOk:b,onCancel:a,okButtonProps:{disabled:m,loading:f||s},width:600,destroyOnClose:!0,children:e.jsxs(w,{direction:"vertical",size:"middle",style:{width:"100%"},children:[e.jsx(D,{message:"Workspace Path Description",description:e.jsxs("div",{children:[e.jsx("p",{children:"Specify the project root directory associated with the current Chat. The backend will provide file listings based on this directory for @ file references."}),e.jsx("p",{children:"It is recommended to select the root directory containing project source code, such as a Git repository root."})]}),type:"info",showIcon:!0}),e.jsx(Ie,{value:n,onChange:k,onValidationChange:j,placeholder:"e.g. /Users/alice/Workspace/MyProject",disabled:f,allowBrowse:!0,showRecentWorkspaces:!0,showSuggestions:!0}),o&&!o.is_valid&&e.jsx(D,{message:"Workspace Path Check",description:o.error_message||"Path may be invalid, please check if the directory exists and is accessible",type:"warning",showIcon:!0})]})})};export{_e as default};
@@ -1 +0,0 @@
1
- import{r as l,m as s}from"./vendor-react-BK4ieJpD.js";import{C as v,p as E}from"./main-D-vCV98n.js";import{aH as $,az as B,av as L}from"./vendor-ui-BecvStzI.js";import"./vendor-chart-hXvGMOW0.js";const M=({visible:i,searchText:w,onSelect:j,onCancel:g,onAutoComplete:f})=>{const[o,k]=l.useState([]),[n,N]=l.useState([]),[c,d]=l.useState(0),[R,I]=l.useState(!1),y=l.useRef(null),t=l.useRef(null);l.useEffect(()=>{if(!i)return;const a=v.getInstance();(async()=>{I(!0);try{const r=await a.listCommands();console.log("[CommandSelector] Fetched commands:",r),k(r),d(0)}catch(r){console.error("[CommandSelector] Failed to fetch commands:",r),k([])}finally{I(!1)}})()},[i]),l.useEffect(()=>{const a=o.filter(e=>{var u,S,x,b,h;const r=w.toLowerCase(),p=(e.displayName??"").toLowerCase();return e.name.toLowerCase().includes(r)||p.includes(r)||e.description.toLowerCase().includes(r)||e.type==="mcp"&&[(u=e.metadata)==null?void 0:u.serverId,(S=e.metadata)==null?void 0:S.serverName,(x=e.metadata)==null?void 0:x.originalName].filter(C=>typeof C=="string").some(C=>C.toLowerCase().includes(r))||(((b=e.category)==null?void 0:b.toLowerCase().includes(r))??!1)||(((h=e.tags)==null?void 0:h.some(C=>C.toLowerCase().includes(r)))??!1)});N(a),d(0)},[o,w]),l.useEffect(()=>{if(!t.current||!y.current)return;const a=y.current,e=t.current,r=a.getBoundingClientRect(),p=e.getBoundingClientRect();p.top<r.top?e.scrollIntoView({block:"start",behavior:"smooth"}):p.bottom>r.bottom&&e.scrollIntoView({block:"end",behavior:"smooth"})},[c,n]);const m=async a=>{try{j({name:a.name,type:a.type,id:a.id})}catch(e){console.error(`[CommandSelector] Failed to select command '${a.name}':`,e)}};return l.useEffect(()=>{const a=e=>{if(i)switch(e.key){case"ArrowDown":case"n":if(e.key==="n"&&!e.ctrlKey)break;e.preventDefault(),e.stopPropagation(),d(r=>r<n.length-1?r+1:0);break;case"ArrowUp":case"p":if(e.key==="p"&&!e.ctrlKey)break;e.preventDefault(),e.stopPropagation(),d(r=>r>0?r-1:n.length-1);break;case"Enter":e.preventDefault(),e.stopPropagation(),n[c]&&m(n[c]);break;case" ":case"Tab":e.preventDefault(),e.stopPropagation(),n[c]&&f&&f(n[c].name);break;case"Escape":e.preventDefault(),e.stopPropagation(),g();break}};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[i,n,c,g,f]),{containerRef:y,selectedItemRef:t,filteredCommands:n,selectedIndex:c,setSelectedIndex:d,isLoading:R,handleCommandSelect:m}},{useToken:T}=B,D={workflow:{color:"blue",icon:"📁",label:"Workflow"},skill:{color:"green",icon:"⚡",label:"Skill"},mcp:{color:"purple",icon:"🔌",label:"MCP"}},A=({visible:i,onSelect:w,onCancel:j,searchText:g,onAutoComplete:f})=>{const{token:o}=T(),{containerRef:k,selectedItemRef:n,filteredCommands:N,selectedIndex:c,setSelectedIndex:d,isLoading:R,handleCommandSelect:I}=M({visible:i,searchText:g,onSelect:w,onCancel:j,onAutoComplete:f});if(!i)return null;if(R)return s.jsxs("div",{style:{position:"absolute",bottom:"100%",left:0,right:0,background:o.colorBgContainer,border:`1px solid ${o.colorBorderSecondary}`,borderRadius:o.borderRadiusSM,boxShadow:o.boxShadowSecondary,padding:`${o.paddingSM}px ${o.paddingMD}px`,zIndex:1e3,marginBottom:o.marginXS,textAlign:"center"},children:[s.jsx($,{size:"small"})," Loading commands..."]});if(N.length===0)return s.jsx("div",{style:{position:"absolute",bottom:"100%",left:0,right:0,background:o.colorBgContainer,border:`1px solid ${o.colorBorderSecondary}`,borderRadius:o.borderRadiusSM,boxShadow:o.boxShadowSecondary,padding:`${o.paddingSM}px ${o.paddingMD}px`,zIndex:1e3,marginBottom:o.marginXS,textAlign:"center",color:o.colorTextSecondary},children:g?`No commands found matching "${g}"`:"No commands available."});const y=(t,m)=>{var S,x,b;const a=D[t.type],e=m===c,r=t.type==="mcp"?E(t.name):null,p=t.type==="mcp"?((S=t.metadata)==null?void 0:S.originalName)||(r==null?void 0:r.toolName)||t.displayName||t.name:null,u=t.type==="mcp"&&(((x=t.metadata)==null?void 0:x.serverName)||((b=t.metadata)==null?void 0:b.serverId)||(r==null?void 0:r.serverId))||null;return s.jsxs("div",{ref:e?n:null,className:`command-selector-item ${e?"selected":""}`,onClick:()=>I(t),onMouseEnter:()=>d(m),children:[s.jsxs("div",{className:"command-selector-item-header",children:[s.jsxs("div",{className:"command-selector-item-name",style:{color:o.colorPrimary},children:["/",t.type==="mcp"&&p?p:t.name]}),s.jsxs("div",{style:{display:"flex",gap:o.marginXS},children:[t.type==="mcp"&&u&&s.jsx(L,{color:"geekblue",children:u}),s.jsxs(L,{color:a.color,children:[a.icon," ",a.label]})]})]}),s.jsx("div",{className:"command-selector-item-description",style:{color:o.colorTextSecondary},children:t.description}),t.type==="mcp"&&u&&s.jsxs("div",{className:"command-selector-item-category",style:{color:o.colorTextTertiary},children:["Server: ",u]}),t.category&&s.jsxs("div",{className:"command-selector-item-category",style:{color:o.colorTextTertiary},children:["Category: ",t.category]}),t.tags&&t.tags.length>0&&s.jsx("div",{className:"command-selector-item-tags",children:t.tags.slice(0,3).map(h=>s.jsx(L,{children:h},h))})]},t.id)};return s.jsxs("div",{ref:k,className:"command-selector-container",style:{background:o.colorBgContainer,border:`1px solid ${o.colorBorderSecondary}`,borderRadius:o.borderRadiusSM,boxShadow:o.boxShadowSecondary},children:[s.jsx("div",{style:{padding:`${o.paddingXXS}px ${o.paddingSM}px`,borderBottom:`1px solid ${o.colorBorderSecondary}`,background:o.colorFillQuaternary,fontSize:o.fontSizeSM,color:o.colorTextTertiary},children:"Navigation: Up/Down or Ctrl+P/N | Select: Enter | Complete: Space/Tab | Cancel: Esc"}),N.map((t,m)=>y(t,m))]})};export{A as default};
@@ -1 +0,0 @@
1
- import{r as i,m as e}from"./vendor-react-BK4ieJpD.js";import{as as R,aG as I,ay as S,at as w,ap as m,ar as z,aq as k,aH as D,az as b}from"./vendor-ui-BecvStzI.js";import{g as X,d as C,l as L}from"./main-D-vCV98n.js";import"./vendor-chart-hXvGMOW0.js";const{Text:y}=z,{useToken:M}=b,_=({visible:a,files:d,searchText:l,loading:x,error:h,onSelect:c,onCancel:f,onChangeWorkspace:g})=>{const{token:s}=M(),[n,u]=i.useState(0),E=i.useRef(null),j=i.useRef(null),o=i.useMemo(()=>{const t=l.trim().toLowerCase();return t?d.filter(r=>r.name.toLowerCase().startsWith(t)):d},[d,l]);return i.useEffect(()=>{u(0)},[l,d]),i.useEffect(()=>{if(!a)return;const t=r=>{a&&(r.key==="ArrowDown"||r.key==="n"&&r.ctrlKey?(r.preventDefault(),u(p=>o.length===0?0:(p+1)%o.length)):r.key==="ArrowUp"||r.key==="p"&&r.ctrlKey?(r.preventDefault(),u(p=>o.length===0?0:(p-1+o.length)%o.length)):r.key==="Enter"||r.key==="Tab"?o[n]&&(r.preventDefault(),c(o[n])):r.key==="Escape"&&(r.preventDefault(),f()))};return window.addEventListener("keydown",t),()=>{window.removeEventListener("keydown",t)}},[a,o,n,c,f]),i.useEffect(()=>{if(!a)return;const t=j.current;t&&t.scrollIntoView({block:"nearest"})},[n,a]),a?e.jsx("div",{style:{position:"absolute",bottom:"100%",left:0,right:0,zIndex:1e3,marginBottom:s.marginXS},children:e.jsx(R,{size:"small",style:{borderRadius:s.borderRadius,border:`1px solid ${s.colorBorderSecondary}`,boxShadow:s.boxShadowSecondary},bodyStyle:{padding:s.paddingXS,maxHeight:240,overflowY:"auto"},title:e.jsxs(m,{align:"center",size:s.marginXS,children:[e.jsx(y,{strong:!0,children:"@ File Reference"}),x&&e.jsx(D,{size:"small"})]}),extra:e.jsxs(m,{size:s.marginXS,children:[g&&e.jsx(k,{type:"text",size:"small",icon:e.jsx(L,{}),onClick:g,children:"Set Workspace"}),e.jsx(k,{type:"text",size:"small",onClick:f,children:"Close"})]}),children:h?e.jsx(I,{type:"error",message:h,showIcon:!0}):o.length===0&&!x?e.jsx(S,{image:S.PRESENTED_IMAGE_SIMPLE,description:l?"No matching files found":"Directory is empty"}):e.jsx("div",{ref:E,children:e.jsx(w,{dataSource:o,renderItem:(t,r)=>e.jsx(w.Item,{onMouseEnter:()=>u(r),onClick:()=>c(t),ref:r===n?j:void 0,style:{cursor:"pointer",backgroundColor:r===n?s.colorPrimaryBg:"transparent",borderRadius:s.borderRadiusSM,padding:`${s.paddingXXS}px ${s.paddingXS}px`},children:e.jsxs(m,{size:s.marginXS,align:"center",children:[t.is_directory?e.jsx(X,{}):e.jsx(C,{}),e.jsxs("div",{children:[e.jsx(y,{children:t.name}),e.jsx("div",{children:e.jsx(y,{type:"secondary",style:{fontSize:s.fontSizeSM},children:t.is_directory?"Directory":"File"})})]})]})},t.path)})})})}):null};export{_ as default};
@@ -1 +0,0 @@
1
- import{r as y,m as t}from"./vendor-react-BK4ieJpD.js";import{u as a,R as w,a as F,b as M}from"./main-D-vCV98n.js";import{aO as s,aq as i,at as c,av as b,aM as v,ax as C,aD as m,aw as r}from"./vendor-ui-BecvStzI.js";import"./vendor-chart-hXvGMOW0.js";const R=()=>{const h=a(e=>e.systemPrompts),f=a(e=>e.addSystemPrompt),P=a(e=>e.updateSystemPrompt),j=a(e=>e.deleteSystemPrompt),[g,d]=y.useState(!1),[n,p]=y.useState(null),[o]=s.useForm(),u=(e=null)=>{p(e),o.setFieldsValue(e||{name:"",description:"",content:""}),d(!0)},x=()=>{d(!1),p(null),o.resetFields()},S=async()=>{try{const e=await o.validateFields();n?(await P({...n,...e}),r.success("Prompt updated successfully")):(await f(e),r.success("Prompt added successfully")),x()}catch(e){console.error("Failed to save prompt:",e),r.error(e instanceof Error?e.message:"Failed to save prompt. Please try again.")}},I=async e=>{try{await j(e),r.success("Prompt deleted successfully")}catch(l){console.error("Failed to delete prompt:",l),r.error(l instanceof Error?l.message:"Failed to delete prompt. Please try again.")}};return t.jsxs("div",{children:[t.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:16},children:[t.jsx("h2",{children:"System Prompt Management"}),t.jsx(i,{type:"primary",icon:t.jsx(w,{}),onClick:()=>u(),children:"Add Prompt"})]}),t.jsx(c,{itemLayout:"horizontal",dataSource:h,renderItem:e=>t.jsxs(c.Item,{actions:[t.jsx(i,{type:"text",icon:t.jsx(F,{}),onClick:()=>u(e)}),e.isDefault?null:t.jsx(v,{title:"Are you sure to delete this prompt?",onConfirm:()=>I(e.id),okText:"Yes",cancelText:"No",children:t.jsx(i,{type:"text",danger:!0,icon:t.jsx(M,{})})})],children:[t.jsx(c.Item.Meta,{title:e.name,description:e.description||e.content.substring(0,200)+(e.content.length>200?"...":"")}),e.isDefault&&t.jsx(b,{children:"Default"})]})}),t.jsx(C,{title:n?"Edit System Prompt":"Add New System Prompt",open:g,onOk:S,onCancel:x,width:"60%",children:t.jsxs(s,{form:o,layout:"vertical",name:"system_prompt_form",children:[t.jsx(s.Item,{name:"name",label:"Prompt Name",rules:[{required:!0,message:"Please input the name of the prompt!"}],children:t.jsx(m,{})}),t.jsx(s.Item,{name:"description",label:"Prompt Description",rules:[{required:!1,message:"Please input the description of the prompt!"}],children:t.jsx(m.TextArea,{rows:3})}),t.jsx(s.Item,{name:"content",label:"Prompt Content",rules:[{required:!0,message:"Please input the content of the prompt!"}],children:t.jsx(m.TextArea,{rows:10})})]})})]})};export{R as default};