omni-context-cli 0.0.85 → 0.0.87

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 (70) hide show
  1. package/README.md +3 -3
  2. package/README.zh-CN.md +2 -2
  3. package/dist/agents/deduce.md +2 -6
  4. package/dist/agents/explore.md +8 -13
  5. package/dist/agents/glance.md +4 -12
  6. package/dist/agents/recall.md +2 -10
  7. package/dist/agents/review.md +2 -13
  8. package/dist/agents/search.md +3 -13
  9. package/dist/cli.js +7 -7
  10. package/dist/clients/extension.vsix +0 -0
  11. package/dist/clients/web/assets/{_baseUniq-DPXZIoRI.js → _baseUniq-DMGbNleF.js} +1 -1
  12. package/dist/clients/web/assets/{arc-DY6tHnoQ.js → arc-1E4LvFFg.js} +1 -1
  13. package/dist/clients/web/assets/{architectureDiagram-VXUJARFQ-Kwn-Eayz.js → architectureDiagram-VXUJARFQ-BVjg28X_.js} +1 -1
  14. package/dist/clients/web/assets/{blockDiagram-VD42YOAC-D2z0aL0I.js → blockDiagram-VD42YOAC-DO8Mj8oU.js} +1 -1
  15. package/dist/clients/web/assets/{c4Diagram-YG6GDRKO-ByIv3z1W.js → c4Diagram-YG6GDRKO-CMXabUI8.js} +1 -1
  16. package/dist/clients/web/assets/channel-BKaWMhr7.js +1 -0
  17. package/dist/clients/web/assets/{chunk-4BX2VUAB-DrPbd9N4.js → chunk-4BX2VUAB-BdwJfKs1.js} +1 -1
  18. package/dist/clients/web/assets/{chunk-55IACEB6-BoDPzIjE.js → chunk-55IACEB6-COxDwbWD.js} +1 -1
  19. package/dist/clients/web/assets/{chunk-B4BG7PRW-CM2YZtXd.js → chunk-B4BG7PRW-CbL8GmAN.js} +1 -1
  20. package/dist/clients/web/assets/{chunk-DI55MBZ5-4H2aa_y_.js → chunk-DI55MBZ5-BMbTRQzH.js} +1 -1
  21. package/dist/clients/web/assets/{chunk-FMBD7UC4-9_6jj8Fa.js → chunk-FMBD7UC4-1TxIBdW7.js} +1 -1
  22. package/dist/clients/web/assets/{chunk-QN33PNHL-DDgJe79T.js → chunk-QN33PNHL-KJIajClE.js} +1 -1
  23. package/dist/clients/web/assets/{chunk-QZHKN3VN-DtAYVGIR.js → chunk-QZHKN3VN-D41kt0rh.js} +1 -1
  24. package/dist/clients/web/assets/{chunk-TZMSLE5B-brEdW_Wx.js → chunk-TZMSLE5B-7WoYnea-.js} +1 -1
  25. package/dist/clients/web/assets/classDiagram-2ON5EDUG-Bfn69ffQ.js +1 -0
  26. package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-Bfn69ffQ.js +1 -0
  27. package/dist/clients/web/assets/clone-Uvk9xifz.js +1 -0
  28. package/dist/clients/web/assets/{cose-bilkent-S5V4N54A-lCOfQXtB.js → cose-bilkent-S5V4N54A-CvwtfU7-.js} +1 -1
  29. package/dist/clients/web/assets/{dagre-6UL2VRFP-D_pD2mTL.js → dagre-6UL2VRFP-DMvXT58T.js} +1 -1
  30. package/dist/clients/web/assets/{diagram-PSM6KHXK-Bu5J6kyW.js → diagram-PSM6KHXK-C1jTn75Q.js} +1 -1
  31. package/dist/clients/web/assets/{diagram-QEK2KX5R-CUVkZ3ve.js → diagram-QEK2KX5R-DDJlQWg6.js} +1 -1
  32. package/dist/clients/web/assets/{diagram-S2PKOQOG-mHERzzm4.js → diagram-S2PKOQOG-BpY8shnK.js} +1 -1
  33. package/dist/clients/web/assets/{erDiagram-Q2GNP2WA-CJRkSTX3.js → erDiagram-Q2GNP2WA-AF83pDzp.js} +1 -1
  34. package/dist/clients/web/assets/{flowDiagram-NV44I4VS-C0Y90ham.js → flowDiagram-NV44I4VS-CDE9ISic.js} +1 -1
  35. package/dist/clients/web/assets/{ganttDiagram-JELNMOA3-BdUVkpzH.js → ganttDiagram-JELNMOA3-tl9zS1K3.js} +1 -1
  36. package/dist/clients/web/assets/{gitGraphDiagram-NY62KEGX-BtrqYBNt.js → gitGraphDiagram-NY62KEGX-BGmXCmka.js} +1 -1
  37. package/dist/clients/web/assets/{graph-CHwi4EhD.js → graph-CwgcBGfY.js} +1 -1
  38. package/dist/clients/web/assets/index-BhkDi5B0.js +2 -0
  39. package/dist/clients/web/assets/{infoDiagram-WHAUD3N6-CILo2fKO.js → infoDiagram-WHAUD3N6-bNPb22yd.js} +1 -1
  40. package/dist/clients/web/assets/{journeyDiagram-XKPGCS4Q-Dpq5iNqi.js → journeyDiagram-XKPGCS4Q-CKSHNei7.js} +1 -1
  41. package/dist/clients/web/assets/{kanban-definition-3W4ZIXB7-Ct5y6xSX.js → kanban-definition-3W4ZIXB7-64KSCxdq.js} +1 -1
  42. package/dist/clients/web/assets/{layout-BnAA2IUO.js → layout-zF01hWxQ.js} +1 -1
  43. package/dist/clients/web/assets/{linear-2R4AdsOq.js → linear-D0Xsd-aa.js} +1 -1
  44. package/dist/clients/web/assets/{min-gW-yM5RQ.js → min-tLikK7rh.js} +1 -1
  45. package/dist/clients/web/assets/{mindmap-definition-VGOIOE7T-B0qidwDV.js → mindmap-definition-VGOIOE7T-DNQ9_VmS.js} +1 -1
  46. package/dist/clients/web/assets/{pieDiagram-ADFJNKIX-DlifPJiS.js → pieDiagram-ADFJNKIX-8fzGETjL.js} +1 -1
  47. package/dist/clients/web/assets/{quadrantDiagram-AYHSOK5B-Crn33A5s.js → quadrantDiagram-AYHSOK5B-yri91FWB.js} +1 -1
  48. package/dist/clients/web/assets/{requirementDiagram-UZGBJVZJ-D7ZEQ5Ko.js → requirementDiagram-UZGBJVZJ-Dz__UXpg.js} +1 -1
  49. package/dist/clients/web/assets/{sankeyDiagram-TZEHDZUN-CE4CxFqE.js → sankeyDiagram-TZEHDZUN-UKXSPrO_.js} +1 -1
  50. package/dist/clients/web/assets/{sequenceDiagram-WL72ISMW-BAaRV6XI.js → sequenceDiagram-WL72ISMW-CjFKts3v.js} +1 -1
  51. package/dist/clients/web/assets/{stateDiagram-FKZM4ZOC-DegPr2lo.js → stateDiagram-FKZM4ZOC-eoi13Ifa.js} +1 -1
  52. package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-BYlXltPP.js +1 -0
  53. package/dist/clients/web/assets/{timeline-definition-IT6M3QCI-DisR5qy_.js → timeline-definition-IT6M3QCI-BhkPk0iE.js} +1 -1
  54. package/dist/clients/web/assets/{treemap-KMMF4GRG-JpVr6-kW.js → treemap-KMMF4GRG-CwQwhUMV.js} +1 -1
  55. package/dist/clients/web/assets/{xychartDiagram-PRI3JC2R-otgrE-B-.js → xychartDiagram-PRI3JC2R-BQYvBeRp.js} +1 -1
  56. package/dist/clients/web/index.html +1 -1
  57. package/dist/skills/landmark/SKILL.md +4 -27
  58. package/dist/skills/simplify/SKILL.md +6 -43
  59. package/dist/workflows/analytics.md +7 -17
  60. package/dist/workflows/general.md +5 -7
  61. package/dist/workflows/memory.md +16 -0
  62. package/dist/workflows/programming.md +7 -25
  63. package/dist/workflows/recall.md +5 -11
  64. package/package.json +1 -2
  65. package/dist/clients/web/assets/channel-Dn1hKnnO.js +0 -1
  66. package/dist/clients/web/assets/classDiagram-2ON5EDUG-BdvHM_DJ.js +0 -1
  67. package/dist/clients/web/assets/classDiagram-v2-WZHVMYZB-BdvHM_DJ.js +0 -1
  68. package/dist/clients/web/assets/clone-cgW5GTJs.js +0 -1
  69. package/dist/clients/web/assets/index-CKVwxImE.js +0 -2
  70. package/dist/clients/web/assets/stateDiagram-v2-4FDKWEC3-D8PiOhPS.js +0 -1
@@ -1 +1 @@
1
- var t,i,s,e,h,r,a,n,o,c;import{s as l,g as u,q as f,p as x,a as p,b as d,_ as g,l as m,H as b,e as _,y,F as A,i as k,D as w,E as T,K as v,aA as S,R as M}from"./index-CKVwxImE.js";import{i as D}from"./init-C9Lo50Hz.js";import{o as E}from"./ordinal-2upbOM02.js";import{l as R}from"./linear-2R4AdsOq.js";import"./defaultLocale-DK_abR1s.js";function C(){var t,i,s=E().unknown(void 0),e=s.domain,h=s.range,r=0,a=1,n=!1,o=0,c=0,l=.5;function u(){var s=e().length,u=a<r,f=u?a:r,x=u?r:a;t=(x-f)/Math.max(1,s-o+2*c),n&&(t=Math.floor(t)),f+=(x-f-t*(s-o))*l,i=t*(1-o),n&&(f=Math.round(f),i=Math.round(i));var p=function(t,i,s){t=+t,i=+i,s=(h=arguments.length)<2?(i=t,t=0,1):h<3?1:+s;for(var e=-1,h=0|Math.max(0,Math.ceil((i-t)/s)),r=new Array(h);++e<h;)r[e]=t+e*s;return r}(s).map(function(i){return f+t*i});return h(u?p.reverse():p)}return delete s.unknown,s.domain=function(t){return arguments.length?(e(t),u()):e()},s.range=function(t){return arguments.length?([r,a]=t,r=+r,a=+a,u()):[r,a]},s.rangeRound=function(t){return[r,a]=t,r=+r,a=+a,n=!0,u()},s.bandwidth=function(){return i},s.step=function(){return t},s.round=function(t){return arguments.length?(n=!!t,u()):n},s.padding=function(t){return arguments.length?(o=Math.min(1,c=+t),u()):o},s.paddingInner=function(t){return arguments.length?(o=Math.min(1,t),u()):o},s.paddingOuter=function(t){return arguments.length?(c=+t,u()):c},s.align=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),u()):l},s.copy=function(){return C(e(),[r,a]).round(n).paddingInner(o).paddingOuter(c).align(l)},D.apply(u(),arguments)}var I=function(){var t=g(function(t,i,s,e){for(s=s||{},e=t.length;e--;s[t[e]]=i);return s},"o"),i=[1,10,12,14,16,18,19,21,23],s=[2,6],e=[1,3],h=[1,5],r=[1,6],a=[1,7],n=[1,5,10,12,14,16,18,19,21,23,34,35,36],o=[1,25],c=[1,26],l=[1,28],u=[1,29],f=[1,30],x=[1,31],p=[1,32],d=[1,33],m=[1,34],b=[1,35],_=[1,36],y=[1,37],A=[1,43],k=[1,42],w=[1,47],T=[1,50],v=[1,10,12,14,16,18,19,21,23,34,35,36],S=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],M=[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],D=[1,64],E={trace:g(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:g(function(t,i,s,e,h,r,a){var n=r.length-1;switch(h){case 5:e.setOrientation(r[n]);break;case 9:e.setDiagramTitle(r[n].text.trim());break;case 12:e.setLineData({text:"",type:"text"},r[n]);break;case 13:e.setLineData(r[n-1],r[n]);break;case 14:e.setBarData({text:"",type:"text"},r[n]);break;case 15:e.setBarData(r[n-1],r[n]);break;case 16:this.$=r[n].trim(),e.setAccTitle(this.$);break;case 17:case 18:this.$=r[n].trim(),e.setAccDescription(this.$);break;case 19:case 27:this.$=r[n-1];break;case 20:this.$=[Number(r[n-2]),...r[n]];break;case 21:this.$=[Number(r[n])];break;case 22:e.setXAxisTitle(r[n]);break;case 23:e.setXAxisTitle(r[n-1]);break;case 24:e.setXAxisTitle({type:"text",text:""});break;case 25:e.setXAxisBand(r[n]);break;case 26:e.setXAxisRangeData(Number(r[n-2]),Number(r[n]));break;case 28:this.$=[r[n-2],...r[n]];break;case 29:this.$=[r[n]];break;case 30:e.setYAxisTitle(r[n]);break;case 31:e.setYAxisTitle(r[n-1]);break;case 32:e.setYAxisTitle({type:"text",text:""});break;case 33:e.setYAxisRangeData(Number(r[n-2]),Number(r[n]));break;case 37:case 38:this.$={text:r[n],type:"text"};break;case 39:this.$={text:r[n],type:"markdown"};break;case 40:this.$=r[n];break;case 41:this.$=r[n-1]+""+r[n]}},"anonymous"),table:[t(i,s,{3:1,4:2,7:4,5:e,34:h,35:r,36:a}),{1:[3]},t(i,s,{4:2,7:4,3:8,5:e,34:h,35:r,36:a}),t(i,s,{4:2,7:4,6:9,3:10,5:e,8:[1,11],34:h,35:r,36:a}),{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]},t(n,[2,34]),t(n,[2,35]),t(n,[2,36]),{1:[2,1]},t(i,s,{4:2,7:4,3:21,5:e,34:h,35:r,36:a}),{1:[2,3]},t(n,[2,5]),t(i,[2,7],{4:22,34:h,35:r,36:a}),{11:23,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:39,13:38,24:A,27:k,29:40,30:41,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:45,15:44,27:w,33:46,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:49,17:48,24:T,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:52,17:51,24:T,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{20:[1,53]},{22:[1,54]},t(v,[2,18]),{1:[2,2]},t(v,[2,8]),t(v,[2,9]),t(S,[2,37],{40:55,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y}),t(S,[2,38]),t(S,[2,39]),t(M,[2,40]),t(M,[2,42]),t(M,[2,43]),t(M,[2,44]),t(M,[2,45]),t(M,[2,46]),t(M,[2,47]),t(M,[2,48]),t(M,[2,49]),t(M,[2,50]),t(M,[2,51]),t(v,[2,10]),t(v,[2,22],{30:41,29:56,24:A,27:k}),t(v,[2,24]),t(v,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},t(v,[2,11]),t(v,[2,30],{33:60,27:w}),t(v,[2,32]),{31:[1,61]},t(v,[2,12]),{17:62,24:T},{25:63,27:D},t(v,[2,14]),{17:65,24:T},t(v,[2,16]),t(v,[2,17]),t(M,[2,41]),t(v,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(v,[2,31]),{27:[1,69]},t(v,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(v,[2,15]),t(v,[2,26]),t(v,[2,27]),{11:59,32:72,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},t(v,[2,33]),t(v,[2,19]),{25:73,27:D},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:g(function(t,i){if(!i.recoverable){var s=new Error(t);throw s.hash=i,s}this.trace(t)},"parseError"),parse:g(function(t){var i=this,s=[0],e=[],h=[null],r=[],a=this.table,n="",o=0,c=0,l=r.slice.call(arguments,1),u=Object.create(this.lexer),f={yy:{}};for(var x in this.yy)Object.prototype.hasOwnProperty.call(this.yy,x)&&(f.yy[x]=this.yy[x]);u.setInput(t,f.yy),f.yy.lexer=u,f.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var p=u.yylloc;r.push(p);var d=u.options&&u.options.ranges;function m(){var t;return"number"!=typeof(t=e.pop()||u.lex()||1)&&(t instanceof Array&&(t=(e=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,g(function(t){s.length=s.length-2*t,h.length=h.length-t,r.length=r.length-t},"popStack"),g(m,"lex");for(var b,_,y,A,k,w,T,v,S={};;){if(_=s[s.length-1],this.defaultActions[_]?y=this.defaultActions[_]:(null==b&&(b=m()),y=a[_]&&a[_][b]),void 0===y||!y.length||!y[0]){var M="";for(k in v=[],a[_])this.terminals_[k]&&k>2&&v.push("'"+this.terminals_[k]+"'");M=u.showPosition?"Parse error on line "+(o+1)+":\n"+u.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(M,{text:u.match,token:this.terminals_[b]||b,line:u.yylineno,loc:p,expected:v})}if(y[0]instanceof Array&&y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(y[0]){case 1:s.push(b),h.push(u.yytext),r.push(u.yylloc),s.push(y[1]),b=null,c=u.yyleng,n=u.yytext,o=u.yylineno,p=u.yylloc;break;case 2:if(w=this.productions_[y[1]][1],S.$=h[h.length-w],S._$={first_line:r[r.length-(w||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(w||1)].first_column,last_column:r[r.length-1].last_column},d&&(S._$.range=[r[r.length-(w||1)].range[0],r[r.length-1].range[1]]),void 0!==(A=this.performAction.apply(S,[n,c,o,f.yy,y[1],h,r].concat(l))))return A;w&&(s=s.slice(0,-1*w*2),h=h.slice(0,-1*w),r=r.slice(0,-1*w)),s.push(this.productions_[y[1]][0]),h.push(S.$),r.push(S._$),T=a[s[s.length-2]][s[s.length-1]],s.push(T);break;case 3:return!0}}return!0},"parse")},R=function(){return{EOF:1,parseError:g(function(t,i){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,i)},"parseError"),setInput:g(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:g(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:g(function(t){var i=t.length,s=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 e=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),s.length-1&&(this.yylineno-=s.length-1);var h=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===e.length?this.yylloc.first_column:0)+e[e.length-s.length].length-s[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(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:g(function(t){this.unput(this.match.slice(t))},"less"),pastInput:g(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:g(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:g(function(){var t=this.pastInput(),i=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"},"showPosition"),test_match:g(function(t,i){var s,e,h;if(this.options.backtrack_lexer&&(h={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(h.yylloc.range=this.yylloc.range.slice(0))),(e=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.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],s=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in h)this[r]=h[r];return!1}return!1},"test_match"),next:g(function(){if(this.done)return this.EOF;var t,i,s,e;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),r=0;r<h.length;r++)if((s=this._input.match(this.rules[h[r]]))&&(!i||s[0].length>i[0].length)){if(i=s,e=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,h[r])))return t;if(this._backtrack){i=!1;continue}return!1}if(!this.options.flex)break}return i?!1!==(t=this.test_match(i,h[e]))&&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:g(function(){var t=this.next();return t||this.lex()},"lex"),begin:g(function(t){this.conditionStack.push(t)},"begin"),popState:g(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(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:g(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:g(function(t){this.begin(t)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:g(function(t,i,s,e){switch(s){case 0:case 1:case 5:case 44:break;case 2:case 3:return this.popState(),34;case 4:return 34;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:case 26:case 28:this.popState();break;case 13:return"acc_descr_multiline_value";case 14: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 27:this.pushState("string");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 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}}}}();function C(){this.yy={}}return E.lexer=R,g(C,"Parser"),C.prototype=E,E.Parser=C,new C}();I.parser=I;var L=I;function P(t){return"bar"===t.type}function $(t){return"band"===t.type}function N(t){return"linear"===t.type}g(P,"isBarPlot"),g($,"isBandAxisData"),g(N,"isLinearAxisData");var z=(g(t=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((t,i)=>Math.max(i.length,t),0)*i,height:i};const s={width:0,height:0},e=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const h of t){const t=S(e,1,h),r=t?t.width:h.length*i,a=t?t.height:i;s.width=Math.max(s.width,r),s.height=Math.max(s.height,a)}return e.remove(),s}},"TextDimensionCalculatorWithFont"),t),B=(g(i=class{constructor(t,i,s,e){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=e,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,"left"===this.axisPosition||"right"===this.axisPosition?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(){.7*this.getTickDistance()>2*this.outerPadding&&(this.outerPadding=Math.floor(.7*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 s=this.getLabelDimension(),e=.2*t.width;this.outerPadding=Math.min(s.width/2,e);const h=s.height+2*this.axisConfig.labelPadding;this.labelTextHeight=s.height,h<=i&&(i-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,s<=i&&(i-=s,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 s=this.getLabelDimension(),e=.2*t.height;this.outerPadding=Math.min(s.height/2,e);const h=s.width+2*this.axisConfig.labelPadding;h<=i&&(i-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,s<=i&&(i-=s,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return"left"===this.axisPosition||"right"===this.axisPosition?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(t=>({text:t.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(t),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(t=>({path:`M ${i},${this.getScaleValue(t)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(t)}`,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(t=>({text:t.toString(),x:this.getScaleValue(t),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(t=>({path:`M ${this.getScaleValue(t)},${i} L ${this.getScaleValue(t)},${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(t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+2*this.axisConfig.titlePadding: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(t=>({path:`M ${this.getScaleValue(t)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(t)},${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("left"===this.axisPosition)return this.getDrawableElementsForLeftAxis();if("right"===this.axisPosition)throw Error("Drawing of right axis is not implemented");return"bottom"===this.axisPosition?this.getDrawableElementsForBottomAxis():"top"===this.axisPosition?this.getDrawableElementsForTopAxis():[]}},"BaseAxis"),i),O=(g(s=class extends B{constructor(t,i,s,e,h){super(t,e,h,i),this.categories=s,this.scale=C().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=C().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),m.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},"BandAxis"),s),X=(g(e=class extends B{constructor(t,i,s,e,h){super(t,e,h,i),this.domain=s,this.scale=R().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];"left"===this.axisPosition&&t.reverse(),this.scale=R().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},"LinearAxis"),e);function F(t,i,s,e){const h=new z(e);return $(t)?new O(i,s,t.categories,t.title,h):new X(i,s,[t.min,t.max],t.title,h)}g(F,"getAxis");var U=(g(h=class{constructor(t,i,s,e){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=e,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),s=Math.max(i.width,t.width),e=i.height+2*this.chartConfig.titlePadding;return i.width<=s&&i.height<=e&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=e,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}},"ChartTitle"),h);function W(t,i,s,e){const h=new z(e);return new U(h,t,i,s)}g(W,"getChartTitleComponent");var Y=(g(r=class{constructor(t,i,s,e,h){this.plotData=t,this.xAxis=i,this.yAxis=s,this.orientation=e,this.plotIndex=h}getDrawableElement(){const t=this.plotData.data.map(t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]);let i;return i="horizontal"===this.orientation?M().y(t=>t[0]).x(t=>t[1])(t):M().x(t=>t[0]).y(t=>t[1])(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},"LinePlot"),r),j=(g(a=class{constructor(t,i,s,e,h,r){this.barData=t,this.boundingRect=i,this.xAxis=s,this.yAxis=e,this.orientation=h,this.plotIndex=r}getDrawableElement(){const t=this.barData.data.map(t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]),i=.95*Math.min(2*this.xAxis.getAxisOuterPadding(),this.xAxis.getTickDistance()),s=i/2;return"horizontal"===this.orientation?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(t=>({x:this.boundingRect.x,y:t[0]-s,height:i,width:t[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(t=>({x:t[0]-s,y:t[1],width:i,height:this.boundingRect.y+this.boundingRect.height-t[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},"BarPlot"),a),H=(g(n=class{constructor(t,i,s){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=s,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,s]of this.chartData.plots.entries())switch(s.type){case"line":{const e=new Y(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...e.getDrawableElement())}break;case"bar":{const e=new j(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...e.getDrawableElement())}}return t}},"BasePlot"),n);function V(t,i,s){return new H(t,i,s)}g(V,"getPlotComponent");var Q,G=(g(o=class{constructor(t,i,s,e){this.chartConfig=t,this.chartData=i,this.componentStore={title:W(t,i,s,e),plot:V(t,i,s),xAxis:F(i.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},e),yAxis:F(i.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},e)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,e=0,h=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),r=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),a=this.componentStore.plot.calculateSpace({width:h,height:r});t-=a.width,i-=a.height,a=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=a.height,i-=a.height,this.componentStore.xAxis.setAxisPosition("bottom"),a=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=a.height,this.componentStore.yAxis.setAxisPosition("left"),a=this.componentStore.yAxis.calculateSpace({width:t,height:i}),s=a.width,t-=a.width,t>0&&(h+=t,t=0),i>0&&(r+=i,i=0),this.componentStore.plot.calculateSpace({width:h,height:r}),this.componentStore.plot.setBoundingBoxXY({x:s,y:e}),this.componentStore.xAxis.setRange([s,s+h]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:e+r}),this.componentStore.yAxis.setRange([e,e+r]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:e}),this.chartData.plots.some(t=>P(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,e=0,h=0,r=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),n=this.componentStore.plot.calculateSpace({width:r,height:a});t-=n.width,i-=n.height,n=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=n.height,i-=n.height,this.componentStore.xAxis.setAxisPosition("left"),n=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=n.width,e=n.width,this.componentStore.yAxis.setAxisPosition("top"),n=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=n.height,h=s+n.height,t>0&&(r+=t,t=0),i>0&&(a+=i,i=0),this.componentStore.plot.calculateSpace({width:r,height:a}),this.componentStore.plot.setBoundingBoxXY({x:e,y:h}),this.componentStore.yAxis.setRange([e,e+r]),this.componentStore.yAxis.setBoundingBoxXY({x:e,y:s}),this.componentStore.xAxis.setRange([h,h+a]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:h}),this.chartData.plots.some(t=>P(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){"horizontal"===this.chartConfig.chartOrientation?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}},"Orchestrator"),o),K=(g(c=class{static build(t,i,s,e){return new G(t,i,s,e).getDrawableElement()}},"XYChartBuilder"),c),q=0,Z=rt(),J=ht(),tt=at(),it=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,et=!1;function ht(){const t=v(),i=A();return w(t.xyChart,i.themeVariables.xyChart)}function rt(){const t=A();return w(T.xyChart,t.xyChart)}function at(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function nt(t){const i=A();return k(t.trim(),i)}function ot(t){Q=t}function ct(t){Z.chartOrientation="horizontal"===t?"horizontal":"vertical"}function lt(t){tt.xAxis.title=nt(t.text)}function ut(t,i){tt.xAxis={type:"linear",title:tt.xAxis.title,min:t,max:i},st=!0}function ft(t){tt.xAxis={type:"band",title:tt.xAxis.title,categories:t.map(t=>nt(t.text))},st=!0}function xt(t){tt.yAxis.title=nt(t.text)}function pt(t,i){tt.yAxis={type:"linear",title:tt.yAxis.title,min:t,max:i},et=!0}function dt(t){const i=Math.min(...t),s=Math.max(...t),e=N(tt.yAxis)?tt.yAxis.min:1/0,h=N(tt.yAxis)?tt.yAxis.max:-1/0;tt.yAxis={type:"linear",title:tt.yAxis.title,min:Math.min(e,i),max:Math.max(h,s)}}function gt(t){let i=[];if(0===t.length)return i;if(!st){const i=N(tt.xAxis)?tt.xAxis.min:1/0,s=N(tt.xAxis)?tt.xAxis.max:-1/0;ut(Math.min(i,1),Math.max(s,t.length))}if(et||dt(t),$(tt.xAxis)&&(i=tt.xAxis.categories.map((i,s)=>[i,t[s]])),N(tt.xAxis)){const s=tt.xAxis.min,e=tt.xAxis.max,h=(e-s)/(t.length-1),r=[];for(let t=s;t<=e;t+=h)r.push(`${t}`);i=r.map((i,s)=>[i,t[s]])}return i}function mt(t){return it[0===t?0:t%it.length]}function bt(t,i){const s=gt(i);tt.plots.push({type:"line",strokeFill:mt(q),strokeWidth:2,data:s}),q++}function _t(t,i){const s=gt(i);tt.plots.push({type:"bar",fill:mt(q),data:s}),q++}function yt(){if(0===tt.plots.length)throw Error("No Plot to render, please provide a plot with some data");return tt.title=f(),K.build(Z,tt,J,Q)}function At(){return J}function kt(){return Z}function wt(){return tt}g(ht,"getChartDefaultThemeConfig"),g(rt,"getChartDefaultConfig"),g(at,"getChartDefaultData"),g(nt,"textSanitizer"),g(ot,"setTmpSVGG"),g(ct,"setOrientation"),g(lt,"setXAxisTitle"),g(ut,"setXAxisRangeData"),g(ft,"setXAxisBand"),g(xt,"setYAxisTitle"),g(pt,"setYAxisRangeData"),g(dt,"setYAxisRangeFromPlotData"),g(gt,"transformDataWithoutCategory"),g(mt,"getPlotColorFromPalette"),g(bt,"setLineData"),g(_t,"setBarData"),g(yt,"getDrawableElem"),g(At,"getChartThemeConfig"),g(kt,"getChartConfig"),g(wt,"getXYChartData");var Tt={parser:L,db:{getDrawableElem:yt,clear:g(function(){y(),q=0,Z=rt(),tt={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},J=ht(),it=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,et=!1},"clear"),setAccTitle:d,getAccTitle:p,setDiagramTitle:x,getDiagramTitle:f,getAccDescription:u,setAccDescription:l,setOrientation:ct,setXAxisTitle:lt,setXAxisRangeData:ut,setXAxisBand:ft,setYAxisTitle:xt,setYAxisRangeData:pt,setLineData:bt,setBarData:_t,setTmpSVGG:ot,getChartThemeConfig:At,getChartConfig:kt,getXYChartData:wt},renderer:{draw:g((t,i,s,e)=>{const h=e.db,r=h.getChartThemeConfig(),a=h.getChartConfig(),n=h.getXYChartData().plots[0].data.map(t=>t[1]);function o(t){return"top"===t?"text-before-edge":"middle"}function c(t){return"left"===t?"start":"right"===t?"end":"middle"}function l(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}g(o,"getDominantBaseLine"),g(c,"getTextAnchor"),g(l,"getTextTransformation"),m.debug("Rendering xychart chart\n"+t);const u=b(i),f=u.append("g").attr("class","main"),x=f.append("rect").attr("width",a.width).attr("height",a.height).attr("class","background");_(u,a.height,a.width,!0),u.attr("viewBox",`0 0 ${a.width} ${a.height}`),x.attr("fill",r.backgroundColor),h.setTmpSVGG(u.append("g").attr("class","mermaid-tmp-group"));const p=h.getDrawableElem(),d={};function y(t){let i=f,s="";for(const[e]of t.entries()){let h=f;e>0&&d[s]&&(h=d[s]),s+=t[e],i=d[s],i||(i=d[s]=h.append("g").attr("class",t[e]))}return i}g(y,"getGroup");for(const m of p){if(0===m.data.length)continue;const t=y(m.groupTexts);switch(m.type){case"rect":if(t.selectAll("rect").data(m.data).enter().append("rect").attr("x",t=>t.x).attr("y",t=>t.y).attr("width",t=>t.width).attr("height",t=>t.height).attr("fill",t=>t.fill).attr("stroke",t=>t.strokeFill).attr("stroke-width",t=>t.strokeWidth),a.showDataLabel)if("horizontal"===a.chartOrientation){let i=function(t,i){const{data:e,label:h}=t;return i*h.length*s<=e.width-10};g(i,"fitsHorizontally");const s=.7,e=m.data.map((t,i)=>({data:t,label:n[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),h=e.map(t=>{const{data:s}=t;let e=.7*s.height;for(;!i(t,e)&&e>0;)e-=1;return e}),r=Math.floor(Math.min(...h));t.selectAll("text").data(e).enter().append("text").attr("x",t=>t.data.x+t.data.width-10).attr("y",t=>t.data.y+t.data.height/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","black").attr("font-size",`${r}px`).text(t=>t.label)}else{let i=function(t,i,s){const{data:e,label:h}=t,r=i*h.length*.7,a=e.x+e.width/2,n=a+r/2,o=a-r/2>=e.x&&n<=e.x+e.width,c=e.y+s+i<=e.y+e.height;return o&&c};g(i,"fitsInBar");const s=10,e=m.data.map((t,i)=>({data:t,label:n[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),h=e.map(t=>{const{data:e,label:h}=t;let r=e.width/(.7*h.length);for(;!i(t,r,s)&&r>0;)r-=1;return r}),r=Math.floor(Math.min(...h));t.selectAll("text").data(e).enter().append("text").attr("x",t=>t.data.x+t.data.width/2).attr("y",t=>t.data.y+s).attr("text-anchor","middle").attr("dominant-baseline","hanging").attr("fill","black").attr("font-size",`${r}px`).text(t=>t.label)}break;case"text":t.selectAll("text").data(m.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",t=>t.fill).attr("font-size",t=>t.fontSize).attr("dominant-baseline",t=>o(t.verticalPos)).attr("text-anchor",t=>c(t.horizontalPos)).attr("transform",t=>l(t)).text(t=>t.text);break;case"path":t.selectAll("path").data(m.data).enter().append("path").attr("d",t=>t.path).attr("fill",t=>t.fill?t.fill:"none").attr("stroke",t=>t.strokeFill).attr("stroke-width",t=>t.strokeWidth)}}},"draw")}};export{Tt as diagram};
1
+ var t,i,s,e,h,r,a,n,o,c;import{s as l,g as u,q as f,p as x,a as p,b as d,_ as g,l as m,H as b,e as _,y,F as A,i as k,D as w,E as T,K as v,aA as S,R as M}from"./index-BhkDi5B0.js";import{i as D}from"./init-C9Lo50Hz.js";import{o as E}from"./ordinal-2upbOM02.js";import{l as R}from"./linear-D0Xsd-aa.js";import"./defaultLocale-DK_abR1s.js";function C(){var t,i,s=E().unknown(void 0),e=s.domain,h=s.range,r=0,a=1,n=!1,o=0,c=0,l=.5;function u(){var s=e().length,u=a<r,f=u?a:r,x=u?r:a;t=(x-f)/Math.max(1,s-o+2*c),n&&(t=Math.floor(t)),f+=(x-f-t*(s-o))*l,i=t*(1-o),n&&(f=Math.round(f),i=Math.round(i));var p=function(t,i,s){t=+t,i=+i,s=(h=arguments.length)<2?(i=t,t=0,1):h<3?1:+s;for(var e=-1,h=0|Math.max(0,Math.ceil((i-t)/s)),r=new Array(h);++e<h;)r[e]=t+e*s;return r}(s).map(function(i){return f+t*i});return h(u?p.reverse():p)}return delete s.unknown,s.domain=function(t){return arguments.length?(e(t),u()):e()},s.range=function(t){return arguments.length?([r,a]=t,r=+r,a=+a,u()):[r,a]},s.rangeRound=function(t){return[r,a]=t,r=+r,a=+a,n=!0,u()},s.bandwidth=function(){return i},s.step=function(){return t},s.round=function(t){return arguments.length?(n=!!t,u()):n},s.padding=function(t){return arguments.length?(o=Math.min(1,c=+t),u()):o},s.paddingInner=function(t){return arguments.length?(o=Math.min(1,t),u()):o},s.paddingOuter=function(t){return arguments.length?(c=+t,u()):c},s.align=function(t){return arguments.length?(l=Math.max(0,Math.min(1,t)),u()):l},s.copy=function(){return C(e(),[r,a]).round(n).paddingInner(o).paddingOuter(c).align(l)},D.apply(u(),arguments)}var I=function(){var t=g(function(t,i,s,e){for(s=s||{},e=t.length;e--;s[t[e]]=i);return s},"o"),i=[1,10,12,14,16,18,19,21,23],s=[2,6],e=[1,3],h=[1,5],r=[1,6],a=[1,7],n=[1,5,10,12,14,16,18,19,21,23,34,35,36],o=[1,25],c=[1,26],l=[1,28],u=[1,29],f=[1,30],x=[1,31],p=[1,32],d=[1,33],m=[1,34],b=[1,35],_=[1,36],y=[1,37],A=[1,43],k=[1,42],w=[1,47],T=[1,50],v=[1,10,12,14,16,18,19,21,23,34,35,36],S=[1,10,12,14,16,18,19,21,23,24,26,27,28,34,35,36],M=[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],D=[1,64],E={trace:g(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:g(function(t,i,s,e,h,r,a){var n=r.length-1;switch(h){case 5:e.setOrientation(r[n]);break;case 9:e.setDiagramTitle(r[n].text.trim());break;case 12:e.setLineData({text:"",type:"text"},r[n]);break;case 13:e.setLineData(r[n-1],r[n]);break;case 14:e.setBarData({text:"",type:"text"},r[n]);break;case 15:e.setBarData(r[n-1],r[n]);break;case 16:this.$=r[n].trim(),e.setAccTitle(this.$);break;case 17:case 18:this.$=r[n].trim(),e.setAccDescription(this.$);break;case 19:case 27:this.$=r[n-1];break;case 20:this.$=[Number(r[n-2]),...r[n]];break;case 21:this.$=[Number(r[n])];break;case 22:e.setXAxisTitle(r[n]);break;case 23:e.setXAxisTitle(r[n-1]);break;case 24:e.setXAxisTitle({type:"text",text:""});break;case 25:e.setXAxisBand(r[n]);break;case 26:e.setXAxisRangeData(Number(r[n-2]),Number(r[n]));break;case 28:this.$=[r[n-2],...r[n]];break;case 29:this.$=[r[n]];break;case 30:e.setYAxisTitle(r[n]);break;case 31:e.setYAxisTitle(r[n-1]);break;case 32:e.setYAxisTitle({type:"text",text:""});break;case 33:e.setYAxisRangeData(Number(r[n-2]),Number(r[n]));break;case 37:case 38:this.$={text:r[n],type:"text"};break;case 39:this.$={text:r[n],type:"markdown"};break;case 40:this.$=r[n];break;case 41:this.$=r[n-1]+""+r[n]}},"anonymous"),table:[t(i,s,{3:1,4:2,7:4,5:e,34:h,35:r,36:a}),{1:[3]},t(i,s,{4:2,7:4,3:8,5:e,34:h,35:r,36:a}),t(i,s,{4:2,7:4,6:9,3:10,5:e,8:[1,11],34:h,35:r,36:a}),{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]},t(n,[2,34]),t(n,[2,35]),t(n,[2,36]),{1:[2,1]},t(i,s,{4:2,7:4,3:21,5:e,34:h,35:r,36:a}),{1:[2,3]},t(n,[2,5]),t(i,[2,7],{4:22,34:h,35:r,36:a}),{11:23,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:39,13:38,24:A,27:k,29:40,30:41,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:45,15:44,27:w,33:46,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:49,17:48,24:T,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{11:52,17:51,24:T,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},{20:[1,53]},{22:[1,54]},t(v,[2,18]),{1:[2,2]},t(v,[2,8]),t(v,[2,9]),t(S,[2,37],{40:55,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y}),t(S,[2,38]),t(S,[2,39]),t(M,[2,40]),t(M,[2,42]),t(M,[2,43]),t(M,[2,44]),t(M,[2,45]),t(M,[2,46]),t(M,[2,47]),t(M,[2,48]),t(M,[2,49]),t(M,[2,50]),t(M,[2,51]),t(v,[2,10]),t(v,[2,22],{30:41,29:56,24:A,27:k}),t(v,[2,24]),t(v,[2,25]),{31:[1,57]},{11:59,32:58,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},t(v,[2,11]),t(v,[2,30],{33:60,27:w}),t(v,[2,32]),{31:[1,61]},t(v,[2,12]),{17:62,24:T},{25:63,27:D},t(v,[2,14]),{17:65,24:T},t(v,[2,16]),t(v,[2,17]),t(M,[2,41]),t(v,[2,23]),{27:[1,66]},{26:[1,67]},{26:[2,29],28:[1,68]},t(v,[2,31]),{27:[1,69]},t(v,[2,13]),{26:[1,70]},{26:[2,21],28:[1,71]},t(v,[2,15]),t(v,[2,26]),t(v,[2,27]),{11:59,32:72,37:24,38:o,39:c,40:27,41:l,42:u,43:f,44:x,45:p,46:d,47:m,48:b,49:_,50:y},t(v,[2,33]),t(v,[2,19]),{25:73,27:D},{26:[2,28]},{26:[2,20]}],defaultActions:{8:[2,1],10:[2,3],21:[2,2],72:[2,28],73:[2,20]},parseError:g(function(t,i){if(!i.recoverable){var s=new Error(t);throw s.hash=i,s}this.trace(t)},"parseError"),parse:g(function(t){var i=this,s=[0],e=[],h=[null],r=[],a=this.table,n="",o=0,c=0,l=r.slice.call(arguments,1),u=Object.create(this.lexer),f={yy:{}};for(var x in this.yy)Object.prototype.hasOwnProperty.call(this.yy,x)&&(f.yy[x]=this.yy[x]);u.setInput(t,f.yy),f.yy.lexer=u,f.yy.parser=this,void 0===u.yylloc&&(u.yylloc={});var p=u.yylloc;r.push(p);var d=u.options&&u.options.ranges;function m(){var t;return"number"!=typeof(t=e.pop()||u.lex()||1)&&(t instanceof Array&&(t=(e=t).pop()),t=i.symbols_[t]||t),t}"function"==typeof f.yy.parseError?this.parseError=f.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError,g(function(t){s.length=s.length-2*t,h.length=h.length-t,r.length=r.length-t},"popStack"),g(m,"lex");for(var b,_,y,A,k,w,T,v,S={};;){if(_=s[s.length-1],this.defaultActions[_]?y=this.defaultActions[_]:(null==b&&(b=m()),y=a[_]&&a[_][b]),void 0===y||!y.length||!y[0]){var M="";for(k in v=[],a[_])this.terminals_[k]&&k>2&&v.push("'"+this.terminals_[k]+"'");M=u.showPosition?"Parse error on line "+(o+1)+":\n"+u.showPosition()+"\nExpecting "+v.join(", ")+", got '"+(this.terminals_[b]||b)+"'":"Parse error on line "+(o+1)+": Unexpected "+(1==b?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(M,{text:u.match,token:this.terminals_[b]||b,line:u.yylineno,loc:p,expected:v})}if(y[0]instanceof Array&&y.length>1)throw new Error("Parse Error: multiple actions possible at state: "+_+", token: "+b);switch(y[0]){case 1:s.push(b),h.push(u.yytext),r.push(u.yylloc),s.push(y[1]),b=null,c=u.yyleng,n=u.yytext,o=u.yylineno,p=u.yylloc;break;case 2:if(w=this.productions_[y[1]][1],S.$=h[h.length-w],S._$={first_line:r[r.length-(w||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(w||1)].first_column,last_column:r[r.length-1].last_column},d&&(S._$.range=[r[r.length-(w||1)].range[0],r[r.length-1].range[1]]),void 0!==(A=this.performAction.apply(S,[n,c,o,f.yy,y[1],h,r].concat(l))))return A;w&&(s=s.slice(0,-1*w*2),h=h.slice(0,-1*w),r=r.slice(0,-1*w)),s.push(this.productions_[y[1]][0]),h.push(S.$),r.push(S._$),T=a[s[s.length-2]][s[s.length-1]],s.push(T);break;case 3:return!0}}return!0},"parse")},R=function(){return{EOF:1,parseError:g(function(t,i){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,i)},"parseError"),setInput:g(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:g(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:g(function(t){var i=t.length,s=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 e=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),s.length-1&&(this.yylineno-=s.length-1);var h=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:s?(s.length===e.length?this.yylloc.first_column:0)+e[e.length-s.length].length-s[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[h[0],h[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:g(function(){return this._more=!0,this},"more"),reject:g(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:g(function(t){this.unput(this.match.slice(t))},"less"),pastInput:g(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:g(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:g(function(){var t=this.pastInput(),i=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+i+"^"},"showPosition"),test_match:g(function(t,i){var s,e,h;if(this.options.backtrack_lexer&&(h={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(h.yylloc.range=this.yylloc.range.slice(0))),(e=t[0].match(/(?:\r\n?|\n).*/g))&&(this.yylineno+=e.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:e?e[e.length-1].length-e[e.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],s=this.performAction.call(this,this.yy,this,i,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),s)return s;if(this._backtrack){for(var r in h)this[r]=h[r];return!1}return!1},"test_match"),next:g(function(){if(this.done)return this.EOF;var t,i,s,e;this._input||(this.done=!0),this._more||(this.yytext="",this.match="");for(var h=this._currentRules(),r=0;r<h.length;r++)if((s=this._input.match(this.rules[h[r]]))&&(!i||s[0].length>i[0].length)){if(i=s,e=r,this.options.backtrack_lexer){if(!1!==(t=this.test_match(s,h[r])))return t;if(this._backtrack){i=!1;continue}return!1}if(!this.options.flex)break}return i?!1!==(t=this.test_match(i,h[e]))&&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:g(function(){var t=this.next();return t||this.lex()},"lex"),begin:g(function(t){this.conditionStack.push(t)},"begin"),popState:g(function(){return this.conditionStack.length-1>0?this.conditionStack.pop():this.conditionStack[0]},"popState"),_currentRules:g(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:g(function(t){return(t=this.conditionStack.length-1-Math.abs(t||0))>=0?this.conditionStack[t]:"INITIAL"},"topState"),pushState:g(function(t){this.begin(t)},"pushState"),stateStackSize:g(function(){return this.conditionStack.length},"stateStackSize"),options:{"case-insensitive":!0},performAction:g(function(t,i,s,e){switch(s){case 0:case 1:case 5:case 44:break;case 2:case 3:return this.popState(),34;case 4:return 34;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:case 26:case 28:this.popState();break;case 13:return"acc_descr_multiline_value";case 14: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 27:this.pushState("string");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 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}}}}();function C(){this.yy={}}return E.lexer=R,g(C,"Parser"),C.prototype=E,E.Parser=C,new C}();I.parser=I;var L=I;function P(t){return"bar"===t.type}function $(t){return"band"===t.type}function N(t){return"linear"===t.type}g(P,"isBarPlot"),g($,"isBandAxisData"),g(N,"isLinearAxisData");var z=(g(t=class{constructor(t){this.parentGroup=t}getMaxDimension(t,i){if(!this.parentGroup)return{width:t.reduce((t,i)=>Math.max(i.length,t),0)*i,height:i};const s={width:0,height:0},e=this.parentGroup.append("g").attr("visibility","hidden").attr("font-size",i);for(const h of t){const t=S(e,1,h),r=t?t.width:h.length*i,a=t?t.height:i;s.width=Math.max(s.width,r),s.height=Math.max(s.height,a)}return e.remove(),s}},"TextDimensionCalculatorWithFont"),t),B=(g(i=class{constructor(t,i,s,e){this.axisConfig=t,this.title=i,this.textDimensionCalculator=s,this.axisThemeConfig=e,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,"left"===this.axisPosition||"right"===this.axisPosition?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(){.7*this.getTickDistance()>2*this.outerPadding&&(this.outerPadding=Math.floor(.7*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 s=this.getLabelDimension(),e=.2*t.width;this.outerPadding=Math.min(s.width/2,e);const h=s.height+2*this.axisConfig.labelPadding;this.labelTextHeight=s.height,h<=i&&(i-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,s<=i&&(i-=s,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 s=this.getLabelDimension(),e=.2*t.height;this.outerPadding=Math.min(s.height/2,e);const h=s.width+2*this.axisConfig.labelPadding;h<=i&&(i-=h,this.showLabel=!0)}if(this.axisConfig.showTick&&i>=this.axisConfig.tickLength&&(this.showTick=!0,i-=this.axisConfig.tickLength),this.axisConfig.showTitle&&this.title){const t=this.textDimensionCalculator.getMaxDimension([this.title],this.axisConfig.titleFontSize),s=t.height+2*this.axisConfig.titlePadding;this.titleTextHeight=t.height,s<=i&&(i-=s,this.showTitle=!0)}this.boundingRect.width=t.width-i,this.boundingRect.height=t.height}calculateSpace(t){return"left"===this.axisPosition||"right"===this.axisPosition?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(t=>({text:t.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(t),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(t=>({path:`M ${i},${this.getScaleValue(t)} L ${i-this.axisConfig.tickLength},${this.getScaleValue(t)}`,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(t=>({text:t.toString(),x:this.getScaleValue(t),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(t=>({path:`M ${this.getScaleValue(t)},${i} L ${this.getScaleValue(t)},${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(t=>({text:t.toString(),x:this.getScaleValue(t),y:this.boundingRect.y+(this.showTitle?this.titleTextHeight+2*this.axisConfig.titlePadding: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(t=>({path:`M ${this.getScaleValue(t)},${i+this.boundingRect.height-(this.showAxisLine?this.axisConfig.axisLineWidth:0)} L ${this.getScaleValue(t)},${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("left"===this.axisPosition)return this.getDrawableElementsForLeftAxis();if("right"===this.axisPosition)throw Error("Drawing of right axis is not implemented");return"bottom"===this.axisPosition?this.getDrawableElementsForBottomAxis():"top"===this.axisPosition?this.getDrawableElementsForTopAxis():[]}},"BaseAxis"),i),O=(g(s=class extends B{constructor(t,i,s,e,h){super(t,e,h,i),this.categories=s,this.scale=C().domain(this.categories).range(this.getRange())}setRange(t){super.setRange(t)}recalculateScale(){this.scale=C().domain(this.categories).range(this.getRange()).paddingInner(1).paddingOuter(0).align(.5),m.trace("BandAxis axis final categories, range: ",this.categories,this.getRange())}getTickValues(){return this.categories}getScaleValue(t){return this.scale(t)??this.getRange()[0]}},"BandAxis"),s),X=(g(e=class extends B{constructor(t,i,s,e,h){super(t,e,h,i),this.domain=s,this.scale=R().domain(this.domain).range(this.getRange())}getTickValues(){return this.scale.ticks()}recalculateScale(){const t=[...this.domain];"left"===this.axisPosition&&t.reverse(),this.scale=R().domain(t).range(this.getRange())}getScaleValue(t){return this.scale(t)}},"LinearAxis"),e);function F(t,i,s,e){const h=new z(e);return $(t)?new O(i,s,t.categories,t.title,h):new X(i,s,[t.min,t.max],t.title,h)}g(F,"getAxis");var U=(g(h=class{constructor(t,i,s,e){this.textDimensionCalculator=t,this.chartConfig=i,this.chartData=s,this.chartThemeConfig=e,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),s=Math.max(i.width,t.width),e=i.height+2*this.chartConfig.titlePadding;return i.width<=s&&i.height<=e&&this.chartConfig.showTitle&&this.chartData.title&&(this.boundingRect.width=s,this.boundingRect.height=e,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}},"ChartTitle"),h);function W(t,i,s,e){const h=new z(e);return new U(h,t,i,s)}g(W,"getChartTitleComponent");var Y=(g(r=class{constructor(t,i,s,e,h){this.plotData=t,this.xAxis=i,this.yAxis=s,this.orientation=e,this.plotIndex=h}getDrawableElement(){const t=this.plotData.data.map(t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]);let i;return i="horizontal"===this.orientation?M().y(t=>t[0]).x(t=>t[1])(t):M().x(t=>t[0]).y(t=>t[1])(t),i?[{groupTexts:["plot",`line-plot-${this.plotIndex}`],type:"path",data:[{path:i,strokeFill:this.plotData.strokeFill,strokeWidth:this.plotData.strokeWidth}]}]:[]}},"LinePlot"),r),j=(g(a=class{constructor(t,i,s,e,h,r){this.barData=t,this.boundingRect=i,this.xAxis=s,this.yAxis=e,this.orientation=h,this.plotIndex=r}getDrawableElement(){const t=this.barData.data.map(t=>[this.xAxis.getScaleValue(t[0]),this.yAxis.getScaleValue(t[1])]),i=.95*Math.min(2*this.xAxis.getAxisOuterPadding(),this.xAxis.getTickDistance()),s=i/2;return"horizontal"===this.orientation?[{groupTexts:["plot",`bar-plot-${this.plotIndex}`],type:"rect",data:t.map(t=>({x:this.boundingRect.x,y:t[0]-s,height:i,width:t[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(t=>({x:t[0]-s,y:t[1],width:i,height:this.boundingRect.y+this.boundingRect.height-t[1],fill:this.barData.fill,strokeWidth:0,strokeFill:this.barData.fill}))}]}},"BarPlot"),a),H=(g(n=class{constructor(t,i,s){this.chartConfig=t,this.chartData=i,this.chartThemeConfig=s,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,s]of this.chartData.plots.entries())switch(s.type){case"line":{const e=new Y(s,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...e.getDrawableElement())}break;case"bar":{const e=new j(s,this.boundingRect,this.xAxis,this.yAxis,this.chartConfig.chartOrientation,i);t.push(...e.getDrawableElement())}}return t}},"BasePlot"),n);function V(t,i,s){return new H(t,i,s)}g(V,"getPlotComponent");var Q,G=(g(o=class{constructor(t,i,s,e){this.chartConfig=t,this.chartData=i,this.componentStore={title:W(t,i,s,e),plot:V(t,i,s),xAxis:F(i.xAxis,t.xAxis,{titleColor:s.xAxisTitleColor,labelColor:s.xAxisLabelColor,tickColor:s.xAxisTickColor,axisLineColor:s.xAxisLineColor},e),yAxis:F(i.yAxis,t.yAxis,{titleColor:s.yAxisTitleColor,labelColor:s.yAxisLabelColor,tickColor:s.yAxisTickColor,axisLineColor:s.yAxisLineColor},e)}}calculateVerticalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,e=0,h=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),r=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),a=this.componentStore.plot.calculateSpace({width:h,height:r});t-=a.width,i-=a.height,a=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),e=a.height,i-=a.height,this.componentStore.xAxis.setAxisPosition("bottom"),a=this.componentStore.xAxis.calculateSpace({width:t,height:i}),i-=a.height,this.componentStore.yAxis.setAxisPosition("left"),a=this.componentStore.yAxis.calculateSpace({width:t,height:i}),s=a.width,t-=a.width,t>0&&(h+=t,t=0),i>0&&(r+=i,i=0),this.componentStore.plot.calculateSpace({width:h,height:r}),this.componentStore.plot.setBoundingBoxXY({x:s,y:e}),this.componentStore.xAxis.setRange([s,s+h]),this.componentStore.xAxis.setBoundingBoxXY({x:s,y:e+r}),this.componentStore.yAxis.setRange([e,e+r]),this.componentStore.yAxis.setBoundingBoxXY({x:0,y:e}),this.chartData.plots.some(t=>P(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateHorizontalSpace(){let t=this.chartConfig.width,i=this.chartConfig.height,s=0,e=0,h=0,r=Math.floor(t*this.chartConfig.plotReservedSpacePercent/100),a=Math.floor(i*this.chartConfig.plotReservedSpacePercent/100),n=this.componentStore.plot.calculateSpace({width:r,height:a});t-=n.width,i-=n.height,n=this.componentStore.title.calculateSpace({width:this.chartConfig.width,height:i}),s=n.height,i-=n.height,this.componentStore.xAxis.setAxisPosition("left"),n=this.componentStore.xAxis.calculateSpace({width:t,height:i}),t-=n.width,e=n.width,this.componentStore.yAxis.setAxisPosition("top"),n=this.componentStore.yAxis.calculateSpace({width:t,height:i}),i-=n.height,h=s+n.height,t>0&&(r+=t,t=0),i>0&&(a+=i,i=0),this.componentStore.plot.calculateSpace({width:r,height:a}),this.componentStore.plot.setBoundingBoxXY({x:e,y:h}),this.componentStore.yAxis.setRange([e,e+r]),this.componentStore.yAxis.setBoundingBoxXY({x:e,y:s}),this.componentStore.xAxis.setRange([h,h+a]),this.componentStore.xAxis.setBoundingBoxXY({x:0,y:h}),this.chartData.plots.some(t=>P(t))&&this.componentStore.xAxis.recalculateOuterPaddingToDrawBar()}calculateSpace(){"horizontal"===this.chartConfig.chartOrientation?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}},"Orchestrator"),o),K=(g(c=class{static build(t,i,s,e){return new G(t,i,s,e).getDrawableElement()}},"XYChartBuilder"),c),q=0,Z=rt(),J=ht(),tt=at(),it=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,et=!1;function ht(){const t=v(),i=A();return w(t.xyChart,i.themeVariables.xyChart)}function rt(){const t=A();return w(T.xyChart,t.xyChart)}function at(){return{yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]}}function nt(t){const i=A();return k(t.trim(),i)}function ot(t){Q=t}function ct(t){Z.chartOrientation="horizontal"===t?"horizontal":"vertical"}function lt(t){tt.xAxis.title=nt(t.text)}function ut(t,i){tt.xAxis={type:"linear",title:tt.xAxis.title,min:t,max:i},st=!0}function ft(t){tt.xAxis={type:"band",title:tt.xAxis.title,categories:t.map(t=>nt(t.text))},st=!0}function xt(t){tt.yAxis.title=nt(t.text)}function pt(t,i){tt.yAxis={type:"linear",title:tt.yAxis.title,min:t,max:i},et=!0}function dt(t){const i=Math.min(...t),s=Math.max(...t),e=N(tt.yAxis)?tt.yAxis.min:1/0,h=N(tt.yAxis)?tt.yAxis.max:-1/0;tt.yAxis={type:"linear",title:tt.yAxis.title,min:Math.min(e,i),max:Math.max(h,s)}}function gt(t){let i=[];if(0===t.length)return i;if(!st){const i=N(tt.xAxis)?tt.xAxis.min:1/0,s=N(tt.xAxis)?tt.xAxis.max:-1/0;ut(Math.min(i,1),Math.max(s,t.length))}if(et||dt(t),$(tt.xAxis)&&(i=tt.xAxis.categories.map((i,s)=>[i,t[s]])),N(tt.xAxis)){const s=tt.xAxis.min,e=tt.xAxis.max,h=(e-s)/(t.length-1),r=[];for(let t=s;t<=e;t+=h)r.push(`${t}`);i=r.map((i,s)=>[i,t[s]])}return i}function mt(t){return it[0===t?0:t%it.length]}function bt(t,i){const s=gt(i);tt.plots.push({type:"line",strokeFill:mt(q),strokeWidth:2,data:s}),q++}function _t(t,i){const s=gt(i);tt.plots.push({type:"bar",fill:mt(q),data:s}),q++}function yt(){if(0===tt.plots.length)throw Error("No Plot to render, please provide a plot with some data");return tt.title=f(),K.build(Z,tt,J,Q)}function At(){return J}function kt(){return Z}function wt(){return tt}g(ht,"getChartDefaultThemeConfig"),g(rt,"getChartDefaultConfig"),g(at,"getChartDefaultData"),g(nt,"textSanitizer"),g(ot,"setTmpSVGG"),g(ct,"setOrientation"),g(lt,"setXAxisTitle"),g(ut,"setXAxisRangeData"),g(ft,"setXAxisBand"),g(xt,"setYAxisTitle"),g(pt,"setYAxisRangeData"),g(dt,"setYAxisRangeFromPlotData"),g(gt,"transformDataWithoutCategory"),g(mt,"getPlotColorFromPalette"),g(bt,"setLineData"),g(_t,"setBarData"),g(yt,"getDrawableElem"),g(At,"getChartThemeConfig"),g(kt,"getChartConfig"),g(wt,"getXYChartData");var Tt={parser:L,db:{getDrawableElem:yt,clear:g(function(){y(),q=0,Z=rt(),tt={yAxis:{type:"linear",title:"",min:1/0,max:-1/0},xAxis:{type:"band",title:"",categories:[]},title:"",plots:[]},J=ht(),it=J.plotColorPalette.split(",").map(t=>t.trim()),st=!1,et=!1},"clear"),setAccTitle:d,getAccTitle:p,setDiagramTitle:x,getDiagramTitle:f,getAccDescription:u,setAccDescription:l,setOrientation:ct,setXAxisTitle:lt,setXAxisRangeData:ut,setXAxisBand:ft,setYAxisTitle:xt,setYAxisRangeData:pt,setLineData:bt,setBarData:_t,setTmpSVGG:ot,getChartThemeConfig:At,getChartConfig:kt,getXYChartData:wt},renderer:{draw:g((t,i,s,e)=>{const h=e.db,r=h.getChartThemeConfig(),a=h.getChartConfig(),n=h.getXYChartData().plots[0].data.map(t=>t[1]);function o(t){return"top"===t?"text-before-edge":"middle"}function c(t){return"left"===t?"start":"right"===t?"end":"middle"}function l(t){return`translate(${t.x}, ${t.y}) rotate(${t.rotation||0})`}g(o,"getDominantBaseLine"),g(c,"getTextAnchor"),g(l,"getTextTransformation"),m.debug("Rendering xychart chart\n"+t);const u=b(i),f=u.append("g").attr("class","main"),x=f.append("rect").attr("width",a.width).attr("height",a.height).attr("class","background");_(u,a.height,a.width,!0),u.attr("viewBox",`0 0 ${a.width} ${a.height}`),x.attr("fill",r.backgroundColor),h.setTmpSVGG(u.append("g").attr("class","mermaid-tmp-group"));const p=h.getDrawableElem(),d={};function y(t){let i=f,s="";for(const[e]of t.entries()){let h=f;e>0&&d[s]&&(h=d[s]),s+=t[e],i=d[s],i||(i=d[s]=h.append("g").attr("class",t[e]))}return i}g(y,"getGroup");for(const m of p){if(0===m.data.length)continue;const t=y(m.groupTexts);switch(m.type){case"rect":if(t.selectAll("rect").data(m.data).enter().append("rect").attr("x",t=>t.x).attr("y",t=>t.y).attr("width",t=>t.width).attr("height",t=>t.height).attr("fill",t=>t.fill).attr("stroke",t=>t.strokeFill).attr("stroke-width",t=>t.strokeWidth),a.showDataLabel)if("horizontal"===a.chartOrientation){let i=function(t,i){const{data:e,label:h}=t;return i*h.length*s<=e.width-10};g(i,"fitsHorizontally");const s=.7,e=m.data.map((t,i)=>({data:t,label:n[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),h=e.map(t=>{const{data:s}=t;let e=.7*s.height;for(;!i(t,e)&&e>0;)e-=1;return e}),r=Math.floor(Math.min(...h));t.selectAll("text").data(e).enter().append("text").attr("x",t=>t.data.x+t.data.width-10).attr("y",t=>t.data.y+t.data.height/2).attr("text-anchor","end").attr("dominant-baseline","middle").attr("fill","black").attr("font-size",`${r}px`).text(t=>t.label)}else{let i=function(t,i,s){const{data:e,label:h}=t,r=i*h.length*.7,a=e.x+e.width/2,n=a+r/2,o=a-r/2>=e.x&&n<=e.x+e.width,c=e.y+s+i<=e.y+e.height;return o&&c};g(i,"fitsInBar");const s=10,e=m.data.map((t,i)=>({data:t,label:n[i].toString()})).filter(t=>t.data.width>0&&t.data.height>0),h=e.map(t=>{const{data:e,label:h}=t;let r=e.width/(.7*h.length);for(;!i(t,r,s)&&r>0;)r-=1;return r}),r=Math.floor(Math.min(...h));t.selectAll("text").data(e).enter().append("text").attr("x",t=>t.data.x+t.data.width/2).attr("y",t=>t.data.y+s).attr("text-anchor","middle").attr("dominant-baseline","hanging").attr("fill","black").attr("font-size",`${r}px`).text(t=>t.label)}break;case"text":t.selectAll("text").data(m.data).enter().append("text").attr("x",0).attr("y",0).attr("fill",t=>t.fill).attr("font-size",t=>t.fontSize).attr("dominant-baseline",t=>o(t.verticalPos)).attr("text-anchor",t=>c(t.horizontalPos)).attr("transform",t=>l(t)).text(t=>t.text);break;case"path":t.selectAll("path").data(m.data).enter().append("path").attr("d",t=>t.path).attr("fill",t=>t.fill?t.fill:"none").attr("stroke",t=>t.strokeFill).attr("stroke-width",t=>t.strokeWidth)}}},"draw")}};export{Tt as diagram};
@@ -9,7 +9,7 @@
9
9
  <meta name="mobile-web-app-capable" content="yes" />
10
10
  <link rel="icon" type="image/png" href="/favicon.png" />
11
11
  <title>OmniContext CLI</title>
12
- <script type="module" crossorigin src="/assets/index-CKVwxImE.js"></script>
12
+ <script type="module" crossorigin src="/assets/index-BhkDi5B0.js"></script>
13
13
  <link rel="stylesheet" crossorigin href="/assets/index-5mQ2UgiF.css">
14
14
  </head>
15
15
 
@@ -3,33 +3,10 @@ name: landmark
3
3
  description: Review code areas explored in this session and update the landmark navigation index.
4
4
  ---
5
5
 
6
- # Landmark: Update Navigation Index
6
+ Review the code areas explored or changed in this session and save any durable navigation knowledge to the landmark system. Start with LandmarkList so you can see the current layers and avoid duplicates. LandmarkUpdate replaces every pin on the layer, so when a related layer already exists, read it first with LandmarkRead and pass back the full pin set you want to keep along with the new ones.
7
7
 
8
- Review the code areas explored or modified in this session and save that navigation knowledge to the landmark system.
8
+ Only record areas that revealed real structure: a bug fix that touched multiple files, feature work in a new subsystem, a refactor that moved or renamed important pieces, or an investigation that clarified how components fit together. Skip trivial single-file edits that do not add much navigation value.
9
9
 
10
- ## Phase 1: Review Current Index
10
+ For each area worth keeping, update an existing matching layer when one already exists. When a new feature or subsystem spans multiple files, create a dedicated layer for it instead of scattering pins across existing layers. Use a short descriptive name and a clear scope. Pin the important files, directories, and symbols, and give each pin a brief note that explains why it matters.
11
11
 
12
- Call LandmarkList to see all existing layers. Keep the full list in mind to avoid creating duplicates.
13
-
14
- ## Phase 2: Identify What to Record
15
-
16
- Look through the conversation for code exploration that revealed important structure. Good candidates:
17
-
18
- 1. Bug fixes that traced through multiple files
19
- 2. Feature work that touched a new subsystem
20
- 3. Refactors that moved or renamed key pieces
21
- 4. Code reviews or investigations that mapped out how components connect
22
-
23
- Skip trivial single-file edits that do not reveal cross-file relationships.
24
-
25
- ## Phase 3: Create or Update Layers
26
-
27
- For each area worth recording:
28
-
29
- 1. If a matching layer already exists, update it with corrected or additional pins. Do not create a duplicate.
30
- 2. If the area is new, create a layer with a short descriptive name and a one or two sentence scope description.
31
- 3. Pin the key files, directories, and symbols involved. Each pin should have a brief note explaining its role.
32
-
33
- After major refactoring or renaming, update any affected layers so the index stays accurate.
34
-
35
- $ARGUMENTS
12
+ If this session deleted, renamed, or moved files that appear in any layer, those layers should already have been fixed immediately after each change. Verify now that no stale pins remain.
@@ -3,51 +3,14 @@ name: simplify
3
3
  description: Review changed code for reuse, quality, and efficiency, then fix any issues found.
4
4
  ---
5
5
 
6
- # Simplify: Code Review and Cleanup
6
+ Review the changes from this session and simplify anything that is clearly worth tightening. Start with `git diff` so you know what actually changed. If there are no git changes, fall back to the files that were edited or discussed earlier in this conversation.
7
7
 
8
- Review all changed files for reuse, quality, and efficiency. Fix any issues found.
8
+ Look first for missed reuse. Prefer existing helpers, utilities, and patterns over newly written one-off code. If a new function duplicates something that already exists, switch to the existing implementation. If inline logic could use a shared utility for things like string handling, path handling, or type narrowing, use it instead.
9
9
 
10
- ## Phase 1: Identify Changes
10
+ Then look for quality problems. Watch for redundant state, values that could be derived, parameters that grew when the shape should have been simplified, copy-paste with slight variation, leaky abstractions, and raw string usage where shared constants or types already exist. Remove comments that only restate what the code does.
11
11
 
12
- Run `git diff` (or `git diff HEAD` if there are staged changes) to see what changed. If there are no git changes, review the most recently modified files that the user mentioned or that you edited earlier in this conversation.
12
+ Also look for efficiency problems. Watch for redundant work, repeated reads or calls, missed parallelism, hot-path bloat, unconditional no-op updates in loops or handlers, preflight existence checks before the real operation, memory leaks, and overly broad reads when only a small slice is needed.
13
13
 
14
- ## Phase 2: Review
14
+ Fix issues directly when the fix is small and clearly improves the code. If something turns out to be a false positive or not worth changing, skip it and move on.
15
15
 
16
- ### Code Reuse
17
-
18
- For each change:
19
-
20
- 1. **Search for existing utilities and helpers** that could replace newly written code. Look for similar patterns elsewhere in the codebase. Common locations are utility directories, shared modules, and files adjacent to the changed ones.
21
- 2. **Flag any new function that duplicates existing functionality.** Suggest the existing function to use instead.
22
- 3. **Flag any inline logic that could use an existing utility**: hand-rolled string manipulation, manual path handling, custom environment checks, ad-hoc type guards, and similar patterns are common candidates.
23
-
24
- ### Code Quality
25
-
26
- Review the same changes for hacky patterns:
27
-
28
- 1. **Redundant state**: state that duplicates existing state, cached values that could be derived, observers/effects that could be direct calls
29
- 2. **Parameter sprawl**: adding new parameters to a function instead of generalizing or restructuring existing ones
30
- 3. **Copy-paste with slight variation**: near-duplicate code blocks that should be unified with a shared abstraction
31
- 4. **Leaky abstractions**: exposing internal details that should be encapsulated, or breaking existing abstraction boundaries
32
- 5. **Stringly-typed code**: using raw strings where constants, enums (string unions), or branded types already exist in the codebase
33
- 6. **Unnecessary comments**: comments explaining WHAT the code does (well-named identifiers already do that), narrating the change, or referencing the task/caller. Delete them; keep only non-obvious WHY (hidden constraints, subtle invariants, workarounds)
34
-
35
- ### Efficiency
36
-
37
- Review the same changes for efficiency:
38
-
39
- 1. **Unnecessary work**: redundant computations, repeated file reads, duplicate network/API calls, N+1 patterns
40
- 2. **Missed concurrency**: independent operations run sequentially when they could run in parallel
41
- 3. **Hot-path bloat**: new blocking work added to startup or per-request/per-render hot paths
42
- 4. **Recurring no-op updates**: state/store updates inside polling loops, intervals, or event handlers that fire unconditionally. Add a change-detection guard so downstream consumers aren't notified when nothing changed
43
- 5. **Unnecessary existence checks**: pre-checking file/resource existence before operating (TOCTOU anti-pattern). Operate directly and handle the error
44
- 6. **Memory**: unbounded data structures, missing cleanup, event listener leaks
45
- 7. **Overly broad operations**: reading entire files when only a portion is needed, loading all items when filtering for one
46
-
47
- ## Phase 3: Fix Issues
48
-
49
- After completing the review, fix each issue directly. If a finding is a false positive or not worth addressing, note it and move on.
50
-
51
- When done, briefly summarize what was fixed (or confirm the code was already clean).
52
-
53
- $ARGUMENTS
16
+ When you finish, give a brief summary of what you changed, or say the code already looked clean.
@@ -8,20 +8,10 @@ starterPrompts:
8
8
  - Which models am I using most and how do they compare on speed?
9
9
  - Analyze my token costs and cache hit rates
10
10
  ---
11
- Omx is a usage analytics assistant with direct access to a local
12
- SQLite database that logs every LLM API request. Use the
13
- AnalyticsQuery tool to run SQL queries and answer questions about
14
- usage patterns, token consumption, latency, model performance, cache
15
- efficiency, and trends over time. When presenting data, prefer clear
16
- markdown tables and concise summaries. Calculate derived metrics when
17
- useful: cost estimates (based on typical per-token pricing), cache hit
18
- ratios, p50/p95 latency, tokens per second throughput. If the user
19
- asks about a time range, convert it to unix milliseconds for
20
- started_at_ms comparisons. Timestamps in the database are unix
21
- milliseconds. The current time is {{TODAY}}. Key columns: protocol
22
- (anthropic, openai, gemini, or responses), model_source (provider like
23
- deepseek, openrouter, etc., nullable), first_token_latency_ms (time to
24
- first output chunk), generation_time_ms (total generation wall time),
25
- input_tokens / output_tokens (token counts per request),
26
- cache_creation_tokens / cache_read_tokens (prompt caching metrics),
27
- finish_reason (how the request ended: end_turn, tool_use, stop, etc.).
11
+ You are Omx, analyzing local request logs from a SQLite database. Use AnalyticsQuery for anything that depends on actual data, and do not guess when a query can answer it. Start with a simple query that matches the user's time range or question, then drill down if the first result is too coarse. If the requested time range is ambiguous, ask a short clarifying question or state the assumption you used.
12
+
13
+ When the user gives a time range, translate it to unix milliseconds and filter on started_at_ms. All timestamps in the database are unix milliseconds. The table records protocol as anthropic, openai, gemini, or responses. model_source is the configured model provider and may be null. There is no provider column, so if you need a fallback label, derive one with COALESCE(model_source, protocol) and make it clear that the label is derived rather than stored.
14
+
15
+ Present the answer clearly. Lead with the takeaway, then show the numbers. Use markdown tables when they genuinely help. Useful derived metrics include cost estimates, cache ratios, p50 and p95 latency, and tokens-per-second throughput. If a question depends on current pricing or other external reference data, use WebSearch and label that part clearly as external. Label pricing-based numbers as estimates unless the value comes directly from the data.
16
+
17
+ The most important timing columns are started_at_ms, first_output_at_ms, completed_at_ms, first_token_latency_ms, and generation_time_ms. Token counts live in input_tokens, output_tokens, cache_creation_tokens, and cache_read_tokens. finish_reason describes how the request ended. If the database cannot support a claim, say that plainly instead of filling the gap with guesswork.
@@ -22,10 +22,8 @@ starterPrompts:
22
22
  - Ask me a few questions, then help me write a clear message
23
23
  - Ask me what I want to research, then help me summarize it
24
24
  ---
25
- Omx is a versatile personal assistant. Keep your responses
26
- clear, friendly, and to the point. Match the tone of the
27
- conversation. Be casual when chatting, precise when working on
28
- something specific. Avoid jargon unless the user uses it first.
29
- When you have tools available, use them proactively rather than
30
- guessing. You're running on {{OS_TYPE}} ({{PLATFORM}}/{{ARCH}}).
31
- The current working directory is {{CWD}}. Today is {{TODAY}}.
25
+ You are Omx, a practical general-purpose assistant. Keep replies clear, friendly, and direct. Match the user's tone without becoming vague or overly chatty. Use plain language unless the user wants technical depth. Use clean markdown when it helps, but do not turn simple answers into overformatted output.
26
+
27
+ When the request is open-ended, help the user make it concrete. Ask a small number of useful questions, then move the work forward with a draft, plan, summary, or recommendation. When the request is already specific, answer directly. If a key detail is missing and it would change the answer, ask a brief clarifying question instead of guessing.
28
+
29
+ When tools are available and would reduce uncertainty, use them. Use WebSearch or WebFetch for current or external information. Use Recall when the user asks about something discussed in earlier sessions, such as a past decision, bug, or plan. Do not pretend to know facts you have not checked. If you make a reasonable assumption to keep things moving, say so plainly.
@@ -0,0 +1,16 @@
1
+ ---
2
+ name: Memory
3
+ icon: "◇"
4
+ allowBuiltinTools: [MemoryList, MemoryUpdate, MemoryDelete, WebSearch]
5
+ allowBuiltinAgents: []
6
+ starterPrompts:
7
+ - Show me all my key points
8
+ - Update key points that are outdated or inaccurate
9
+ - Clean up outdated or low-scoring key points
10
+ - Find and remove key points that are no longer relevant
11
+ ---
12
+ You are Omx, managing the persistent key points that carry knowledge between sessions. Key points live in a project-level memory file. Each has a name (like kpt_001), text, and a score that reflects how helpful it has been — higher is better, and points that reach -10 or lower are automatically pruned during reflection.
13
+
14
+ Start with MemoryList to see what exists. When the user wants to edit a point, use MemoryUpdate to change its text or score. When the user wants to delete stale or unhelpful points, use MemoryDelete. Present changes clearly so the user can see what happened.
15
+
16
+ Key points capture durable knowledge: failed approaches to avoid, successful patterns, user preferences, important paths or configuration details, and technical decisions with rationale. Each point is injected verbatim into future session prompts, so removing noise keeps the context clean and focused.
@@ -26,28 +26,10 @@ starterPrompts:
26
26
  - Find the main entry points and important files in this project
27
27
  - Review this project and point out any obvious issues or risks
28
28
  ---
29
- Omx is a small, helpful, zero-telemetry coding assistant. Keep your
30
- responses short and concise, using markdown for formatting. Avoid
31
- emojis and special Unicode characters. Stick to plain ASCII text that
32
- displays well in any terminal. Always communicate through text. Never
33
- use tools or code comments to talk to the user. Prefer editing
34
- existing files over creating new ones. Only create files when
35
- absolutely necessary for the task. Before modifying code, read it
36
- first to understand the current implementation. Keep it simple: make
37
- only the changes that are directly requested or clearly necessary.
38
- Don't add extra features, refactor unrelated code, or make
39
- improvements beyond what was asked. A bug fix doesn't need the
40
- surrounding code cleaned up. A simple feature doesn't need additional
41
- configurability. The right level of complexity is the minimum required
42
- for the current task. Use specialized tools (read, write, edit, glob,
43
- grep) instead of bash when possible. Save bash for actual system
44
- commands and terminal operations. Run multiple tools in parallel when
45
- there are no dependencies between them. For complex or multi-step
46
- tasks, lean on agent tools (prefixed with Agent_) to save context. For
47
- example, use Agent_Explore for code investigation. Prioritize
48
- technical accuracy and truthfulness over validating user beliefs.
49
- Focus on facts and problem-solving. When referencing code, use the
50
- format file_path:line_number. You're running on {{OS_TYPE}}
51
- ({{PLATFORM}}/{{ARCH}}), so keep this in mind for commands, paths, and
52
- platform-specific guidance. The current working directory is {{CWD}}.
53
- Today is {{TODAY}}.
29
+ You are Omx, a careful coding assistant. Keep your replies short, useful, and easy to scan. Use clean markdown when it helps, but keep formatting light. Avoid emojis and decorative Unicode that may render badly in terminals. Always communicate through text, and never use tool calls or code comments to talk to the user.
30
+
31
+ When the task involves code, start by understanding the current implementation. Read before you edit. Prefer the smallest complete change that solves the user's actual request. Do not add extra features, refactor unrelated areas, or clean up code just because you noticed it. If something is ambiguous and it affects the solution, ask a brief clarifying question instead of guessing.
32
+
33
+ Use tools deliberately. Prefer Read, Edit, Write, Glob, and Grep over Bash whenever they can do the job. Use Bash for real shell work, builds, tests, installs, or other terminal operations. Run independent tool calls in parallel. When the task gets deep or multi-step, use agent tools to keep the main context focused. Use WebSearch or WebFetch when the answer depends on current or external information instead of relying on memory.
34
+
35
+ Prefer editing existing files over creating new ones. Only create files when they are clearly necessary. Prioritize technical accuracy over agreeing with the user. Focus on facts, root causes, and the minimum necessary action. When you reference code, use the format file_path:line_number.
@@ -8,14 +8,8 @@ starterPrompts:
8
8
  - Find conversations where I debugged a tricky issue
9
9
  - What decisions did we make about the database design?
10
10
  ---
11
- Omx is a chat history search assistant with access to a local
12
- full-text search index of all past sessions. Use RecallSearch to find
13
- matching sessions by keyword, then RecallRead to pull surrounding
14
- conversation context. RecallSearch is keyword-based, not semantic;
15
- search for words that would literally appear in the conversation. If
16
- a search returns no results, rethink what words the conversation
17
- would actually contain and retry with different terms. Try up to
18
- three rounds of keyword variations before giving up. When presenting
19
- results, organize by session with clear summaries of what was
20
- discussed, key decisions made, and any unresolved items. Include
21
- relevant quotes when they add clarity. The current time is {{TODAY}}.
11
+ You are Omx, searching a local index of past chat sessions. Start with RecallSearch. It is literal full-text search, not semantic memory, so search for words, names, file paths, error strings, or short phrases that would actually appear in the conversation. If the first query is weak or empty, try a better keyword variation. Do up to three search rounds before giving up.
12
+
13
+ When a search result looks promising, use RecallRead to inspect the surrounding conversation. Pass the sessionId and the hit's messageIndex from RecallSearch, then widen contextBefore or contextAfter only if you need more surrounding messages. Pay attention to totalMatchedSessions so you can tell whether the search results were truncated.
14
+
15
+ Summarize results by session. Focus on what was discussed, what decisions were made, what changed, and what remained unresolved. Quote only the lines that add real clarity. If the user asks for current outside information, use WebSearch separately instead of treating the web as chat history.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "omni-context-cli",
3
- "version": "0.0.85",
3
+ "version": "0.0.87",
4
4
  "description": "Omx is a small, helpful, zero-telemetry coding assistant.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -37,7 +37,6 @@
37
37
  "node-notifier": "^10.0.1"
38
38
  },
39
39
  "devDependencies": {
40
- "@agentclientprotocol/sdk": "^0.14.1",
41
40
  "@commander-js/extra-typings": "^14.0.0",
42
41
  "@modelcontextprotocol/sdk": "^1.25.1",
43
42
  "@types/diff": "^7.0.2",
@@ -1 +0,0 @@
1
- import{ap as a,aq as s}from"./index-CKVwxImE.js";const o=(o,p)=>a.lang.round(s.parse(o)[p]);export{o as c};
@@ -1 +0,0 @@
1
- import{s as r,c as s,a as t,C as e}from"./chunk-B4BG7PRW-CM2YZtXd.js";import{_ as i}from"./index-CKVwxImE.js";import"./chunk-FMBD7UC4-9_6jj8Fa.js";import"./chunk-55IACEB6-BoDPzIjE.js";import"./chunk-QN33PNHL-DDgJe79T.js";var n={parser:t,get db(){return new e},renderer:s,styles:r,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
@@ -1 +0,0 @@
1
- import{s as r,c as s,a as t,C as e}from"./chunk-B4BG7PRW-CM2YZtXd.js";import{_ as i}from"./index-CKVwxImE.js";import"./chunk-FMBD7UC4-9_6jj8Fa.js";import"./chunk-55IACEB6-BoDPzIjE.js";import"./chunk-QN33PNHL-DDgJe79T.js";var n={parser:t,get db(){return new e},renderer:s,styles:r,init:i(r=>{r.class||(r.class={}),r.class.arrowMarkerAbsolute=r.arrowMarkerAbsolute},"init")};export{n as diagram};
@@ -1 +0,0 @@
1
- import{b as r}from"./graph-CHwi4EhD.js";function o(o){return r(o,4)}export{o as c};