@smartmemory/compose 0.2.46-beta → 0.2.48-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (71) hide show
  1. package/README.md +17 -0
  2. package/bin/compose.js +35 -1
  3. package/dist/assets/{App-CZNprfTP.js → App-D7E7S49Q.js} +163 -153
  4. package/dist/assets/{arc-D7Ql7gBh.js → arc-LOW60tiI.js} +1 -1
  5. package/dist/assets/{architectureDiagram-3BPJPVTR-CMzqpLWw.js → architectureDiagram-3BPJPVTR-BDY00hRy.js} +1 -1
  6. package/dist/assets/{blockDiagram-GPEHLZMM-CbW2AYzk.js → blockDiagram-GPEHLZMM-DiC_6ktq.js} +1 -1
  7. package/dist/assets/browser-DW2JlJCC.js +8 -0
  8. package/dist/assets/{c4Diagram-AAUBKEIU-C89TIEqM.js → c4Diagram-AAUBKEIU-CXZC8woU.js} +1 -1
  9. package/dist/assets/channel-Dh96pu1k.js +1 -0
  10. package/dist/assets/{chunk-2J33WTMH-jLQK9et3.js → chunk-2J33WTMH-b8Rdk4S-.js} +1 -1
  11. package/dist/assets/{chunk-4BX2VUAB-bH25OCUA.js → chunk-4BX2VUAB-BSxn03f-.js} +1 -1
  12. package/dist/assets/{chunk-55IACEB6-Dhb0bOrW.js → chunk-55IACEB6-uUk1WzZ1.js} +1 -1
  13. package/dist/assets/{chunk-727SXJPM-CBfeQuSd.js → chunk-727SXJPM-zvXhT6iZ.js} +1 -1
  14. package/dist/assets/{chunk-AQP2D5EJ-CIxa5qRv.js → chunk-AQP2D5EJ-B6GCyrIp.js} +1 -1
  15. package/dist/assets/{chunk-FMBD7UC4-CmXvjRAO.js → chunk-FMBD7UC4-DlhrqkBp.js} +1 -1
  16. package/dist/assets/{chunk-ND2GUHAM-DRs6NTTH.js → chunk-ND2GUHAM-lo_8kNzw.js} +1 -1
  17. package/dist/assets/{chunk-QZHKN3VN-BmkcOtBV.js → chunk-QZHKN3VN-on-yD-C0.js} +1 -1
  18. package/dist/assets/classDiagram-4FO5ZUOK-BCqpDcaS.js +1 -0
  19. package/dist/assets/classDiagram-v2-Q7XG4LA2-BCqpDcaS.js +1 -0
  20. package/dist/assets/{cose-bilkent-S5V4N54A-BZwhzUqa.js → cose-bilkent-S5V4N54A-DxV7Y2bU.js} +1 -1
  21. package/dist/assets/{dagre-BM42HDAG-CEHe9vzv.js → dagre-BM42HDAG-BHf9sURy.js} +1 -1
  22. package/dist/assets/{diagram-2AECGRRQ-Cq8RCIdY.js → diagram-2AECGRRQ-R9Puxzlh.js} +1 -1
  23. package/dist/assets/{diagram-5GNKFQAL-DCaYgQ-u.js → diagram-5GNKFQAL-BbjlClKx.js} +1 -1
  24. package/dist/assets/{diagram-KO2AKTUF-DehQMQAE.js → diagram-KO2AKTUF-r89Mx4m1.js} +1 -1
  25. package/dist/assets/{diagram-LMA3HP47-BUJ8pJCq.js → diagram-LMA3HP47-CstVDJZ3.js} +1 -1
  26. package/dist/assets/{diagram-OG6HWLK6-BrqALaH3.js → diagram-OG6HWLK6-xmX57FKh.js} +1 -1
  27. package/dist/assets/{erDiagram-TEJ5UH35-Cz2hnPqN.js → erDiagram-TEJ5UH35-DhLPxvrl.js} +1 -1
  28. package/dist/assets/{flowDiagram-I6XJVG4X-BpPrbE4K.js → flowDiagram-I6XJVG4X-BExoUaNm.js} +1 -1
  29. package/dist/assets/{ganttDiagram-6RSMTGT7-Dne2jtVu.js → ganttDiagram-6RSMTGT7-BEXa5a22.js} +1 -1
  30. package/dist/assets/{gitGraphDiagram-PVQCEYII-W8OpyxIG.js → gitGraphDiagram-PVQCEYII-Cbes9api.js} +1 -1
  31. package/dist/assets/{graph-viND0NdB.js → graph-BBXaecIU.js} +1 -1
  32. package/dist/assets/index-BwLfbbOu.css +1 -0
  33. package/dist/assets/{index-BVnbNZXC.js → index-DNuHtZwR.js} +22 -22
  34. package/dist/assets/{infoDiagram-5YYISTIA-4OeddgjS.js → infoDiagram-5YYISTIA-UBm4ssfm.js} +1 -1
  35. package/dist/assets/{ishikawaDiagram-YF4QCWOH-D0XwMcCq.js → ishikawaDiagram-YF4QCWOH-CksBYHCF.js} +1 -1
  36. package/dist/assets/{journeyDiagram-JHISSGLW-CO0wIeDT.js → journeyDiagram-JHISSGLW-CKHkIHky.js} +1 -1
  37. package/dist/assets/{kanban-definition-UN3LZRKU-CLU0ciYv.js → kanban-definition-UN3LZRKU-CEahMFzE.js} +1 -1
  38. package/dist/assets/{linear-BOFLe2h1.js → linear-CqLVtYRk.js} +1 -1
  39. package/dist/assets/{mindmap-definition-RKZ34NQL-ByuwlkdD.js → mindmap-definition-RKZ34NQL-C61zWt4M.js} +1 -1
  40. package/dist/assets/mobile-DwmxS_O4.js +17 -0
  41. package/dist/assets/{pieDiagram-4H26LBE5-CPm2BXke.js → pieDiagram-4H26LBE5-BIpZHyJW.js} +1 -1
  42. package/dist/assets/{quadrantDiagram-W4KKPZXB-CR3NLvwU.js → quadrantDiagram-W4KKPZXB-Db7nRbZm.js} +1 -1
  43. package/dist/assets/{requirementDiagram-4Y6WPE33-D4vpyryW.js → requirementDiagram-4Y6WPE33-BQqFCAr0.js} +1 -1
  44. package/dist/assets/{sankeyDiagram-5OEKKPKP--Clp0eo-.js → sankeyDiagram-5OEKKPKP-D-oAAMci.js} +1 -1
  45. package/dist/assets/{sequenceDiagram-3UESZ5HK-B1xrJkMo.js → sequenceDiagram-3UESZ5HK-Dc4Cp0Om.js} +1 -1
  46. package/dist/assets/{stateDiagram-AJRCARHV-D5w5yQql.js → stateDiagram-AJRCARHV-B5DkQ8Pr.js} +1 -1
  47. package/dist/assets/stateDiagram-v2-BHNVJYJU-BM1Uf6a_.js +1 -0
  48. package/dist/assets/{timeline-definition-PNZ67QCA-DxOINQqf.js → timeline-definition-PNZ67QCA-DU9Fl-FW.js} +1 -1
  49. package/dist/assets/{vennDiagram-CIIHVFJN-B3Wss4do.js → vennDiagram-CIIHVFJN-Bthz7siw.js} +1 -1
  50. package/dist/assets/{wardley-L42UT6IY-nYDkwvlu.js → wardley-L42UT6IY-nqdlFSIA.js} +1 -1
  51. package/dist/assets/{wardleyDiagram-YWT4CUSO-BMM3myEL.js → wardleyDiagram-YWT4CUSO-BJ1BC5zc.js} +1 -1
  52. package/dist/assets/{xychartDiagram-2RQKCTM6-B5ElCNMx.js → xychartDiagram-2RQKCTM6-Bib5JrbR.js} +1 -1
  53. package/dist/index.html +3 -3
  54. package/lib/cli-remote.js +533 -0
  55. package/package.json +3 -1
  56. package/server/auth-middleware.js +309 -0
  57. package/server/auth-routes.js +195 -0
  58. package/server/auth-store.js +539 -0
  59. package/server/build-routes.js +1 -1
  60. package/server/index.js +134 -7
  61. package/server/remote-utils.js +134 -0
  62. package/server/security.js +46 -1
  63. package/server/supervisor.js +7 -1
  64. package/server/vision-routes.js +1 -1
  65. package/server/vision-server.js +1 -1
  66. package/dist/assets/channel-sjm4Ncyv.js +0 -1
  67. package/dist/assets/classDiagram-4FO5ZUOK-LkIQdBsc.js +0 -1
  68. package/dist/assets/classDiagram-v2-Q7XG4LA2-LkIQdBsc.js +0 -1
  69. package/dist/assets/index-D9M5IzwO.css +0 -1
  70. package/dist/assets/mobile-B-d4crm_.js +0 -17
  71. package/dist/assets/stateDiagram-v2-BHNVJYJU-TPU-mOqi.js +0 -1
@@ -1,2 +1,2 @@
1
- import{_ as a,l as s,I as n,e as i}from"./App-CZNprfTP.js";import{p}from"./wardley-L42UT6IY-nYDkwvlu.js";import"./mobile-B-d4crm_.js";import"./index-BVnbNZXC.js";import"./graph-viND0NdB.js";var g={parse:a(async r=>{const e=await p("info",r);s.debug(e)},"parse")},v={version:"11.15.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,o)=>{s.debug(`rendering info diagram
1
+ import{_ as a,l as s,I as n,e as i}from"./App-D7E7S49Q.js";import{p}from"./wardley-L42UT6IY-nqdlFSIA.js";import"./mobile-DwmxS_O4.js";import"./index-DNuHtZwR.js";import"./graph-BBXaecIU.js";var g={parse:a(async r=>{const e=await p("info",r);s.debug(e)},"parse")},v={version:"11.15.0"},d=a(()=>v.version,"getVersion"),m={getVersion:d},c=a((r,e,o)=>{s.debug(`rendering info diagram
2
2
  `+r);const t=n(e);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${o}`)},"draw"),l={draw:c},y={parser:g,db:m,renderer:l};export{y as diagram};
@@ -1,4 +1,4 @@
1
- import{_ as o,c as ot,N as ut,I as dt,ap as yt,z as pt,k as ft,p as it,a as gt,b as kt,g as mt,s as wt,q as _t,e as bt}from"./App-CZNprfTP.js";import"./mobile-B-d4crm_.js";import"./index-BVnbNZXC.js";import"./graph-viND0NdB.js";var tt=(function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],p=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],B={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,f,n,v){var w=n.length-1;switch(f){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:p,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:p,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],f=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(C.yy[z]=this.yy[z]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function F(N){i.length=i.length-2*N,f.length=f.length-N,n.length=n.length-N}o(F,"popStack");function j(){var N;return N=u.pop()||b.lex()||E,typeof N!="number"&&(N instanceof Array&&(u=N,N=u.pop()),N=s.symbols_[N]||N),N}o(j,"lex");for(var A,W,P,K,H={},X,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?P=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=j()),P=v[W]&&v[W][A]),typeof P>"u"||!P.length||!P[0]){var Q="";Y=[];for(X in v[W])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
1
+ import{_ as o,c as ot,N as ut,I as dt,ap as yt,z as pt,k as ft,p as it,a as gt,b as kt,g as mt,s as wt,q as _t,e as bt}from"./App-D7E7S49Q.js";import"./mobile-DwmxS_O4.js";import"./index-DNuHtZwR.js";import"./graph-BBXaecIU.js";var tt=(function(){var e=o(function(M,t,s,i){for(s=s||{},i=M.length;i--;s[M[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],p=[1,20],d=[1,18],m=[1,19],c=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],B={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,u,f,n,v){var w=n.length-1;switch(f){case 6:case 7:return u;case 15:u.addNode(n[w-1].length,n[w].trim());break;case 16:u.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:p,7:d,10:17,11:m},e(c,[2,18],{14:[1,21]}),e(c,[2,16]),e(c,[2,17]),{6:p,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(c,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],u=[],f=[null],n=[],v=this.table,w="",I=0,S=0,L=2,E=1,R=n.slice.call(arguments,1),b=Object.create(this.lexer),C={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(C.yy[z]=this.yy[z]);b.setInput(t,C.yy),C.yy.lexer=b,C.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var T=b.yylloc;n.push(T);var D=b.options&&b.options.ranges;typeof C.yy.parseError=="function"?this.parseError=C.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function F(N){i.length=i.length-2*N,f.length=f.length-N,n.length=n.length-N}o(F,"popStack");function j(){var N;return N=u.pop()||b.lex()||E,typeof N!="number"&&(N instanceof Array&&(u=N,N=u.pop()),N=s.symbols_[N]||N),N}o(j,"lex");for(var A,W,P,K,H={},X,V,et,Y;;){if(W=i[i.length-1],this.defaultActions[W]?P=this.defaultActions[W]:((A===null||typeof A>"u")&&(A=j()),P=v[W]&&v[W][A]),typeof P>"u"||!P.length||!P[0]){var Q="";Y=[];for(X in v[W])this.terminals_[X]&&X>L&&Y.push("'"+this.terminals_[X]+"'");b.showPosition?Q="Parse error on line "+(I+1)+`:
2
2
  `+b.showPosition()+`
3
3
  Expecting `+Y.join(", ")+", got '"+(this.terminals_[A]||A)+"'":Q="Parse error on line "+(I+1)+": Unexpected "+(A==E?"end of input":"'"+(this.terminals_[A]||A)+"'"),this.parseError(Q,{text:b.match,token:this.terminals_[A]||A,line:b.yylineno,loc:T,expected:Y})}if(P[0]instanceof Array&&P.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+A);switch(P[0]){case 1:i.push(A),f.push(b.yytext),n.push(b.yylloc),i.push(P[1]),A=null,S=b.yyleng,w=b.yytext,I=b.yylineno,T=b.yylloc;break;case 2:if(V=this.productions_[P[1]][1],H.$=f[f.length-V],H._$={first_line:n[n.length-(V||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(V||1)].first_column,last_column:n[n.length-1].last_column},D&&(H._$.range=[n[n.length-(V||1)].range[0],n[n.length-1].range[1]]),K=this.performAction.apply(H,[w,S,I,C.yy,P[1],f,n].concat(R)),typeof K<"u")return K;V&&(i=i.slice(0,-1*V*2),f=f.slice(0,-1*V),n=n.slice(0,-1*V)),i.push(this.productions_[P[1]][0]),f.push(H.$),n.push(H._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=(function(){var M={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var f=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===u.length?this.yylloc.first_column:0)+u[u.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(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:o(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:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{g as gt}from"./chunk-FMBD7UC4-CmXvjRAO.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-ND2GUHAM-DRs6NTTH.js";import{g as _t,s as vt,a as bt,b as wt,q as Tt,p as St,_ as s,c as R,d as X,e as $t,z as Mt}from"./App-CZNprfTP.js";import{d as it}from"./arc-D7Ql7gBh.js";import"./mobile-B-d4crm_.js";import"./index-BVnbNZXC.js";import"./graph-viND0NdB.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
1
+ import{g as gt}from"./chunk-FMBD7UC4-DlhrqkBp.js";import{a as mt,g as lt,h as xt,d as kt}from"./chunk-ND2GUHAM-lo_8kNzw.js";import{g as _t,s as vt,a as bt,b as wt,q as Tt,p as St,_ as s,c as R,d as X,e as $t,z as Mt}from"./App-D7E7S49Q.js";import{d as it}from"./arc-LOW60tiI.js";import"./mobile-DwmxS_O4.js";import"./index-DNuHtZwR.js";import"./graph-BBXaecIU.js";var U=(function(){var t=s(function(h,r,n,l){for(n=n||{},l=h.length;l--;n[h[l]]=r);return n},"o"),e=[6,8,10,11,12,14,16,17,18],a=[1,9],f=[1,10],i=[1,11],u=[1,12],p=[1,13],o=[1,14],g={trace:s(function(){},"trace"),yy:{},symbols_:{error:2,start:3,journey:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NEWLINE:10,title:11,acc_title:12,acc_title_value:13,acc_descr:14,acc_descr_value:15,acc_descr_multiline_value:16,section:17,taskName:18,taskData:19,$accept:0,$end:1},terminals_:{2:"error",4:"journey",6:"EOF",8:"SPACE",10:"NEWLINE",11:"title",12:"acc_title",13:"acc_title_value",14:"acc_descr",15:"acc_descr_value",16:"acc_descr_multiline_value",17:"section",18:"taskName",19:"taskData"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,2]],performAction:s(function(r,n,l,y,d,c,v){var k=c.length-1;switch(d){case 1:return c[k-1];case 2:this.$=[];break;case 3:c[k-1].push(c[k]),this.$=c[k-1];break;case 4:case 5:this.$=c[k];break;case 6:case 7:this.$=[];break;case 8:y.setDiagramTitle(c[k].substr(6)),this.$=c[k].substr(6);break;case 9:this.$=c[k].trim(),y.setAccTitle(this.$);break;case 10:case 11:this.$=c[k].trim(),y.setAccDescription(this.$);break;case 12:y.addSection(c[k].substr(8)),this.$=c[k].substr(8);break;case 13:y.addTask(c[k-1],c[k]),this.$="task";break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:15,11:a,12:f,14:i,16:u,17:p,18:o},t(e,[2,5]),t(e,[2,6]),t(e,[2,8]),{13:[1,16]},{15:[1,17]},t(e,[2,11]),t(e,[2,12]),{19:[1,18]},t(e,[2,4]),t(e,[2,9]),t(e,[2,10]),t(e,[2,13])],defaultActions:{},parseError:s(function(r,n){if(n.recoverable)this.trace(r);else{var l=new Error(r);throw l.hash=n,l}},"parseError"),parse:s(function(r){var n=this,l=[0],y=[],d=[null],c=[],v=this.table,k="",C=0,Q=0,yt=2,D=1,dt=c.slice.call(arguments,1),_=Object.create(this.lexer),I={yy:{}};for(var O in this.yy)Object.prototype.hasOwnProperty.call(this.yy,O)&&(I.yy[O]=this.yy[O]);_.setInput(r,I.yy),I.yy.lexer=_,I.yy.parser=this,typeof _.yylloc>"u"&&(_.yylloc={});var Y=_.yylloc;c.push(Y);var ft=_.options&&_.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pt(w){l.length=l.length-2*w,d.length=d.length-w,c.length=c.length-w}s(pt,"popStack");function tt(){var w;return w=y.pop()||_.lex()||D,typeof w!="number"&&(w instanceof Array&&(y=w,w=y.pop()),w=n.symbols_[w]||w),w}s(tt,"lex");for(var b,A,T,q,F={},N,M,et,z;;){if(A=l[l.length-1],this.defaultActions[A]?T=this.defaultActions[A]:((b===null||typeof b>"u")&&(b=tt()),T=v[A]&&v[A][b]),typeof T>"u"||!T.length||!T[0]){var H="";z=[];for(N in v[A])this.terminals_[N]&&N>yt&&z.push("'"+this.terminals_[N]+"'");_.showPosition?H="Parse error on line "+(C+1)+`:
2
2
  `+_.showPosition()+`
3
3
  Expecting `+z.join(", ")+", got '"+(this.terminals_[b]||b)+"'":H="Parse error on line "+(C+1)+": Unexpected "+(b==D?"end of input":"'"+(this.terminals_[b]||b)+"'"),this.parseError(H,{text:_.match,token:this.terminals_[b]||b,line:_.yylineno,loc:Y,expected:z})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+A+", token: "+b);switch(T[0]){case 1:l.push(b),d.push(_.yytext),c.push(_.yylloc),l.push(T[1]),b=null,Q=_.yyleng,k=_.yytext,C=_.yylineno,Y=_.yylloc;break;case 2:if(M=this.productions_[T[1]][1],F.$=d[d.length-M],F._$={first_line:c[c.length-(M||1)].first_line,last_line:c[c.length-1].last_line,first_column:c[c.length-(M||1)].first_column,last_column:c[c.length-1].last_column},ft&&(F._$.range=[c[c.length-(M||1)].range[0],c[c.length-1].range[1]]),q=this.performAction.apply(F,[k,Q,C,I.yy,T[1],d,c].concat(dt)),typeof q<"u")return q;M&&(l=l.slice(0,-1*M*2),d=d.slice(0,-1*M),c=c.slice(0,-1*M)),l.push(this.productions_[T[1]][0]),d.push(F.$),c.push(F._$),et=v[l[l.length-2]][l[l.length-1]],l.push(et);break;case 3:return!0}}return!0},"parse")},m=(function(){var h={EOF:1,parseError:s(function(n,l){if(this.yy.parser)this.yy.parser.parseError(n,l);else throw new Error(n)},"parseError"),setInput:s(function(r,n){return this.yy=n||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:s(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var n=r.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:s(function(r){var n=r.length,l=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var y=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var d=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===y.length?this.yylloc.first_column:0)+y[y.length-l.length].length-l[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[d[0],d[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:s(function(){return this._more=!0,this},"more"),reject:s(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:s(function(r){this.unput(this.match.slice(r))},"less"),pastInput:s(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:s(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:s(function(){var r=this.pastInput(),n=new Array(r.length+1).join("-");return r+this.upcomingInput()+`
@@ -1,4 +1,4 @@
1
- import{_ as c,l as te,c as W,I as fe,af as ye,ag as be,ah as me,Y as _e,G as K,i as F,t as ke,J as Ee,V as Se,W as le,X as ce}from"./App-CZNprfTP.js";import{g as Ne}from"./chunk-FMBD7UC4-CmXvjRAO.js";import"./mobile-B-d4crm_.js";import"./index-BVnbNZXC.js";import"./graph-viND0NdB.js";var $=(function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],M=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],U=[1,35],j=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:M}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:U,11:j}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:M}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:U,11:j}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;e.push(q);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,Q,G={},X,I,oe,Y;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=B[R]&&B[R][E]),typeof v>"u"||!v.length||!v[0]){var Z="";Y=[];for(X in B[R])this.terminals_[X]&&X>ue&&Y.push("'"+this.terminals_[X]+"'");m.showPosition?Z="Parse error on line "+(z+1)+`:
1
+ import{_ as c,l as te,c as W,I as fe,af as ye,ag as be,ah as me,Y as _e,G as K,i as F,t as ke,J as Ee,V as Se,W as le,X as ce}from"./App-D7E7S49Q.js";import{g as Ne}from"./chunk-FMBD7UC4-DlhrqkBp.js";import"./mobile-DwmxS_O4.js";import"./index-DNuHtZwR.js";import"./graph-BBXaecIU.js";var $=(function(){var t=c(function(_,s,n,a){for(n=n||{},a=_.length;a--;n[_[a]]=s);return n},"o"),g=[1,4],d=[1,13],r=[1,12],p=[1,15],k=[1,16],f=[1,20],h=[1,19],L=[6,7,8],C=[1,26],w=[1,24],N=[1,25],i=[6,7,11],M=[1,31],x=[6,7,11,24],P=[1,6,13,16,17,20,23],U=[1,35],j=[1,36],A=[1,6,7,11,13,16,17,20,23],H=[1,38],V={trace:c(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:c(function(s,n,a,o,u,e,B){var l=e.length-1;switch(u){case 6:case 7:return o;case 8:o.getLogger().trace("Stop NL ");break;case 9:o.getLogger().trace("Stop EOF ");break;case 11:o.getLogger().trace("Stop NL2 ");break;case 12:o.getLogger().trace("Stop EOF2 ");break;case 15:o.getLogger().info("Node: ",e[l-1].id),o.addNode(e[l-2].length,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 16:o.getLogger().info("Node: ",e[l].id),o.addNode(e[l-1].length,e[l].id,e[l].descr,e[l].type);break;case 17:o.getLogger().trace("Icon: ",e[l]),o.decorateNode({icon:e[l]});break;case 18:case 23:o.decorateNode({class:e[l]});break;case 19:o.getLogger().trace("SPACELIST");break;case 20:o.getLogger().trace("Node: ",e[l-1].id),o.addNode(0,e[l-1].id,e[l-1].descr,e[l-1].type,e[l]);break;case 21:o.getLogger().trace("Node: ",e[l].id),o.addNode(0,e[l].id,e[l].descr,e[l].type);break;case 22:o.decorateNode({icon:e[l]});break;case 27:o.getLogger().trace("node found ..",e[l-2]),this.$={id:e[l-1],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 28:this.$={id:e[l],descr:e[l],type:0};break;case 29:o.getLogger().trace("node found ..",e[l-3]),this.$={id:e[l-3],descr:e[l-1],type:o.getType(e[l-2],e[l])};break;case 30:this.$=e[l-1]+e[l];break;case 31:this.$=e[l];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:g},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:g},{6:d,7:[1,10],9:9,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(L,[2,3]),{1:[2,2]},t(L,[2,4]),t(L,[2,5]),{1:[2,6],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:d,9:22,12:11,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},{6:C,7:w,10:23,11:N},t(i,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:f,23:h}),t(i,[2,19]),t(i,[2,21],{15:30,24:M}),t(i,[2,22]),t(i,[2,23]),t(x,[2,25]),t(x,[2,26]),t(x,[2,28],{20:[1,32]}),{21:[1,33]},{6:C,7:w,10:34,11:N},{1:[2,7],6:d,12:21,13:r,14:14,16:p,17:k,18:17,19:18,20:f,23:h},t(P,[2,14],{7:U,11:j}),t(A,[2,8]),t(A,[2,9]),t(A,[2,10]),t(i,[2,16],{15:37,24:M}),t(i,[2,17]),t(i,[2,18]),t(i,[2,20],{24:H}),t(x,[2,31]),{21:[1,39]},{22:[1,40]},t(P,[2,13],{7:U,11:j}),t(A,[2,11]),t(A,[2,12]),t(i,[2,15],{24:H}),t(x,[2,30]),{22:[1,41]},t(x,[2,27]),t(x,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:c(function(s,n){if(n.recoverable)this.trace(s);else{var a=new Error(s);throw a.hash=n,a}},"parseError"),parse:c(function(s){var n=this,a=[0],o=[],u=[null],e=[],B=this.table,l="",z=0,ie=0,ue=2,re=1,ge=e.slice.call(arguments,1),m=Object.create(this.lexer),T={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(T.yy[J]=this.yy[J]);m.setInput(s,T.yy),T.yy.lexer=m,T.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var q=m.yylloc;e.push(q);var de=m.options&&m.options.ranges;typeof T.yy.parseError=="function"?this.parseError=T.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){a.length=a.length-2*S,u.length=u.length-S,e.length=e.length-S}c(pe,"popStack");function ae(){var S;return S=o.pop()||m.lex()||re,typeof S!="number"&&(S instanceof Array&&(o=S,S=o.pop()),S=n.symbols_[S]||S),S}c(ae,"lex");for(var E,R,v,Q,G={},X,I,oe,Y;;){if(R=a[a.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((E===null||typeof E>"u")&&(E=ae()),v=B[R]&&B[R][E]),typeof v>"u"||!v.length||!v[0]){var Z="";Y=[];for(X in B[R])this.terminals_[X]&&X>ue&&Y.push("'"+this.terminals_[X]+"'");m.showPosition?Z="Parse error on line "+(z+1)+`:
2
2
  `+m.showPosition()+`
3
3
  Expecting `+Y.join(", ")+", got '"+(this.terminals_[E]||E)+"'":Z="Parse error on line "+(z+1)+": Unexpected "+(E==re?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(Z,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:q,expected:Y})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+E);switch(v[0]){case 1:a.push(E),u.push(m.yytext),e.push(m.yylloc),a.push(v[1]),E=null,ie=m.yyleng,l=m.yytext,z=m.yylineno,q=m.yylloc;break;case 2:if(I=this.productions_[v[1]][1],G.$=u[u.length-I],G._$={first_line:e[e.length-(I||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(I||1)].first_column,last_column:e[e.length-1].last_column},de&&(G._$.range=[e[e.length-(I||1)].range[0],e[e.length-1].range[1]]),Q=this.performAction.apply(G,[l,ie,z,T.yy,v[1],u,e].concat(ge)),typeof Q<"u")return Q;I&&(a=a.slice(0,-1*I*2),u=u.slice(0,-1*I),e=e.slice(0,-1*I)),a.push(this.productions_[v[1]][0]),u.push(G.$),e.push(G._$),oe=B[a[a.length-2]][a[a.length-1]],a.push(oe);break;case 3:return!0}}return!0},"parse")},y=(function(){var _={EOF:1,parseError:c(function(n,a){if(this.yy.parser)this.yy.parser.parseError(n,a);else throw new Error(n)},"parseError"),setInput:c(function(s,n){return this.yy=n||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:c(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:c(function(s){var n=s.length,a=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var o=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),a.length-1&&(this.yylineno-=a.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:a?(a.length===o.length?this.yylloc.first_column:0)+o[o.length-a.length].length-a[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:c(function(){return this._more=!0,this},"more"),reject:c(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:c(function(s){this.unput(this.match.slice(s))},"less"),pastInput:c(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:c(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:c(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{b7 as j,b8 as p,b9 as w,ba as k,bb as q}from"./App-CZNprfTP.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function E(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function G(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function H(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function J(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function K(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=d(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function L(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function Q(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=d(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function d(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?L:J(r)?H:Array.isArray(r)?K:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Q:p)(n,r)}function U(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function W(n){return Math.max(0,-g(Math.abs(n)))}function X(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Y(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function Z(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function N(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:Z(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=N(u,e),f=t(a,f)):(e=N(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=N(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=x(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=d,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t};
1
+ import{b7 as j,b8 as p,b9 as w,ba as k,bb as q}from"./App-D7E7S49Q.js";import{i as D}from"./init-Gi6I4Gst.js";import{e as g,f as F,a as z,b as B}from"./defaultLocale-DX6XiGOO.js";function M(n,r){return n==null||r==null?NaN:n<r?-1:n>r?1:n>=r?0:NaN}function I(n,r){return n==null||r==null?NaN:r<n?-1:r>n?1:r>=n?0:NaN}function R(n){let r,t,e;n.length!==2?(r=M,t=(o,c)=>M(n(o),c),e=(o,c)=>n(o)-c):(r=n===M||n===I?n:P,t=n,e=n);function u(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<0?i=l+1:h=l}while(i<h)}return i}function f(o,c,i=0,h=o.length){if(i<h){if(r(c,c)!==0)return h;do{const l=i+h>>>1;t(o[l],c)<=0?i=l+1:h=l}while(i<h)}return i}function a(o,c,i=0,h=o.length){const l=u(o,c,i,h-1);return l>i&&e(o[l-1],c)>-e(o[l],c)?l-1:l}return{left:u,center:a,right:f}}function P(){return 0}function V(n){return n===null?NaN:+n}const $=R(M),x=$.right;R(V).center;const O=Math.sqrt(50),T=Math.sqrt(10),C=Math.sqrt(2);function v(n,r,t){const e=(r-n)/Math.max(0,t),u=Math.floor(Math.log10(e)),f=e/Math.pow(10,u),a=f>=O?10:f>=T?5:f>=C?2:1;let o,c,i;return u<0?(i=Math.pow(10,-u)/a,o=Math.round(n*i),c=Math.round(r*i),o/i<n&&++o,c/i>r&&--c,i=-i):(i=Math.pow(10,u)*a,o=Math.round(n/i),c=Math.round(r/i),o*i<n&&++o,c*i>r&&--c),c<o&&.5<=t&&t<2?v(n,r,t*2):[o,c,i]}function E(n,r,t){if(r=+r,n=+n,t=+t,!(t>0))return[];if(n===r)return[n];const e=r<n,[u,f,a]=e?v(r,n,t):v(n,r,t);if(!(f>=u))return[];const o=f-u+1,c=new Array(o);if(e)if(a<0)for(let i=0;i<o;++i)c[i]=(f-i)/-a;else for(let i=0;i<o;++i)c[i]=(f-i)*a;else if(a<0)for(let i=0;i<o;++i)c[i]=(u+i)/-a;else for(let i=0;i<o;++i)c[i]=(u+i)*a;return c}function y(n,r,t){return r=+r,n=+n,t=+t,v(n,r,t)[2]}function G(n,r,t){r=+r,n=+n,t=+t;const e=r<n,u=e?y(r,n,t):y(n,r,t);return(e?-1:1)*(u<0?1/-u:u)}function H(n,r){r||(r=[]);var t=n?Math.min(r.length,n.length):0,e=r.slice(),u;return function(f){for(u=0;u<t;++u)e[u]=n[u]*(1-f)+r[u]*f;return e}}function J(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function K(n,r){var t=r?r.length:0,e=n?Math.min(t,n.length):0,u=new Array(e),f=new Array(t),a;for(a=0;a<e;++a)u[a]=d(n[a],r[a]);for(;a<t;++a)f[a]=r[a];return function(o){for(a=0;a<e;++a)f[a]=u[a](o);return f}}function L(n,r){var t=new Date;return n=+n,r=+r,function(e){return t.setTime(n*(1-e)+r*e),t}}function Q(n,r){var t={},e={},u;(n===null||typeof n!="object")&&(n={}),(r===null||typeof r!="object")&&(r={});for(u in r)u in n?t[u]=d(n[u],r[u]):e[u]=r[u];return function(f){for(u in t)e[u]=t[u](f);return e}}function d(n,r){var t=typeof r,e;return r==null||t==="boolean"?j(r):(t==="number"?p:t==="string"?(e=w(r))?(r=e,k):q:r instanceof w?k:r instanceof Date?L:J(r)?H:Array.isArray(r)?K:typeof r.valueOf!="function"&&typeof r.toString!="function"||isNaN(r)?Q:p)(n,r)}function U(n,r){return n=+n,r=+r,function(t){return Math.round(n*(1-t)+r*t)}}function W(n){return Math.max(0,-g(Math.abs(n)))}function X(n,r){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(g(r)/3)))*3-g(Math.abs(n)))}function Y(n,r){return n=Math.abs(n),r=Math.abs(r)-n,Math.max(0,g(r)-g(n))+1}function Z(n){return function(){return n}}function _(n){return+n}var A=[0,1];function m(n){return n}function N(n,r){return(r-=n=+n)?function(t){return(t-n)/r}:Z(isNaN(r)?NaN:.5)}function b(n,r){var t;return n>r&&(t=n,n=r,r=t),function(e){return Math.max(n,Math.min(r,e))}}function nn(n,r,t){var e=n[0],u=n[1],f=r[0],a=r[1];return u<e?(e=N(u,e),f=t(a,f)):(e=N(e,u),f=t(f,a)),function(o){return f(e(o))}}function rn(n,r,t){var e=Math.min(n.length,r.length)-1,u=new Array(e),f=new Array(e),a=-1;for(n[e]<n[0]&&(n=n.slice().reverse(),r=r.slice().reverse());++a<e;)u[a]=N(n[a],n[a+1]),f[a]=t(r[a],r[a+1]);return function(o){var c=x(n,o,1,e)-1;return f[c](u[c](o))}}function en(n,r){return r.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function tn(){var n=A,r=A,t=d,e,u,f,a=m,o,c,i;function h(){var s=Math.min(n.length,r.length);return a!==m&&(a=b(n[0],n[s-1])),o=s>2?rn:nn,c=i=null,l}function l(s){return s==null||isNaN(s=+s)?f:(c||(c=o(n.map(e),r,t)))(e(a(s)))}return l.invert=function(s){return a(u((i||(i=o(r,n.map(e),p)))(s)))},l.domain=function(s){return arguments.length?(n=Array.from(s,_),h()):n.slice()},l.range=function(s){return arguments.length?(r=Array.from(s),h()):r.slice()},l.rangeRound=function(s){return r=Array.from(s),t=U,h()},l.clamp=function(s){return arguments.length?(a=s?!0:m,h()):a!==m},l.interpolate=function(s){return arguments.length?(t=s,h()):t},l.unknown=function(s){return arguments.length?(f=s,l):f},function(s,S){return e=s,u=S,h()}}function un(){return tn()(m,m)}function an(n,r,t,e){var u=G(n,r,t),f;switch(e=F(e??",f"),e.type){case"s":{var a=Math.max(Math.abs(n),Math.abs(r));return e.precision==null&&!isNaN(f=X(u,a))&&(e.precision=f),z(e,a)}case"":case"e":case"g":case"p":case"r":{e.precision==null&&!isNaN(f=Y(u,Math.max(Math.abs(n),Math.abs(r))))&&(e.precision=f-(e.type==="e"));break}case"f":case"%":{e.precision==null&&!isNaN(f=W(u))&&(e.precision=f-(e.type==="%")*2);break}}return B(e)}function on(n){var r=n.domain;return n.ticks=function(t){var e=r();return E(e[0],e[e.length-1],t??10)},n.tickFormat=function(t,e){var u=r();return an(u[0],u[u.length-1],t??10,e)},n.nice=function(t){t==null&&(t=10);var e=r(),u=0,f=e.length-1,a=e[u],o=e[f],c,i,h=10;for(o<a&&(i=a,a=o,o=i,i=u,u=f,f=i);h-- >0;){if(i=y(a,o,t),i===c)return e[u]=a,e[f]=o,r(e);if(i>0)a=Math.floor(a/i)*i,o=Math.ceil(o/i)*i;else if(i<0)a=Math.ceil(a*i)/i,o=Math.floor(o*i)/i;else break;c=i}return n},n}function fn(){var n=un();return n.copy=function(){return en(n,fn())},D.apply(n,arguments),on(n)}export{en as a,R as b,un as c,fn as l,G as t};
@@ -1,4 +1,4 @@
1
- import{g as le}from"./chunk-55IACEB6-Dhb0bOrW.js";import{s as he}from"./chunk-2J33WTMH-jLQK9et3.js";import{_ as h,l as R,o as de,r as ge,D as ue,G as W,c as M,i as H,b6 as pe,V as fe,W as me,X as ye}from"./App-CZNprfTP.js";import"./mobile-B-d4crm_.js";import"./index-BVnbNZXC.js";import"./graph-viND0NdB.js";const _=[];for(let t=0;t<256;++t)_.push((t+256).toString(16).slice(1));function Ee(t,e=0){return(_[t[e+0]]+_[t[e+1]]+_[t[e+2]]+_[t[e+3]]+"-"+_[t[e+4]]+_[t[e+5]]+"-"+_[t[e+6]]+_[t[e+7]]+"-"+_[t[e+8]]+_[t[e+9]]+"-"+_[t[e+10]]+_[t[e+11]]+_[t[e+12]]+_[t[e+13]]+_[t[e+14]]+_[t[e+15]]).toLowerCase()}let K;const _e=new Uint8Array(16);function be(){if(!K){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");K=crypto.getRandomValues.bind(crypto)}return K(_e)}const ke=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ie={randomUUID:ke};function Se(t,e,a){var n;if(ie.randomUUID&&!t)return ie.randomUUID();t=t||{};const l=t.random??((n=t.rng)==null?void 0:n.call(t))??be();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,Ee(l)}var Q=(function(){var t=h(function(O,s,i,o){for(i=i||{},o=O.length;o--;i[O[o]]=s);return i},"o"),e=[1,4],a=[1,13],l=[1,12],n=[1,15],d=[1,16],p=[1,20],y=[1,19],E=[6,7,8],k=[1,26],L=[1,24],N=[1,25],b=[6,7,11],$=[1,6,13,15,16,19,22],f=[1,33],U=[1,34],B=[1,6,7,11,13,15,16,19,22],X={trace:h(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:h(function(s,i,o,c,u,r,P){var g=r.length-1;switch(u){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[g].id),c.addNode(r[g-1].length,r[g].id,r[g].descr,r[g].type);break;case 16:c.getLogger().trace("Icon: ",r[g]),c.decorateNode({icon:r[g]});break;case 17:case 21:c.decorateNode({class:r[g]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[g].id),c.addNode(0,r[g].id,r[g].descr,r[g].type);break;case 20:c.decorateNode({icon:r[g]});break;case 25:c.getLogger().trace("node found ..",r[g-2]),this.$={id:r[g-1],descr:r[g-1],type:c.getType(r[g-2],r[g])};break;case 26:this.$={id:r[g],descr:r[g],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[g-3]),this.$={id:r[g-3],descr:r[g-1],type:c.getType(r[g-2],r[g])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:a,7:[1,10],9:9,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},t(E,[2,3]),{1:[2,2]},t(E,[2,4]),t(E,[2,5]),{1:[2,6],6:a,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},{6:a,9:22,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},{6:k,7:L,10:23,11:N},t(b,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:p,22:y}),t(b,[2,18]),t(b,[2,19]),t(b,[2,20]),t(b,[2,21]),t(b,[2,23]),t(b,[2,24]),t(b,[2,26],{19:[1,30]}),{20:[1,31]},{6:k,7:L,10:32,11:N},{1:[2,7],6:a,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},t($,[2,14],{7:f,11:U}),t(B,[2,8]),t(B,[2,9]),t(B,[2,10]),t(b,[2,15]),t(b,[2,16]),t(b,[2,17]),{20:[1,35]},{21:[1,36]},t($,[2,13],{7:f,11:U}),t(B,[2,11]),t(B,[2,12]),{21:[1,37]},t(b,[2,25]),t(b,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:h(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:h(function(s){var i=this,o=[0],c=[],u=[null],r=[],P=this.table,g="",F=0,Z=0,re=2,ee=1,oe=r.slice.call(arguments,1),m=Object.create(this.lexer),I={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(I.yy[z]=this.yy[z]);m.setInput(s,I.yy),I.yy.lexer=m,I.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var Y=m.yylloc;r.push(Y);var ae=m.options&&m.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(x){o.length=o.length-2*x,u.length=u.length-x,r.length=r.length-x}h(ce,"popStack");function te(){var x;return x=c.pop()||m.lex()||ee,typeof x!="number"&&(x instanceof Array&&(c=x,x=c.pop()),x=i.symbols_[x]||x),x}h(te,"lex");for(var S,C,D,q,w={},G,v,ne,j;;){if(C=o[o.length-1],this.defaultActions[C]?D=this.defaultActions[C]:((S===null||typeof S>"u")&&(S=te()),D=P[C]&&P[C][S]),typeof D>"u"||!D.length||!D[0]){var J="";j=[];for(G in P[C])this.terminals_[G]&&G>re&&j.push("'"+this.terminals_[G]+"'");m.showPosition?J="Parse error on line "+(F+1)+`:
1
+ import{g as le}from"./chunk-55IACEB6-uUk1WzZ1.js";import{s as he}from"./chunk-2J33WTMH-b8Rdk4S-.js";import{_ as h,l as R,o as de,r as ge,D as ue,G as W,c as M,i as H,b6 as pe,V as fe,W as me,X as ye}from"./App-D7E7S49Q.js";import"./mobile-DwmxS_O4.js";import"./index-DNuHtZwR.js";import"./graph-BBXaecIU.js";const _=[];for(let t=0;t<256;++t)_.push((t+256).toString(16).slice(1));function Ee(t,e=0){return(_[t[e+0]]+_[t[e+1]]+_[t[e+2]]+_[t[e+3]]+"-"+_[t[e+4]]+_[t[e+5]]+"-"+_[t[e+6]]+_[t[e+7]]+"-"+_[t[e+8]]+_[t[e+9]]+"-"+_[t[e+10]]+_[t[e+11]]+_[t[e+12]]+_[t[e+13]]+_[t[e+14]]+_[t[e+15]]).toLowerCase()}let K;const _e=new Uint8Array(16);function be(){if(!K){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");K=crypto.getRandomValues.bind(crypto)}return K(_e)}const ke=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),ie={randomUUID:ke};function Se(t,e,a){var n;if(ie.randomUUID&&!t)return ie.randomUUID();t=t||{};const l=t.random??((n=t.rng)==null?void 0:n.call(t))??be();if(l.length<16)throw new Error("Random bytes length must be >= 16");return l[6]=l[6]&15|64,l[8]=l[8]&63|128,Ee(l)}var Q=(function(){var t=h(function(O,s,i,o){for(i=i||{},o=O.length;o--;i[O[o]]=s);return i},"o"),e=[1,4],a=[1,13],l=[1,12],n=[1,15],d=[1,16],p=[1,20],y=[1,19],E=[6,7,8],k=[1,26],L=[1,24],N=[1,25],b=[6,7,11],$=[1,6,13,15,16,19,22],f=[1,33],U=[1,34],B=[1,6,7,11,13,15,16,19,22],X={trace:h(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:h(function(s,i,o,c,u,r,P){var g=r.length-1;switch(u){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[g].id),c.addNode(r[g-1].length,r[g].id,r[g].descr,r[g].type);break;case 16:c.getLogger().trace("Icon: ",r[g]),c.decorateNode({icon:r[g]});break;case 17:case 21:c.decorateNode({class:r[g]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[g].id),c.addNode(0,r[g].id,r[g].descr,r[g].type);break;case 20:c.decorateNode({icon:r[g]});break;case 25:c.getLogger().trace("node found ..",r[g-2]),this.$={id:r[g-1],descr:r[g-1],type:c.getType(r[g-2],r[g])};break;case 26:this.$={id:r[g],descr:r[g],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[g-3]),this.$={id:r[g-3],descr:r[g-1],type:c.getType(r[g-2],r[g])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:a,7:[1,10],9:9,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},t(E,[2,3]),{1:[2,2]},t(E,[2,4]),t(E,[2,5]),{1:[2,6],6:a,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},{6:a,9:22,12:11,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},{6:k,7:L,10:23,11:N},t(b,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:p,22:y}),t(b,[2,18]),t(b,[2,19]),t(b,[2,20]),t(b,[2,21]),t(b,[2,23]),t(b,[2,24]),t(b,[2,26],{19:[1,30]}),{20:[1,31]},{6:k,7:L,10:32,11:N},{1:[2,7],6:a,12:21,13:l,14:14,15:n,16:d,17:17,18:18,19:p,22:y},t($,[2,14],{7:f,11:U}),t(B,[2,8]),t(B,[2,9]),t(B,[2,10]),t(b,[2,15]),t(b,[2,16]),t(b,[2,17]),{20:[1,35]},{21:[1,36]},t($,[2,13],{7:f,11:U}),t(B,[2,11]),t(B,[2,12]),{21:[1,37]},t(b,[2,25]),t(b,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:h(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:h(function(s){var i=this,o=[0],c=[],u=[null],r=[],P=this.table,g="",F=0,Z=0,re=2,ee=1,oe=r.slice.call(arguments,1),m=Object.create(this.lexer),I={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(I.yy[z]=this.yy[z]);m.setInput(s,I.yy),I.yy.lexer=m,I.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var Y=m.yylloc;r.push(Y);var ae=m.options&&m.options.ranges;typeof I.yy.parseError=="function"?this.parseError=I.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function ce(x){o.length=o.length-2*x,u.length=u.length-x,r.length=r.length-x}h(ce,"popStack");function te(){var x;return x=c.pop()||m.lex()||ee,typeof x!="number"&&(x instanceof Array&&(c=x,x=c.pop()),x=i.symbols_[x]||x),x}h(te,"lex");for(var S,C,D,q,w={},G,v,ne,j;;){if(C=o[o.length-1],this.defaultActions[C]?D=this.defaultActions[C]:((S===null||typeof S>"u")&&(S=te()),D=P[C]&&P[C][S]),typeof D>"u"||!D.length||!D[0]){var J="";j=[];for(G in P[C])this.terminals_[G]&&G>re&&j.push("'"+this.terminals_[G]+"'");m.showPosition?J="Parse error on line "+(F+1)+`:
2
2
  `+m.showPosition()+`
3
3
  Expecting `+j.join(", ")+", got '"+(this.terminals_[S]||S)+"'":J="Parse error on line "+(F+1)+": Unexpected "+(S==ee?"end of input":"'"+(this.terminals_[S]||S)+"'"),this.parseError(J,{text:m.match,token:this.terminals_[S]||S,line:m.yylineno,loc:Y,expected:j})}if(D[0]instanceof Array&&D.length>1)throw new Error("Parse Error: multiple actions possible at state: "+C+", token: "+S);switch(D[0]){case 1:o.push(S),u.push(m.yytext),r.push(m.yylloc),o.push(D[1]),S=null,Z=m.yyleng,g=m.yytext,F=m.yylineno,Y=m.yylloc;break;case 2:if(v=this.productions_[D[1]][1],w.$=u[u.length-v],w._$={first_line:r[r.length-(v||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(v||1)].first_column,last_column:r[r.length-1].last_column},ae&&(w._$.range=[r[r.length-(v||1)].range[0],r[r.length-1].range[1]]),q=this.performAction.apply(w,[g,Z,F,I.yy,D[1],u,r].concat(oe)),typeof q<"u")return q;v&&(o=o.slice(0,-1*v*2),u=u.slice(0,-1*v),r=r.slice(0,-1*v)),o.push(this.productions_[D[1]][0]),u.push(w.$),r.push(w._$),ne=P[o[o.length-2]][o[o.length-1]],o.push(ne);break;case 3:return!0}}return!0},"parse")},se=(function(){var O={EOF:1,parseError:h(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},"parseError"),setInput:h(function(s,i){return this.yy=i||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:h(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:h(function(s){var i=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var c=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),o.length-1&&(this.yylineno-=o.length-1);var u=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:o?(o.length===c.length?this.yylloc.first_column:0)+c[c.length-o.length].length-o[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:h(function(){return this._more=!0,this},"more"),reject:h(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:h(function(s){this.unput(this.match.slice(s))},"less"),pastInput:h(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:h(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:h(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
@@ -0,0 +1,17 @@
1
+ function Ze(e,a){for(var s=0;s<a.length;s++){const n=a[s];if(typeof n!="string"&&!Array.isArray(n)){for(const i in n)if(i!=="default"&&!(i in e)){const u=Object.getOwnPropertyDescriptor(n,i);u&&Object.defineProperty(e,i,u.get?u:{enumerable:!0,get:()=>n[i]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Js=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function et(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ge={exports:{}},ae={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Te;function tt(){if(Te)return ae;Te=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function s(n,i,u){var c=null;if(u!==void 0&&(c=""+u),i.key!==void 0&&(c=""+i.key),"key"in i){u={};for(var l in i)l!=="key"&&(u[l]=i[l])}else u=i;return i=u.ref,{$$typeof:e,type:n,key:c,ref:i!==void 0?i:null,props:u}}return ae.Fragment=a,ae.jsx=s,ae.jsxs=s,ae}var Ee;function st(){return Ee||(Ee=1,ge.exports=tt()),ge.exports}var t=st(),xe={exports:{}},I={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Ae;function at(){if(Ae)return I;Ae=1;var e=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),c=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),f=Symbol.for("react.activity"),b=Symbol.iterator;function h(o){return o===null||typeof o!="object"?null:(o=b&&o[b]||o["@@iterator"],typeof o=="function"?o:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,w={};function T(o,k,_){this.props=o,this.context=k,this.refs=w,this.updater=_||N}T.prototype.isReactComponent={},T.prototype.setState=function(o,k){if(typeof o!="object"&&typeof o!="function"&&o!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,o,k,"setState")},T.prototype.forceUpdate=function(o){this.updater.enqueueForceUpdate(this,o,"forceUpdate")};function S(){}S.prototype=T.prototype;function E(o,k,_){this.props=o,this.context=k,this.refs=w,this.updater=_||N}var j=E.prototype=new S;j.constructor=E,C(j,T.prototype),j.isPureReactComponent=!0;var x=Array.isArray;function p(){}var y={H:null,A:null,T:null,S:null},v=Object.prototype.hasOwnProperty;function A(o,k,_){var $=_.ref;return{$$typeof:e,type:o,key:k,ref:$!==void 0?$:null,props:_}}function M(o,k){return A(o.type,k,o.props)}function P(o){return typeof o=="object"&&o!==null&&o.$$typeof===e}function O(o){var k={"=":"=0",":":"=2"};return"$"+o.replace(/[=:]/g,function(_){return k[_]})}var L=/\/+/g;function F(o,k){return typeof o=="object"&&o!==null&&o.key!=null?O(""+o.key):k.toString(36)}function Y(o){switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:switch(typeof o.status=="string"?o.then(p,p):(o.status="pending",o.then(function(k){o.status==="pending"&&(o.status="fulfilled",o.value=k)},function(k){o.status==="pending"&&(o.status="rejected",o.reason=k)})),o.status){case"fulfilled":return o.value;case"rejected":throw o.reason}}throw o}function q(o,k,_,$,D){var U=typeof o;(U==="undefined"||U==="boolean")&&(o=null);var G=!1;if(o===null)G=!0;else switch(U){case"bigint":case"string":case"number":G=!0;break;case"object":switch(o.$$typeof){case e:case a:G=!0;break;case m:return G=o._init,q(G(o._payload),k,_,$,D)}}if(G)return D=D(o),G=$===""?"."+F(o,0):$,x(D)?(_="",G!=null&&(_=G.replace(L,"$&/")+"/"),q(D,k,_,"",function(R){return R})):D!=null&&(P(D)&&(D=M(D,_+(D.key==null||o&&o.key===D.key?"":(""+D.key).replace(L,"$&/")+"/")+G)),k.push(D)),1;G=0;var W=$===""?".":$+":";if(x(o))for(var J=0;J<o.length;J++)$=o[J],U=W+F($,J),G+=q($,k,_,U,D);else if(J=h(o),typeof J=="function")for(o=J.call(o),J=0;!($=o.next()).done;)$=$.value,U=W+F($,J++),G+=q($,k,_,U,D);else if(U==="object"){if(typeof o.then=="function")return q(Y(o),k,_,$,D);throw k=String(o),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}return G}function z(o,k,_){if(o==null)return o;var $=[],D=0;return q(o,$,"","",function(U){return k.call(_,U,D++)}),$}function te(o){if(o._status===-1){var k=o._result;k=k(),k.then(function(_){(o._status===0||o._status===-1)&&(o._status=1,o._result=_)},function(_){(o._status===0||o._status===-1)&&(o._status=2,o._result=_)}),o._status===-1&&(o._status=0,o._result=k)}if(o._status===1)return o._result.default;throw o._result}var Q=typeof reportError=="function"?reportError:function(o){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var k=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof o=="object"&&o!==null&&typeof o.message=="string"?String(o.message):String(o),error:o});if(!window.dispatchEvent(k))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",o);return}console.error(o)},K={map:z,forEach:function(o,k,_){z(o,function(){k.apply(this,arguments)},_)},count:function(o){var k=0;return z(o,function(){k++}),k},toArray:function(o){return z(o,function(k){return k})||[]},only:function(o){if(!P(o))throw Error("React.Children.only expected to receive a single React element child.");return o}};return I.Activity=f,I.Children=K,I.Component=T,I.Fragment=s,I.Profiler=i,I.PureComponent=E,I.StrictMode=n,I.Suspense=d,I.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=y,I.__COMPILER_RUNTIME={__proto__:null,c:function(o){return y.H.useMemoCache(o)}},I.cache=function(o){return function(){return o.apply(null,arguments)}},I.cacheSignal=function(){return null},I.cloneElement=function(o,k,_){if(o==null)throw Error("The argument must be a React element, but you passed "+o+".");var $=C({},o.props),D=o.key;if(k!=null)for(U in k.key!==void 0&&(D=""+k.key),k)!v.call(k,U)||U==="key"||U==="__self"||U==="__source"||U==="ref"&&k.ref===void 0||($[U]=k[U]);var U=arguments.length-2;if(U===1)$.children=_;else if(1<U){for(var G=Array(U),W=0;W<U;W++)G[W]=arguments[W+2];$.children=G}return A(o.type,D,$)},I.createContext=function(o){return o={$$typeof:c,_currentValue:o,_currentValue2:o,_threadCount:0,Provider:null,Consumer:null},o.Provider=o,o.Consumer={$$typeof:u,_context:o},o},I.createElement=function(o,k,_){var $,D={},U=null;if(k!=null)for($ in k.key!==void 0&&(U=""+k.key),k)v.call(k,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(D[$]=k[$]);var G=arguments.length-2;if(G===1)D.children=_;else if(1<G){for(var W=Array(G),J=0;J<G;J++)W[J]=arguments[J+2];D.children=W}if(o&&o.defaultProps)for($ in G=o.defaultProps,G)D[$]===void 0&&(D[$]=G[$]);return A(o,U,D)},I.createRef=function(){return{current:null}},I.forwardRef=function(o){return{$$typeof:l,render:o}},I.isValidElement=P,I.lazy=function(o){return{$$typeof:m,_payload:{_status:-1,_result:o},_init:te}},I.memo=function(o,k){return{$$typeof:g,type:o,compare:k===void 0?null:k}},I.startTransition=function(o){var k=y.T,_={};y.T=_;try{var $=o(),D=y.S;D!==null&&D(_,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(p,Q)}catch(U){Q(U)}finally{k!==null&&_.types!==null&&(k.types=_.types),y.T=k}},I.unstable_useCacheRefresh=function(){return y.H.useCacheRefresh()},I.use=function(o){return y.H.use(o)},I.useActionState=function(o,k,_){return y.H.useActionState(o,k,_)},I.useCallback=function(o,k){return y.H.useCallback(o,k)},I.useContext=function(o){return y.H.useContext(o)},I.useDebugValue=function(){},I.useDeferredValue=function(o,k){return y.H.useDeferredValue(o,k)},I.useEffect=function(o,k){return y.H.useEffect(o,k)},I.useEffectEvent=function(o){return y.H.useEffectEvent(o)},I.useId=function(){return y.H.useId()},I.useImperativeHandle=function(o,k,_){return y.H.useImperativeHandle(o,k,_)},I.useInsertionEffect=function(o,k){return y.H.useInsertionEffect(o,k)},I.useLayoutEffect=function(o,k){return y.H.useLayoutEffect(o,k)},I.useMemo=function(o,k){return y.H.useMemo(o,k)},I.useOptimistic=function(o,k){return y.H.useOptimistic(o,k)},I.useReducer=function(o,k,_){return y.H.useReducer(o,k,_)},I.useRef=function(o){return y.H.useRef(o)},I.useState=function(o){return y.H.useState(o)},I.useSyncExternalStore=function(o,k,_){return y.H.useSyncExternalStore(o,k,_)},I.useTransition=function(){return y.H.useTransition()},I.version="19.2.7",I}var Re;function nt(){return Re||(Re=1,xe.exports=at()),xe.exports}var r=nt();const rt=et(r),Ys=Ze({__proto__:null,default:rt},[r]),je={},it=(je==null?void 0:je.VITE_COMPOSE_API_TOKEN)||"";let Fe=null;function ee(e){Fe=e||null}function le(){return Fe||it||""}function V(e={}){const a=le();return a?{...e,"x-compose-token":a}:e}const oe="compose:mobile:accessToken",ie="compose:mobile:refreshToken",pe="compose:mobile:accessExpiry";let ne=null,fe=null;function lt(e){fe=e}async function ot(){const e=localStorage.getItem(oe),a=parseInt(localStorage.getItem(pe)||"0",10);return e&&a>Date.now()+3e4?(le()!==e&&ee(e),e):Ge()}async function Ge(){if(ne)return ne;const e=localStorage.getItem(ie);if(!e)throw new Error("NoRefreshToken");return ne=fetch("/api/auth/refresh",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refresh_token:e})}).then(async a=>{if(!a.ok)throw localStorage.removeItem(oe),localStorage.removeItem(ie),localStorage.removeItem(pe),ee(localStorage.getItem("compose:mobile:sensitiveToken")||null),fe==null||fe("cockpit"),new Error("RefreshFailed");const s=await a.json();return localStorage.setItem(oe,s.access_token),localStorage.setItem(ie,s.refresh_token),localStorage.setItem(pe,String(Date.now()+s.expires_in*1e3)),ee(s.access_token),s.access_token}).finally(()=>{ne=null}),ne}let we=null,ce="cockpit";lt(e=>{ce=e});function qs(e){we=e??null}function He(e){ce=e}function Se(){return ce}async function B(e,a={}){if(ce==="mobile-paired")try{await ot()}catch{}const s={...a.headers||{}};we&&(s["X-Compose-Workspace-Id"]=we);const n=le();n&&(ce==="mobile-paired"?s.Authorization=`Bearer ${n}`:s["x-compose-token"]=n);let i=await fetch(e,{...a,headers:s});if(i.status===401){if((await i.clone().json().catch(()=>({}))).code==="TokenExpired"){try{await Ge()}catch{throw window.location.href="/m/pair",new Error("NeedsPairing")}i=await fetch(e,{...a,headers:{...s,Authorization:`Bearer ${le()}`}})}if(i.status===401){const c=await i.clone().json().catch(()=>({}));if(c.code==="TokenExpired"||c.code==="TokenInvalid")throw window.location.href="/m/pair",new Error("NeedsPairing")}}return i}let ke=!1;function Be(e){ke=!0}function Ks(){return ke}function ct(){if(Se()==="mobile-paired"){try{const e=localStorage.getItem(oe);if(e)return e}catch{}return null}if(ke){const e=le();if(e)return e}return null}function Ce(e){const a=ct();return a?`${e}?token=${encodeURIComponent(a)}`:e}function Je(e){return`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}${e}`}function ue(){return Ce(Je("/ws/vision"))}function Ws(){return Ce(Je("/ws/files"))}function dt(e){return Ce(e)}function ut(e){return e?/iPad|iPhone|iPod/.test(e)?"iOS":/Android/.test(e)?"Android":/Mac/.test(e)?"macOS":/Win/.test(e)?"Windows":/Linux/.test(e)?"Linux":"Unknown":"Unknown"}function mt(e){return e?/Edg/.test(e)?"Edge":/CriOS|Chrome/.test(e)?"Chrome":/FxiOS|Firefox/.test(e)?"Firefox":/Safari/.test(e)?"Safari":"Browser":"Browser"}function ft(e){const a=String(e).indexOf("?");if(a===-1)return null;try{return new URLSearchParams(String(e).slice(a+1)).get("code")||null}catch{return null}}function ht(){const[e,a]=r.useState(()=>{try{return new URLSearchParams(window.location.search||"").get("code")||null}catch{return null}}),[s,n]=r.useState(()=>{const b=typeof navigator<"u"&&navigator.userAgent||"";return`${ut(b)} (${mt(b)})`}),[i,u]=r.useState(!1),[c,l]=r.useState(null),[d,g]=r.useState(""),m=r.useCallback(b=>{const h=b.target.value;g(h);const N=ft(h);N&&(a(N),l(null))},[]),f=r.useCallback(async b=>{if(b==null||b.preventDefault(),!!e){u(!0),l(null);try{const h=await fetch("/api/auth/pair/complete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,device_name:s})}),N=await h.json().catch(()=>({}));if(!h.ok){const C=(N==null?void 0:N.error)||`HTTP ${h.status}`;l(`Pairing failed: ${C}. On your desktop, run \`compose remote pair\` to generate a new code.`);return}localStorage.setItem(oe,N.access_token),localStorage.setItem(ie,N.refresh_token),localStorage.setItem(pe,String(Date.now()+N.expires_in*1e3)),ee(N.access_token),He("mobile-paired"),Be(!0),window.location.href="/m/agents"}catch(h){l(`Pairing failed: ${h.message}. On your desktop, run \`compose remote pair\` to generate a new code.`)}finally{u(!1)}}},[e,s]);return e?t.jsxs("div",{className:"m-root","data-testid":"mobile-pair-code-screen",children:[t.jsx("header",{className:"m-header",children:t.jsx("div",{className:"m-header-title",children:"Complete pairing"})}),t.jsxs("main",{className:"m-main m-pair-page",children:[t.jsx("p",{className:"m-pair-instructions",children:"Give this device a name so you can recognize it in the paired devices list."}),t.jsxs("form",{onSubmit:f,className:"m-pair-form",children:[t.jsxs("div",{className:"m-pair-field",children:[t.jsx("label",{htmlFor:"m-pair-device-name",className:"m-pair-label",children:"Device name"}),t.jsx("input",{id:"m-pair-device-name","data-testid":"mobile-pair-device-name-input",className:"m-pair-input",type:"text",value:s,onChange:b=>n(b.target.value),disabled:i,required:!0})]}),c&&t.jsx("p",{"data-testid":"mobile-pair-error",className:"m-pair-error",children:c}),t.jsx("button",{type:"submit","data-testid":"mobile-pair-submit-btn",className:"m-pair-btn",disabled:i||!s.trim(),children:i?"Pairing…":"Pair this device"})]})]})]}):t.jsxs("div",{className:"m-root","data-testid":"mobile-pair-codeless-screen",children:[t.jsx("header",{className:"m-header",children:t.jsx("div",{className:"m-header-title",children:"Pair this device"})}),t.jsxs("main",{className:"m-main m-pair-page",children:[t.jsxs("p",{"data-testid":"mobile-pair-codeless-instructions",className:"m-pair-instructions",children:["This device is no longer paired (or pairing has expired). On your desktop, run ",t.jsx("code",{children:"compose remote pair"})," or open Cockpit → Pair mobile, then scan the new QR code. If your camera is unavailable, paste the pairing URL below:"]}),t.jsxs("div",{className:"m-pair-field",children:[t.jsx("label",{htmlFor:"m-pair-url-input",className:"m-pair-label",children:"Pairing URL"}),t.jsx("input",{id:"m-pair-url-input","data-testid":"mobile-pair-url-input",className:"m-pair-input",type:"text",placeholder:"https://your-host/m/pair?code=...",value:d,onChange:m,autoComplete:"off"})]}),c&&t.jsx("p",{"data-testid":"mobile-pair-error",className:"m-pair-error",children:c})]})]})}const pt=[{id:"explore_design",name:"Explore Design",agent:"claude",phase:"design",hasGate:!1},{id:"design_review",name:"Design Review",agent:"codex",phase:"design",hasGate:!1},{id:"design_gate",name:"Design Gate",agent:"human",phase:"design",hasGate:!0},{id:"prd",name:"PRD",agent:"claude",phase:"design",hasGate:!1},{id:"prd_review",name:"PRD Review",agent:"codex",phase:"design",hasGate:!1},{id:"prd_gate",name:"PRD Gate",agent:"human",phase:"design",hasGate:!0},{id:"architecture",name:"Architecture",agent:"claude",phase:"design",hasGate:!1},{id:"architecture_review",name:"Arch Review",agent:"codex",phase:"design",hasGate:!1},{id:"architecture_gate",name:"Arch Gate",agent:"human",phase:"design",hasGate:!0},{id:"blueprint",name:"Blueprint",agent:"claude",phase:"blueprint",hasGate:!1},{id:"verification",name:"Verification",agent:"claude",phase:"blueprint",hasGate:!1},{id:"blueprint_review",name:"BP Review",agent:"codex",phase:"blueprint",hasGate:!1},{id:"plan",name:"Plan",agent:"claude",phase:"implementation",hasGate:!1},{id:"plan_review",name:"Plan Review",agent:"codex",phase:"implementation",hasGate:!1},{id:"plan_gate",name:"Plan Gate",agent:"human",phase:"implementation",hasGate:!0},{id:"execute",name:"Execute",agent:"claude",phase:"implementation",hasGate:!1},{id:"review",name:"Review Loop",agent:"codex",phase:"implementation",hasGate:!1},{id:"coverage",name:"Coverage Sweep",agent:"claude",phase:"implementation",hasGate:!1},{id:"report",name:"Report",agent:"claude",phase:"ship",hasGate:!1},{id:"report_review",name:"Report Review",agent:"codex",phase:"ship",hasGate:!1},{id:"report_gate",name:"Report Gate",agent:"human",phase:"ship",hasGate:!0},{id:"docs",name:"Docs",agent:"claude",phase:"ship",hasGate:!1},{id:"ship",name:"Ship",agent:"claude",phase:"ship",hasGate:!1},{id:"ship_gate",name:"Ship Gate",agent:"human",phase:"ship",hasGate:!0}],bt=new Set(["complete","completed","aborted","failed","killed","done"]);function de(e){return bt.has(e)}function yt(e,a,s){const n=Array.isArray(a)?Object.fromEntries(a.map(c=>[c.id,c.status])):{},i=Array.isArray(a)?Object.fromEntries(a.map(c=>[c.id,c])):{},u=e.map(c=>{const l=i[c.id],d=l?{...c,...l}:{...c};return d.id===s&&!n[d.id]&&(d.status="active"),d});if(Array.isArray(a))for(const c of a)e.find(l=>l.id===c.id)||u.push({id:c.id,name:c.id.replace(/_/g," "),agent:"claude",phase:"implementation",...c});return u}function gt(e,a,s){if(!e)return!1;const{featureCode:n,status:i,currentStepId:u}=e;if(i!=="running"||!u||!u.endsWith("_gate"))return!1;const c=Array.isArray(s)?s:[],l=c.find(d=>d.featureCode===n)||c.find(d=>d.title===n)||c.find(d=>d.title&&d.title.startsWith(n+":"));return l?(Array.isArray(a)?a:[]).some(d=>d.itemId===l.id&&!d.resolvedAt):!1}const xt=[{id:"agents",label:"Agents",icon:"◇"},{id:"roadmap",label:"Roadmap",icon:"⚡"},{id:"builds",label:"Builds",icon:"⏵"},{id:"ideas",label:"Ideas",icon:"✦"}];function jt({active:e,onSelect:a,badges:s}){return t.jsx("nav",{className:"m-bottom-nav",role:"tablist","aria-label":"Mobile navigation",children:xt.map(n=>{const i=s==null?void 0:s[n.id];return t.jsxs("button",{type:"button",className:"m-nav-btn",role:"tab","aria-pressed":e===n.id?"true":"false","aria-label":n.label,"data-tab":n.id,"data-testid":`mobile-nav-${n.id}`,onClick:()=>a(n.id),children:[t.jsxs("span",{className:"m-nav-icon-wrap",children:[t.jsx("span",{className:"m-nav-icon","aria-hidden":"true",children:n.icon}),i&&t.jsx("span",{className:`m-nav-badge m-nav-badge-${i.level||"info"}`,"data-testid":`mobile-nav-badge-${n.id}`,"aria-hidden":"true",children:i.count!=null?String(i.count):""})]}),t.jsx("span",{className:"m-nav-label",children:n.label})]},n.id)})})}function me({url:e,onMessage:a,onOpen:s,onClose:n,onError:i,maxBackoffMs:u=3e4}){let c=null,l=0,d=!1,g=null;function m(h){return typeof h=="function"?h():h}function f(){if(!d){try{c=new WebSocket(m(e))}catch(h){i==null||i(h),b();return}c.onopen=()=>{l=0,s==null||s(c)},c.onmessage=h=>a==null?void 0:a(h),c.onclose=()=>{n==null||n(),b()},c.onerror=h=>{i==null||i(h)}}}function b(){if(d||g)return;const h=Math.min(u,1e3*Math.pow(2,l++));g=setTimeout(()=>{g=null,f()},h)}return f(),{get socket(){return c},isOpen(){return(c==null?void 0:c.readyState)===1},send(h){(c==null?void 0:c.readyState)===1&&c.send(h)},close(){if(d=!0,g&&(clearTimeout(g),g=null),c){try{c.onclose=null,c.onerror=null,c.close()}catch{}c=null}}}}async function Nt(e,a={}){const s=await B(e,a);let n=null;try{n=await s.json()}catch{}if(!s.ok){const i=n&&n.error||`HTTP ${s.status}`;throw new Error(i)}return n}function vt(){const[e,a]=r.useState([]),[s,n]=r.useState(!0),[i,u]=r.useState(null),c=r.useRef(!0),l=r.useCallback(async()=>{try{const d=await Nt("/api/agents/tree");if(!c.current)return;a(Array.isArray(d==null?void 0:d.agents)?d.agents:[]),u(null)}catch(d){if(!c.current)return;u(d.message)}finally{c.current&&n(!1)}},[]);return r.useEffect(()=>(c.current=!0,l(),()=>{c.current=!1}),[l]),r.useEffect(()=>{if(typeof window>"u"||typeof WebSocket>"u")return;const d=me({url:()=>ue(),onMessage:g=>{try{const m=JSON.parse(g.data);if(!m||!m.type)return;(m.type==="agentSpawned"||m.type==="agentStopped"||m.type==="agentStatusChanged"||m.type==="agentTreeUpdated")&&l()}catch{}}});return()=>{try{d.close()}catch{}}},[l]),{agents:e,loading:s,error:i,refetch:l}}const Ne={};function Ye(e){if(typeof window>"u"||!window.location)return e;const a=typeof import.meta<"u"&&(Ne==null?void 0:Ne.VITE_AGENT_PORT)||"4002";return`${window.location.protocol}//${window.location.hostname}:${a}${e}`}const wt=5e3,St={"/api/agent/session":"/api/agent/proxy/session","/api/agent/message":"/api/agent/proxy/message","/api/agent/interrupt":"/api/agent/proxy/interrupt","/api/agent/session/status":"/api/agent/proxy/session/status"};function qe(e){return Se()==="mobile-paired"?St[e]||e:Ye(e)}async function _e(e,a){const s=await B(qe(e),{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify(a||{})});let n=null;try{n=await s.json()}catch{}if(!s.ok){const i=n&&n.error||`HTTP ${s.status}`;throw new Error(i)}return n}function kt(){const[e,a]=r.useState(!1),[s,n]=r.useState(null),[i,u]=r.useState(!0),[c,l]=r.useState(null),[d,g]=r.useState(!1),m=r.useRef(!0),f=r.useCallback(async()=>{try{const C=await(await B(qe("/api/agent/session/status"))).json().catch(()=>({}));if(!m.current)return;a(!!C.active),n(C.sessionId||null),l(null)}catch(N){if(!m.current)return;l(N.message)}finally{m.current&&u(!1)}},[]);r.useEffect(()=>{m.current=!0,f();const N=setInterval(f,wt);return()=>{m.current=!1,clearInterval(N)}},[f]);const b=r.useCallback(async N=>{const C=(N||"").trim();if(!C)throw new Error("message is empty");g(!0);try{const T=await _e(s?"/api/agent/message":"/api/agent/session",{prompt:C});return f(),T}finally{g(!1)}},[s,f]),h=r.useCallback(async()=>_e("/api/agent/interrupt",{}),[]);return{active:e,sessionId:s,loading:i,error:c,sending:d,sendMessage:b,interrupt:h,refresh:f}}function Ct(e){if(!e)return"";const a=typeof e=="string"?Date.parse(e):Number(e);if(!a||Number.isNaN(a))return"";const s=Date.now()-a;return s<5e3?"just now":s<6e4?`${Math.floor(s/1e3)}s ago`:s<36e5?`${Math.floor(s/6e4)}m ago`:`${Math.floor(s/36e5)}h ago`}function Tt({agent:e,onOpen:a,onAfterKill:s}){const[n,i]=r.useState(!1),[u,c]=r.useState(null),l=e.agentId||e.id,d=e.status||"unknown",g=e.lastActivityAt||e.lastEventAt||e.startedAt||null,m=r.useCallback(async b=>{if(b==null||b.stopPropagation(),!!l){i(!0),c(null);try{const h=await B(`/api/agent/${encodeURIComponent(l)}/stop`,{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify({})});if(!h.ok){let N=null;try{N=await h.json()}catch{}throw new Error(N&&N.error||`HTTP ${h.status}`)}s==null||s(l)}catch(h){c(h.message)}finally{i(!1)}}},[l,s]),f=r.useCallback(()=>a==null?void 0:a(e),[a,e]);return t.jsxs("div",{className:"m-agent-card","data-testid":`mobile-agent-card-${l}`,role:"button",tabIndex:0,onClick:f,onKeyDown:b=>{b.key==="Enter"&&f()},children:[t.jsxs("div",{className:"m-agent-card-row",children:[t.jsx("div",{className:"m-agent-card-id",title:l,children:l||"(no id)"}),t.jsx("span",{className:"m-status-pill","data-status":d,children:d})]}),t.jsxs("div",{className:"m-agent-card-meta",children:[t.jsx("span",{className:"m-agent-card-time",children:Ct(g)}),t.jsx("button",{type:"button",className:"m-btn m-btn-danger m-btn-sm","data-testid":`mobile-agent-kill-${l}`,disabled:n||d!=="running",onClick:m,children:n?"Killing…":"Kill"})]}),u&&t.jsx("div",{className:"m-agent-card-error",children:u})]})}const Et=3e4,At=5,Rt=3e4;function _t({url:e,onEvent:a,onOpen:s,onClose:n,onError:i,onRetry:u,onStall:c,onExhausted:l,namedEvents:d=["hydrate"],maxBackoffMs:g=Et,maxRetries:m=At,stallTimeoutMs:f=Rt}){if(!e)throw new Error("createAgentStream: url is required");if(typeof EventSource>"u")return{close(){}};let b=null,h=!1,N=0,C=null,w=null;function T(){w&&clearTimeout(w),!h&&(w=setTimeout(()=>{c==null||c({elapsedMs:f})},f))}function S(){w&&(clearTimeout(w),w=null)}function E(p,y){if(T(),!!a)try{const v=JSON.parse(y);a(v,p)}catch{}}function j(){if(S(),h||C)return;if(N>=m){const y=new Error(`agent-stream: failed after ${m} retries`);i==null||i(y),h=!0;try{b==null||b.close()}catch{}b=null,n==null||n(),l==null||l();return}const p=Math.min(g,1e3*Math.pow(2,N));N+=1,u==null||u({attempt:N,maxRetries:m,nextBackoffMs:p}),C=setTimeout(()=>{C=null,x()},p)}function x(){if(!h){try{b=new EventSource(e)}catch(p){i==null||i(p),j();return}b.onopen=()=>{N=0,S(),s==null||s()},b.onmessage=p=>E("message",p.data);for(const p of d)b.addEventListener(p,y=>E(p,y.data));b.onerror=p=>{i==null||i(p instanceof Error?p:new Error("agent-stream error"));try{b==null||b.close()}catch{}b=null,n==null||n(),j()}}}return x(),{close(){h=!0,S(),C&&(clearTimeout(C),C=null);try{b==null||b.close()}catch{}b=null},reconnect(){h=!1,N=0,S(),C&&(clearTimeout(C),C=null);try{b==null||b.close()}catch{}b=null,x()}}}function $t(){return typeof window>"u"||!window.location?"":Se()==="mobile-paired"?dt("/api/agent/proxy/stream"):Ye("/api/agent/stream")}function Pt(e){return!e||typeof e!="object"?null:e.agentId||e.agent_id||e.id||null}function Ke({url:e,agentId:a,max:s=500,enabled:n=!0}={}){const[i,u]=r.useState([]),[c,l]=r.useState(!1),d=r.useRef(null),g=r.useMemo(()=>e||$t(),[e]);return r.useEffect(()=>{if(!n||!g)return;const f=_t({url:g,onOpen:()=>l(!0),onClose:()=>l(!1),onEvent:b=>{u(h=>{const N=h.length>=s?h.slice(h.length-s+1):h.slice();return N.push(b),N})}});return d.current=f,()=>{try{f.close()}catch{}}},[g,n,s]),{events:r.useMemo(()=>a?i.filter(f=>Pt(f)===a):i,[i,a]),allEvents:i,connected:c}}function It(e,a){if(typeof e=="string")return e;if(e!=null&&e.type&&(e!=null&&e.message))return`[${e.type}] ${typeof e.message=="string"?e.message:JSON.stringify(e.message)}`;if(e!=null&&e.type)return`[${e.type}] ${JSON.stringify(e).slice(0,240)}`;try{return JSON.stringify(e)}catch{return`(unserializable #${a})`}}function Lt({agent:e,onClose:a}){const s=(e==null?void 0:e.agentId)||(e==null?void 0:e.id),{events:n}=Ke({agentId:s}),i=r.useRef(null),[u,c]=r.useState(!1),[l,d]=r.useState(null);r.useEffect(()=>{var m;(m=i.current)==null||m.scrollIntoView({behavior:"smooth"})},[n.length]);const g=r.useCallback(async()=>{if(s){c(!0),d(null);try{const m=await B(`/api/agent/${encodeURIComponent(s)}/stop`,{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify({})});if(!m.ok){let f=null;try{f=await m.json()}catch{}throw new Error(f&&f.error||`HTTP ${m.status}`)}}catch(m){d(m.message)}finally{c(!1)}}},[s]);return e?t.jsxs("div",{className:"m-overlay","data-testid":"mobile-agent-detail",role:"dialog","aria-modal":"true",children:[t.jsxs("header",{className:"m-overlay-header",children:[t.jsxs("div",{className:"m-overlay-header-inner",children:[t.jsx("div",{className:"m-overlay-title",title:s,children:s}),t.jsx("span",{className:"m-status-pill","data-status":e.status,children:e.status||"unknown"})]}),t.jsxs("div",{className:"m-overlay-actions",children:[t.jsx("button",{type:"button",className:"m-btn m-btn-danger m-btn-sm",disabled:u,onClick:g,"data-testid":"mobile-agent-detail-kill",children:u?"Killing…":"Kill"}),t.jsx("button",{type:"button",className:"m-btn m-btn-sm",onClick:a,"data-testid":"mobile-agent-detail-close",children:"Close"})]})]}),t.jsxs("div",{className:"m-overlay-body m-agent-log",children:[n.length===0?t.jsx("div",{className:"m-empty",children:"No live events for this agent yet."}):n.map((m,f)=>t.jsx("div",{className:"m-agent-log-line",children:It(m,f)},f)),t.jsx("div",{ref:i})]}),l&&t.jsx("div",{className:"m-agent-card-error",children:l})]}):null}function Ot({session:e}){const{active:a,sessionId:s,sending:n,sendMessage:i}=e,[u,c]=r.useState(""),[l,d]=r.useState(null),g=r.useCallback(async m=>{if(m==null||m.preventDefault(),!!u.trim()){d(null);try{await i(u),c("")}catch(f){d(f.message)}}},[u,i]);return t.jsxs("div",{className:"m-session-card","data-testid":"mobile-interactive-session",children:[t.jsxs("div",{className:"m-session-card-row",children:[t.jsx("div",{className:"m-session-card-title",children:"Interactive session"}),t.jsx("span",{className:"m-status-pill","data-status":a?"in_progress":"planned",children:a?"active":"ready"})]}),t.jsx("div",{className:"m-session-card-id",children:s?`id: ${s}`:"No active session"}),t.jsxs("form",{className:"m-session-card-form",onSubmit:g,children:[t.jsx("input",{type:"text",className:"m-input",placeholder:a?"Message Claude…":"Start a new session…",value:u,onChange:m=>c(m.target.value),"data-testid":"mobile-interactive-session-input",disabled:n}),t.jsx("button",{type:"submit",className:"m-btn m-btn-primary m-btn-sm",disabled:n||!u.trim(),"data-testid":"mobile-interactive-session-send",children:n?"Sending…":"Send"})]}),l&&t.jsx("div",{className:"m-agent-card-error",children:l})]})}function Mt({gate:e,onOpen:a}){const s=e.id,n=e.flowId||e.flow||"",i=e.stepId||e.step||"",u=e.summary||e.comment||"",c=e.toPhase||e.fromPhase||"";return t.jsxs("div",{className:"m-gate-card","data-testid":`mobile-gate-card-${s}`,role:"button",tabIndex:0,onClick:()=>a==null?void 0:a(e),onKeyDown:l=>{l.key==="Enter"&&(a==null||a(e))},children:[t.jsxs("div",{className:"m-gate-card-row",children:[t.jsx("div",{className:"m-gate-card-title",children:n||s}),c&&t.jsx("span",{className:"m-status-pill","data-status":"in_progress",children:c})]}),t.jsx("div",{className:"m-gate-card-step",children:i}),u&&t.jsx("div",{className:"m-gate-card-summary",children:u})]})}const Dt=[{id:"approve",label:"Approve",kind:"primary"},{id:"revise",label:"Revise",kind:"warn"},{id:"kill",label:"Kill",kind:"danger"}];function Ut({gate:e,onResolve:a,onClose:s}){const[n,i]=r.useState(null),[u,c]=r.useState(""),[l,d]=r.useState(""),[g,m]=r.useState(!1),[f,b]=r.useState(null),h=r.useCallback(async N=>{if(N==null||N.preventDefault(),!n){b("Pick an outcome");return}if(n==="kill"&&!u.trim()){b("Reason is required when killing a gate");return}m(!0),b(null);try{await a(e.id,{outcome:n,reason:u.trim(),summary:l.trim()}),s==null||s()}catch(C){b(C.message)}finally{m(!1)}},[e,n,u,l,a,s]);return t.jsx("div",{className:"m-sheet-backdrop","data-testid":"mobile-gate-sheet",onClick:s,children:t.jsxs("div",{className:"m-sheet",role:"dialog","aria-modal":"true",onClick:N=>N.stopPropagation(),children:[t.jsxs("div",{className:"m-sheet-header",children:[t.jsx("div",{className:"m-sheet-title",children:"Resolve gate"}),t.jsxs("div",{className:"m-sheet-subtitle",children:[e.flowId,":",e.stepId]})]}),t.jsxs("form",{onSubmit:h,className:"m-sheet-body",children:[t.jsx("div",{className:"m-sheet-outcomes",role:"radiogroup","aria-label":"Outcome",children:Dt.map(N=>t.jsx("button",{type:"button",role:"radio","aria-checked":n===N.id,className:`m-btn m-btn-${N.kind} ${n===N.id?"m-btn-active":""}`,"data-testid":`mobile-gate-outcome-${N.id}`,onClick:()=>i(N.id),children:N.label},N.id))}),t.jsxs("label",{className:"m-field",children:[t.jsxs("span",{className:"m-field-label",children:["Reason ",n==="kill"?"(required)":"(optional)"]}),t.jsx("textarea",{className:"m-textarea","data-testid":"mobile-gate-reason",value:u,onChange:N=>c(N.target.value),rows:2})]}),t.jsxs("label",{className:"m-field",children:[t.jsx("span",{className:"m-field-label",children:"Summary (optional)"}),t.jsx("textarea",{className:"m-textarea","data-testid":"mobile-gate-summary",value:l,onChange:N=>d(N.target.value),rows:2})]}),f&&t.jsx("div",{className:"m-agent-card-error",children:f}),t.jsxs("div",{className:"m-sheet-actions",children:[t.jsx("button",{type:"button",className:"m-btn m-btn-sm",onClick:s,disabled:g,children:"Cancel"}),t.jsx("button",{type:"submit",className:"m-btn m-btn-primary m-btn-sm",disabled:g||!n,"data-testid":"mobile-gate-submit",children:g?"Submitting…":"Submit"})]})]})]})})}function Ft({gates:e=[],gatesLoading:a=!1,resolveGate:s}){const{agents:n,loading:i,refetch:u}=vt(),c=kt(),[l,d]=r.useState(null),[g,m]=r.useState(null),f=r.useCallback(()=>{u(),d(null)},[u]);return t.jsxs("section",{"data-testid":"mobile-tab-agents",className:"m-agents-tab",children:[t.jsxs("div",{className:"m-section","data-testid":"mobile-section-spawned",children:[t.jsx("h2",{className:"m-section-title",children:"Spawned agents"}),i?t.jsx("div",{className:"m-empty",children:"Loading agents…"}):n.length===0?t.jsx("div",{className:"m-empty",children:"No spawned agents."}):t.jsx("div",{className:"m-stack",children:n.map(b=>t.jsx(Tt,{agent:b,onOpen:d,onAfterKill:f},b.agentId||b.id))})]}),t.jsxs("div",{className:"m-section","data-testid":"mobile-section-session",children:[t.jsx("h2",{className:"m-section-title",children:"Interactive session"}),t.jsx(Ot,{session:c})]}),t.jsxs("div",{className:"m-section","data-testid":"mobile-section-gates",children:[t.jsx("h2",{className:"m-section-title",children:"Pending gates"}),a?t.jsx("div",{className:"m-empty",children:"Loading gates…"}):e.length===0?t.jsx("div",{className:"m-empty",children:"No pending gates."}):t.jsx("div",{className:"m-stack",children:e.map(b=>t.jsx(Mt,{gate:b,onOpen:m},b.id))})]}),l&&t.jsx(Lt,{agent:l,onClose:()=>d(null)}),g&&t.jsx(Ut,{gate:g,onResolve:s,onClose:()=>m(null)})]})}const Gt=[{value:"planned",label:"planned"},{value:"in_progress",label:"in progress"},{value:"blocked",label:"blocked"},{value:"complete",label:"complete"},{value:"parked",label:"parked"},{value:"killed",label:"killed"}];function Ht({statuses:e=[],onToggleStatus:a,group:s="",groupOptions:n=[],onChangeGroup:i,keyword:u="",onChangeKeyword:c}){return t.jsxs("div",{className:"m-filter-bar","data-testid":"mobile-filter-bar",children:[t.jsx("div",{className:"m-filter-chips",role:"group","aria-label":"Status filter",children:Gt.map(l=>{const d=e.includes(l.value);return t.jsx("button",{type:"button",className:"m-filter-chip","aria-pressed":d,"data-testid":`mobile-filter-status-${l.value}`,onClick:()=>a==null?void 0:a(l.value),children:l.label},l.value)})}),t.jsxs("div",{className:"m-filter-row",children:[t.jsxs("select",{className:"m-filter-select","data-testid":"mobile-filter-group",value:s,onChange:l=>i==null?void 0:i(l.target.value),"aria-label":"Group filter",children:[t.jsx("option",{value:"",children:"All groups"}),n.map(l=>t.jsx("option",{value:l,children:l},l))]}),t.jsx("input",{type:"search",className:"m-filter-keyword","data-testid":"mobile-filter-keyword",placeholder:"Search title or description",value:u,onChange:l=>c==null?void 0:c(l.target.value),"aria-label":"Keyword filter"})]})]})}const Bt=new Set(["planned","in_progress","blocked","complete","partial","superseded","parked"]);function We({status:e,children:a}){const s=typeof e=="string"?e.toLowerCase():"",n=Bt.has(s)?s:"unknown",i=a??e??"unknown";return t.jsx("span",{className:"m-status-pill","data-status":n,children:i})}function Jt(e,a=140){if(typeof e!="string")return"";const s=e.trim();return s.length<=a?s:s.slice(0,a-1).trimEnd()+"…"}function Yt({item:e,onSelect:a}){if(!e)return null;const s=e.title||e.id||"Untitled",n=e.status||"unknown",i=e.group||"",u=Jt(e.description||"");return t.jsxs("button",{type:"button",className:"m-item-card","data-testid":`mobile-item-card-${e.id}`,onClick:()=>a==null?void 0:a(e),children:[t.jsxs("div",{className:"m-item-card-row",children:[t.jsx("div",{className:"m-item-card-title",children:s}),t.jsx(We,{status:n})]}),t.jsxs("div",{className:"m-item-card-meta",children:[i?t.jsx("span",{className:"m-item-card-group","data-testid":"mobile-item-group",children:i}):null,e.id?t.jsx("span",{className:"m-item-card-id",children:e.id}):null]}),u?t.jsx("div",{className:"m-item-card-desc",children:u}):null]})}const qt=["planned","ready","in_progress","review","complete","blocked","parked","killed","superseded"],Kt=["informs","blocks","supports","contradicts","implements"];function Wt({item:e,onClose:a,onSave:s,onDelete:n,allItems:i=[],addConnection:u,removeConnection:c,fetchItemDetail:l}){const d=r.useMemo(()=>({status:(e==null?void 0:e.status)||"planned",group:(e==null?void 0:e.group)||"",confidence:(e==null?void 0:e.confidence)??""}),[e]),[g,m]=r.useState(d.status),[f,b]=r.useState(d.group),[h,N]=r.useState(d.confidence),[C,w]=r.useState(!1),[T,S]=r.useState(!1),[E,j]=r.useState(!1),x=r.useRef(null),[p,y]=r.useState([]),[v,A]=r.useState(!1),[M,P]=r.useState(!1),[O,L]=r.useState(""),[F,Y]=r.useState("informs"),[q,z]=r.useState(!1),[te,Q]=r.useState(null),K=r.useRef(null);if(r.useEffect(()=>{m(d.status),b(d.group),N(d.confidence),S(!1),y([]),P(!1),L(""),Y("informs"),Q(null),x.current&&clearTimeout(x.current),K.current&&clearTimeout(K.current)},[e==null?void 0:e.id,d.status,d.group,d.confidence]),r.useEffect(()=>{!(e!=null&&e.id)||!l||(A(!0),l(e.id).then(R=>{var H;R!=null&&R.ok&&Array.isArray((H=R.item)==null?void 0:H.connections)&&y(R.item.connections)}).finally(()=>A(!1)))},[e==null?void 0:e.id,l]),r.useEffect(()=>()=>{x.current&&clearTimeout(x.current),K.current&&clearTimeout(K.current)},[]),!e)return null;const o=g!==d.status||f!==d.group||String(h)!==String(d.confidence);function k(){S(!1),x.current&&clearTimeout(x.current)}function _(){T&&k(),te!==null&&(Q(null),K.current&&clearTimeout(K.current))}const $=async()=>{if(!o||C)return;const R={};if(g!==d.status&&(R.status=g),f!==d.group&&(R.group=f),String(h)!==String(d.confidence)){const H=h===""?null:Number(h);H!==null&&Number.isFinite(H)?R.confidence=H:h===""&&(R.confidence=null)}w(!0);try{await(s==null?void 0:s(e.id,R))}finally{w(!1)}},D=async()=>{if(!T)S(!0),x.current=setTimeout(()=>{S(!1)},3e3);else{x.current&&clearTimeout(x.current),S(!1),j(!0);try{await(n==null?void 0:n(e.id))}finally{j(!1)}}},U=r.useMemo(()=>{const R=O.toLowerCase();return i.filter(H=>H.id===e.id?!1:R?H.id.toLowerCase().includes(R)||(H.title||"").toLowerCase().includes(R):!0)},[i,e==null?void 0:e.id,O]),G=async R=>{z(!0);const H=await(u==null?void 0:u({fromId:e.id,toId:R.id,type:F}));if(H!=null&&H.ok){const X=H.connection||{id:`local-${Date.now()}`,fromId:e.id,toId:R.id,type:F};y(se=>[...se,X]),P(!1),L(""),Y("informs")}z(!1)},W=async(R,H)=>{if(te!==H)K.current&&clearTimeout(K.current),Q(H),K.current=setTimeout(()=>{Q(null)},3e3);else{K.current&&clearTimeout(K.current),Q(null);const X=await(c==null?void 0:c(R.id));X!=null&&X.ok&&y(se=>se.filter(be=>be.id!==R.id))}};function J(R){const H=i.find(X=>X.id===R);return(H==null?void 0:H.title)||R}return t.jsx("div",{className:"m-sheet-overlay",role:"dialog","aria-modal":"true","data-testid":"mobile-item-sheet",children:t.jsxs("div",{className:"m-sheet",children:[t.jsxs("header",{className:"m-sheet-header",children:[t.jsx("button",{type:"button",className:"m-sheet-close",onClick:a,"data-testid":"mobile-item-sheet-close","aria-label":"Close",children:"×"}),t.jsxs("div",{className:"m-sheet-title-row",children:[t.jsx("div",{className:"m-sheet-title",children:e.title||e.id}),t.jsx(We,{status:g})]})]}),t.jsxs("div",{className:"m-sheet-body",children:[e.description?t.jsxs("section",{className:"m-sheet-section",children:[t.jsx("div",{className:"m-sheet-label",children:"Description"}),t.jsx("p",{className:"m-sheet-desc",children:e.description})]}):null,t.jsxs("section",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-sheet-status",children:"Status"}),t.jsx("select",{id:"m-sheet-status",className:"m-sheet-input","data-testid":"mobile-item-sheet-status",value:g,onChange:R=>{_(),m(R.target.value)},children:qt.map(R=>t.jsx("option",{value:R,children:R},R))})]}),t.jsxs("section",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-sheet-group",children:"Group"}),t.jsx("input",{id:"m-sheet-group",type:"text",className:"m-sheet-input","data-testid":"mobile-item-sheet-group",value:f,onChange:R=>{_(),b(R.target.value)}})]}),t.jsxs("section",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-sheet-confidence",children:"Confidence (0–4)"}),t.jsx("input",{id:"m-sheet-confidence",type:"number",min:"0",max:"4",step:"1",className:"m-sheet-input","data-testid":"mobile-item-sheet-confidence",value:h,onChange:R=>{_(),N(R.target.value)}})]}),t.jsxs("section",{className:"m-sheet-section m-sheet-connections",children:[t.jsxs("div",{className:"m-sheet-connections-header",children:[t.jsx("span",{className:"m-sheet-label",children:"Connections"}),!M&&t.jsx("button",{type:"button",className:"m-conn-add-btn","data-testid":"mobile-item-conn-add",onClick:()=>{_(),P(!0)},children:"+ Add"})]}),v?t.jsx("div",{className:"m-conn-loading",children:"Loading…"}):p.length===0&&!M?t.jsx("div",{className:"m-conn-empty",children:"No connections"}):t.jsx("ul",{className:"m-conn-list",children:p.map((R,H)=>{const X=R.fromId===e.id,se=X?R.toId:R.fromId,be=J(se),ye=te===H;return t.jsxs("li",{className:"m-conn-row",children:[t.jsx("span",{className:"m-conn-dir",children:X?"→":"←"}),t.jsx("span",{className:"m-conn-title",children:be}),t.jsx("span",{className:"m-conn-type",children:R.type}),t.jsx("button",{type:"button",className:`m-conn-remove${ye?" m-conn-remove--armed":""}`,"data-testid":`mobile-item-conn-remove-${H}`,"aria-label":ye?"Confirm remove connection":"Remove connection",onClick:()=>{_(),W(R,H)},children:ye?"✓":"×"})]},R.id)})}),M&&t.jsxs("div",{className:"m-conn-picker",children:[t.jsxs("div",{className:"m-conn-picker-row",children:[t.jsx("input",{type:"text",className:"m-sheet-input m-conn-search",placeholder:"Search items…",value:O,onChange:R=>L(R.target.value),"data-testid":"mobile-item-conn-search",autoFocus:!0}),t.jsx("select",{className:"m-sheet-input m-conn-type-select",value:F,onChange:R=>Y(R.target.value),"data-testid":"mobile-item-conn-type",children:Kt.map(R=>t.jsx("option",{value:R,children:R},R))})]}),t.jsxs("ul",{className:"m-conn-picker-list",children:[U.map(R=>t.jsx("li",{children:t.jsxs("button",{type:"button",className:"m-conn-picker-item",disabled:q,onClick:()=>G(R),"data-testid":`mobile-item-conn-pick-${R.id}`,children:[t.jsx("span",{className:"m-conn-picker-title",children:R.title||R.id}),t.jsx("span",{className:"m-conn-picker-id",children:R.id})]})},R.id)),U.length===0&&t.jsx("li",{className:"m-conn-picker-empty",children:"No items found"})]}),t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary",onClick:()=>{P(!1),L(""),Y("informs")},children:"Cancel"})]})]})]}),t.jsxs("footer",{className:"m-sheet-footer",children:[t.jsx("button",{type:"button",className:`m-sheet-btn m-sheet-btn-danger${T?" m-sheet-btn-danger--armed":""}`,onClick:D,disabled:E,"data-testid":"mobile-item-sheet-delete",children:E?"Deleting…":T?"Confirm delete":"Delete"}),t.jsxs("div",{className:"m-sheet-footer-right",children:[t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary",onClick:a,"data-testid":"mobile-item-sheet-cancel",children:"Cancel"}),t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-primary",onClick:$,disabled:!o||C,"data-testid":"mobile-item-sheet-save",children:C?"Saving…":"Save"})]})]})]})})}const zt=["planned","ready","in_progress","review","complete","blocked","parked","killed","superseded"];function Xt({open:e,onClose:a,onCreate:s,groupOptions:n=[]}){const[i,u]=r.useState(""),[c,l]=r.useState(""),[d,g]=r.useState(""),[m,f]=r.useState("planned"),[b,h]=r.useState(""),[N,C]=r.useState(!1),[w,T]=r.useState(null),S=r.useId();if(!e)return null;function E(){u(""),l(""),g(""),f("planned"),h(""),T(null),C(!1)}function j(){E(),a==null||a()}async function x(p){if(p.preventDefault(),!i.trim()){T("Title is required");return}C(!0),T(null);try{const y={title:i.trim()};if(c.trim()&&(y.description=c.trim()),d.trim()&&(y.group=d.trim()),m&&(y.status=m),b!==""){const v=Number(b);Number.isFinite(v)&&(y.confidence=v)}await(s==null?void 0:s(y)),j()}catch(y){T(y.message||"Failed to create item"),C(!1)}}return t.jsx("div",{className:"m-sheet-overlay","data-testid":"mobile-create-sheet",role:"dialog","aria-modal":"true","aria-label":"Create roadmap item",onClick:p=>{p.target===p.currentTarget&&j()},children:t.jsxs("div",{className:"m-sheet",children:[t.jsxs("header",{className:"m-sheet-header",children:[t.jsx("button",{type:"button",className:"m-sheet-close","aria-label":"Close",onClick:j,disabled:N,children:"×"}),t.jsx("div",{className:"m-sheet-title-row",children:t.jsx("div",{className:"m-sheet-title",children:"New roadmap item"})})]}),t.jsxs("form",{className:"m-sheet-body",onSubmit:x,children:[t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-create-title",children:"Title"}),t.jsx("input",{id:"m-create-title",type:"text",className:"m-sheet-input",value:i,onChange:p=>u(p.target.value),placeholder:"Feature title","data-testid":"mobile-create-title",autoFocus:!0,required:!0})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-create-desc",children:"Description (optional)"}),t.jsx("textarea",{id:"m-create-desc",className:"m-sheet-input m-textarea",value:c,onChange:p=>l(p.target.value),rows:3,"data-testid":"mobile-create-desc"})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-create-group",children:"Group (optional)"}),t.jsx("input",{id:"m-create-group",type:"text",className:"m-sheet-input",value:d,onChange:p=>g(p.target.value),list:S,placeholder:"e.g. core, infra","data-testid":"mobile-create-group"}),t.jsx("datalist",{id:S,children:n.map(p=>t.jsx("option",{value:p},p))})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-create-status",children:"Status"}),t.jsx("select",{id:"m-create-status",className:"m-sheet-input",value:m,onChange:p=>f(p.target.value),"data-testid":"mobile-create-status",children:zt.map(p=>t.jsx("option",{value:p,children:p},p))})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-create-confidence",children:"Confidence (0–4, optional)"}),t.jsx("input",{id:"m-create-confidence",type:"number",min:"0",max:"4",step:"1",className:"m-sheet-input",value:b,onChange:p=>h(p.target.value),"data-testid":"mobile-create-confidence"})]}),w?t.jsx("div",{className:"m-form-error",role:"alert","data-testid":"mobile-create-error",children:w}):null]}),t.jsxs("footer",{className:"m-sheet-footer",children:[t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary",onClick:j,disabled:N,"data-testid":"mobile-create-cancel",children:"Cancel"}),t.jsx("div",{className:"m-sheet-footer-right",children:t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-primary",disabled:N||!i.trim(),"data-testid":"mobile-create-submit",onClick:x,children:N?"Creating…":"Create"})})]})]})})}function ze({message:e,kind:a="error",durationMs:s=3e3,onDismiss:n}){return r.useEffect(()=>{if(!e)return;const i=setTimeout(()=>n==null?void 0:n(),s);return()=>clearTimeout(i)},[e,s,n]),e?t.jsx("div",{className:"m-toast",role:"status","data-kind":a,"data-testid":"mobile-toast",children:e}):null}function Vt(e){const a=new Set;for(const s of e){const n=((s==null?void 0:s.group)||"").trim();n&&a.add(n)}return Array.from(a).sort()}function Qt(e,a){if(!a)return!0;const s=a.toLowerCase(),n=(e.title||"").toLowerCase(),i=(e.description||"").toLowerCase();return n.includes(s)||i.includes(s)}function Zt({items:e=[],loading:a=!1,error:s=null,applyOptimisticEdit:n,createItem:i,deleteItem:u,addConnection:c,removeConnection:l,fetchItemDetail:d}){const[g,m]=r.useState([]),[f,b]=r.useState(""),[h,N]=r.useState(""),[C,w]=r.useState(null),[T,S]=r.useState(!1),[E,j]=r.useState(null),x=r.useMemo(()=>Vt(e),[e]),p=r.useMemo(()=>e.filter(O=>!(g.length&&!g.includes(O.status)||f&&O.group!==f||!Qt(O,h))),[e,g,f,h]),y=r.useMemo(()=>e.find(O=>O.id===C)||null,[e,C]),v=O=>{m(L=>L.includes(O)?L.filter(F=>F!==O):[...L,O])},A=async(O,L)=>{const F=await n(O,L);F!=null&&F.ok?w(null):j((F==null?void 0:F.error)||"Save failed")},M=async O=>{const L=await(i==null?void 0:i(O));if(!(L!=null&&L.ok))throw new Error((L==null?void 0:L.error)||"Create failed")},P=async O=>{const L=await(u==null?void 0:u(O));L!=null&&L.ok?w(null):j((L==null?void 0:L.error)||"Delete failed")};return t.jsxs("section",{className:"m-roadmap","data-testid":"mobile-tab-roadmap",children:[t.jsx(Ht,{statuses:g,onToggleStatus:v,group:f,groupOptions:x,onChangeGroup:b,keyword:h,onChangeKeyword:N}),s?t.jsx("div",{className:"m-roadmap-error","data-testid":"mobile-roadmap-error",children:s}):null,a?t.jsx("div",{className:"m-roadmap-skeleton","data-testid":"mobile-roadmap-loading",children:Array.from({length:4}).map((O,L)=>t.jsx("div",{className:"m-skel-card"},L))}):p.length===0?t.jsx("div",{className:"m-roadmap-empty","data-testid":"mobile-roadmap-empty",children:e.length===0?"No roadmap items yet.":"No items match the current filters."}):t.jsx("ul",{className:"m-roadmap-list","data-testid":"mobile-roadmap-list",children:p.map(O=>t.jsx("li",{children:t.jsx(Yt,{item:O,onSelect:L=>w(L.id)})},O.id))}),y?t.jsx(Wt,{item:y,onClose:()=>w(null),onSave:A,onDelete:P,allItems:e,addConnection:c,removeConnection:l,fetchItemDetail:d}):null,t.jsx(Xt,{open:T,onClose:()=>S(!1),onCreate:M,groupOptions:x}),t.jsx("button",{type:"button",className:"m-fab","data-testid":"mobile-roadmap-fab","aria-label":"Create new roadmap item",onClick:()=>S(!0),children:"+"}),t.jsx(ze,{message:E,onDismiss:()=>j(null)})]})}const Z="—";async function re(e,a={}){const s=await B(e,a);let n=null;try{n=await s.json()}catch{}if(!s.ok){const i=n&&n.error||`HTTP ${s.status}`;throw new Error(i)}return n}function es(){const[e,a]=r.useState([]),[s,n]=r.useState([]),[i,u]=r.useState(!0),[c,l]=r.useState(null),[d,g]=r.useState([]),m=r.useRef(e);m.current=e;const f=r.useCallback((S,E)=>{const j=`t_${Date.now()}_${Math.random().toString(36).slice(2,6)}`;g(x=>[...x,{id:j,kind:S,message:E}]),setTimeout(()=>{g(x=>x.filter(p=>p.id!==j))},3500)},[]),b=r.useCallback(S=>{g(E=>E.filter(j=>j.id!==S))},[]),h=r.useCallback(async()=>{try{const S=await re("/api/ideabox");a(Array.isArray(S==null?void 0:S.ideas)?S.ideas:[]),n(Array.isArray(S==null?void 0:S.killed)?S.killed:[]),l(null)}catch(S){l(S.message),f("error",`Failed to load ideas: ${S.message}`)}finally{u(!1)}},[f]);r.useEffect(()=>{let S=!0;return(async()=>S&&await h())(),()=>{S=!1}},[h]),r.useEffect(()=>{if(typeof window>"u"||typeof WebSocket>"u")return;const S=me({url:()=>ue(),onMessage:E=>{try{const j=JSON.parse(E.data);j&&j.type==="ideaboxUpdated"&&h()}catch{}}});return()=>{try{S.close()}catch{}}},[h]);const N=r.useCallback(async({title:S,description:E,source:j,tags:x,cluster:p})=>{if(!S||!S.trim()){const A=new Error("title is required");throw f("error",A.message),A}const y=`tmp_${Date.now()}`,v={id:y,num:0,title:S.trim(),description:E||"",source:j||"",tags:Array.isArray(x)?x:[],cluster:p||null,status:"NEW",priority:Z,_pending:!0};a(A=>[v,...A]);try{const A=await re("/api/ideabox/ideas",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:S.trim(),description:E,source:j,tags:x,cluster:p})});return a(M=>M.map(P=>P.id===y?{...A}:P)),f("ok","Idea captured"),A}catch(A){throw a(M=>M.filter(P=>P.id!==y)),f("error",`Capture failed: ${A.message}`),A}},[f]),C=r.useCallback(async(S,{featureCode:E}={})=>{const j=m.current;a(x=>x.map(p=>p.id===S?{...p,_promoting:!0}:p));try{const x=await re(`/api/ideabox/ideas/${encodeURIComponent(S)}/promote`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({featureCode:E||""})});return f("ok",`Promoted${x!=null&&x.featureCode?` → ${x.featureCode}`:""}`),h(),x}catch(x){throw a(j),f("error",`Promote failed: ${x.message}`),x}},[f,h]),w=r.useCallback(async(S,{reason:E}={})=>{const j=m.current,x=j.find(p=>p.id===S);a(p=>p.filter(y=>y.id!==S)),x&&n(p=>[{...x,status:"KILLED",reason:E||""},...p]);try{const p=await re(`/api/ideabox/ideas/${encodeURIComponent(S)}/kill`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({reason:E||""})});return f("ok","Idea killed"),h(),p}catch(p){throw a(j),n(y=>y.filter(v=>v.id!==S||v.status!=="KILLED")),f("error",`Kill failed: ${p.message}`),p}},[f,h]),T=r.useCallback(async(S,E)=>{if(!["P0","P1","P2",Z].includes(E)){const p=new Error(`Invalid priority: ${E}`);throw f("error",p.message),p}const x=m.current;a(p=>p.map(y=>y.id===S?{...y,priority:E}:y));try{const p=await re(`/api/ideabox/ideas/${encodeURIComponent(S)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:E})});return f("ok",`Priority → ${E===Z?"Untriaged":E}`),p}catch(p){throw a(x),f("error",`Set priority failed: ${p.message}`),p}},[f]);return{ideas:e,killed:s,loading:i,error:c,toasts:d,dismissToast:b,refetch:h,createIdea:N,promote:C,kill:w,setPriority:T}}function ts(e,a={}){const{onSwipeLeft:s,onSwipeRight:n,onDrag:i,onDragEnd:u,threshold:c=80,axis:l="x"}=a,d=r.useRef({onSwipeLeft:s,onSwipeRight:n,onDrag:i,onDragEnd:u});d.current={onSwipeLeft:s,onSwipeRight:n,onDrag:i,onDragEnd:u},r.useEffect(()=>{const g=e&&e.current;if(!g)return;let m=0,f=0,b=null,h=!1,N=0;function C(S){if(!(S.button!==void 0&&S.button!==0)){b=S.pointerId,m=S.clientX,f=S.clientY,h=!0,N=0;try{g.setPointerCapture(S.pointerId)}catch{}}}function w(S){var x,p,y,v;if(!h||S.pointerId!==b)return;const E=S.clientX-m,j=S.clientY-f;if(l==="x"&&Math.abs(j)>Math.abs(E)&&Math.abs(j)>12){h=!1,(p=(x=d.current).onDragEnd)==null||p.call(x,0,!1);return}N=E,(v=(y=d.current).onDrag)==null||v.call(y,E)}function T(S){var x,p,y,v,A,M;if(!h||S&&S.pointerId!==b)return;const E=N;h=!1;try{g.releasePointerCapture(b)}catch{}b=null;let j=!1;E<=-c?((p=(x=d.current).onSwipeLeft)==null||p.call(x),j=!0):E>=c&&((v=(y=d.current).onSwipeRight)==null||v.call(y),j=!0),(M=(A=d.current).onDragEnd)==null||M.call(A,E,j)}return g.addEventListener("pointerdown",C),g.addEventListener("pointermove",w),g.addEventListener("pointerup",T),g.addEventListener("pointercancel",T),()=>{g.removeEventListener("pointerdown",C),g.removeEventListener("pointermove",w),g.removeEventListener("pointerup",T),g.removeEventListener("pointercancel",T)}},[e,c,l])}function ss(e){return e==="P0"||e==="P1"||e==="P2"?e.toLowerCase():"untriaged"}function as(e){return e==="P0"||e==="P1"||e==="P2"?e:"Untriaged"}function ns({idea:e,onTap:a,onSwipeLeft:s,onSwipeRight:n}){const i=r.useRef(null),[u,c]=r.useState(0),[l,d]=r.useState(null),g=r.useCallback(h=>{c(h),h<=-40?d("kill"):h>=40?d("promote"):d(null)},[]),m=r.useCallback(()=>{c(0),d(null)},[]);ts(i,{onSwipeLeft:()=>s==null?void 0:s(e),onSwipeRight:()=>n==null?void 0:n(e),onDrag:g,onDragEnd:m,threshold:80});const f=ss(e.priority),b=Array.isArray(e.tags)?e.tags:[];return t.jsxs("div",{className:"m-idea-row","data-testid":`idea-row-${e.id}`,children:[t.jsx("div",{className:"m-idea-action m-idea-action-left","aria-hidden":"true",children:"Promote"}),t.jsx("div",{className:"m-idea-action m-idea-action-right","aria-hidden":"true",children:"Kill"}),t.jsxs("article",{ref:i,className:`m-idea-card${l?` is-intent-${l}`:""}`,"data-testid":"idea-card","data-idea-id":e.id,"data-priority":f,style:{transform:`translateX(${u}px)`},role:"button",tabIndex:0,onClick:()=>{Math.abs(u)<4&&(a==null||a(e))},onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),a==null||a(e))},children:[t.jsxs("div",{className:"m-idea-head",children:[t.jsx("span",{className:"m-priority-badge","data-priority":f,"data-testid":`priority-badge-${e.id}`,children:as(e.priority)}),e.cluster?t.jsx("span",{className:"m-idea-cluster",title:e.cluster,children:e.cluster}):null]}),t.jsx("h3",{className:"m-idea-title","data-testid":`idea-title-${e.id}`,children:e.title}),b.length>0?t.jsx("div",{className:"m-idea-tags",children:b.map(h=>t.jsx("span",{className:"m-idea-tag",children:h},h))}):null]})]})}function rs({open:e,onClose:a,onSubmit:s,existingClusters:n=[]}){const[i,u]=r.useState(""),[c,l]=r.useState(""),[d,g]=r.useState(""),[m,f]=r.useState([]),[b,h]=r.useState(""),[N,C]=r.useState(!1),[w,T]=r.useState(null),S=r.useId(),E=r.useMemo(()=>{const v=new Set;for(const A of n)A&&typeof A=="string"&&v.add(A);return[...v].sort()},[n]);if(!e)return null;function j(){u(""),l(""),g(""),f([]),h(""),T(null),C(!1)}function x(){j(),a==null||a()}function p(){const v=d.trim();v&&(m.includes(v)||f([...m,v]),g(""))}async function y(v){if(v.preventDefault(),!i.trim()){T("Title is required");return}C(!0),T(null);try{await(s==null?void 0:s({title:i.trim(),description:c.trim()||void 0,tags:m.length?m:void 0,cluster:b.trim()||void 0})),x()}catch(A){T(A.message||"Failed to capture"),C(!1)}}return t.jsx("div",{className:"m-sheet-overlay","data-testid":"capture-sheet",role:"dialog","aria-modal":"true","aria-label":"Capture idea",onClick:v=>{v.target===v.currentTarget&&x()},children:t.jsxs("div",{className:"m-sheet",children:[t.jsxs("header",{className:"m-sheet-header",children:[t.jsx("button",{type:"button",className:"m-sheet-close","aria-label":"Close capture",onClick:x,disabled:N,children:"×"}),t.jsx("div",{className:"m-sheet-title-row",children:t.jsx("div",{className:"m-sheet-title",children:"Capture idea"})})]}),t.jsxs("form",{className:"m-sheet-body",onSubmit:y,children:[t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-capture-title",children:"Title"}),t.jsx("input",{id:"m-capture-title",type:"text",className:"m-sheet-input",value:i,onChange:v=>u(v.target.value),placeholder:"What's the idea?","data-testid":"capture-title",autoFocus:!0,required:!0})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-capture-desc",children:"Description (optional)"}),t.jsx("textarea",{id:"m-capture-desc",className:"m-sheet-input m-textarea",value:c,onChange:v=>l(v.target.value),rows:4,"data-testid":"capture-description"})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-capture-tag",children:"Tags (optional)"}),t.jsxs("div",{className:"m-tag-input-row",children:[t.jsx("input",{id:"m-capture-tag",type:"text",className:"m-sheet-input",value:d,onChange:v=>g(v.target.value),onKeyDown:v=>{(v.key==="Enter"||v.key===",")&&(v.preventDefault(),p())},placeholder:"Add tag and press Enter","data-testid":"capture-tag-input"}),t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary m-tag-add",onClick:p,children:"Add"})]}),m.length>0?t.jsx("div",{className:"m-idea-tags","data-testid":"capture-tags",children:m.map(v=>t.jsxs("span",{className:"m-idea-tag",children:[v,t.jsx("button",{type:"button",className:"m-tag-remove","aria-label":`Remove tag ${v}`,onClick:()=>f(m.filter(A=>A!==v)),children:"×"})]},v))}):null]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-capture-cluster",children:"Cluster (optional)"}),t.jsx("input",{id:"m-capture-cluster",type:"text",className:"m-sheet-input",value:b,onChange:v=>h(v.target.value),list:S,placeholder:"Group into a theme","data-testid":"capture-cluster"}),t.jsx("datalist",{id:S,children:E.map(v=>t.jsx("option",{value:v},v))})]}),w?t.jsx("div",{className:"m-form-error",role:"alert",children:w}):null]}),t.jsxs("footer",{className:"m-sheet-footer",children:[t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary",onClick:x,disabled:N,"data-testid":"capture-cancel",children:"Cancel"}),t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-primary",disabled:N||!i.trim(),"data-testid":"capture-submit",onClick:y,children:N?"Saving…":"Capture"})]})]})})}const is=[{value:"P0",label:"P0"},{value:"P1",label:"P1"},{value:"P2",label:"P2"},{value:Z,label:"Untriaged"}];function ls({value:e,onChange:a,disabled:s=!1}){return t.jsx("div",{className:"m-priority-selector",role:"radiogroup","aria-label":"Priority",children:is.map(n=>{const i=e===n.value,u=`m-priority-chip${i?" is-selected":""}`;return t.jsx("button",{type:"button",role:"radio","aria-checked":i?"true":"false",className:u,"data-priority":n.value===Z?"untriaged":n.value.toLowerCase(),"data-testid":`priority-chip-${n.value===Z?"untriaged":n.value.toLowerCase()}`,disabled:s,onClick:()=>a(n.value),children:n.label},n.value)})})}function os({idea:e,open:a,onClose:s,onPromote:n,onKill:i,onSetPriority:u}){const[c,l]=r.useState(!1);if(!a||!e)return null;const d=Array.isArray(e.tags)?e.tags:[],g=e.priority||Z;async function m(f,b=!0){l(!0);try{await f(),b&&(s==null||s())}catch{}finally{l(!1)}}return t.jsx("div",{className:"m-sheet-overlay","data-testid":"idea-detail-sheet",role:"dialog","aria-modal":"true","aria-label":`Idea ${e.id}`,onClick:f=>{f.target===f.currentTarget&&(s==null||s())},children:t.jsxs("div",{className:"m-sheet",children:[t.jsxs("header",{className:"m-sheet-header",children:[t.jsx("button",{type:"button",className:"m-sheet-close","aria-label":"Close detail",onClick:s,disabled:c,children:"×"}),t.jsx("div",{className:"m-sheet-title-row",children:t.jsx("div",{className:"m-sheet-title",children:e.title})}),t.jsxs("div",{className:"m-detail-meta",children:[t.jsx("span",{className:"m-detail-meta-id",children:e.id}),t.jsx("span",{className:"m-detail-meta-status",children:e.status||"NEW"}),e.cluster?t.jsx("span",{className:"m-detail-meta-cluster",children:e.cluster}):null]})]}),t.jsxs("div",{className:"m-sheet-body",children:[e.description?t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("div",{className:"m-sheet-label",children:"Description"}),t.jsx("p",{className:"m-sheet-desc",children:e.description})]}):null,e.source?t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("div",{className:"m-sheet-label",children:"Source"}),t.jsx("p",{className:"m-sheet-desc",children:e.source})]}):null,d.length>0?t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("div",{className:"m-sheet-label",children:"Tags"}),t.jsx("div",{className:"m-idea-tags",children:d.map(f=>t.jsx("span",{className:"m-idea-tag",children:f},f))})]}):null,t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("div",{className:"m-sheet-label",children:"Priority"}),t.jsx(ls,{value:g,disabled:c,onChange:f=>m(()=>u==null?void 0:u(e.id,f),!1)})]})]}),t.jsxs("footer",{className:"m-sheet-footer",children:[t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary","data-testid":"detail-kill",disabled:c,onClick:()=>m(()=>i==null?void 0:i(e.id)),children:"Kill"}),t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-primary","data-testid":"detail-promote",disabled:c,onClick:()=>m(()=>n==null?void 0:n(e.id)),children:"Promote"})]})]})})}const cs=[{id:"all",label:"All"},{id:"P0",label:"P0"},{id:"P1",label:"P1"},{id:"P2",label:"P2"},{id:"untriaged",label:"Untriaged"}],$e={P0:3,P1:2,P2:1};function ds(e){return[...e].sort((a,s)=>{const n=$e[a.priority]||0,i=$e[s.priority]||0;if(n!==i)return i-n;const u=typeof a.num=="number"?a.num:0;return(typeof s.num=="number"?s.num:0)-u})}function us(){const{ideas:e,loading:a,toasts:s,dismissToast:n,createIdea:i,promote:u,kill:c,setPriority:l}=es(),[d,g]=r.useState("all"),[m,f]=r.useState(!1),[b,h]=r.useState(null),N=r.useMemo(()=>{let w=e;return d==="untriaged"?w=w.filter(T=>!T.priority||T.priority===Z||T.priority===""):d!=="all"&&(w=w.filter(T=>T.priority===d)),ds(w)},[e,d]),C=r.useMemo(()=>{const w=new Set;for(const T of e)T.cluster&&w.add(T.cluster);return[...w]},[e]);return t.jsxs("section",{className:"m-ideas-tab","data-testid":"mobile-tab-ideas",children:[t.jsxs("div",{className:"m-ideas-toolbar",children:[t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-primary m-capture-btn",onClick:()=>f(!0),"data-testid":"open-capture","aria-label":"Capture new idea",children:"+ Capture"}),t.jsx("div",{className:"m-filter-chips",role:"tablist","aria-label":"Priority filter",children:cs.map(w=>t.jsx("button",{type:"button",role:"tab","aria-pressed":d===w.id?"true":"false","aria-selected":d===w.id?"true":"false",className:"m-filter-chip",onClick:()=>g(w.id),"data-testid":`filter-${w.id}`,children:w.label},w.id))})]}),a?t.jsx("div",{className:"m-ideas-list","data-testid":"ideas-loading",children:[0,1,2].map(w=>t.jsx("div",{className:"m-idea-skeleton","aria-hidden":"true"},w))}):N.length===0?t.jsxs("div",{className:"m-empty-state","data-testid":"ideas-empty",children:[t.jsx("div",{className:"m-empty-title",children:e.length===0?"No ideas yet":"Nothing matches this filter"}),t.jsx("div",{className:"m-empty-body",children:e.length===0?"Tap Capture to add your first idea.":"Try All to see everything."})]}):t.jsx("div",{className:"m-ideas-list","data-testid":"ideas-list",children:N.map(w=>t.jsx(ns,{idea:w,onTap:T=>h(T),onSwipeLeft:T=>c(T.id),onSwipeRight:T=>u(T.id)},w.id))}),t.jsx(rs,{open:m,onClose:()=>f(!1),onSubmit:i,existingClusters:C}),t.jsx(os,{idea:b,open:!!b,onClose:()=>h(null),onPromote:w=>u(w),onKill:w=>c(w),onSetPriority:(w,T)=>l(w,T)}),t.jsx("div",{className:"m-toast-stack","aria-live":"polite","data-testid":"toasts",children:s.map(w=>t.jsx("div",{className:"m-toast","data-kind":w.kind==="error"?"error":"ok",role:w.kind==="error"?"alert":"status",onClick:()=>n(w.id),children:w.message},w.id))})]})}function ms(e){if(!e)return"";const a=typeof e=="string"?Date.parse(e):Number(e);if(!a||Number.isNaN(a))return"";const s=Date.now()-a;return s<5e3?"just now":s<6e4?`${Math.floor(s/1e3)}s ago`:s<36e5?`${Math.floor(s/6e4)}m ago`:`${Math.floor(s/36e5)}h ago`}function fs(e,a=3){return e?Array.isArray(e.logTail)?e.logTail.slice(-a):Array.isArray(e.recentLogs)?e.recentLogs.slice(-a):Array.isArray(e.steps)?e.steps.slice(-a).map(s=>`${s.id||s.name||""}: ${s.status||""}`.trim()):[]:[]}function hs({active:e,onOpen:a,onAbort:s,aborting:n}){const[i,u]=r.useState(null),c=(e==null?void 0:e.featureCode)||"(unknown)",l=(e==null?void 0:e.mode)||"feature",d=(e==null?void 0:e.status)||"unknown",g=(e==null?void 0:e.startedAt)||(e==null?void 0:e.started_at)||null,m=fs(e),f=r.useCallback(async h=>{if(h==null||h.stopPropagation(),!!(e!=null&&e.featureCode)){u(null);try{await(s==null?void 0:s({featureCode:e.featureCode}))}catch(N){u(N.message||"Failed to abort")}}},[e,s]),b=r.useCallback(()=>a==null?void 0:a(e),[a,e]);return t.jsxs("div",{className:"m-build-card","data-testid":"mobile-build-card","data-feature":c,role:"button",tabIndex:0,onClick:b,onKeyDown:h=>{h.key==="Enter"&&b()},children:[t.jsxs("div",{className:"m-build-card-row",children:[t.jsx("div",{className:"m-build-card-feature",title:c,children:c}),t.jsx("span",{className:"m-status-pill","data-status":d,children:d})]}),t.jsxs("div",{className:"m-build-card-meta",children:[t.jsx("span",{className:"m-build-card-mode","data-mode":l,children:l}),t.jsx("span",{className:"m-build-card-time",children:ms(g)})]}),m.length>0&&t.jsx("div",{className:"m-build-card-tail",children:m.map((h,N)=>t.jsx("div",{className:"m-build-card-tail-line",children:String(h).slice(0,200)},N))}),t.jsx("div",{className:"m-build-card-actions",children:t.jsx("button",{type:"button",className:"m-btn m-btn-danger m-btn-sm","data-testid":"mobile-build-abort",disabled:n||de(d),onClick:f,children:n?"Aborting…":"Abort"})}),i&&t.jsx("div",{className:"m-agent-card-error",children:i})]})}const ps={design:"Design",blueprint:"Blueprint",implementation:"Implementation",ship:"Ship"},bs=["design","blueprint","implementation","ship"];function ys(e){return e==="active"?"◉":e==="done"||e==="complete"||e==="completed"?"●":e==="failed"||e==="error"?"✕":"○"}function Pe(e){return e==="done"||e==="complete"||e==="completed"}function gs(e){return e==="failed"||e==="error"}function xs(e){return e||null}function js(e){const a=[];let s=0;for(;s<e.length;){const n=e[s];if(!Pe(n.status)){a.push({type:"step",step:n}),s++;continue}let i=s;for(;i<e.length&&Pe(e[i].status);)i++;const u=i-s;if(u>=3)a.push({type:"collapsed",steps:e.slice(s,i),count:u});else for(let c=s;c<i;c++)a.push({type:"step",step:e[c]});s=i}return a}function Xe({step:e}){const a=ys(e.status),s=gs(e.status),n=e.status==="active";return t.jsxs("div",{className:["m-step-row",n?"m-step-row--active":"",s?"m-step-row--failed":""].filter(Boolean).join(" "),"data-testid":`mobile-build-step-${e.id}`,"data-status":e.status||"pending",children:[t.jsx("span",{className:`m-step-glyph${n?" m-step-glyph--pulse":""}`,"aria-hidden":"true",children:a}),t.jsx("span",{className:"m-step-name",children:e.name||e.id}),xs(e.agent)&&t.jsx("span",{className:"m-step-agent-chip",children:e.agent}),s&&e.summary&&t.jsx("div",{className:"m-step-summary",children:e.summary})]})}function Ns({segment:e,expandedKey:a,onToggle:s}){const n=a===e.steps[0].id;return t.jsx("div",{className:"m-step-collapsed-row","data-testid":"mobile-build-steps-collapsed",role:"button",tabIndex:0,"aria-expanded":n,onClick:()=>s(e.steps[0].id),onKeyDown:i=>{(i.key==="Enter"||i.key===" ")&&s(e.steps[0].id)},children:n?e.steps.map(i=>t.jsx(Xe,{step:i},i.id)):t.jsxs("span",{className:"m-step-collapsed-label",children:[e.count," done ✓"]})})}function vs({active:e}){const[a,s]=r.useState(null),n=yt(pt,(e==null?void 0:e.steps)??null,(e==null?void 0:e.currentStepId)??null),i={};for(const l of n){const d=l.phase||"implementation";i[d]||(i[d]=[]),i[d].push(l)}const u=bs.filter(l=>{var d;return((d=i[l])==null?void 0:d.length)>0});function c(l){s(d=>d===l?null:l)}return t.jsx("div",{className:"m-build-steps-list","data-testid":"mobile-build-steps",children:u.map(l=>{const d=i[l],g=js(d);return t.jsxs("div",{className:"m-build-steps-phase",children:[t.jsx("div",{className:"m-build-steps-phase-header",children:ps[l]||l}),t.jsx("div",{className:"m-build-steps-phase-rows",children:g.map((m,f)=>m.type==="collapsed"?t.jsx(Ns,{segment:m,expandedKey:a,onToggle:c},`collapsed-${f}`):t.jsx(Xe,{step:m.step},m.step.id))})]},l)})})}function ws(e,a){if(typeof e=="string")return e;if(e!=null&&e.type&&(e!=null&&e.message))return`[${e.type}] ${typeof e.message=="string"?e.message:JSON.stringify(e.message)}`;if(e!=null&&e.type)return`[${e.type}] ${JSON.stringify(e).slice(0,240)}`;try{return JSON.stringify(e)}catch{return`(unserializable #${a})`}}function Ss({active:e,onClose:a,onAbort:s}){const n=e==null?void 0:e.featureCode,{events:i}=Ke({agentId:(e==null?void 0:e.flowId)||null}),u=r.useRef(null),[c,l]=r.useState(!1),[d,g]=r.useState(null),[m,f]=r.useState("steps");r.useEffect(()=>{var C;(C=u.current)==null||C.scrollIntoView({behavior:"smooth"})},[i.length]);const b=r.useCallback(async()=>{if(n){l(!0),g(null);try{await(s==null?void 0:s({featureCode:n}))}catch(C){g(C.message||"Failed to abort")}finally{l(!1)}}},[n,s]);if(!e)return null;const h=e.status||"unknown",N=e.mode||"feature";return t.jsxs("div",{className:"m-overlay","data-testid":"mobile-build-detail",role:"dialog","aria-modal":"true",children:[t.jsxs("header",{className:"m-overlay-header",children:[t.jsxs("div",{className:"m-overlay-header-inner",children:[t.jsx("div",{className:"m-overlay-title",title:n,children:n}),t.jsx("span",{className:"m-status-pill","data-status":h,children:h}),t.jsx("span",{className:"m-build-card-mode","data-mode":N,children:N})]}),t.jsxs("div",{className:"m-overlay-actions",children:[t.jsx("button",{type:"button",className:"m-btn m-btn-danger m-btn-sm",disabled:c||de(h),onClick:b,"data-testid":"mobile-build-detail-abort",children:c?"Aborting…":"Abort"}),t.jsx("button",{type:"button",className:"m-btn m-btn-sm",onClick:a,"data-testid":"mobile-build-detail-close",children:"Close"})]})]}),t.jsxs("div",{className:"m-build-detail-tabs",children:[t.jsx("button",{type:"button",className:`m-build-detail-tab${m==="steps"?" is-active":""}`,"data-testid":"mobile-build-detail-tab-steps","aria-pressed":m==="steps",onClick:()=>f("steps"),children:"Steps"}),t.jsx("button",{type:"button",className:`m-build-detail-tab${m==="log"?" is-active":""}`,"data-testid":"mobile-build-detail-tab-log","aria-pressed":m==="log",onClick:()=>f("log"),children:"Log"})]}),m==="steps"?t.jsx("div",{className:"m-overlay-body",children:t.jsx(vs,{active:e})}):t.jsxs("div",{className:"m-overlay-body m-agent-log",children:[i.length===0?t.jsx("div",{className:"m-empty",children:"No live events yet."}):i.map((C,w)=>t.jsx("div",{className:"m-agent-log-line",children:ws(C,w)},w)),t.jsx("div",{ref:u})]}),d&&t.jsx("div",{className:"m-agent-card-error",children:d})]})}function ks(e){if(!e)return"";const a=typeof e=="string"?Date.parse(e):Number(e);if(!a||Number.isNaN(a))return"";const s=Date.now()-a;return s<5e3?"just now":s<6e4?`${Math.floor(s/1e3)}s ago`:s<36e5?`${Math.floor(s/6e4)}m ago`:s<864e5?`${Math.floor(s/36e5)}h ago`:`${Math.floor(s/864e5)}d ago`}function Cs(e){if(!e||typeof e!="number")return"—";if(e<1e3)return`${e}ms`;if(e<6e4)return`${Math.floor(e/1e3)}s`;if(e<36e5){const n=Math.floor(e/6e4),i=Math.floor(e%6e4/1e3);return i>0?`${n}m ${i}s`:`${n}m`}const a=Math.floor(e/36e5),s=Math.floor(e%36e5/6e4);return s>0?`${a}h ${s}m`:`${a}h`}const Ie=80,Ts={done:"●",failed:"✕",revised:"↻",killed:"✕"};function Es(e){if(!e)return"";const a=e.toLowerCase();return a==="complete"||a==="completed"?"ok":a==="failed"||a==="error"?"error":a==="aborted"||a==="killed"?"warn":""}function As({build:e,index:a}){const[s,n]=r.useState(!1),i=ks(e.completedAt),u=e.failureReason?e.failureReason.slice(0,Ie)+(e.failureReason.length>Ie?"…":""):null,c=Es(e.status);return t.jsxs("div",{className:`m-build-history-row${s?" is-expanded":""}`,"data-testid":`mobile-build-history-${a}`,"data-status":e.status||"unknown",role:"button",tabIndex:0,"aria-expanded":s,onClick:()=>n(l=>!l),onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&n(d=>!d)},children:[t.jsxs("div",{className:"m-build-history-summary",children:[t.jsx("span",{className:"m-build-history-code",children:e.featureCode||"(unknown)"}),t.jsx("span",{className:`m-status-pill${c?" m-status-pill--"+c:""}`,"data-status":e.status,children:e.status||"unknown"}),i&&t.jsx("span",{className:"m-build-history-rel",children:i}),!s&&u&&t.jsx("span",{className:"m-build-history-reason-trunc",children:u})]}),s&&t.jsxs("div",{className:"m-build-history-detail",children:[e.mode!=null&&t.jsxs("div",{className:"m-build-history-field",children:[t.jsx("span",{className:"m-build-history-field-label",children:"Mode"}),t.jsx("span",{className:"m-build-history-field-value",children:e.mode})]}),e.durationMs!=null&&t.jsxs("div",{className:"m-build-history-field",children:[t.jsx("span",{className:"m-build-history-field-label",children:"Duration"}),t.jsx("span",{className:"m-build-history-field-value",children:Cs(e.durationMs)})]}),e.stepCount!=null&&t.jsxs("div",{className:"m-build-history-field",children:[t.jsx("span",{className:"m-build-history-field-label",children:"Steps"}),t.jsx("span",{className:"m-build-history-field-value",children:e.stepCount})]}),Array.isArray(e.steps)&&e.steps.length>0&&t.jsx("div",{className:"m-build-history-steps","data-testid":`mobile-build-history-steps-${a}`,children:e.steps.map((l,d)=>t.jsxs("div",{className:`m-build-history-step${l.status==="failed"?" is-failed":""}`,"data-status":l.status,children:[t.jsx("span",{className:"m-build-history-step-glyph",children:Ts[l.status]||"○"}),t.jsx("span",{className:"m-build-history-step-id",children:(l.id||"").replace(/_/g," ")}),l.agent&&t.jsx("span",{className:"m-build-history-step-agent",children:l.agent}),l.status==="failed"&&l.summary&&t.jsx("span",{className:"m-build-history-step-summary",children:l.summary})]},`${l.id||d}`))}),e.failureReason&&t.jsxs("div",{className:"m-build-history-field m-build-history-field--block",children:[t.jsx("span",{className:"m-build-history-field-label",children:"Failure reason"}),t.jsx("span",{className:"m-build-history-field-value m-build-history-failure",children:e.failureReason})]}),e.startedAt&&t.jsxs("div",{className:"m-build-history-field",children:[t.jsx("span",{className:"m-build-history-field-label",children:"Started"}),t.jsx("span",{className:"m-build-history-field-value",children:new Date(e.startedAt).toLocaleString()})]}),e.completedAt&&t.jsxs("div",{className:"m-build-history-field",children:[t.jsx("span",{className:"m-build-history-field-label",children:"Completed"}),t.jsx("span",{className:"m-build-history-field-value",children:new Date(e.completedAt).toLocaleString()})]})]})]})}function Rs({builds:e,loading:a,error:s}){return a?t.jsx("div",{className:"m-build-history","data-testid":"mobile-build-history",children:t.jsx("div",{className:"m-empty",children:"Loading history…"})}):s?t.jsx("div",{className:"m-build-history","data-testid":"mobile-build-history",children:t.jsxs("div",{className:"m-empty",children:["Error: ",s]})}):t.jsx("div",{className:"m-build-history","data-testid":"mobile-build-history",children:!e||e.length===0?t.jsx("div",{className:"m-empty",children:"No past builds."}):e.map((n,i)=>t.jsx(As,{build:n,index:i},n.flowId||i))})}async function _s(){var e;try{const a=await B("/api/vision/items");if(!a.ok)return[];const s=await a.json(),n=Array.isArray(s==null?void 0:s.items)?s.items:Array.isArray(s)?s:[],i=new Set;for(const u of n){const c=((e=u==null?void 0:u.lifecycle)==null?void 0:e.featureCode)||(u==null?void 0:u.featureCode)||(u==null?void 0:u.id);c&&typeof c=="string"&&i.add(c)}return[...i].sort()}catch{return[]}}function $s({open:e,onClose:a,onSubmit:s}){const[n,i]=r.useState(""),[u,c]=r.useState("feature"),[l,d]=r.useState(""),[g,m]=r.useState(!1),[f,b]=r.useState(null),[h,N]=r.useState([]),C=r.useId();r.useEffect(()=>{if(!e)return;let j=!0;return _s().then(x=>{j&&N(x)}),()=>{j=!1}},[e]);const w=r.useMemo(()=>h,[h]);if(!e)return null;function T(){i(""),c("feature"),d(""),b(null),m(!1)}function S(){T(),a==null||a()}async function E(j){if(j==null||j.preventDefault(),!n.trim()){b("Feature code is required");return}m(!0),b(null);try{await(s==null?void 0:s({featureCode:n.trim(),mode:u,description:l.trim()})),S()}catch(x){b(x.message||"Failed to start build"),m(!1)}}return t.jsx("div",{className:"m-sheet-overlay","data-testid":"mobile-start-build-sheet",role:"dialog","aria-modal":"true","aria-label":"Start build",onClick:j=>{j.target===j.currentTarget&&S()},children:t.jsxs("div",{className:"m-sheet",children:[t.jsxs("header",{className:"m-sheet-header",children:[t.jsx("button",{type:"button",className:"m-sheet-close","aria-label":"Close start build",onClick:S,disabled:g,children:"×"}),t.jsx("div",{className:"m-sheet-title-row",children:t.jsx("div",{className:"m-sheet-title",children:"Start build"})})]}),t.jsxs("form",{className:"m-sheet-body",onSubmit:E,children:[t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-build-feature",children:"Feature code"}),t.jsx("input",{id:"m-build-feature",type:"text",className:"m-sheet-input",value:n,onChange:j=>i(j.target.value),placeholder:"e.g. COMP-MOBILE","data-testid":"mobile-build-feature-input",list:C,autoFocus:!0,required:!0}),t.jsx("datalist",{id:C,children:w.map(j=>t.jsx("option",{value:j},j))})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("div",{className:"m-sheet-label",children:"Mode"}),t.jsxs("div",{className:"m-build-mode-row",role:"radiogroup","aria-label":"Build mode",children:[t.jsx("button",{type:"button",role:"radio","aria-checked":u==="feature",className:`m-priority-chip${u==="feature"?" is-selected":""}`,"data-testid":"mobile-build-mode-feature",onClick:()=>c("feature"),children:"Feature"}),t.jsx("button",{type:"button",role:"radio","aria-checked":u==="bug",className:`m-priority-chip${u==="bug"?" is-selected":""}`,"data-testid":"mobile-build-mode-bug",onClick:()=>c("bug"),children:"Bug"})]})]}),t.jsxs("div",{className:"m-sheet-section",children:[t.jsx("label",{className:"m-sheet-label",htmlFor:"m-build-desc",children:"Description (optional)"}),t.jsx("textarea",{id:"m-build-desc",className:"m-sheet-input m-textarea",value:l,onChange:j=>d(j.target.value),rows:4,"data-testid":"mobile-build-description"})]}),f?t.jsx("div",{className:"m-form-error",role:"alert",children:f}):null]}),t.jsxs("footer",{className:"m-sheet-footer",children:[t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-secondary",onClick:S,disabled:g,"data-testid":"mobile-build-cancel",children:"Cancel"}),t.jsx("button",{type:"button",className:"m-sheet-btn m-sheet-btn-primary",disabled:g||!n.trim(),"data-testid":"mobile-build-submit",onClick:E,children:g?"Starting…":"Start"})]})]})})}const Ve=4e3,Le={info:{color:"hsl(var(--foreground))",bg:"hsl(var(--muted))"},warn:{color:"hsl(var(--warning, 32 95% 52%))",bg:"hsl(var(--muted))"},error:{color:"hsl(var(--destructive))",bg:"hsl(var(--destructive) / 0.08)"}};function zs(){const[e,a]=r.useState(null),s=r.useRef(null);if(r.useEffect(()=>{function i(u){const{message:c,level:l="info",ttl:d=Ve}=u.detail??{};c&&(clearTimeout(s.current),a({message:c,level:l}),d>0&&(s.current=setTimeout(()=>a(null),d)))}return window.addEventListener("compose:notify",i),()=>{window.removeEventListener("compose:notify",i),clearTimeout(s.current)}},[]),!e)return null;const n=Le[e.level]??Le.info;return t.jsxs("div",{className:"h-6 flex items-center justify-between px-3 gap-2 shrink-0 text-[11px] font-mono",style:{background:n.bg,color:n.color,borderTop:"1px solid hsl(var(--border))"},role:"status","aria-live":"polite",children:[t.jsx("span",{className:"flex-1 min-w-0 truncate",children:e.message}),t.jsx("button",{className:"shrink-0 opacity-60 hover:opacity-100 text-[10px]",onClick:()=>{clearTimeout(s.current),a(null)},"aria-label":"Dismiss notification",children:"✕"})]})}function he(e,a="info",s=Ve){try{window.dispatchEvent(new CustomEvent("compose:notify",{detail:{message:e,level:a,ttl:s}}))}catch{}}async function Oe(e,a={}){const s=await B(e,a);let n=null;try{n=await s.json()}catch{}if(!s.ok){const i=n&&n.error||`HTTP ${s.status}`;throw new Error(i)}return n}const Ps=new Set(["complete","completed"]);function Is({active:e,limit:a=20}={}){const[s,n]=r.useState([]),[i,u]=r.useState(!0),[c,l]=r.useState(null),d=r.useRef(new Map),g=r.useRef(new Map),m=r.useRef(!0),f=r.useRef(null),b=r.useCallback(C=>{n(C),l(null);for(const w of C){const T=w.flowId;if(!T)continue;const S=d.current.get(T);if(S&&Ps.has(S)&&w.status==="failed"&&g.current.get(T)!==w.status){g.current.set(T,w.status);try{he(`Build failed post-checks: ${w.featureCode}`,"error",0)}catch{}}}},[]),h=r.useCallback(async({pendingFlowId:C}={})=>{try{const w=await Oe(`/api/builds?limit=${a}`);if(!m.current)return;const T=Array.isArray(w==null?void 0:w.builds)?w.builds:[];b(T),C&&(T.some(E=>E.flowId===C)||(f.current&&clearTimeout(f.current),f.current=setTimeout(async()=>{if(m.current)try{const E=await Oe(`/api/builds?limit=${a}`);if(!m.current)return;const j=Array.isArray(E==null?void 0:E.builds)?E.builds:[];b(j)}catch(E){m.current&&l(E.message)}},2500)))}catch(w){if(!m.current)return;l(w.message)}finally{m.current&&u(!1)}},[a,b]);r.useEffect(()=>(m.current=!0,h(),()=>{m.current=!1,f.current&&clearTimeout(f.current)}),[h]);const N=r.useRef(null);return r.useEffect(()=>{if(!e)return;N.current,N.current=e;const C=e.flowId;if(!(!C||!de(e.status))){if(d.current.has(C)){d.current.get(C)!==e.status&&d.current.set(C,e.status);return}d.current.set(C,e.status),h({pendingFlowId:C})}},[e,h]),{builds:s,loading:i,error:c,refetch:h}}function Ls({active:e,loading:a,error:s,startBuild:n,abortBuild:i}){const[u,c]=r.useState(!1),[l,d]=r.useState(!1),[g,m]=r.useState(!1),[f,b]=r.useState(null),{builds:h,loading:N,error:C}=Is({active:e}),w=!!(e&&e.featureCode&&!de(e.status)),T=r.useCallback(async({featureCode:E,mode:j,description:x})=>{try{await n({featureCode:E,mode:j,description:x}),b({kind:"ok",message:`Build started for ${E}`})}catch(p){const y=(p==null?void 0:p.status)===409?`A build for ${E} is already active`:(p==null?void 0:p.message)||"Failed to start build";throw b({kind:"error",message:y}),p}},[n]),S=r.useCallback(async({featureCode:E})=>{m(!0);try{await i({featureCode:E}),b({kind:"ok",message:`Aborted ${E}`}),d(!1)}catch(j){throw b({kind:"error",message:(j==null?void 0:j.message)||"Failed to abort"}),j}finally{m(!1)}},[i]);return t.jsxs("section",{"data-testid":"mobile-tab-builds",className:"m-builds-tab",children:[t.jsxs("div",{className:"m-section",children:[t.jsx("h2",{className:"m-section-title",children:"Current build"}),a?t.jsx("div",{className:"m-empty","data-testid":"mobile-build-loading",children:"Loading…"}):w?t.jsx(hs,{active:e,onOpen:()=>d(!0),onAbort:S,aborting:g}):t.jsxs("div",{className:"m-empty-state","data-testid":"mobile-build-empty",children:[t.jsx("div",{className:"m-empty-title",children:"No active build"}),t.jsx("div",{className:"m-empty-body",children:e&&de(e.status)?`Last build: ${e.featureCode} (${e.status})`:"Start a build to track progress here."}),t.jsx("button",{type:"button",className:"m-btn m-btn-primary","data-testid":"mobile-build-start",onClick:()=>c(!0),children:"Start build"})]}),s&&t.jsxs("div",{className:"m-empty","data-testid":"mobile-build-error",children:["Error: ",s]})]}),w&&t.jsx("div",{className:"m-section",children:t.jsx("button",{type:"button",className:"m-btn m-btn-sm","data-testid":"mobile-build-start-secondary",onClick:()=>c(!0),children:"Start another build"})}),t.jsxs("div",{className:"m-section","data-testid":"mobile-build-history-section",children:[t.jsx("h2",{className:"m-section-title",children:"History"}),t.jsx(Rs,{builds:h,loading:N,error:C})]}),t.jsx($s,{open:u,onClose:()=>c(!1),onSubmit:T}),l&&e&&t.jsx(Ss,{active:e,onClose:()=>d(!1),onAbort:S}),t.jsx(ze,{message:f==null?void 0:f.message,kind:f==null?void 0:f.kind,onDismiss:()=>b(null)})]})}const Os=3;function Ms({onNavigate:e}){const[a,s]=r.useState([]),n=r.useRef(new Map),i=r.useRef(0),u=r.useCallback(l=>{clearTimeout(n.current.get(l)),n.current.delete(l),s(d=>d.filter(g=>g.id!==l))},[]);if(r.useEffect(()=>{function l(d){const{message:g,level:m="info",ttl:f}=d.detail??{};if(!g)return;const b=++i.current;s(N=>{const C=[...N,{id:b,message:g,level:m}];if(C.length>Os){const w=C.shift();clearTimeout(n.current.get(w.id)),n.current.delete(w.id)}return C});const h=typeof f=="number"&&f>0&&isFinite(f)?f:0;if(h>0){const N=setTimeout(()=>{s(C=>C.filter(w=>w.id!==b)),n.current.delete(b)},h);n.current.set(b,N)}}return window.addEventListener("compose:notify",l),()=>{window.removeEventListener("compose:notify",l);for(const d of n.current.values())clearTimeout(d);n.current.clear()}},[]),a.length===0)return null;function c(l){return l==="warn"?"agents":"builds"}return t.jsx("div",{className:"m-alert-bar","data-testid":"mobile-alert-bar","aria-live":"polite",children:a.map(l=>t.jsxs("div",{className:`m-alert m-alert-${l.level}`,"data-testid":`mobile-alert-${l.level}`,role:"status",onClick:()=>{e==null||e(c(l.level)),u(l.id)},children:[t.jsx("span",{className:"m-alert-msg",children:l.message}),t.jsx("button",{type:"button",className:"m-alert-dismiss","aria-label":"Dismiss",onClick:d=>{d.stopPropagation(),u(l.id)},children:"✕"})]},l.id))})}async function Me(e,a={}){const s=await B(e,a);let n=null;try{n=await s.json()}catch{}if(!s.ok){const i=n&&n.error||`HTTP ${s.status}`;throw new Error(i)}return n}function Ds(){const[e,a]=r.useState([]),[s,n]=r.useState(!0),[i,u]=r.useState(null),c=r.useRef(!0),l=r.useCallback(async()=>{try{const g=await Me("/api/vision/gates");if(!c.current)return;a(Array.isArray(g==null?void 0:g.gates)?g.gates:[]),u(null)}catch(g){if(!c.current)return;u(g.message)}finally{c.current&&n(!1)}},[]);r.useEffect(()=>(c.current=!0,l(),()=>{c.current=!1}),[l]),r.useEffect(()=>{if(typeof window>"u"||typeof WebSocket>"u")return;const g=me({url:()=>ue(),onMessage:m=>{try{const f=JSON.parse(m.data);if(!f||!f.type)return;(f.type==="gateCreated"||f.type==="gateResolved"||f.type==="gateUpdated")&&l()}catch{}}});return()=>{try{g.close()}catch{}}},[l]);const d=r.useCallback(async(g,{outcome:m,reason:f,summary:b}={})=>{if(!["approve","revise","kill"].includes(m))throw new Error(`outcome must be approve|revise|kill (got ${m})`);const h=[];f&&h.push(f),b&&h.push(b);const N=h.join(" — ")||void 0,C={outcome:m};N&&(C.comment=N);const w=await Me(`/api/vision/gates/${encodeURIComponent(g)}/resolve`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(C)});return l(),w},[l]);return{gates:e,loading:s,error:i,refetch:l,resolve:d}}async function ve(e,a={}){const s=await B(e,a);let n=null;try{n=await s.json()}catch{}if(!s.ok){const i=n&&n.error||`HTTP ${s.status}`,u=new Error(i);throw u.status=s.status,u.data=n,u}return n}function Us(){const[e,a]=r.useState(null),[s,n]=r.useState(!0),[i,u]=r.useState(null),c=r.useRef(!0),l=r.useCallback(async()=>{try{const m=await ve("/api/build/state");if(!c.current)return;a((m==null?void 0:m.state)??null),u(null)}catch(m){if(!c.current)return;u(m.message)}finally{c.current&&n(!1)}},[]);r.useEffect(()=>(c.current=!0,l(),()=>{c.current=!1}),[l]),r.useEffect(()=>{if(typeof window>"u"||typeof WebSocket>"u")return;const m=me({url:()=>ue(),onMessage:f=>{try{const b=JSON.parse(f.data);if(!b||!b.type)return;b.type==="buildState"&&l()}catch{}}});return()=>{try{m.close()}catch{}}},[l]);const d=r.useCallback(async({featureCode:m,mode:f="feature",description:b=""}={})=>{if(!m)throw new Error("featureCode required");const h=await ve("/api/build/start",{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify({featureCode:m,mode:f,description:b})});return l(),h},[l]),g=r.useCallback(async({featureCode:m}={})=>{if(!m)throw new Error("featureCode required");const f=await ve("/api/build/abort",{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify({featureCode:m})});return l(),f},[l]);return{active:e,loading:s,error:i,refetch:l,startBuild:d,abortBuild:g}}function Fs(){const[e,a]=r.useState([]),[s,n]=r.useState(!0),[i,u]=r.useState(null),[c,l]=r.useState(!1),d=r.useRef(e);d.current=e;const g=r.useRef(new Map),m=r.useRef(new Map),f=r.useRef(new Set),b=r.useRef(0),h=r.useCallback(async()=>{try{const x=await(await B("/api/vision/items")).json(),p=Array.isArray(x==null?void 0:x.items)?x.items:Array.isArray(x)?x:[];a(p),u(null)}catch(j){u((j==null?void 0:j.message)||"Failed to load items")}finally{n(!1)}},[]);r.useEffect(()=>{let j=!1;h();const x=me({url:()=>ue(),onOpen:()=>{j||l(!0)},onClose:()=>{j||l(!1)},onMessage:p=>{var A,M;if(j)return;let y;try{y=JSON.parse(p.data)}catch{return}if(!y||typeof y!="object")return;const v=y.type;(v==="visionState"||v==="hydrate")&&Array.isArray(y.items)?a(()=>{const P=g.current,O=m.current,L=f.current;let F=y.items;if(P.size>0&&(F=F.map(Y=>{const q=P.get(Y.id);return q?{...Y,...q}:Y})),L.size>0&&(F=F.filter(Y=>!L.has(Y.id))),O.size>0){const Y=new Set(F.map(z=>z.id)),q=[...O.values()].filter(z=>!Y.has(z.id));q.length>0&&(F=[...q,...F])}return F}):v==="itemUpdated"&&((A=y.item)!=null&&A.id)?a(P=>{const O=P.findIndex(F=>F.id===y.item.id);if(O===-1)return[...P,y.item];const L=P.slice();return L[O]={...L[O],...y.item},L}):v==="itemCreated"&&((M=y.item)!=null&&M.id)?a(P=>P.some(O=>O.id===y.item.id)?P:[...P,y.item]):v==="itemDeleted"&&y.id?a(P=>P.filter(O=>O.id!==y.id)):v==="state"&&Array.isArray(y.items)?a(y.items):(v==="visionUpdated"||v==="roadmapUpdated")&&h()}});return()=>{j=!0;try{x.close()}catch{}}},[h]);const N=r.useCallback(async(j,x)=>{if(!j||!x||typeof x!="object")return{ok:!1,error:"invalid patch"};const p=d.current;if(!p.find(A=>A.id===j))return{ok:!1,error:"item not found"};g.current.set(j,x);const v=p.map(A=>A.id===j?{...A,...x}:A);a(v);try{const A=await B(`/api/vision/items/${j}`,{method:"PATCH",headers:V({"Content-Type":"application/json"}),body:JSON.stringify(x)}),M=await A.json().catch(()=>({}));if(!A.ok)return g.current.delete(j),a(p),{ok:!1,error:(M==null?void 0:M.error)||`HTTP ${A.status}`};g.current.delete(j);const P=(M==null?void 0:M.item)||(M==null?void 0:M.updated)||null;return P&&P.id===j&&a(O=>O.map(L=>L.id===j?{...L,...P}:L)),{ok:!0,item:P||v.find(O=>O.id===j)}}catch(A){return g.current.delete(j),a(p),{ok:!1,error:(A==null?void 0:A.message)||"Network error"}}},[]),C=r.useCallback(async j=>{if(!j||typeof j!="object")return{ok:!1,error:"invalid fields"};const x=`tmp-${++b.current}`,p={...j,type:"feature",id:x};m.current.set(x,p),a(y=>[p,...y]);try{const y=await B("/api/vision/items",{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify({...j,type:"feature"})}),v=await y.json().catch(()=>({}));if(!y.ok)return m.current.delete(x),a(M=>M.filter(P=>P.id!==x)),{ok:!1,error:(v==null?void 0:v.error)||`HTTP ${y.status}`};const A=(v==null?void 0:v.item)||(v!=null&&v.id?v:null);return m.current.delete(x),a(M=>A&&M.some(P=>P.id===A.id)?M.filter(P=>P.id!==x):M.map(P=>P.id===x&&A?{...P,...A}:P)),{ok:!0,item:A}}catch(y){return m.current.delete(x),a(v=>v.filter(A=>A.id!==x)),{ok:!1,error:(y==null?void 0:y.message)||"Network error"}}},[]),w=r.useCallback(async j=>{if(!j)return{ok:!1,error:"id required"};const x=d.current;f.current.add(j),a(p=>p.filter(y=>y.id!==j));try{const p=await B(`/api/vision/items/${j}`,{method:"DELETE",headers:V({"Content-Type":"application/json"})}),y=await p.json().catch(()=>({}));return p.ok?(f.current.delete(j),{ok:!0}):(f.current.delete(j),a(x),{ok:!1,error:(y==null?void 0:y.error)||`HTTP ${p.status}`})}catch(p){return f.current.delete(j),a(x),{ok:!1,error:(p==null?void 0:p.message)||"Network error"}}},[]),T=r.useCallback(async({fromId:j,toId:x,type:p})=>{try{const y=await B("/api/vision/connections",{method:"POST",headers:V({"Content-Type":"application/json"}),body:JSON.stringify({fromId:j,toId:x,type:p})}),v=await y.json().catch(()=>({}));return y.ok?{ok:!0,connection:(v==null?void 0:v.connection)||v}:{ok:!1,error:(v==null?void 0:v.error)||`HTTP ${y.status}`}}catch(y){return{ok:!1,error:(y==null?void 0:y.message)||"Network error"}}},[]),S=r.useCallback(async j=>{try{const x=await B(`/api/vision/connections/${j}`,{method:"DELETE",headers:V({"Content-Type":"application/json"})}),p=await x.json().catch(()=>({}));return x.ok?{ok:!0}:{ok:!1,error:(p==null?void 0:p.error)||`HTTP ${x.status}`}}catch(x){return{ok:!1,error:(x==null?void 0:x.message)||"Network error"}}},[]),E=r.useCallback(async j=>{try{const x=await B(`/api/vision/items/${j}`),p=await x.json().catch(()=>({}));return x.ok?{ok:!0,item:p}:{ok:!1,error:(p==null?void 0:p.error)||`HTTP ${x.status}`}}catch(x){return{ok:!1,error:(x==null?void 0:x.message)||"Network error"}}},[]);return{items:e,loading:s,error:i,connected:c,refetch:h,applyOptimisticEdit:N,createItem:C,deleteItem:w,addConnection:T,removeConnection:S,fetchItemDetail:E}}function Gs({active:e,gates:a,items:s}){const n=r.useRef(null),i=r.useRef(new Map);r.useEffect(()=>{if(Array.isArray(a)){if(n.current===null){n.current=new Set(a.map(u=>u.id));return}for(const u of a)if(!n.current.has(u.id)){n.current.add(u.id);const c=(Array.isArray(s)?s:[]).find(d=>d.id===u.itemId),l=(c==null?void 0:c.title)||"Gate pending";he(`Gate pending: ${l}`,"warn",0)}}},[a,s]),r.useEffect(()=>{if(!e||!e.flowId)return;const u=i.current.get(e.flowId),c=e.status;u!==void 0&&u!==c&&(c==="failed"?he(`Build failed: ${e.featureCode||e.flowId}`,"error",0):(c==="complete"||c==="completed")&&he(`Build complete: ${e.featureCode||e.flowId}`,"info",4e3)),i.current.set(e.flowId,c)},[e])}const Qe=["agents","roadmap","builds","ideas"],De="agents",Ue="compose:mobile:sensitiveToken";function Hs(e){const a=e.match(/^\/m(?:\/([^/?#]+))?\/?$/);if(!a)return De;const s=a[1];return s&&Qe.includes(s)?s:De}function Bs(){const e=window.location.pathname==="/m/pair",[a,s]=r.useState(()=>Hs(window.location.pathname));r.useEffect(()=>{try{localStorage.getItem(ie)&&(He("mobile-paired"),Be(!0))}catch{}},[]),r.useEffect(()=>{try{const y=new URL(window.location.href),v=y.searchParams.get("token");if(v){try{localStorage.setItem(Ue,v)}catch{}ee(v),y.searchParams.delete("token"),window.history.replaceState({},"",y.pathname+(y.search?y.search:"")+y.hash)}else{let A=null;try{A=localStorage.getItem(Ue)}catch{}A&&ee(A)}}catch{}},[]),r.useEffect(()=>{if(!(typeof navigator>"u")&&"serviceWorker"in navigator)try{navigator.serviceWorker.register("/m-sw.js").catch(y=>{console.warn("[compose-mobile] SW registration failed:",y)})}catch(y){console.warn("[compose-mobile] SW registration threw:",y)}},[]);const n=r.useCallback(y=>{if(Qe.includes(y)){s(y);try{const v=new URL(window.location.href);v.pathname=`/m/${y}`,window.history.replaceState({},"",v.pathname+v.search+v.hash)}catch{}}},[]),{gates:i,loading:u,resolve:c}=Ds(),{active:l,loading:d,error:g,startBuild:m,abortBuild:f}=Us(),{items:b,loading:h,error:N,applyOptimisticEdit:C,createItem:w,deleteItem:T,addConnection:S,removeConnection:E,fetchItemDetail:j}=Fs();Gs({active:l,gates:i,items:b});const x={};if(i.length>0&&(x.agents={count:i.length,level:"warn"}),(l==null?void 0:l.status)==="failed"?x.builds={level:"error"}:gt(l,i,b)&&(x.builds={level:"warn"}),e)return t.jsx(ht,{});let p=null;return a==="agents"?p=t.jsx(Ft,{gates:i,gatesLoading:u,resolveGate:c}):a==="roadmap"?p=t.jsx(Zt,{items:b,loading:h,error:N,applyOptimisticEdit:C,createItem:w,deleteItem:T,addConnection:S,removeConnection:E,fetchItemDetail:j}):a==="ideas"?p=t.jsx(us,{}):a==="builds"&&(p=t.jsx(Ls,{active:l,loading:d,error:g,startBuild:m,abortBuild:f})),t.jsxs("div",{className:"m-root","data-testid":"mobile-root",children:[t.jsx("header",{className:"m-header",children:t.jsx("div",{className:"m-header-title",children:"Compose"})}),t.jsx(Ms,{onNavigate:n}),t.jsx("main",{className:"m-main","data-testid":"mobile-main","data-tab":a,children:p}),t.jsx(jt,{active:a,onSelect:n,badges:x})]})}const Xs=Object.freeze(Object.defineProperty({__proto__:null,default:Bs},Symbol.toStringTag,{value:"Module"}));export{Xs as M,zs as N,pt as P,Ys as R,r as a,Be as b,Js as c,rt as d,dt as e,_t as f,et as g,me as h,Ks as i,t as j,V as k,Ye as l,yt as m,he as n,Ws as o,nt as r,qs as s,ue as v,B as w};
@@ -1,4 +1,4 @@
1
- import{a4 as S,a7 as R,b5 as Q,g as Y,s as tt,a as et,b as at,q as rt,p as nt,_ as p,l as z,c as it,F as st,I as ot,N as lt,e as ct,z as ut,G as pt}from"./App-CZNprfTP.js";import{p as gt}from"./chunk-4BX2VUAB-bH25OCUA.js";import{p as dt}from"./wardley-L42UT6IY-nYDkwvlu.js";import{d as _}from"./arc-D7Ql7gBh.js";import{o as ft}from"./ordinal-Cboi1Yqb.js";import"./mobile-B-d4crm_.js";import"./index-BVnbNZXC.js";import"./graph-viND0NdB.js";import"./init-Gi6I4Gst.js";function ht(t,a){return a<t?-1:a>t?1:a>=t?0:NaN}function mt(t){return t}function vt(){var t=mt,a=ht,f=null,y=S(0),s=S(R),g=S(0);function o(e){var n,l=(e=Q(e)).length,d,h,v=0,c=new Array(l),i=new Array(l),x=+y.apply(this,arguments),w=Math.min(R,Math.max(-R,s.apply(this,arguments)-x)),m,D=Math.min(Math.abs(w)/l,g.apply(this,arguments)),$=D*(w<0?-1:1),u;for(n=0;n<l;++n)(u=i[c[n]=n]=+t(e[n],n,e))>0&&(v+=u);for(a!=null?c.sort(function(A,C){return a(i[A],i[C])}):f!=null&&c.sort(function(A,C){return f(e[A],e[C])}),n=0,h=v?(w-l*$)/v:0;n<l;++n,x=m)d=c[n],u=i[d],m=x+(u>0?u*h:0)+$,i[d]={data:e[d],index:n,value:u,startAngle:x,endAngle:m,padAngle:D};return i}return o.value=function(e){return arguments.length?(t=typeof e=="function"?e:S(+e),o):t},o.sortValues=function(e){return arguments.length?(a=e,f=null,o):a},o.sort=function(e){return arguments.length?(f=e,a=null,o):f},o.startAngle=function(e){return arguments.length?(y=typeof e=="function"?e:S(+e),o):y},o.endAngle=function(e){return arguments.length?(s=typeof e=="function"?e:S(+e),o):s},o.padAngle=function(e){return arguments.length?(g=typeof e=="function"?e:S(+e),o):g},o}var xt=pt.pie,F={sections:new Map,showData:!1},T=F.sections,W=F.showData,St=structuredClone(xt),yt=p(()=>structuredClone(St),"getConfig"),wt=p(()=>{T=new Map,W=F.showData,ut()},"clear"),At=p(({label:t,value:a})=>{if(a<0)throw new Error(`"${t}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);T.has(t)||(T.set(t,a),z.debug(`added new section: ${t}, with value: ${a}`))},"addSection"),Ct=p(()=>T,"getSections"),Dt=p(t=>{W=t},"setShowData"),$t=p(()=>W,"getShowData"),V={getConfig:yt,clear:wt,setDiagramTitle:nt,getDiagramTitle:rt,setAccTitle:at,getAccTitle:et,setAccDescription:tt,getAccDescription:Y,addSection:At,getSections:Ct,setShowData:Dt,getShowData:$t},Tt=p((t,a)=>{gt(t,a),a.setShowData(t.showData),t.sections.map(a.addSection)},"populateDb"),bt={parse:p(async t=>{const a=await dt("pie",t);z.debug(a),Tt(a,V)},"parse")},kt=p(t=>`
1
+ import{a4 as S,a7 as R,b5 as Q,g as Y,s as tt,a as et,b as at,q as rt,p as nt,_ as p,l as z,c as it,F as st,I as ot,N as lt,e as ct,z as ut,G as pt}from"./App-D7E7S49Q.js";import{p as gt}from"./chunk-4BX2VUAB-BSxn03f-.js";import{p as dt}from"./wardley-L42UT6IY-nqdlFSIA.js";import{d as _}from"./arc-LOW60tiI.js";import{o as ft}from"./ordinal-Cboi1Yqb.js";import"./mobile-DwmxS_O4.js";import"./index-DNuHtZwR.js";import"./graph-BBXaecIU.js";import"./init-Gi6I4Gst.js";function ht(t,a){return a<t?-1:a>t?1:a>=t?0:NaN}function mt(t){return t}function vt(){var t=mt,a=ht,f=null,y=S(0),s=S(R),g=S(0);function o(e){var n,l=(e=Q(e)).length,d,h,v=0,c=new Array(l),i=new Array(l),x=+y.apply(this,arguments),w=Math.min(R,Math.max(-R,s.apply(this,arguments)-x)),m,D=Math.min(Math.abs(w)/l,g.apply(this,arguments)),$=D*(w<0?-1:1),u;for(n=0;n<l;++n)(u=i[c[n]=n]=+t(e[n],n,e))>0&&(v+=u);for(a!=null?c.sort(function(A,C){return a(i[A],i[C])}):f!=null&&c.sort(function(A,C){return f(e[A],e[C])}),n=0,h=v?(w-l*$)/v:0;n<l;++n,x=m)d=c[n],u=i[d],m=x+(u>0?u*h:0)+$,i[d]={data:e[d],index:n,value:u,startAngle:x,endAngle:m,padAngle:D};return i}return o.value=function(e){return arguments.length?(t=typeof e=="function"?e:S(+e),o):t},o.sortValues=function(e){return arguments.length?(a=e,f=null,o):a},o.sort=function(e){return arguments.length?(f=e,a=null,o):f},o.startAngle=function(e){return arguments.length?(y=typeof e=="function"?e:S(+e),o):y},o.endAngle=function(e){return arguments.length?(s=typeof e=="function"?e:S(+e),o):s},o.padAngle=function(e){return arguments.length?(g=typeof e=="function"?e:S(+e),o):g},o}var xt=pt.pie,F={sections:new Map,showData:!1},T=F.sections,W=F.showData,St=structuredClone(xt),yt=p(()=>structuredClone(St),"getConfig"),wt=p(()=>{T=new Map,W=F.showData,ut()},"clear"),At=p(({label:t,value:a})=>{if(a<0)throw new Error(`"${t}" has invalid value: ${a}. Negative values are not allowed in pie charts. All slice values must be >= 0.`);T.has(t)||(T.set(t,a),z.debug(`added new section: ${t}, with value: ${a}`))},"addSection"),Ct=p(()=>T,"getSections"),Dt=p(t=>{W=t},"setShowData"),$t=p(()=>W,"getShowData"),V={getConfig:yt,clear:wt,setDiagramTitle:nt,getDiagramTitle:rt,setAccTitle:at,getAccTitle:et,setAccDescription:tt,getAccDescription:Y,addSection:At,getSections:Ct,setShowData:Dt,getShowData:$t},Tt=p((t,a)=>{gt(t,a),a.setShowData(t.showData),t.sections.map(a.addSection)},"populateDb"),bt={parse:p(async t=>{const a=await dt("pie",t);z.debug(a),Tt(a,V)},"parse")},kt=p(t=>`
2
2
  .pieCircle{
3
3
  stroke: ${t.pieStrokeColor};
4
4
  stroke-width : ${t.pieStrokeWidth};
@@ -1,4 +1,4 @@
1
- import{s as Ae,g as ke,q as ae,p as Fe,a as Pe,b as ve,_ as o,c as wt,l as At,d as zt,e as Ce,z as Le,G as z,i as Ee,K as De}from"./App-CZNprfTP.js";import{l as ie}from"./linear-BOFLe2h1.js";import"./mobile-B-d4crm_.js";import"./index-BVnbNZXC.js";import"./graph-viND0NdB.js";import"./init-Gi6I4Gst.js";import"./defaultLocale-DX6XiGOO.js";var Vt=(function(){var t=o(function(j,r,l,g){for(l=l||{},g=j.length;g--;l[j[g]]=r);return l},"o"),n=[1,3],u=[1,4],c=[1,5],h=[1,6],p=[1,7],y=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],S=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],a=[55,56,57],k=[2,36],d=[1,37],T=[1,36],m=[1,38],q=[1,35],b=[1,43],x=[1,41],_=[1,45],Y=[1,14],G=[1,23],yt=[1,18],Tt=[1,19],dt=[1,20],Ft=[1,21],ut=[1,22],xt=[1,24],ft=[1,25],gt=[1,26],i=[1,27],Bt=[1,28],Rt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],H=[1,63],X=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Nt=[1,66],Wt=[1,67],Ut=[1,68],Qt=[1,69],Ot=[1,70],Ht=[1,71],Xt=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],Kt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],J=[1,91],$=[1,92],tt=[1,93],et=[1,100],it=[1,94],at=[1,97],nt=[1,95],st=[1,96],rt=[1,98],ot=[1,99],Pt=[1,103],Zt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],vt={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,g,f,A,e,pt){var s=e.length-1;switch(A){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],f.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),f.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),f.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),f.setAccDescription(this.$);break;case 46:f.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:f.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:f.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:f.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:f.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:f.setXAxisLeftText(e[s-2]),f.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",f.setXAxisLeftText(e[s-1]);break;case 53:f.setXAxisLeftText(e[s]);break;case 54:f.setYAxisBottomText(e[s-2]),f.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",f.setYAxisBottomText(e[s-1]);break;case 56:f.setYAxisBottomText(e[s]);break;case 57:f.setQuadrant1Text(e[s]);break;case 58:f.setQuadrant2Text(e[s]);break;case 59:f.setQuadrant3Text(e[s]);break;case 60:f.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:u,55:c,56:h,57:p},{1:[3]},{18:n,26:8,27:2,28:u,55:c,56:h,57:p},{18:n,26:9,27:2,28:u,55:c,56:h,57:p},t(y,[2,33],{29:10}),t(S,[2,61]),t(S,[2,62]),t(S,[2,63]),{1:[2,30]},{1:[2,31]},t(a,k,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:d,5:T,10:m,12:q,13:b,14:x,15:_,18:Y,25:G,35:yt,37:Tt,39:dt,41:Ft,42:ut,48:xt,50:ft,51:gt,52:i,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(y,[2,34]),{27:46,55:c,56:h,57:p},t(a,[2,37]),t(a,k,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:d,5:T,10:m,12:q,13:b,14:x,15:_,18:Y,25:G,35:yt,37:Tt,39:dt,41:Ft,42:ut,48:xt,50:ft,51:gt,52:i,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(a,[2,45]),t(a,[2,46]),{18:[1,51]},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:52,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:53,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:54,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:55,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:56,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:57,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(y,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:65,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,21:64},t(a,[2,53],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(a,[2,56],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(a,[2,57],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,58],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,59],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,60],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(a,[2,52],{58:31,43:84,4:d,5:T,10:m,12:q,13:b,14:x,15:_,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,55],{58:31,43:85,4:d,5:T,10:m,12:q,13:b,14:x,15:_,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:J,5:$,6:tt,8:et,11:it,13:at,16:90,17:nt,18:st,19:rt,20:ot,22:89,23:88},t(w,[2,24]),t(a,[2,51],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,54],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,47],{22:89,16:90,23:101,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),{46:[1,102]},t(a,[2,29],{10:Pt}),t(Zt,[2,27],{16:104,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(a,[2,49],{10:Pt}),t(a,[2,48],{22:89,16:90,23:105,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),{4:J,5:$,6:tt,8:et,11:it,13:at,16:90,17:nt,18:st,19:rt,20:ot,22:106},t(N,[2,26]),t(a,[2,50],{10:Pt}),t(Zt,[2,28],{16:104,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(r,l){if(l.recoverable)this.trace(r);else{var g=new Error(r);throw g.hash=l,g}},"parseError"),parse:o(function(r){var l=this,g=[0],f=[],A=[null],e=[],pt=this.table,s="",qt=0,Jt=0,qe=2,$t=1,be=e.slice.call(arguments,1),D=Object.create(this.lexer),K={yy:{}};for(var Ct in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ct)&&(K.yy[Ct]=this.yy[Ct]);D.setInput(r,K.yy),K.yy.lexer=D,K.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Lt=D.yylloc;e.push(Lt);var Se=D.options&&D.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(R){g.length=g.length-2*R,A.length=A.length-R,e.length=e.length-R}o(_e,"popStack");function te(){var R;return R=f.pop()||D.lex()||$t,typeof R!="number"&&(R instanceof Array&&(f=R,R=f.pop()),R=l.symbols_[R]||R),R}o(te,"lex");for(var B,Z,W,Et,lt={},bt,M,ee,St;;){if(Z=g[g.length-1],this.defaultActions[Z]?W=this.defaultActions[Z]:((B===null||typeof B>"u")&&(B=te()),W=pt[Z]&&pt[Z][B]),typeof W>"u"||!W.length||!W[0]){var Dt="";St=[];for(bt in pt[Z])this.terminals_[bt]&&bt>qe&&St.push("'"+this.terminals_[bt]+"'");D.showPosition?Dt="Parse error on line "+(qt+1)+`:
1
+ import{s as Ae,g as ke,q as ae,p as Fe,a as Pe,b as ve,_ as o,c as wt,l as At,d as zt,e as Ce,z as Le,G as z,i as Ee,K as De}from"./App-D7E7S49Q.js";import{l as ie}from"./linear-CqLVtYRk.js";import"./mobile-DwmxS_O4.js";import"./index-DNuHtZwR.js";import"./graph-BBXaecIU.js";import"./init-Gi6I4Gst.js";import"./defaultLocale-DX6XiGOO.js";var Vt=(function(){var t=o(function(j,r,l,g){for(l=l||{},g=j.length;g--;l[j[g]]=r);return l},"o"),n=[1,3],u=[1,4],c=[1,5],h=[1,6],p=[1,7],y=[1,4,5,10,12,13,14,15,18,25,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],S=[1,4,5,10,12,13,14,15,18,25,28,35,37,39,41,42,48,50,51,52,53,54,55,56,57,60,61,63,64,65,66,67],a=[55,56,57],k=[2,36],d=[1,37],T=[1,36],m=[1,38],q=[1,35],b=[1,43],x=[1,41],_=[1,45],Y=[1,14],G=[1,23],yt=[1,18],Tt=[1,19],dt=[1,20],Ft=[1,21],ut=[1,22],xt=[1,24],ft=[1,25],gt=[1,26],i=[1,27],Bt=[1,28],Rt=[1,29],U=[1,32],Q=[1,33],F=[1,34],P=[1,39],v=[1,40],C=[1,42],L=[1,44],H=[1,63],X=[1,62],E=[4,5,8,10,12,13,14,15,18,44,47,49,55,56,57,63,64,65,66,67],Nt=[1,66],Wt=[1,67],Ut=[1,68],Qt=[1,69],Ot=[1,70],Ht=[1,71],Xt=[1,72],Mt=[1,73],Yt=[1,74],jt=[1,75],Gt=[1,76],Kt=[1,77],w=[4,5,6,7,8,9,10,11,12,13,14,15,18],J=[1,91],$=[1,92],tt=[1,93],et=[1,100],it=[1,94],at=[1,97],nt=[1,95],st=[1,96],rt=[1,98],ot=[1,99],Pt=[1,103],Zt=[10,55,56,57],N=[4,5,6,8,10,11,13,17,18,19,20,55,56,57],vt={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,idStringToken:3,ALPHA:4,NUM:5,NODE_STRING:6,DOWN:7,MINUS:8,DEFAULT:9,COMMA:10,COLON:11,AMP:12,BRKT:13,MULT:14,UNICODE_TEXT:15,styleComponent:16,UNIT:17,SPACE:18,STYLE:19,PCT:20,idString:21,style:22,stylesOpt:23,classDefStatement:24,CLASSDEF:25,start:26,eol:27,QUADRANT:28,document:29,line:30,statement:31,axisDetails:32,quadrantDetails:33,points:34,title:35,title_value:36,acc_title:37,acc_title_value:38,acc_descr:39,acc_descr_value:40,acc_descr_multiline_value:41,section:42,text:43,point_start:44,point_x:45,point_y:46,class_name:47,"X-AXIS":48,"AXIS-TEXT-DELIMITER":49,"Y-AXIS":50,QUADRANT_1:51,QUADRANT_2:52,QUADRANT_3:53,QUADRANT_4:54,NEWLINE:55,SEMI:56,EOF:57,alphaNumToken:58,textNoTagsToken:59,STR:60,MD_STR:61,alphaNum:62,PUNCTUATION:63,PLUS:64,EQUALS:65,DOT:66,UNDERSCORE:67,$accept:0,$end:1},terminals_:{2:"error",4:"ALPHA",5:"NUM",6:"NODE_STRING",7:"DOWN",8:"MINUS",9:"DEFAULT",10:"COMMA",11:"COLON",12:"AMP",13:"BRKT",14:"MULT",15:"UNICODE_TEXT",17:"UNIT",18:"SPACE",19:"STYLE",20:"PCT",25:"CLASSDEF",28:"QUADRANT",35:"title",36:"title_value",37:"acc_title",38:"acc_title_value",39:"acc_descr",40:"acc_descr_value",41:"acc_descr_multiline_value",42:"section",44:"point_start",45:"point_x",46:"point_y",47:"class_name",48:"X-AXIS",49:"AXIS-TEXT-DELIMITER",50:"Y-AXIS",51:"QUADRANT_1",52:"QUADRANT_2",53:"QUADRANT_3",54:"QUADRANT_4",55:"NEWLINE",56:"SEMI",57:"EOF",60:"STR",61:"MD_STR",63:"PUNCTUATION",64:"PLUS",65:"EQUALS",66:"DOT",67:"UNDERSCORE"},productions_:[0,[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[3,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[16,1],[21,1],[21,2],[22,1],[22,2],[23,1],[23,3],[24,5],[26,2],[26,2],[26,2],[29,0],[29,2],[30,2],[31,0],[31,1],[31,2],[31,1],[31,1],[31,1],[31,2],[31,2],[31,2],[31,1],[31,1],[34,4],[34,5],[34,5],[34,6],[32,4],[32,3],[32,2],[32,4],[32,3],[32,2],[33,2],[33,2],[33,2],[33,2],[27,1],[27,1],[27,1],[43,1],[43,2],[43,1],[43,1],[62,1],[62,2],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[58,1],[59,1],[59,1],[59,1]],performAction:o(function(r,l,g,f,A,e,pt){var s=e.length-1;switch(A){case 23:this.$=e[s];break;case 24:this.$=e[s-1]+""+e[s];break;case 26:this.$=e[s-1]+e[s];break;case 27:this.$=[e[s].trim()];break;case 28:e[s-2].push(e[s].trim()),this.$=e[s-2];break;case 29:this.$=e[s-4],f.addClass(e[s-2],e[s]);break;case 37:this.$=[];break;case 42:this.$=e[s].trim(),f.setDiagramTitle(this.$);break;case 43:this.$=e[s].trim(),f.setAccTitle(this.$);break;case 44:case 45:this.$=e[s].trim(),f.setAccDescription(this.$);break;case 46:f.addSection(e[s].substr(8)),this.$=e[s].substr(8);break;case 47:f.addPoint(e[s-3],"",e[s-1],e[s],[]);break;case 48:f.addPoint(e[s-4],e[s-3],e[s-1],e[s],[]);break;case 49:f.addPoint(e[s-4],"",e[s-2],e[s-1],e[s]);break;case 50:f.addPoint(e[s-5],e[s-4],e[s-2],e[s-1],e[s]);break;case 51:f.setXAxisLeftText(e[s-2]),f.setXAxisRightText(e[s]);break;case 52:e[s-1].text+=" ⟶ ",f.setXAxisLeftText(e[s-1]);break;case 53:f.setXAxisLeftText(e[s]);break;case 54:f.setYAxisBottomText(e[s-2]),f.setYAxisTopText(e[s]);break;case 55:e[s-1].text+=" ⟶ ",f.setYAxisBottomText(e[s-1]);break;case 56:f.setYAxisBottomText(e[s]);break;case 57:f.setQuadrant1Text(e[s]);break;case 58:f.setQuadrant2Text(e[s]);break;case 59:f.setQuadrant3Text(e[s]);break;case 60:f.setQuadrant4Text(e[s]);break;case 64:this.$={text:e[s],type:"text"};break;case 65:this.$={text:e[s-1].text+""+e[s],type:e[s-1].type};break;case 66:this.$={text:e[s],type:"text"};break;case 67:this.$={text:e[s],type:"markdown"};break;case 68:this.$=e[s];break;case 69:this.$=e[s-1]+""+e[s];break}},"anonymous"),table:[{18:n,26:1,27:2,28:u,55:c,56:h,57:p},{1:[3]},{18:n,26:8,27:2,28:u,55:c,56:h,57:p},{18:n,26:9,27:2,28:u,55:c,56:h,57:p},t(y,[2,33],{29:10}),t(S,[2,61]),t(S,[2,62]),t(S,[2,63]),{1:[2,30]},{1:[2,31]},t(a,k,{30:11,31:12,24:13,32:15,33:16,34:17,43:30,58:31,1:[2,32],4:d,5:T,10:m,12:q,13:b,14:x,15:_,18:Y,25:G,35:yt,37:Tt,39:dt,41:Ft,42:ut,48:xt,50:ft,51:gt,52:i,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(y,[2,34]),{27:46,55:c,56:h,57:p},t(a,[2,37]),t(a,k,{24:13,32:15,33:16,34:17,43:30,58:31,31:47,4:d,5:T,10:m,12:q,13:b,14:x,15:_,18:Y,25:G,35:yt,37:Tt,39:dt,41:Ft,42:ut,48:xt,50:ft,51:gt,52:i,53:Bt,54:Rt,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,39]),t(a,[2,40]),t(a,[2,41]),{36:[1,48]},{38:[1,49]},{40:[1,50]},t(a,[2,45]),t(a,[2,46]),{18:[1,51]},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:52,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:53,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:54,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:55,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:56,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,10:m,12:q,13:b,14:x,15:_,43:57,58:31,60:U,61:Q,63:F,64:P,65:v,66:C,67:L},{4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,44:[1,58],47:[1,59],58:61,59:60,63:F,64:P,65:v,66:C,67:L},t(E,[2,64]),t(E,[2,66]),t(E,[2,67]),t(E,[2,70]),t(E,[2,71]),t(E,[2,72]),t(E,[2,73]),t(E,[2,74]),t(E,[2,75]),t(E,[2,76]),t(E,[2,77]),t(E,[2,78]),t(E,[2,79]),t(E,[2,80]),t(E,[2,81]),t(y,[2,35]),t(a,[2,38]),t(a,[2,42]),t(a,[2,43]),t(a,[2,44]),{3:65,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,21:64},t(a,[2,53],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,49:[1,78],63:F,64:P,65:v,66:C,67:L}),t(a,[2,56],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,49:[1,79],63:F,64:P,65:v,66:C,67:L}),t(a,[2,57],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,58],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,59],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,60],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),{45:[1,80]},{44:[1,81]},t(E,[2,65]),t(E,[2,82]),t(E,[2,83]),t(E,[2,84]),{3:83,4:Nt,5:Wt,6:Ut,7:Qt,8:Ot,9:Ht,10:Xt,11:Mt,12:Yt,13:jt,14:Gt,15:Kt,18:[1,82]},t(w,[2,23]),t(w,[2,1]),t(w,[2,2]),t(w,[2,3]),t(w,[2,4]),t(w,[2,5]),t(w,[2,6]),t(w,[2,7]),t(w,[2,8]),t(w,[2,9]),t(w,[2,10]),t(w,[2,11]),t(w,[2,12]),t(a,[2,52],{58:31,43:84,4:d,5:T,10:m,12:q,13:b,14:x,15:_,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),t(a,[2,55],{58:31,43:85,4:d,5:T,10:m,12:q,13:b,14:x,15:_,60:U,61:Q,63:F,64:P,65:v,66:C,67:L}),{46:[1,86]},{45:[1,87]},{4:J,5:$,6:tt,8:et,11:it,13:at,16:90,17:nt,18:st,19:rt,20:ot,22:89,23:88},t(w,[2,24]),t(a,[2,51],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,54],{59:60,58:61,4:d,5:T,8:H,10:m,12:q,13:b,14:x,15:_,18:X,63:F,64:P,65:v,66:C,67:L}),t(a,[2,47],{22:89,16:90,23:101,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),{46:[1,102]},t(a,[2,29],{10:Pt}),t(Zt,[2,27],{16:104,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),t(N,[2,25]),t(N,[2,13]),t(N,[2,14]),t(N,[2,15]),t(N,[2,16]),t(N,[2,17]),t(N,[2,18]),t(N,[2,19]),t(N,[2,20]),t(N,[2,21]),t(N,[2,22]),t(a,[2,49],{10:Pt}),t(a,[2,48],{22:89,16:90,23:105,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot}),{4:J,5:$,6:tt,8:et,11:it,13:at,16:90,17:nt,18:st,19:rt,20:ot,22:106},t(N,[2,26]),t(a,[2,50],{10:Pt}),t(Zt,[2,28],{16:104,4:J,5:$,6:tt,8:et,11:it,13:at,17:nt,18:st,19:rt,20:ot})],defaultActions:{8:[2,30],9:[2,31]},parseError:o(function(r,l){if(l.recoverable)this.trace(r);else{var g=new Error(r);throw g.hash=l,g}},"parseError"),parse:o(function(r){var l=this,g=[0],f=[],A=[null],e=[],pt=this.table,s="",qt=0,Jt=0,qe=2,$t=1,be=e.slice.call(arguments,1),D=Object.create(this.lexer),K={yy:{}};for(var Ct in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Ct)&&(K.yy[Ct]=this.yy[Ct]);D.setInput(r,K.yy),K.yy.lexer=D,K.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var Lt=D.yylloc;e.push(Lt);var Se=D.options&&D.options.ranges;typeof K.yy.parseError=="function"?this.parseError=K.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function _e(R){g.length=g.length-2*R,A.length=A.length-R,e.length=e.length-R}o(_e,"popStack");function te(){var R;return R=f.pop()||D.lex()||$t,typeof R!="number"&&(R instanceof Array&&(f=R,R=f.pop()),R=l.symbols_[R]||R),R}o(te,"lex");for(var B,Z,W,Et,lt={},bt,M,ee,St;;){if(Z=g[g.length-1],this.defaultActions[Z]?W=this.defaultActions[Z]:((B===null||typeof B>"u")&&(B=te()),W=pt[Z]&&pt[Z][B]),typeof W>"u"||!W.length||!W[0]){var Dt="";St=[];for(bt in pt[Z])this.terminals_[bt]&&bt>qe&&St.push("'"+this.terminals_[bt]+"'");D.showPosition?Dt="Parse error on line "+(qt+1)+`:
2
2
  `+D.showPosition()+`
3
3
  Expecting `+St.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Dt="Parse error on line "+(qt+1)+": Unexpected "+(B==$t?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Dt,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:Lt,expected:St})}if(W[0]instanceof Array&&W.length>1)throw new Error("Parse Error: multiple actions possible at state: "+Z+", token: "+B);switch(W[0]){case 1:g.push(B),A.push(D.yytext),e.push(D.yylloc),g.push(W[1]),B=null,Jt=D.yyleng,s=D.yytext,qt=D.yylineno,Lt=D.yylloc;break;case 2:if(M=this.productions_[W[1]][1],lt.$=A[A.length-M],lt._$={first_line:e[e.length-(M||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(M||1)].first_column,last_column:e[e.length-1].last_column},Se&&(lt._$.range=[e[e.length-(M||1)].range[0],e[e.length-1].range[1]]),Et=this.performAction.apply(lt,[s,Jt,qt,K.yy,W[1],A,e].concat(be)),typeof Et<"u")return Et;M&&(g=g.slice(0,-1*M*2),A=A.slice(0,-1*M),e=e.slice(0,-1*M)),g.push(this.productions_[W[1]][0]),A.push(lt.$),e.push(lt._$),ee=pt[g[g.length-2]][g[g.length-1]],g.push(ee);break;case 3:return!0}}return!0},"parse")},me=(function(){var j={EOF:1,parseError:o(function(l,g){if(this.yy.parser)this.yy.parser.parseError(l,g);else throw new Error(l)},"parseError"),setInput:o(function(r,l){return this.yy=l||this.yy||{},this._input=r,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var r=this._input[0];this.yytext+=r,this.yyleng++,this.offset++,this.match+=r,this.matched+=r;var l=r.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),r},"input"),unput:o(function(r){var l=r.length,g=r.split(/(?:\r\n?|\n)/g);this._input=r+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var f=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),g.length-1&&(this.yylineno-=g.length-1);var A=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:g?(g.length===f.length?this.yylloc.first_column:0)+f[f.length-g.length].length-g[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[A[0],A[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(r){this.unput(this.match.slice(r))},"less"),pastInput:o(function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var r=this.match;return r.length<20&&(r+=this._input.substr(0,20-r.length)),(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var r=this.pastInput(),l=new Array(r.length+1).join("-");return r+this.upcomingInput()+`