@intent-hq/web 2.365.1 → 2.366.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/web/app/immutable/chunks/{CJYn86Zh.js → 0M6fbwP5.js} +1 -1
- package/web/app/immutable/chunks/{CKje4aJN.js → 21sFenOt.js} +1 -1
- package/web/app/immutable/chunks/{BVrp8JNX.js → 49lTJ3BE.js} +2 -2
- package/web/app/immutable/chunks/{lrmMeOQf.js → 4h0tfUCi.js} +3 -3
- package/web/app/immutable/chunks/{mCOr3gFd.js → 5E0QgiwD.js} +1 -1
- package/web/app/immutable/chunks/{RmJBfBVs.js → 6uErOUPb.js} +1 -1
- package/web/app/immutable/chunks/{zZJCq9G-.js → B1SzcYNV.js} +1 -1
- package/web/app/immutable/chunks/{CkBkXm1t.js → B3UM3noM.js} +1 -1
- package/web/app/immutable/chunks/{DIM_Vy_1.js → BBy28q2Z.js} +1 -1
- package/web/app/immutable/chunks/{BkoWIItN.js → BCO7QB9d.js} +2 -2
- package/web/app/immutable/chunks/{XZZBqDDU.js → BFcLC0z2.js} +1 -1
- package/web/app/immutable/chunks/{ChAjeelV.js → BJ-fbkKc.js} +1 -1
- package/web/app/immutable/chunks/{BhPnF9Tm.js → BJI544co.js} +1 -1
- package/web/app/immutable/chunks/{COSufLLe.js → BKmmpS_o.js} +1 -1
- package/web/app/immutable/chunks/{BKYUqADc.js → BM_VA785.js} +2 -2
- package/web/app/immutable/chunks/{HaIAX7Y7.js → BMfv2h4V.js} +4 -4
- package/web/app/immutable/chunks/{DBKSlWdm.js → BPrfv6mU.js} +6 -6
- package/web/app/immutable/chunks/{noaeKV0Q.js → BQ1ZZijd.js} +1 -1
- package/web/app/immutable/chunks/{hcNIFtJ6.js → BRYJbzW_.js} +1 -1
- package/web/app/immutable/chunks/{hScRAhOj.js → BUF9JqHS.js} +1 -1
- package/web/app/immutable/chunks/{C0XKBd5S.js → BVTzd6Hl.js} +1 -1
- package/web/app/immutable/chunks/{BmC4tEjN.js → BXVypBPm.js} +1 -1
- package/web/app/immutable/chunks/{DltL77xh.js → BZvRHZRX.js} +3 -3
- package/web/app/immutable/chunks/{B1BgnlCp.js → B_DnvXWy.js} +1 -1
- package/web/app/immutable/chunks/{C7l0Qi5K.js → BbS3ITS9.js} +3 -3
- package/web/app/immutable/chunks/{DNdoVC6a.js → Bbhq0zNP.js} +1 -1
- package/web/app/immutable/chunks/{DxbU9ouN.js → BcPqtSWG.js} +1 -1
- package/web/app/immutable/chunks/{BtfRwPt7.js → BcZXVFY0.js} +1 -1
- package/web/app/immutable/chunks/{Dg4msq0S.js → Bd1yJLuT.js} +3 -3
- package/web/app/immutable/chunks/{D52r2_SQ.js → Be6UkUHV.js} +1 -1
- package/web/app/immutable/chunks/{vmkeuBVe.js → BgeOjbIJ.js} +1 -1
- package/web/app/immutable/chunks/{DtygAQLZ.js → BhRggWJG.js} +1 -1
- package/web/app/immutable/chunks/{Dt4bX8KM.js → BhdS24nz.js} +1 -1
- package/web/app/immutable/chunks/{DXO8eQ8m.js → BiwwC2i_.js} +1 -1
- package/web/app/immutable/chunks/{CAvsAMG1.js → BkkQ86YU.js} +3 -3
- package/web/app/immutable/chunks/{C65VWWrO.js → Blze1yhO.js} +1 -1
- package/web/app/immutable/chunks/{nP0kFcGH.js → BmCjoY7z.js} +1 -1
- package/web/app/immutable/chunks/{bOJ0A0T0.js → BnWwgbQb.js} +2 -2
- package/web/app/immutable/chunks/{DHrWTFlr.js → BtvkhtJl.js} +3 -3
- package/web/app/immutable/chunks/{dFXYIobT.js → Bu9XbfVp.js} +1 -1
- package/web/app/immutable/chunks/{ChgmG2BO.js → BuKCKjfD.js} +1 -1
- package/web/app/immutable/chunks/{Cxj53KWB.js → BvXw5pjm.js} +1 -1
- package/web/app/immutable/chunks/{DdVKhlSE.js → BxV3tHc5.js} +1 -1
- package/web/app/immutable/chunks/{CTZj8P4K.js → BxZoDX0x.js} +1 -1
- package/web/app/immutable/chunks/{DHP7uaTl.js → BytTiswf.js} +46 -46
- package/web/app/immutable/chunks/{EXklmDak.js → C-VaINAh.js} +1 -1
- package/web/app/immutable/chunks/{BFrK5arF.js → C1kTqhrr.js} +1 -1
- package/web/app/immutable/chunks/{DkA8rA6d.js → C6h7jyQ0.js} +1 -1
- package/web/app/immutable/chunks/{6AoPTtLI.js → CA7EW4TZ.js} +1 -1
- package/web/app/immutable/chunks/{DKAYHp4B.js → CCo3qtBT.js} +1 -1
- package/web/app/immutable/chunks/{Cv3VPe8L.js → CHANO0NR.js} +1 -1
- package/web/app/immutable/chunks/{CBhc_pLy.js → CJJx_QIR.js} +1 -1
- package/web/app/immutable/chunks/{CYaSc2Q1.js → CLObTzYA.js} +1 -1
- package/web/app/immutable/chunks/{C2I2Ii1u.js → CLrh-ioU.js} +1 -1
- package/web/app/immutable/chunks/{Bh-jBfbM.js → CNot5Xcx.js} +1 -1
- package/web/app/immutable/chunks/{Bn5omuEb.js → CPj748Kb.js} +1 -1
- package/web/app/immutable/chunks/{idGIWvOH.js → CSTA4Rpp.js} +1 -1
- package/web/app/immutable/chunks/{DL0qyyOL.js → CXPDYmq9.js} +1 -1
- package/web/app/immutable/chunks/{DQ-MSxyp.js → CY6Tgnsl.js} +1 -1
- package/web/app/immutable/chunks/{CJXN40w9.js → C_xHqw3E.js} +3 -3
- package/web/app/immutable/chunks/{DkjvcUsP.js → CavHmsXI.js} +2 -2
- package/web/app/immutable/chunks/{M5LF5FKY.js → CbVQfloe.js} +1 -1
- package/web/app/immutable/chunks/{BX9yK5SR.js → CcN7mJ_U.js} +1 -1
- package/web/app/immutable/chunks/{CSHq_biu.js → CcOfQ1Gy.js} +2 -2
- package/web/app/immutable/chunks/{pQG9xktk.js → ChtQ627P.js} +1 -1
- package/web/app/immutable/chunks/{BbS5Qizt.js → CiD1dowc.js} +1 -1
- package/web/app/immutable/chunks/{cTDZw3QR.js → Crc_RZlw.js} +1 -1
- package/web/app/immutable/chunks/{BEOu6eQL.js → Crxrlr4k.js} +1 -1
- package/web/app/immutable/chunks/{apIeVE2H.js → Cs2yVMNS.js} +1 -1
- package/web/app/immutable/chunks/{VPexQKGs.js → Cv5uE2nr.js} +1 -1
- package/web/app/immutable/chunks/{CVkMmqXo.js → CvrktPas.js} +1 -1
- package/web/app/immutable/chunks/{DbGYKgXT.js → CwQ__QB6.js} +1 -1
- package/web/app/immutable/chunks/{pGhoz8FU.js → Cz8SK8lY.js} +1 -1
- package/web/app/immutable/chunks/{qgDYb1By.js → D-_X4rIZ.js} +2 -2
- package/web/app/immutable/chunks/{BpsufErm.js → D06l8Z7y.js} +1 -1
- package/web/app/immutable/chunks/{B4H4s5Rg.js → D07ilAuT.js} +1 -1
- package/web/app/immutable/chunks/{DePeY13v.js → D0GXE8-2.js} +2 -2
- package/web/app/immutable/chunks/{DwUTqa-t.js → D0dCVsGx.js} +1 -1
- package/web/app/immutable/chunks/{BDEbFHGY.js → D0g7LNHv.js} +3 -3
- package/web/app/immutable/chunks/{DD3t48QH.js → D27jN3Dg.js} +1 -1
- package/web/app/immutable/chunks/{BgOH0Zzl.js → D3Uccj5-.js} +1 -1
- package/web/app/immutable/chunks/{Dno6xKfG.js → D7BSEHxV.js} +1 -1
- package/web/app/immutable/chunks/{tPn0bGH7.js → D7NgsFtX.js} +4 -4
- package/web/app/immutable/chunks/{Dwcp9g5N.js → D7p6sqYu.js} +1 -1
- package/web/app/immutable/chunks/{CU5BHy1W.js → DAV1dgP_.js} +1 -1
- package/web/app/immutable/chunks/{y4eDAS8h.js → DEBzQhFj.js} +1 -1
- package/web/app/immutable/chunks/{D3VgLsjX.js → DJghC2cn.js} +1 -1
- package/web/app/immutable/chunks/{CPqT58jI.js → DP8R2A_9.js} +1 -1
- package/web/app/immutable/chunks/{BR-Ar56A.js → DVYKRap9.js} +1 -1
- package/web/app/immutable/chunks/{DcrFkbHp.js → DVxZwdBj.js} +1 -1
- package/web/app/immutable/chunks/{BbdYMVNx.js → DY9_t95j.js} +1 -1
- package/web/app/immutable/chunks/{ChXP1yTZ.js → D_ID4BWe.js} +1 -1
- package/web/app/immutable/chunks/{CikjWVQh.js → Dao2qcXJ.js} +1 -1
- package/web/app/immutable/chunks/{DGrWVJ0v.js → DaqnlEJR.js} +1 -1
- package/web/app/immutable/chunks/{GuF0uSZG.js → DboA1NeQ.js} +1 -1
- package/web/app/immutable/chunks/{DBRi5-39.js → DcdXOwGw.js} +1 -1
- package/web/app/immutable/chunks/{bfJbR-yE.js → Det4RbYN.js} +1 -1
- package/web/app/immutable/chunks/{pXldx06t.js → DlT8jbfO.js} +1 -1
- package/web/app/immutable/chunks/{D--zmlwp.js → DmNvVRRE.js} +1 -1
- package/web/app/immutable/chunks/{D-qAIzQP.js → DqAYbvOg.js} +2 -2
- package/web/app/immutable/chunks/{B-AmD-Nq.js → DrNuCzBC.js} +1 -1
- package/web/app/immutable/chunks/{BuZhTAVX.js → DsVuLeey.js} +1 -1
- package/web/app/immutable/chunks/{8NOm3iaU.js → Dsr7i_He.js} +1 -1
- package/web/app/immutable/chunks/{DqNieJFI.js → Exc8p1jd.js} +1 -1
- package/web/app/immutable/chunks/{BjW79gKz.js → FBvbrcZr.js} +1 -1
- package/web/app/immutable/chunks/{CWADgVJP.js → HL3zgzKn.js} +1 -1
- package/web/app/immutable/chunks/{BNUyltQZ.js → Km71QNzW.js} +1 -1
- package/web/app/immutable/chunks/{D6dBEmMZ.js → OZBmmXod.js} +3 -3
- package/web/app/immutable/chunks/{DHh2eCii.js → QSE3LueN.js} +1 -1
- package/web/app/immutable/chunks/{CibNXCBL.js → QisRq2Sw.js} +1 -1
- package/web/app/immutable/chunks/{CGs0vmiU.js → V9WvgRYX.js} +1 -1
- package/web/app/immutable/chunks/{Z3XtTxwQ.js → VFjJnRWQ.js} +2 -2
- package/web/app/immutable/chunks/{C2MLvspO.js → W11aBxPu.js} +1 -1
- package/web/app/immutable/chunks/{DyYcnOWN.js → Zfe2ndo2.js} +1 -1
- package/web/app/immutable/chunks/{DOkTuNnC.js → _Kd9GHXD.js} +1 -1
- package/web/app/immutable/chunks/{4Kf5TY5X.js → _vlUWDHN.js} +1 -1
- package/web/app/immutable/chunks/{DTJ583wE.js → aMfDxuvw.js} +1 -1
- package/web/app/immutable/chunks/{DcimsnLD.js → cOqLUCrx.js} +1 -1
- package/web/app/immutable/chunks/{C0ItZHN5.js → fVUImVux.js} +1 -1
- package/web/app/immutable/chunks/{Cu9L3sv4.js → gb92yXjT.js} +1 -1
- package/web/app/immutable/chunks/{B74l16-1.js → iSEs_vDT.js} +1 -1
- package/web/app/immutable/chunks/{DT3Hhppd.js → k1zcqeIU.js} +1 -1
- package/web/app/immutable/chunks/{2AhpRF3T.js → qiLHIFHW.js} +1 -1
- package/web/app/immutable/chunks/{CxIswu2X.js → sYqaWTP3.js} +1 -1
- package/web/app/immutable/chunks/{CwhN6crj.js → uqpkI3ja.js} +1 -1
- package/web/app/immutable/entry/{app.7G8GWQFV.js → app.D_4OTEkX.js} +2 -2
- package/web/app/immutable/entry/start.qUtaE6c2.js +1 -0
- package/web/app/immutable/nodes/{0.DRiM7T-G.js → 0.2VtZG26z.js} +1 -1
- package/web/app/immutable/nodes/{1.9vkn3vyy.js → 1.B0usVk87.js} +1 -1
- package/web/app/immutable/nodes/{10.DSYgbbT9.js → 10.BsWr1W3S.js} +4 -4
- package/web/app/immutable/nodes/{11.CIM80lhx.js → 11.BQtMkcf2.js} +1 -1
- package/web/app/immutable/nodes/{15.3l37Ve75.js → 15.BLJkehTM.js} +1 -1
- package/web/app/immutable/nodes/{19.CnXH3Iz_.js → 19.CM_o2Cvu.js} +2 -2
- package/web/app/immutable/nodes/{2.wGzWUUPc.js → 2.D3E2UrAW.js} +4 -4
- package/web/app/immutable/nodes/{3.CTWSQnPv.js → 3.DdcIH9ug.js} +1 -1
- package/web/app/immutable/nodes/{4.BSig_ApP.js → 4.PpqfkNsN.js} +1 -1
- package/web/app/immutable/nodes/{5.NR-bMbpi.js → 5.D-L3Wu1j.js} +1 -1
- package/web/app/immutable/nodes/{6.Xig6esy6.js → 6.BD1nMsC2.js} +1 -1
- package/web/app/immutable/nodes/{7.FpVTsVRc.js → 7.CpDR971O.js} +1 -1
- package/web/app/immutable/nodes/{8.CqRfRN2m.js → 8.C49Lx7aV.js} +1 -1
- package/web/app/immutable/nodes/{9.nHcDmWdB.js → 9.BoGpnsP3.js} +11 -11
- package/web/app/version.json +1 -1
- package/web/generated/paraglide.js +8 -8
- package/web/index.html +9 -9
- package/web/app/immutable/entry/start.Cgrocrgj.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as o,W as pt,x as nt,am as Wt,an as Rt,au as Pt,H as Bt,X as ft,ay as E,aX as Vt,aH as Ft,b3 as yt,aW as U,d as ct,_ as zt,y as Ot,r as Gt}from"./
|
|
1
|
+
import{b as o,W as pt,x as nt,am as Wt,an as Rt,au as Pt,H as Bt,X as ft,ay as E,aX as Vt,aH as Ft,b3 as yt,aW as U,d as ct,_ as zt,y as Ot,r as Gt}from"./BMfv2h4V.js";var tt=(function(){var e=o(function(k,a,d,l){for(d=d||{},l=k.length;l--;d[k[l]]=a);return d},"o"),t=[6,11,13,14,15,17,19,20,23,24],s=[1,12],r=[1,13],n=[1,14],h=[1,15],c=[1,16],i=[1,19],y=[1,20],p={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,timeline_header:4,document:5,EOF:6,timeline:7,timeline_lr:8,timeline_td:9,line:10,SPACE:11,statement:12,NEWLINE:13,title:14,acc_title:15,acc_title_value:16,acc_descr:17,acc_descr_value:18,acc_descr_multiline_value:19,section:20,period_statement:21,event_statement:22,period:23,event:24,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",7:"timeline",8:"timeline_lr",9:"timeline_td",11:"SPACE",13:"NEWLINE",14:"title",15:"acc_title",16:"acc_title_value",17:"acc_descr",18:"acc_descr_value",19:"acc_descr_multiline_value",20:"section",23:"period",24:"event"},productions_:[0,[3,3],[4,1],[4,1],[4,1],[5,0],[5,2],[10,2],[10,1],[10,1],[10,1],[12,1],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[21,1],[22,1]],performAction:o(function(a,d,l,g,x,u,S){var v=u.length-1;switch(x){case 1:return u[v-1];case 3:g.setDirection("LR");break;case 4:g.setDirection("TD");break;case 5:this.$=[];break;case 6:u[v-1].push(u[v]),this.$=u[v-1];break;case 7:case 8:this.$=u[v];break;case 9:case 10:this.$=[];break;case 11:g.getCommonDb().setDiagramTitle(u[v].substr(6)),this.$=u[v].substr(6);break;case 12:this.$=u[v].trim(),g.getCommonDb().setAccTitle(this.$);break;case 13:case 14:this.$=u[v].trim(),g.getCommonDb().setAccDescription(this.$);break;case 15:g.addSection(u[v].substr(8)),this.$=u[v].substr(8);break;case 18:g.addTask(u[v],0,""),this.$=u[v];break;case 19:g.addEvent(u[v].substr(2)),this.$=u[v];break}},"anonymous"),table:[{3:1,4:2,7:[1,3],8:[1,4],9:[1,5]},{1:[3]},e(t,[2,5],{5:6}),e(t,[2,2]),e(t,[2,3]),e(t,[2,4]),{6:[1,7],10:8,11:[1,9],12:10,13:[1,11],14:s,15:r,17:n,19:h,20:c,21:17,22:18,23:i,24:y},e(t,[2,10],{1:[2,1]}),e(t,[2,6]),{12:21,14:s,15:r,17:n,19:h,20:c,21:17,22:18,23:i,24:y},e(t,[2,8]),e(t,[2,9]),e(t,[2,11]),{16:[1,22]},{18:[1,23]},e(t,[2,14]),e(t,[2,15]),e(t,[2,16]),e(t,[2,17]),e(t,[2,18]),e(t,[2,19]),e(t,[2,7]),e(t,[2,12]),e(t,[2,13])],defaultActions:{},parseError:o(function(a,d){if(d.recoverable)this.trace(a);else{var l=new Error(a);throw l.hash=d,l}},"parseError"),parse:o(function(a){var d=this,l=[0],g=[],x=[null],u=[],S=this.table,v="",I=0,C=0,R=2,O=1,L=u.slice.call(arguments,1),w=Object.create(this.lexer),H={yy:{}};for(var V in this.yy)Object.prototype.hasOwnProperty.call(this.yy,V)&&(H.yy[V]=this.yy[V]);w.setInput(a,H.yy),H.yy.lexer=w,H.yy.parser=this,typeof w.yylloc>"u"&&(w.yylloc={});var F=w.yylloc;u.push(F);var K=w.options&&w.options.ranges;typeof H.yy.parseError=="function"?this.parseError=H.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function N(A){l.length=l.length-2*A,x.length=x.length-A,u.length=u.length-A}o(N,"popStack");function b(){var A;return A=g.pop()||w.lex()||O,typeof A!="number"&&(A instanceof Array&&(g=A,A=g.pop()),A=d.symbols_[A]||A),A}o(b,"lex");for(var _,$,T,P,W={},G,B,Z,j;;){if($=l[l.length-1],this.defaultActions[$]?T=this.defaultActions[$]:((_===null||typeof _>"u")&&(_=b()),T=S[$]&&S[$][_]),typeof T>"u"||!T.length||!T[0]){var Y="";j=[];for(G in S[$])this.terminals_[G]&&G>R&&j.push("'"+this.terminals_[G]+"'");w.showPosition?Y="Parse error on line "+(I+1)+`:
|
|
2
2
|
`+w.showPosition()+`
|
|
3
3
|
Expecting `+j.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Y="Parse error on line "+(I+1)+": Unexpected "+(_==O?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Y,{text:w.match,token:this.terminals_[_]||_,line:w.yylineno,loc:F,expected:j})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+$+", token: "+_);switch(T[0]){case 1:l.push(_),x.push(w.yytext),u.push(w.yylloc),l.push(T[1]),_=null,C=w.yyleng,v=w.yytext,I=w.yylineno,F=w.yylloc;break;case 2:if(B=this.productions_[T[1]][1],W.$=x[x.length-B],W._$={first_line:u[u.length-(B||1)].first_line,last_line:u[u.length-1].last_line,first_column:u[u.length-(B||1)].first_column,last_column:u[u.length-1].last_column},K&&(W._$.range=[u[u.length-(B||1)].range[0],u[u.length-1].range[1]]),P=this.performAction.apply(W,[v,C,I,H.yy,T[1],x,u].concat(L)),typeof P<"u")return P;B&&(l=l.slice(0,-1*B*2),x=x.slice(0,-1*B),u=u.slice(0,-1*B)),l.push(this.productions_[T[1]][0]),x.push(W.$),u.push(W._$),Z=S[l[l.length-2]][l[l.length-1]],l.push(Z);break;case 3:return!0}}return!0},"parse")},m=(function(){var k={EOF:1,parseError:o(function(d,l){if(this.yy.parser)this.yy.parser.parseError(d,l);else throw new Error(d)},"parseError"),setInput:o(function(a,d){return this.yy=d||this.yy||{},this._input=a,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 a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var d=a.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:o(function(a){var d=a.length,l=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var g=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 x=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===g.length?this.yylloc.first_column:0)+g[g.length-l.length].length-l[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[x[0],x[0]+this.yyleng-d]),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(a){this.unput(this.match.slice(a))},"less"),pastInput:o(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var a=this.pastInput(),d=new Array(a.length+1).join("-");return a+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var $s=Object.defineProperty;var Fs=(f,r,l)=>r in f?$s(f,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):f[r]=l;var q=(f,r,l)=>Fs(f,typeof r!="symbol"?r+"":r,l);import{t as dn,bo as y,bm as P,bw as un,bq as On,b as hn,bs as je}from"./DUPdECze.js";import{ai as xr,bs as gn,ca as Be,aD as e,bH as m,a5 as N,bA as H,b_ as z,aw as sn,aj as ln,W as w,bn as fn,bV as Y,aA as x,ay as ne,bS as C,bl as de,bO as K,aB as T,c9 as u,a7 as nt,br as tt,bj as sr,c5 as gt,c0 as Ln,a as Us,be as Tt,b$ as ft,bf as or}from"./CJxGDkBm.js";import{i as M}from"./BxPVGrtc.js";import{g as Pt,i as Hn,I as ir,e as ar}from"./CDDY7bU6.js";import{n as cn,l as Ws,c as Bs}from"./tAo3FW4C.js";import{f as En,s as Ve,g as lr}from"./DYGZj8tM.js";import{b as on}from"./NtFyWdpR.js";import{I$ as Me,eK as Vs,eB as Ks,eC as js,oO as qs,nC as Vt,nG as cr,nF as In,eE as Gs,vp as Qs,vq as Xs,vs as Ys,H3 as Js,J4 as Zs,rH as eo,eJ as to}from"./Dou_hoaA.js";import{c as no}from"./DIcAJPWy.js";import{F as Ne,a1 as ro,a8 as An,aw as dr,ax as ur,bS as so,aP as oo,cd as hr,bZ as gr,cq as fr}from"./DWlZtz5u.js";import{dD as io,bp as ao,X as lo,aN as mr,p as co}from"./R5qsERXh.js";import{L as pr}from"./41ykQ_u9.js";import{C as an}from"./DypB-Dwi.js";import{b8 as kr,bN as uo,bT as ho}from"./CikjWVQh.js";import{q as $e,d as go,g as fo}from"./DBRi5-39.js";import"./NvPqoUzX.js";import"./DeOvWG_V.js";/* empty css */import{T as Pr}from"./CU5BHy1W.js";import{g as Nn}from"./rvnDEnqx.js";import{A as mo}from"./CfruS_oL.js";import{f as ke}from"./CdO4czEi.js";import{C as po}from"./CmU8A6S6.js";import{C as vo}from"./BDjmUG9E.js";import{s as vr}from"./ChXP1yTZ.js";import{S as Dt}from"./B5sCzlWo.js";import{l as Rt}from"./CzTFPES1.js";import{G as _r}from"./CBgyyGVJ.js";import{P as _o}from"./jUOoTQha.js";import{g as wo}from"./BvbYtLg2.js";import{a8 as bo,Y as So}from"./BpsufErm.js";import{ap as Co}from"./DHrWTFlr.js";import{L as wr}from"./Dg4msq0S.js";import{ae as yo,ad as xo,af as ko}from"./DHP7uaTl.js";function br({scrollTop:f,scrollHeight:r,height:l,fitPerfectly:a=!1,fitPerfectlyOverscroll:c=0,overscrollSize:p}){const b=l+p*2,S=a?l+c*2:b;if(r=Math.max(r,S),b>=r||a){const G=Math.max(f-c,0),h=Math.min(f+S,r);return{top:G,bottom:Math.max(h,G)}}let A=f+l/2-b/2,F=A+b;return A<0&&(A=0),F>r&&(F=r),A=Math.floor(Math.max(A,0)),{top:A,bottom:Math.ceil(Math.max(Math.min(F,r),A))}}function Po(f,r){return f==null||r==null?f===r:f.top===r.top&&f.bottom===r.bottom}const Rr=1e3,Ro=Rr*4,Lo=[0,1e-6,.99999,1],Ho={overscrollSize:Rr,intersectionObserverMargin:Ro,resizeDebugging:!1};let rn=0,Io=-1;var Pe,Ao=(Pe=class{constructor(r){q(this,"__id",`virtualizer-${++Io}`);q(this,"config");q(this,"type","simple");q(this,"intersectionObserver");q(this,"scrollTop",0);q(this,"height",0);q(this,"scrollHeight",0);q(this,"windowSpecs",{top:0,bottom:0});q(this,"root");q(this,"contentContainer");q(this,"resizeObserver");q(this,"observers",new Map);q(this,"visibleInstances",new Map);q(this,"visibleInstancesDirty",!1);q(this,"instancesChanged",new Set);q(this,"reconcileQueue",new Set);q(this,"scrollDirty",!0);q(this,"heightDirty",!0);q(this,"scrollHeightDirty",!0);q(this,"renderedObservers",0);q(this,"connectQueue",new Map);q(this,"handleContainerResize",r=>{if(this.root==null)return;let l=!1;for(const a of r){const c=a.borderBoxSize[0].blockSize;this.root instanceof Document?c!==this.scrollHeight&&(this.scrollHeightDirty=!0,l=!0,this.config.resizeDebugging&&(console.log("Virtualizer: content size change",this.__id,{sizeChange:c-rn,newSize:c}),rn=c)):a.target===this.root?c!==this.height&&(this.heightDirty=!0,l=!0):a.target===this.contentContainer&&(this.scrollHeightDirty=!0,l=!0,this.config.resizeDebugging&&(console.log("Virtualizer: scroller size change",this.__id,{sizeChange:c-rn,newSize:c}),rn=c))}l&&$e(this.computeRenderRangeAndEmit)});q(this,"handleWindowResize",()=>{Pe.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"handleWindowScroll",()=>{Pe.__STOP||this.root==null||!(this.root instanceof Document)||(this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"handleElementScroll",()=>{Pe.__STOP||this.root==null||this.root instanceof Document||(this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"computeRenderRangeAndEmit",()=>{if(Pe.__STOP)return;const r=this.heightDirty||this.scrollHeightDirty;let l=this.instancesChanged.size>0;if(this.instancesChanged.size===0){const p=br({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize});if(!r&&Po(this.windowSpecs,p)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.reconcileQueue.size===0)return;this.windowSpecs=p}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;const a=this.getScrollAnchor(this.height),c=new Set;for(const p of r?this.observers.values():this.visibleInstances.values())p.onRender(r)&&c.add(p);for(const p of this.instancesChanged)c.has(p)||p.onRender(r)&&c.add(p);this.scrollFix(a);for(const p of c)this.reconcileQueue.delete(p),p.reconcileHeights();for(const p of this.reconcileQueue)p.reconcileHeights()&&(l=!0);this.reconcileQueue.clear(),l||=this.instancesChanged.size>0,l&&this.markDOMDirty(),(l||r)&&$e(this.computeRenderRangeAndEmit),c.clear(),this.instancesChanged.clear()});q(this,"handleIntersectionChange",r=>{this.scrollDirty=!0;for(const{target:l,isIntersecting:a}of r){if(!(l instanceof HTMLElement))throw new Error("Virtualizer.handleIntersectionChange: target not an HTMLElement");const c=this.observers.get(l);c!=null&&(a&&!this.visibleInstances.has(l)?(c.setVisibility(!0),this.visibleInstances.set(l,c),this.visibleInstancesDirty=!0):!a&&this.visibleInstances.has(l)&&(c.setVisibility(!1),this.visibleInstances.delete(l),this.visibleInstancesDirty=!0))}this.visibleInstancesDirty&&$e(this.computeRenderRangeAndEmit)});this.config={...Ho,...r}}setup(r,l){if(this.root==null){this.root=r,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:Lo,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),r instanceof Document?this.setupWindow():this.setupElement(l),window.__INSTANCE=this,window.__TOGGLE=()=>{Pe.__STOP?(Pe.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:Pe.__lastScrollPosition}),$e(this.computeRenderRangeAndEmit)):(Pe.__lastScrollPosition=this.getScrollTop(),Pe.__STOP=!0)};for(const[a,c]of this.connectQueue.entries())this.connect(a,c);this.connectQueue.clear(),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)}}instanceChanged(r,l){this.instancesChanged.add(r),l&&this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)}requestHeightReconcile(r){this.reconcileQueue.add(r),$e(this.computeRenderRangeAndEmit)}getWindowSpecs(){return this.windowSpecs.top===0&&this.windowSpecs.bottom===0&&(this.windowSpecs=br({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize})),this.windowSpecs}getRoot(){return this.root}isInstanceVisible(r,l){const a=this.getScrollTop(),c=this.getHeight(),p=this.config.intersectionObserverMargin,b=a-p,S=a+c+p;return!(r<b-l||r>S)}setupWindow(){if(this.root==null||!(this.root instanceof Document))throw new Error("Virtualizer.setupWindow: Invalid setup method");window.addEventListener("scroll",this.handleWindowScroll,{passive:!0}),window.addEventListener("resize",this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(r){if(this.root==null||this.root instanceof Document)throw new Error("Virtualizer.setupElement: Invalid setup method");this.root.addEventListener("scroll",this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),r??=this.root.firstElementChild??void 0,r instanceof HTMLElement&&(this.contentContainer=r,this.resizeObserver?.observe(r))}cleanUp(){go(this.computeRenderRangeAndEmit),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener("scroll",this.handleElementScroll),window.removeEventListener("scroll",this.handleWindowScroll),window.removeEventListener("resize",this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.reconcileQueue.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.scrollHeightDirty=!0}getOffsetInScrollContainer(r){return this.getScrollTop()+Kt(r,this.getScrollContainerElement())}connect(r,l){if(this.observers.has(r))throw new Error("Virtualizer.connect: instance is already connected...");return this.intersectionObserver==null?this.connectQueue.set(r,l):(this.intersectionObserver.observe(r),this.observers.set(r,l),this.instancesChanged.add(l),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)),()=>this.disconnect(r)}disconnect(r){const l=this.observers.get(r);this.connectQueue.delete(r),l!=null&&(this.intersectionObserver?.unobserve(r),this.observers.delete(r),this.instancesChanged.delete(l),this.reconcileQueue.delete(l),this.visibleInstances.delete(r)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit))}scrollFix(r){if(r==null)return;const l=this.getScrollContainerElement(),{lineIndex:a,lineOffset:c,fileElement:p,fileOffset:b,fileTypeOffset:S}=r;if(a!=null&&c!=null){const F=p.shadowRoot?.querySelector(`[data-line][data-line-index="${a}"]`);if(F instanceof HTMLElement){const G=Kt(F,l);if(G!==c){const h=G-c;this.applyScrollFix(h)}return}}const A=Kt(p,l);if(S==="top")A!==b&&this.applyScrollFix(A-b);else{const F=A+p.getBoundingClientRect().height;F!==b&&this.applyScrollFix(F-b)}}applyScrollFix(r){this.root==null||this.root instanceof Document?window.scrollTo({top:window.scrollY+r,behavior:"instant"}):this.root.scrollTo({top:this.root.scrollTop+r,behavior:"instant"}),this.markDOMDirty()}getScrollAnchor(r){const l=this.getScrollContainerElement();let a;for(const[c]of this.visibleInstances.entries()){const p=Kt(c,l),b=p+c.offsetHeight;let S,A;b<=0?(S=b,A="bottom"):(S=p,A="top");let F,G;if(b>0&&p<r)for(const oe of c.shadowRoot?.querySelectorAll("[data-line][data-line-index]")??[]){if(!(oe instanceof HTMLElement))continue;const Te=oe.dataset.lineIndex;if(Te==null)continue;const ue=Kt(oe,l);if(!(ue<0)){F=Te,G=ue;break}}if(a?.lineOffset!=null&&G==null)continue;let h=!1;(a==null||G!=null&&(a.lineOffset==null||G<a.lineOffset)||G==null&&a.lineOffset==null&&(S>=0&&(a.fileOffset<0||S<a.fileOffset)||S<0&&a.fileOffset<0&&S>a.fileOffset))&&(h=!0),h&&(a={fileElement:c,fileTypeOffset:A,fileOffset:S,lineIndex:F,lineOffset:G})}return a}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let r=this.root==null?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return r=this.clampScrollTop(r),this.scrollTop=r,r}scrollTo({top:r,behavior:l="auto"}){const{root:a}=this;if(a==null)return;const c=this.clampScrollTop(r);a instanceof Document?window.scrollTo({top:c,behavior:l}):a.scrollTo({top:c,behavior:l}),this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit)}clampScrollTop(r){return Math.max(0,Math.min(r,this.getScrollHeight()-this.getHeight()))}getScrollHeight(){return this.scrollHeightDirty?(this.scrollHeightDirty=!1,this.scrollHeight=this.root==null?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight,this.scrollHeight):this.scrollHeight}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root==null?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height,this.height):this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return this.root==null||this.root instanceof Document?void 0:this.root}},q(Pe,"__STOP",!1),q(Pe,"__lastScrollPosition",0),Pe);function Kt(f,r){const l=f.getBoundingClientRect(),a=r?.getBoundingClientRect().top??0;return l.top-a}var Eo=T('<div class="absolute inset-0 flex items-center justify-center rounded-lg bg-background/60 backdrop-blur-[2px] transition-opacity duration-spring-moderate ease-spring-moderate motion-reduce:transition-none z-10 pointer-events-none"><div class="flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-xs font-medium text-subtle shadow-lg"><!> </div></div>'),Oo=T("<!> <!>",1),No=T('<div class="flex h-24 items-center justify-start text-left text-subtle"> </div>'),To=T('<div role="region"><!></div>');function Lr(f,r){if(new.target)return dn({component:Lr,...f});gn(r,!0);const l=()=>je(ve,"$sideBySide",a),[a,c]=On(),p=Nn()?.workspaceId??void 0;let b=y(r,"change",7),S=y(r,"foldUnchanged",7,!0),A=y(r,"allowHeadReads",7,!0),F=y(r,"canReadHeadFiles",7),G=y(r,"lineWrapping",7,!1),h=y(r,"scrollToLine",7),oe=y(r,"isAggregate",7,!1),Te=y(r,"showScrollHint",7,!1),ue=y(r,"onStageHunk",7),Q=y(r,"onUnstageHunk",7),at=y(r,"onOpenCommit",7),pt=y(r,"virtualizer",7),vt=y(r,"gitRootId",7,void 0),_t=y(r,"gitRootPath",7,void 0);const ve=kr();let Re=Y(!1),Se=Y(!1),Fe=Y(!1),Ue=Y(0),qe=Y(void 0);const $=80;function ie(){m(Se,!0)}function De(){m(Se,!1),m(Fe,!1),m(Ue,0)}function Le(v){!e(Se)||e(Re)||(m(Ue,e(Ue)+Math.abs(v.deltaY)),e(Ue)>=$&&!e(Fe)&&m(Fe,!0))}function jt(){m(Re,!0),m(Fe,!1),m(Ue,0)}function qt(v){e(qe)&&!e(qe).contains(v.relatedTarget)&&m(Re,!1)}Be(()=>{(e(Re)||!e(Se))&&(m(Fe,!1),m(Ue,0))});let Lt=u(()=>{const{toolCallId:v,filePath:_e,additions:Qe,deletions:St,oldContent:re,newContent:Xe}=b(),rt="staged"in b()&&b().staged===!0,Ke="category"in b()?b().category:void 0,At="commitHash"in b()?b().commitHash:void 0,zt="gitlink"in b()?b().gitlink:void 0,Mt="isFullFileContent"in b()?b().isFullFileContent:!1;let Ct;return Ke==="committed"?Ct=an.Committed:rt?Ct=an.Staged:Ct=an.Unstaged,{id:v,file:_e,relativePath:_e,stage:Ct,commitHash:At,gitlink:zt,stats:{additions:Qe,deletions:St},attribution:{timestamp:0},content:re!==void 0||Xe!==void 0?{oldContent:re??"",newContent:Xe??"",isFullFileContent:Mt}:void 0}});const D=u(()=>b().isFullFileContent?1:("chunks"in b()?b().chunks?.[0]?.newStart:void 0)??b().startLineNumber??1);var Ht={get change(){return b()},set change(v){b(v),x()},get foldUnchanged(){return S()},set foldUnchanged(v=!0){S(v),x()},get allowHeadReads(){return A()},set allowHeadReads(v=!0){A(v),x()},get canReadHeadFiles(){return F()},set canReadHeadFiles(v){F(v),x()},get lineWrapping(){return G()},set lineWrapping(v=!1){G(v),x()},get scrollToLine(){return h()},set scrollToLine(v){h(v),x()},get isAggregate(){return oe()},set isAggregate(v=!1){oe(v),x()},get showScrollHint(){return Te()},set showScrollHint(v=!1){Te(v),x()},get onStageHunk(){return ue()},set onStageHunk(v){ue(v),x()},get onUnstageHunk(){return Q()},set onUnstageHunk(v){Q(v),x()},get onOpenCommit(){return at()},set onOpenCommit(v){at(v),x()},get virtualizer(){return pt()},set virtualizer(v){pt(v),x()},get gitRootId(){return vt()},set gitRootId(v=void 0){vt(v),x()},get gitRootPath(){return _t()},set gitRootPath(v=void 0){_t(v),x()},$set:un,$on:(v,_e)=>hn(r,v,_e)},He=To();let wt;var It=N(He);{var Ge=v=>{var _e=Oo(),Qe=ne(_e);{let Xe=u(()=>l()?"split":"unified");Pr(Qe,{get change(){return e(Lt)},get workspaceId(){return p},get viewMode(){return e(Xe)},get foldUnchanged(){return S()},get lineWrapping(){return G()},get onStageHunk(){return ue()},get onUnstageHunk(){return Q()},useProvidedContent:!0,get allowHeadReads(){return A()},get canReadHeadFiles(){return F()},get lineOffset(){return e(D)},get virtualizer(){return pt()},get gitRootId(){return vt()},get gitRootPath(){return _t()}})}var St=C(Qe,2);{var re=Xe=>{var rt=Eo(),Ke=N(rt),At=N(Ke);Ne(At,{get icon(){return ro},class:"w-3 h-3"});var zt=C(At);H(Ke),H(rt),z(Mt=>K(zt,` ${Mt??""}`),[()=>P.chat_inlineDiffItem_clickToScroll_label()]),cn(1,rt,()=>Ws,()=>({tier:"fast",y:0,scale:1})),cn(2,rt,()=>Bs,()=>({tier:"fast"})),w(Xe,rt)};M(St,Xe=>{Te()&&e(Fe)&&Xe(re)})}w(v,_e)},bt=v=>{var _e=No(),Qe=de(_e,!0);z(St=>K(Qe,St),[()=>P.chat_inlineDiffItem_noWorkspace_label()]),w(v,_e)};M(It,v=>{p?v(Ge):v(bt,-1)})}H(He),on(He,v=>m(qe,v),()=>e(qe)),z(v=>{wt=En(He,1,"inline-diff-container relative",null,wt,{focused:e(Re)}),Ve(He,"aria-label",v)},[()=>P.chat_inlineDiffItem_viewer_ariaLabel()]),sn("mouseenter",He,ie),sn("mouseleave",He,De),sn("wheel",He,Le),ln("focusin",He,jt),ln("focusout",He,qt),w(f,He);var mn=fn(Ht);return c(),mn}xr(["focusin","focusout"]);function Sr(f){return[f.stage,f.type,f.oldLineNumber??"",f.newLineNumber??"",f.content].join("\0")}function Do(f){let r=f.oldStart,l=f.newStart;return f.lines.map(a=>{const c={...a,oldLineNumber:a.oldLineNumber??a.oldNumber,newLineNumber:a.newLineNumber??a.newNumber};return c.oldLineNumber===void 0&&c.newLineNumber===void 0?a.type==="Context"?(c.oldLineNumber=r++,c.newLineNumber=l++):a.type==="Deletion"?c.oldLineNumber=r++:a.type==="Addition"&&(c.newLineNumber=l++):a.type==="Context"?(r=(c.oldLineNumber??r)+1,l=(c.newLineNumber??l)+1):a.type==="Deletion"?r=(c.oldLineNumber??r)+1:a.type==="Addition"&&(l=(c.newLineNumber??l)+1),c})}function zo(f,r){const l=f?f.split(`
|
|
1
|
+
var $s=Object.defineProperty;var Fs=(f,r,l)=>r in f?$s(f,r,{enumerable:!0,configurable:!0,writable:!0,value:l}):f[r]=l;var q=(f,r,l)=>Fs(f,typeof r!="symbol"?r+"":r,l);import{t as dn,bo as y,bm as P,bw as un,bq as On,b as hn,bs as je}from"./DUPdECze.js";import{ai as xr,bs as gn,ca as Be,aD as e,bH as m,a5 as N,bA as H,b_ as z,aw as sn,aj as ln,W as w,bn as fn,bV as Y,aA as x,ay as ne,bS as C,bl as de,bO as K,aB as T,c9 as u,a7 as nt,br as tt,bj as sr,c5 as gt,c0 as Ln,a as Us,be as Tt,b$ as ft,bf as or}from"./CJxGDkBm.js";import{i as M}from"./BxPVGrtc.js";import{g as Pt,i as Hn,I as ir,e as ar}from"./CDDY7bU6.js";import{n as cn,l as Ws,c as Bs}from"./tAo3FW4C.js";import{f as En,s as Ve,g as lr}from"./DYGZj8tM.js";import{b as on}from"./NtFyWdpR.js";import{I$ as Me,eK as Vs,eB as Ks,eC as js,oO as qs,nC as Vt,nG as cr,nF as In,eE as Gs,vp as Qs,vq as Xs,vs as Ys,H3 as Js,J4 as Zs,rH as eo,eJ as to}from"./Dou_hoaA.js";import{c as no}from"./DIcAJPWy.js";import{F as Ne,a1 as ro,a8 as An,aw as dr,ax as ur,bS as so,aP as oo,cd as hr,bZ as gr,cq as fr}from"./DWlZtz5u.js";import{dD as io,bp as ao,X as lo,aN as mr,p as co}from"./R5qsERXh.js";import{L as pr}from"./41ykQ_u9.js";import{C as an}from"./DypB-Dwi.js";import{b8 as kr,bN as uo,bT as ho}from"./Dao2qcXJ.js";import{q as $e,d as go,g as fo}from"./DcdXOwGw.js";import"./NvPqoUzX.js";import"./DeOvWG_V.js";/* empty css */import{T as Pr}from"./DAV1dgP_.js";import{g as Nn}from"./rvnDEnqx.js";import{A as mo}from"./CfruS_oL.js";import{f as ke}from"./CdO4czEi.js";import{C as po}from"./CmU8A6S6.js";import{C as vo}from"./BDjmUG9E.js";import{s as vr}from"./D_ID4BWe.js";import{S as Dt}from"./B5sCzlWo.js";import{l as Rt}from"./CzTFPES1.js";import{G as _r}from"./CBgyyGVJ.js";import{P as _o}from"./jUOoTQha.js";import{g as wo}from"./BvbYtLg2.js";import{a8 as bo,Y as So}from"./D06l8Z7y.js";import{ap as Co}from"./BtvkhtJl.js";import{L as wr}from"./Bd1yJLuT.js";import{ae as yo,ad as xo,af as ko}from"./BytTiswf.js";function br({scrollTop:f,scrollHeight:r,height:l,fitPerfectly:a=!1,fitPerfectlyOverscroll:c=0,overscrollSize:p}){const b=l+p*2,S=a?l+c*2:b;if(r=Math.max(r,S),b>=r||a){const G=Math.max(f-c,0),h=Math.min(f+S,r);return{top:G,bottom:Math.max(h,G)}}let A=f+l/2-b/2,F=A+b;return A<0&&(A=0),F>r&&(F=r),A=Math.floor(Math.max(A,0)),{top:A,bottom:Math.ceil(Math.max(Math.min(F,r),A))}}function Po(f,r){return f==null||r==null?f===r:f.top===r.top&&f.bottom===r.bottom}const Rr=1e3,Ro=Rr*4,Lo=[0,1e-6,.99999,1],Ho={overscrollSize:Rr,intersectionObserverMargin:Ro,resizeDebugging:!1};let rn=0,Io=-1;var Pe,Ao=(Pe=class{constructor(r){q(this,"__id",`virtualizer-${++Io}`);q(this,"config");q(this,"type","simple");q(this,"intersectionObserver");q(this,"scrollTop",0);q(this,"height",0);q(this,"scrollHeight",0);q(this,"windowSpecs",{top:0,bottom:0});q(this,"root");q(this,"contentContainer");q(this,"resizeObserver");q(this,"observers",new Map);q(this,"visibleInstances",new Map);q(this,"visibleInstancesDirty",!1);q(this,"instancesChanged",new Set);q(this,"reconcileQueue",new Set);q(this,"scrollDirty",!0);q(this,"heightDirty",!0);q(this,"scrollHeightDirty",!0);q(this,"renderedObservers",0);q(this,"connectQueue",new Map);q(this,"handleContainerResize",r=>{if(this.root==null)return;let l=!1;for(const a of r){const c=a.borderBoxSize[0].blockSize;this.root instanceof Document?c!==this.scrollHeight&&(this.scrollHeightDirty=!0,l=!0,this.config.resizeDebugging&&(console.log("Virtualizer: content size change",this.__id,{sizeChange:c-rn,newSize:c}),rn=c)):a.target===this.root?c!==this.height&&(this.heightDirty=!0,l=!0):a.target===this.contentContainer&&(this.scrollHeightDirty=!0,l=!0,this.config.resizeDebugging&&(console.log("Virtualizer: scroller size change",this.__id,{sizeChange:c-rn,newSize:c}),rn=c))}l&&$e(this.computeRenderRangeAndEmit)});q(this,"handleWindowResize",()=>{Pe.__STOP||window.innerHeight===this.height||(this.heightDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"handleWindowScroll",()=>{Pe.__STOP||this.root==null||!(this.root instanceof Document)||(this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"handleElementScroll",()=>{Pe.__STOP||this.root==null||this.root instanceof Document||(this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit))});q(this,"computeRenderRangeAndEmit",()=>{if(Pe.__STOP)return;const r=this.heightDirty||this.scrollHeightDirty;let l=this.instancesChanged.size>0;if(this.instancesChanged.size===0){const p=br({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize});if(!r&&Po(this.windowSpecs,p)&&this.renderedObservers===this.observers.size&&!this.visibleInstancesDirty&&this.reconcileQueue.size===0)return;this.windowSpecs=p}this.visibleInstancesDirty=!1,this.renderedObservers=this.observers.size;const a=this.getScrollAnchor(this.height),c=new Set;for(const p of r?this.observers.values():this.visibleInstances.values())p.onRender(r)&&c.add(p);for(const p of this.instancesChanged)c.has(p)||p.onRender(r)&&c.add(p);this.scrollFix(a);for(const p of c)this.reconcileQueue.delete(p),p.reconcileHeights();for(const p of this.reconcileQueue)p.reconcileHeights()&&(l=!0);this.reconcileQueue.clear(),l||=this.instancesChanged.size>0,l&&this.markDOMDirty(),(l||r)&&$e(this.computeRenderRangeAndEmit),c.clear(),this.instancesChanged.clear()});q(this,"handleIntersectionChange",r=>{this.scrollDirty=!0;for(const{target:l,isIntersecting:a}of r){if(!(l instanceof HTMLElement))throw new Error("Virtualizer.handleIntersectionChange: target not an HTMLElement");const c=this.observers.get(l);c!=null&&(a&&!this.visibleInstances.has(l)?(c.setVisibility(!0),this.visibleInstances.set(l,c),this.visibleInstancesDirty=!0):!a&&this.visibleInstances.has(l)&&(c.setVisibility(!1),this.visibleInstances.delete(l),this.visibleInstancesDirty=!0))}this.visibleInstancesDirty&&$e(this.computeRenderRangeAndEmit)});this.config={...Ho,...r}}setup(r,l){if(this.root==null){this.root=r,this.resizeObserver=new ResizeObserver(this.handleContainerResize),this.intersectionObserver=new IntersectionObserver(this.handleIntersectionChange,{root:this.root,threshold:Lo,rootMargin:`${this.config.intersectionObserverMargin}px 0px ${this.config.intersectionObserverMargin}px 0px`}),r instanceof Document?this.setupWindow():this.setupElement(l),window.__INSTANCE=this,window.__TOGGLE=()=>{Pe.__STOP?(Pe.__STOP=!1,(this.getScrollContainerElement()??window).scrollTo({top:Pe.__lastScrollPosition}),$e(this.computeRenderRangeAndEmit)):(Pe.__lastScrollPosition=this.getScrollTop(),Pe.__STOP=!0)};for(const[a,c]of this.connectQueue.entries())this.connect(a,c);this.connectQueue.clear(),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)}}instanceChanged(r,l){this.instancesChanged.add(r),l&&this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)}requestHeightReconcile(r){this.reconcileQueue.add(r),$e(this.computeRenderRangeAndEmit)}getWindowSpecs(){return this.windowSpecs.top===0&&this.windowSpecs.bottom===0&&(this.windowSpecs=br({scrollTop:this.getScrollTop(),height:this.getHeight(),scrollHeight:this.getScrollHeight(),overscrollSize:this.config.overscrollSize})),this.windowSpecs}getRoot(){return this.root}isInstanceVisible(r,l){const a=this.getScrollTop(),c=this.getHeight(),p=this.config.intersectionObserverMargin,b=a-p,S=a+c+p;return!(r<b-l||r>S)}setupWindow(){if(this.root==null||!(this.root instanceof Document))throw new Error("Virtualizer.setupWindow: Invalid setup method");window.addEventListener("scroll",this.handleWindowScroll,{passive:!0}),window.addEventListener("resize",this.handleWindowResize,{passive:!0}),this.resizeObserver?.observe(this.root.documentElement)}setupElement(r){if(this.root==null||this.root instanceof Document)throw new Error("Virtualizer.setupElement: Invalid setup method");this.root.addEventListener("scroll",this.handleElementScroll,{passive:!0}),this.resizeObserver?.observe(this.root),r??=this.root.firstElementChild??void 0,r instanceof HTMLElement&&(this.contentContainer=r,this.resizeObserver?.observe(r))}cleanUp(){go(this.computeRenderRangeAndEmit),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.intersectionObserver?.disconnect(),this.intersectionObserver=void 0,this.root?.removeEventListener("scroll",this.handleElementScroll),window.removeEventListener("scroll",this.handleWindowScroll),window.removeEventListener("resize",this.handleWindowResize),this.root=void 0,this.contentContainer=void 0,this.observers.clear(),this.visibleInstances.clear(),this.instancesChanged.clear(),this.reconcileQueue.clear(),this.connectQueue.clear(),this.visibleInstancesDirty=!1,this.windowSpecs={top:0,bottom:0},this.scrollTop=0,this.height=0,this.scrollHeight=0,this.scrollDirty=!0,this.heightDirty=!0,this.scrollHeightDirty=!0}getOffsetInScrollContainer(r){return this.getScrollTop()+Kt(r,this.getScrollContainerElement())}connect(r,l){if(this.observers.has(r))throw new Error("Virtualizer.connect: instance is already connected...");return this.intersectionObserver==null?this.connectQueue.set(r,l):(this.intersectionObserver.observe(r),this.observers.set(r,l),this.instancesChanged.add(l),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit)),()=>this.disconnect(r)}disconnect(r){const l=this.observers.get(r);this.connectQueue.delete(r),l!=null&&(this.intersectionObserver?.unobserve(r),this.observers.delete(r),this.instancesChanged.delete(l),this.reconcileQueue.delete(l),this.visibleInstances.delete(r)&&(this.visibleInstancesDirty=!0),this.markDOMDirty(),$e(this.computeRenderRangeAndEmit))}scrollFix(r){if(r==null)return;const l=this.getScrollContainerElement(),{lineIndex:a,lineOffset:c,fileElement:p,fileOffset:b,fileTypeOffset:S}=r;if(a!=null&&c!=null){const F=p.shadowRoot?.querySelector(`[data-line][data-line-index="${a}"]`);if(F instanceof HTMLElement){const G=Kt(F,l);if(G!==c){const h=G-c;this.applyScrollFix(h)}return}}const A=Kt(p,l);if(S==="top")A!==b&&this.applyScrollFix(A-b);else{const F=A+p.getBoundingClientRect().height;F!==b&&this.applyScrollFix(F-b)}}applyScrollFix(r){this.root==null||this.root instanceof Document?window.scrollTo({top:window.scrollY+r,behavior:"instant"}):this.root.scrollTo({top:this.root.scrollTop+r,behavior:"instant"}),this.markDOMDirty()}getScrollAnchor(r){const l=this.getScrollContainerElement();let a;for(const[c]of this.visibleInstances.entries()){const p=Kt(c,l),b=p+c.offsetHeight;let S,A;b<=0?(S=b,A="bottom"):(S=p,A="top");let F,G;if(b>0&&p<r)for(const oe of c.shadowRoot?.querySelectorAll("[data-line][data-line-index]")??[]){if(!(oe instanceof HTMLElement))continue;const Te=oe.dataset.lineIndex;if(Te==null)continue;const ue=Kt(oe,l);if(!(ue<0)){F=Te,G=ue;break}}if(a?.lineOffset!=null&&G==null)continue;let h=!1;(a==null||G!=null&&(a.lineOffset==null||G<a.lineOffset)||G==null&&a.lineOffset==null&&(S>=0&&(a.fileOffset<0||S<a.fileOffset)||S<0&&a.fileOffset<0&&S>a.fileOffset))&&(h=!0),h&&(a={fileElement:c,fileTypeOffset:A,fileOffset:S,lineIndex:F,lineOffset:G})}return a}getScrollTop(){if(!this.scrollDirty)return this.scrollTop;this.scrollDirty=!1;let r=this.root==null?0:this.root instanceof Document?window.scrollY:this.root.scrollTop;return r=this.clampScrollTop(r),this.scrollTop=r,r}scrollTo({top:r,behavior:l="auto"}){const{root:a}=this;if(a==null)return;const c=this.clampScrollTop(r);a instanceof Document?window.scrollTo({top:c,behavior:l}):a.scrollTo({top:c,behavior:l}),this.scrollDirty=!0,$e(this.computeRenderRangeAndEmit)}clampScrollTop(r){return Math.max(0,Math.min(r,this.getScrollHeight()-this.getHeight()))}getScrollHeight(){return this.scrollHeightDirty?(this.scrollHeightDirty=!1,this.scrollHeight=this.root==null?0:this.root instanceof Document?this.root.documentElement.scrollHeight:this.root.scrollHeight,this.scrollHeight):this.scrollHeight}getHeight(){return this.heightDirty?(this.heightDirty=!1,this.height=this.root==null?0:this.root instanceof Document?globalThis.innerHeight:this.root.getBoundingClientRect().height,this.height):this.height}markDOMDirty(){this.scrollDirty=!0,this.scrollHeightDirty=!0,this.heightDirty=!0}getScrollContainerElement(){return this.root==null||this.root instanceof Document?void 0:this.root}},q(Pe,"__STOP",!1),q(Pe,"__lastScrollPosition",0),Pe);function Kt(f,r){const l=f.getBoundingClientRect(),a=r?.getBoundingClientRect().top??0;return l.top-a}var Eo=T('<div class="absolute inset-0 flex items-center justify-center rounded-lg bg-background/60 backdrop-blur-[2px] transition-opacity duration-spring-moderate ease-spring-moderate motion-reduce:transition-none z-10 pointer-events-none"><div class="flex items-center gap-2 rounded-lg border border-border bg-card px-3 py-2 text-xs font-medium text-subtle shadow-lg"><!> </div></div>'),Oo=T("<!> <!>",1),No=T('<div class="flex h-24 items-center justify-start text-left text-subtle"> </div>'),To=T('<div role="region"><!></div>');function Lr(f,r){if(new.target)return dn({component:Lr,...f});gn(r,!0);const l=()=>je(ve,"$sideBySide",a),[a,c]=On(),p=Nn()?.workspaceId??void 0;let b=y(r,"change",7),S=y(r,"foldUnchanged",7,!0),A=y(r,"allowHeadReads",7,!0),F=y(r,"canReadHeadFiles",7),G=y(r,"lineWrapping",7,!1),h=y(r,"scrollToLine",7),oe=y(r,"isAggregate",7,!1),Te=y(r,"showScrollHint",7,!1),ue=y(r,"onStageHunk",7),Q=y(r,"onUnstageHunk",7),at=y(r,"onOpenCommit",7),pt=y(r,"virtualizer",7),vt=y(r,"gitRootId",7,void 0),_t=y(r,"gitRootPath",7,void 0);const ve=kr();let Re=Y(!1),Se=Y(!1),Fe=Y(!1),Ue=Y(0),qe=Y(void 0);const $=80;function ie(){m(Se,!0)}function De(){m(Se,!1),m(Fe,!1),m(Ue,0)}function Le(v){!e(Se)||e(Re)||(m(Ue,e(Ue)+Math.abs(v.deltaY)),e(Ue)>=$&&!e(Fe)&&m(Fe,!0))}function jt(){m(Re,!0),m(Fe,!1),m(Ue,0)}function qt(v){e(qe)&&!e(qe).contains(v.relatedTarget)&&m(Re,!1)}Be(()=>{(e(Re)||!e(Se))&&(m(Fe,!1),m(Ue,0))});let Lt=u(()=>{const{toolCallId:v,filePath:_e,additions:Qe,deletions:St,oldContent:re,newContent:Xe}=b(),rt="staged"in b()&&b().staged===!0,Ke="category"in b()?b().category:void 0,At="commitHash"in b()?b().commitHash:void 0,zt="gitlink"in b()?b().gitlink:void 0,Mt="isFullFileContent"in b()?b().isFullFileContent:!1;let Ct;return Ke==="committed"?Ct=an.Committed:rt?Ct=an.Staged:Ct=an.Unstaged,{id:v,file:_e,relativePath:_e,stage:Ct,commitHash:At,gitlink:zt,stats:{additions:Qe,deletions:St},attribution:{timestamp:0},content:re!==void 0||Xe!==void 0?{oldContent:re??"",newContent:Xe??"",isFullFileContent:Mt}:void 0}});const D=u(()=>b().isFullFileContent?1:("chunks"in b()?b().chunks?.[0]?.newStart:void 0)??b().startLineNumber??1);var Ht={get change(){return b()},set change(v){b(v),x()},get foldUnchanged(){return S()},set foldUnchanged(v=!0){S(v),x()},get allowHeadReads(){return A()},set allowHeadReads(v=!0){A(v),x()},get canReadHeadFiles(){return F()},set canReadHeadFiles(v){F(v),x()},get lineWrapping(){return G()},set lineWrapping(v=!1){G(v),x()},get scrollToLine(){return h()},set scrollToLine(v){h(v),x()},get isAggregate(){return oe()},set isAggregate(v=!1){oe(v),x()},get showScrollHint(){return Te()},set showScrollHint(v=!1){Te(v),x()},get onStageHunk(){return ue()},set onStageHunk(v){ue(v),x()},get onUnstageHunk(){return Q()},set onUnstageHunk(v){Q(v),x()},get onOpenCommit(){return at()},set onOpenCommit(v){at(v),x()},get virtualizer(){return pt()},set virtualizer(v){pt(v),x()},get gitRootId(){return vt()},set gitRootId(v=void 0){vt(v),x()},get gitRootPath(){return _t()},set gitRootPath(v=void 0){_t(v),x()},$set:un,$on:(v,_e)=>hn(r,v,_e)},He=To();let wt;var It=N(He);{var Ge=v=>{var _e=Oo(),Qe=ne(_e);{let Xe=u(()=>l()?"split":"unified");Pr(Qe,{get change(){return e(Lt)},get workspaceId(){return p},get viewMode(){return e(Xe)},get foldUnchanged(){return S()},get lineWrapping(){return G()},get onStageHunk(){return ue()},get onUnstageHunk(){return Q()},useProvidedContent:!0,get allowHeadReads(){return A()},get canReadHeadFiles(){return F()},get lineOffset(){return e(D)},get virtualizer(){return pt()},get gitRootId(){return vt()},get gitRootPath(){return _t()}})}var St=C(Qe,2);{var re=Xe=>{var rt=Eo(),Ke=N(rt),At=N(Ke);Ne(At,{get icon(){return ro},class:"w-3 h-3"});var zt=C(At);H(Ke),H(rt),z(Mt=>K(zt,` ${Mt??""}`),[()=>P.chat_inlineDiffItem_clickToScroll_label()]),cn(1,rt,()=>Ws,()=>({tier:"fast",y:0,scale:1})),cn(2,rt,()=>Bs,()=>({tier:"fast"})),w(Xe,rt)};M(St,Xe=>{Te()&&e(Fe)&&Xe(re)})}w(v,_e)},bt=v=>{var _e=No(),Qe=de(_e,!0);z(St=>K(Qe,St),[()=>P.chat_inlineDiffItem_noWorkspace_label()]),w(v,_e)};M(It,v=>{p?v(Ge):v(bt,-1)})}H(He),on(He,v=>m(qe,v),()=>e(qe)),z(v=>{wt=En(He,1,"inline-diff-container relative",null,wt,{focused:e(Re)}),Ve(He,"aria-label",v)},[()=>P.chat_inlineDiffItem_viewer_ariaLabel()]),sn("mouseenter",He,ie),sn("mouseleave",He,De),sn("wheel",He,Le),ln("focusin",He,jt),ln("focusout",He,qt),w(f,He);var mn=fn(Ht);return c(),mn}xr(["focusin","focusout"]);function Sr(f){return[f.stage,f.type,f.oldLineNumber??"",f.newLineNumber??"",f.content].join("\0")}function Do(f){let r=f.oldStart,l=f.newStart;return f.lines.map(a=>{const c={...a,oldLineNumber:a.oldLineNumber??a.oldNumber,newLineNumber:a.newLineNumber??a.newNumber};return c.oldLineNumber===void 0&&c.newLineNumber===void 0?a.type==="Context"?(c.oldLineNumber=r++,c.newLineNumber=l++):a.type==="Deletion"?c.oldLineNumber=r++:a.type==="Addition"&&(c.newLineNumber=l++):a.type==="Context"?(r=(c.oldLineNumber??r)+1,l=(c.newLineNumber??l)+1):a.type==="Deletion"?r=(c.oldLineNumber??r)+1:a.type==="Addition"&&(l=(c.newLineNumber??l)+1),c})}function zo(f,r){const l=f?f.split(`
|
|
2
2
|
`):[],a=r?r.split(`
|
|
3
3
|
`):[];if(l.length===0&&a.length===0)return[];const c=[];for(const p of l)c.push({type:"Deletion",content:p});for(const p of a)c.push({type:"Addition",content:p});return[{oldStart:1,oldLines:l.length,newStart:1,newLines:a.length,lines:c}]}function Mo(f){if(!f||f.length===0)return[];const r=[];for(const a of f){let c=a.change.chunks||[];c.length===0&&(a.change.oldContent!=null||a.change.newContent!=null)&&(c=zo(a.change.oldContent??"",a.change.newContent??"")),c.forEach((p,b)=>{r.push({hunk:p,stage:a.category,part:a,hunkIndex:b})})}if(r.length===0)return[];r.sort((a,c)=>a.hunk.newStart-c.hunk.newStart);const l=[];for(const{hunk:a,stage:c,hunkIndex:p}of r){const S=Do(a).map(A=>({type:A.type,content:A.content,oldLineNumber:A.oldLineNumber,newLineNumber:A.newLineNumber,stage:c,hunkIndex:p}));l.push({headStart:a.oldStart,headLines:a.oldLines,wtStart:a.newStart,wtLines:a.newLines,lines:S,stages:new Set([c])})}return $o(l)}function $o(f){if(f.length<=1)return f;const r=[];let l=f[0];for(let a=1;a<f.length;a++){const c=f[a],p=l.wtStart+l.wtLines;c.wtStart<=p+3?l=Fo(l,c):(r.push(l),l=c)}return r.push(l),r}function Fo(f,r){const l=new Map,a=new Map,c=new Set;for(const h of f.lines)c.add(Sr(h)),h.newLineNumber!==void 0&&l.set(h.newLineNumber,h),h.oldLineNumber!==void 0&&h.type!=="Addition"&&a.set(h.oldLineNumber,h);const p=[...f.lines];for(const h of r.lines){const oe=Sr(h);if(!c.has(oe)){if(h.type==="Context"){const Te=h.newLineNumber!==void 0?l.get(h.newLineNumber):void 0,ue=h.oldLineNumber!==void 0?a.get(h.oldLineNumber):void 0;if(Te?.type==="Context"||ue?.type==="Context"){c.add(oe);continue}}p.push(h),c.add(oe),h.newLineNumber!==void 0&&l.set(h.newLineNumber,h),h.oldLineNumber!==void 0&&h.type!=="Addition"&&a.set(h.oldLineNumber,h)}}p.sort((h,oe)=>{const Te=h.newLineNumber??h.oldLineNumber??0,ue=oe.newLineNumber??oe.oldLineNumber??0;return Te-ue});const b=new Set([...f.stages,...r.stages]),S=Math.min(f.headStart,r.headStart),A=Math.min(f.wtStart,r.wtStart),F=Math.max(f.headStart+f.headLines,r.headStart+r.headLines),G=Math.max(f.wtStart+f.wtLines,r.wtStart+r.wtLines);return{headStart:S,headLines:F-S,wtStart:A,wtLines:G-A,lines:p,stages:b}}function Uo(f){const r=[],l=[];let a=f[0]?.headStart??1,c=f[0]?.wtStart??1;const p=(b,S,A)=>{let F=S;for(;F<A;)b.push(""),F++;return F};for(const b of f){a=p(r,a,b.headStart),c=p(l,c,b.wtStart);for(const S of b.lines)S.type==="Context"?(S.oldLineNumber!==void 0&&(a=p(r,a,S.oldLineNumber)),S.newLineNumber!==void 0&&(c=p(l,c,S.newLineNumber)),r.push(S.content),l.push(S.content),a++,c++):S.type==="Deletion"?(S.oldLineNumber!==void 0&&(a=p(r,a,S.oldLineNumber)),r.push(S.content),a++):S.type==="Addition"&&(S.newLineNumber!==void 0&&(c=p(l,c,S.newLineNumber)),l.push(S.content),c++)}return{oldContent:r.join(`
|
|
4
4
|
`),newContent:l.join(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as St,bo as x,bw as wt,bq as Rt,b as It,bs as g}from"./DUPdECze.js";import{bs as Pt,ca as I,aD as t,c9 as s,bn as kt,bH as N,bV as M,aA as F}from"./CJxGDkBm.js";import{b as vt}from"./NtFyWdpR.js";import{I$ as l,eB as Ut,eC as At,sQ as Bt,ob as xt,oc as Ft,Jz as Tt,JO as Dt,JE as Lt,og as T}from"./Dou_hoaA.js";import{t as _t}from"./D2MmXC4A.js";import{g as Wt}from"./BrMXrCxP.js";import{dD as Et,bL as Gt,bN as Nt,bK as Mt,bP as Vt,da as zt,m as Ht}from"./R5qsERXh.js";import{C as Jt}from"./
|
|
1
|
+
import{t as St,bo as x,bw as wt,bq as Rt,b as It,bs as g}from"./DUPdECze.js";import{bs as Pt,ca as I,aD as t,c9 as s,bn as kt,bH as N,bV as M,aA as F}from"./CJxGDkBm.js";import{b as vt}from"./NtFyWdpR.js";import{I$ as l,eB as Ut,eC as At,sQ as Bt,ob as xt,oc as Ft,Jz as Tt,JO as Dt,JE as Lt,og as T}from"./Dou_hoaA.js";import{t as _t}from"./D2MmXC4A.js";import{g as Wt}from"./BrMXrCxP.js";import{dD as Et,bL as Gt,bN as Nt,bK as Mt,bP as Vt,da as zt,m as Ht}from"./R5qsERXh.js";import{C as Jt}from"./CLrh-ioU.js";import{V as qt}from"./Cpjf0qUO.js";import{bT as Kt,bN as Ot,b8 as Qt}from"./Dao2qcXJ.js";import{i as D,n as V}from"./H2jLkRRS.js";import{af as jt}from"./BtvkhtJl.js";function Xt(L,$){if(new.target)return St({component:Xt,...L});Pt($,!0);const z=()=>g(at,"$gitRoots$",c),y=()=>g(ot,"$workspace",c),H=()=>g(nt,"$ftCommits$",c),J=()=>g(lt,"$rootGitRoots$",c),b=()=>g(st,"$ftChanges$",c),q=()=>g(tt,"$foldUnchanged",c),K=()=>g(Z,"$lineWrapping",c),O=()=>g(et,"$diffSideBySide",c),Q=()=>g(rt,"$ftLoading$",c),j=()=>g(it,"$ftBoundarySha$",c),[c,X]=Rt(),Y=o=>{qt(o,{embedded:!0,showExpand:!0,get expanded(){return t(w)},onToggleExpand:()=>{N(w,!t(w)),t(w)?t(R)?.expandAll():t(R)?.collapseAll()},get foldEnabled(){return q()},onToggleFold:()=>l.dispatch(Lt()),get wrapEnabled(){return K()},onToggleWrap:()=>l.dispatch(Dt()),get splitEnabled(){return O()},onToggleSplit:()=>l.dispatch(Tt())})},Z=Kt(),tt=Ot(),et=Qt();let P=x($,"tab",7),m=x($,"workspaceId",7),C=x($,"isActive",7);const _=Wt(),p=_t(()=>m()),ot=Et(p);I(()=>{const o=m();if(!(!C()||!o||t(n)))return l.dispatch(Ut(o,"all")),()=>l.dispatch(At(o,"all"))});const n=s(()=>P().data?.gitRootId||""),at=jt(p),S=s(()=>z().find(o=>o.id===t(n))),h=s(()=>y()?.worktreePath||y()?.repositoryPath||""),k=s(()=>t(S)?.path||t(h)),st=Gt(p),nt=Nt(p),it=Mt(p),rt=Vt(p),dt=s(()=>H()||[]),lt=zt(p),f=s(()=>J()[t(n)]??Ht),ct=s(()=>t(f).status),gt=s(()=>t(f).loading),mt=s(()=>t(f).commitFiles),ut=s(()=>{const o=t(S)?.registeredCommitSha,i=o?t(f).commits.findIndex(e=>e.hash===o):-1;return i>=0?t(f).commits.slice(0,i):t(f).commits});I(()=>{const o=m(),i=t(n);o&&i&&l.dispatch(Bt(o,i,t(S)?.registeredCommitSha,100))});let w=M(!0),R=M(null);const pt=s(()=>{if(t(n))return[...(t(ct)?.files??[]).map(e=>({filePath:`${t(k)}/${e.path}`,action:"modify",additions:e.additions??0,deletions:e.deletions??0,toolName:"local",toolCallId:`root-${t(n)}-${e.staged}-${e.path}`,staged:e.staged,category:e.staged?"staged":"unstaged"})),...t(ut).flatMap(e=>(t(mt)[e.hash]??[]).map(a=>({filePath:`${t(k)}/${a.path}`,action:"modify",additions:a.additions??0,deletions:a.deletions??0,toolName:"local",toolCallId:`root-commit-${e.hash}-${a.path}`,staged:!1,category:"committed",commitHash:e.hash,commitMessage:e.message})))];const o=b().filter(e=>e.stage==="unstaged"),i=b().filter(e=>e.stage==="staged");return[...o.map(e=>{const a=e.file||e.relativePath,r=a&&D(a)?a:`${t(h)}/${a}`;return{filePath:r,action:"modify",additions:e.stats?.additions||0,deletions:e.stats?.deletions||0,toolName:"local",toolCallId:`local-unstaged-${r}`,staged:!1,category:"unstaged",oldContent:e.content?.oldContent,newContent:e.content?.newContent,gitlink:e.gitlink}}),...i.map(e=>{const a=e.file||e.relativePath,r=a&&D(a)?a:`${t(h)}/${a}`;return{filePath:r,action:"modify",additions:e.stats?.additions||0,deletions:e.stats?.deletions||0,toolName:"local",toolCallId:`local-staged-${r}`,staged:!0,category:"staged",oldContent:e.content?.oldContent,newContent:e.content?.newContent,gitlink:e.gitlink}}),...t(dt).flatMap(e=>(e.files||[]).map(a=>{const r=typeof a=="string"?a:a.path||"",U=r&&D(r)?r:`${t(h)}/${r}`,A=typeof a=="string"?0:a.additions||0,B=typeof a=="string"?0:a.deletions||0;return{filePath:U,action:"modify",additions:A,deletions:B,toolName:"local",toolCallId:`commit-${e.hash}-${r}`,staged:!1,category:"committed",commitHash:e.hash,commitMessage:e.message}}))]});function v(o){if(!t(h))return o;const i=V(o),e=V(t(h));return i.startsWith(`${e}/`)?i.slice(e.length+1):o}function W(o){l.dispatch(T(m(),crypto.randomUUID(),{kind:"stage",paths:o.map(v),source:"localChanges"}))}function E(o){l.dispatch(T(m(),crypto.randomUUID(),{kind:"unstage",paths:o.map(v),source:"localChanges"}))}function ht(o){l.dispatch(T(m(),crypto.randomUUID(),{kind:"discard",paths:o.map(v),source:"localChanges"}))}I(()=>{!_||!C()||_.registerActions({display:Y})});const G=crypto.randomUUID();I(()=>{const o=m();if(!(!(C()&&t(n))||!o))return l.dispatch(xt(o,G)),()=>l.dispatch(Ft(o,G))});var ft={get tab(){return P()},set tab(o){P(o),F()},get workspaceId(){return m()},set workspaceId(o){m(o),F()},get isActive(){return C()},set isActive(o){C(o),F()},$set:wt,$on:(o,i)=>It($,o,i)};{let o=s(()=>t(n)?t(gt):Q()),i=s(()=>t(n)||void 0),e=s(()=>t(n)?t(k):void 0),a=s(()=>y()?.baseRef??null),r=s(()=>t(n)?t(S)?.registeredCommitSha||null:j()||y()?.baseCommitSha||null),U=s(()=>!t(n)),A=s(()=>t(n)?void 0:d=>void W([d])),B=s(()=>t(n)?void 0:d=>void E([d])),Ct=s(()=>t(n)?void 0:d=>void ht([d])),yt=s(()=>t(n)?void 0:()=>{const d=b().filter(u=>u.stage==="unstaged");W(d.map(u=>u.relativePath||u.file))}),bt=s(()=>t(n)?void 0:()=>{const d=b().filter(u=>u.stage==="staged");E(d.map(u=>u.relativePath||u.file))});vt(Jt(L,{get isLoading(){return t(o)},get changes(){return t(pt)},get gitRootId(){return t(i)},get gitRootPath(){return t(e)},get branchBaseRef(){return t(a)},get branchBaseCommitSha(){return t(r)},get showStagingControls(){return t(U)},showCategoryFilter:!0,get onStage(){return t(A)},get onUnstage(){return t(B)},get onRevert(){return t(Ct)},get onStageAll(){return t(yt)},get onUnstageAll(){return t(bt)}}),d=>N(R,d,!0),()=>t(R))}var $t=kt(ft);return X(),$t}export{Xt as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as Qe,bo as h,bw as Ye,b as $e,bq as nt,bm as w,bs as Ve}from"./DUPdECze.js";import{bo as st,bs as et,a7 as U,ay as y,aD as e,bS as X,W as c,a5 as Pe,bA as De,bH as V,bl as _e,b_ as oe,bO as de,bn as tt,bf as je,bV as Ee,aA as v,c9 as k,aB as H,be as it,b$ as lt,bj as dt,cd as ct,ca as Le,bk as ut}from"./CJxGDkBm.js";import{i as G}from"./1d4tWxyl.js";import{I$ as Ue,n4 as pt,u$ as ft}from"./Dou_hoaA.js";import{aN as ht}from"./CKje4aJN.js";import{cy as vt}from"./R5qsERXh.js";import{c as gt}from"./ChTqQfQN.js";import{i as Xe,t as He}from"./H2jLkRRS.js";import{w as _t}from"./gsFx6FSh.js";import{d as mt}from"./B0Z-1lwJ.js";import{F as Re,aw as bt,ax as wt,cV as Je,aZ as qe,bg as kt,ao as yt,an as At,cS as Ge}from"./DWlZtz5u.js";import{m as K,w as Ft}from"./BDjmUG9E.js";import{s as Ne,f as xe,c as Wt}from"./DYGZj8tM.js";import{s as Ct}from"./NvPqoUzX.js";import{w as xt}from"./DeOvWG_V.js";import"./CtnMBSuA.js";import{i as M}from"./BxPVGrtc.js";import{g as It,e as Te}from"./CDDY7bU6.js";import{c as Z}from"./DKOGfBeL.js";import{a as Pt,r as Dt}from"./C0ItZHN5.js";import{f as Mt,aa as Et}from"./CdO4czEi.js";import{t as Be}from"./DAsc1V4f.js";import{h as Ke,k as Ot,j as St,R as Rt,i as Nt,g as Tt,c as Bt,e as zt}from"./B5sCzlWo.js";import{M as Vt}from"./DR6lkAOz.js";import{m as ze}from"./BlNY__m5.js";var jt=H('<img alt="" class="size-4"/>'),Lt=H('<span class="min-w-0 flex-1 text-left"><span class="block truncate"> </span> <span class="block text-muted-foreground" aria-hidden="true" data-menu-action-reason=""> </span></span>'),Ut=H("<span> </span>"),Xt=H('<span data-menu-action-detail=""> </span>'),Ht=H('<span aria-hidden="true"><!></span>'),Ze=H("<!> <!> <!>",1),Jt=H('<div class="my-1 h-px bg-border" role="separator"></div>'),Me=H("<!> <!>",1),qt=H('<!> <p data-menu-action-note=""> </p>',1),Gt=H('<span class="flex size-4 shrink-0 items-center justify-center" aria-hidden="true"><!></span> <!> <!>',1),Kt=H('<p data-menu-action-note=""> </p>'),Zt=H('<div class="pl-4"><!> <!></div>'),Qt=H('<span class="sr-only"> </span>');function me(be,d){const we=st();if(new.target)return Qe({component:me,...be});et(d,!0);const Ie=(p,r=je)=>{var O=U(),S=y(O);{var j=W=>{const x=k(()=>Pt(r().editor));var L=U(),m=y(L);{var f=s=>{var i=jt();oe(()=>Ne(i,"src",`data:image/png;base64,${r().editor.iconBase64??""}`)),c(s,i)},o=s=>{var i=U(),b=y(i);Z(b,()=>e(x),(T,ae)=>{ae(T,{size:16})}),c(s,i)},N=s=>{{let i=k(()=>Dt(r().editor.category));Re(s,{get icon(){return e(i)},size:16})}};M(m,s=>{r().editor.iconBase64?s(f):e(x)?s(o,1):s(N,-1)})}c(W,L)},R=W=>{var x=U(),L=y(x);Ct(L,()=>r().iconSnippet),c(W,x)},q=W=>{{let x=k(()=>r().variant==="destructive"?"text-current":"text-muted-foreground");Re(W,{get icon(){return r().icon},get weight(){return J()},size:16,get class(){return e(x)}})}};M(S,W=>{r().editor?W(j):r().iconSnippet?W(R,1):r().icon&&W(q,2)})}c(p,O)},ne=(p,r=je)=>{var O=Ze(),S=y(O);{var j=m=>{var f=Lt(),o=Pe(f),N=_e(o,!0);Te(o,(b,T)=>Be?.(b,T),()=>r().label);var s=X(o,2),i=_e(s,!0);De(f),oe(()=>{de(N,r().label),de(i,r().disabledReason)}),c(m,f)},R=m=>{var f=Ut(),o=_e(f,!0);Te(f,(N,s)=>Be?.(N,s),()=>r().label),oe(()=>{xe(f,1,`min-w-0 truncate text-left ${r().detail?"flex-[1_0_auto]":"flex-1"}`),de(o,r().label)}),c(m,f)};M(S,m=>{r().disabledReason?m(j):m(R,-1)})}var q=X(S,2);{var W=m=>{var f=Xt(),o=_e(f,!0);Te(f,(N,s)=>Be?.(N,s),()=>r().detail),oe(()=>{xe(f,1,`ml-4 min-w-0 truncate ${(r().detailTone==="danger"?"text-danger":ze)??""}`),de(o,r().detail)}),c(m,f)};M(q,m=>{r().detail&&m(W)})}var x=X(q,2);{var L=m=>{var f=Ht(),o=Pe(f);Et(o,{children:(N,s)=>{it();var i=lt();oe(b=>de(i,b),[()=>xt(r().shortcut)]),c(N,i)},$$slots:{default:!0}}),De(f),oe(()=>xe(f,1,Wt(E()?"ml-4 flex h-lh shrink-0 items-center":"ml-4"))),c(m,f)};M(x,m=>{r().shortcut&&m(L)})}c(p,O)};let ke=h(d,"actions",7),E=h(d,"menu",7),J=h(d,"iconWeight",7),u=h(d,"onClose",7),A=h(d,"selection",7),F=Ee(null);function Q(p){p.disabled||p.disabledReason!==void 0||(p.onClick(),u()?.())}var ce={get actions(){return ke()},set actions(p){ke(p),v()},get menu(){return E()},set menu(p){E(p),v()},get iconWeight(){return J()},set iconWeight(p){J(p),v()},get onClose(){return u()},set onClose(p){u(p),v()},get selection(){return A()},set selection(p){A(p),v()},$set:Ye,$on:(p,r)=>$e(d,p,r)},se=U(),ie=y(se);return It(ie,17,ke,p=>p.id,(p,r)=>{const O=i=>{Ie(i,()=>e(r))},S=k(()=>!!(e(r).editor||e(r).iconSnippet||e(r).icon)),j=k(()=>e(r).disabled||e(r).disabledReason!==void 0),R=k(()=>e(r).disabledReason?`${we}-${e(r).id}-reason`:void 0);var q=Ze(),W=y(q);{var x=i=>{var b=U(),T=y(b);{var ae=a=>{var n=U(),g=y(n);Z(g,()=>Ke,(C,P)=>{P(C,{})}),c(a,n)},ue=a=>{var n=Jt();c(a,n)};M(T,a=>{E()?a(ae):a(ue,-1)})}c(i,b)};M(W,i=>{e(r).dividerBefore&&i(x)})}var L=X(W,2);{var m=i=>{var b=U(),T=y(b);{var ae=g=>{var C=U(),P=y(C);Z(P,()=>Nt,(I,D)=>{D(I,{children:(B,Y)=>{var $=Me(),pe=y($);{let te=k(()=>e(S)?O:void 0);Z(pe,()=>Ot,(fe,he)=>{he(fe,{get leading(){return e(te)},get disabled(){return e(j)},get"aria-describedby"(){return e(R)},get"data-action-id"(){return e(r).id},children:(ve,ye)=>{ne(ve,()=>e(r))},$$slots:{default:!0}})})}var ee=X(pe,2);{let te=k(()=>e(r).note?`${we}-${e(r).id}-note`:void 0);Z(ee,()=>St,(fe,he)=>{he(fe,{class:"w-60",get"aria-describedby"(){return e(te)},children:(ve,ye)=>{var t=Me(),l=y(t);{var _=re=>{var Ae=Me(),Fe=y(Ae);{let Ce=k(()=>e(r).submenu.find(ge=>ge.checked)?.id??"");Z(Fe,()=>Rt,(ge,Se)=>{Se(ge,{get value(){return e(Ce)},get"aria-label"(){return e(r).label},children:(rt,$t)=>{{let at=k(()=>e(r).submenu.filter(ot=>ot.checked!==void 0));me(rt,{get actions(){return e(at)},selection:"single",get menu(){return E()},get iconWeight(){return J()},get onClose(){return u()}})}},$$slots:{default:!0}})})}var We=X(Fe,2);{let Ce=k(()=>e(r).submenu.filter(ge=>ge.checked===void 0));me(We,{get actions(){return e(Ce)},get menu(){return E()},get iconWeight(){return J()},get onClose(){return u()}})}c(re,Ae)},z=re=>{me(re,{get actions(){return e(r).submenu},get menu(){return E()},get iconWeight(){return J()},get onClose(){return u()}})};M(l,re=>{e(r).selection==="single"?re(_):re(z,-1)})}var le=X(l,2);{var Oe=re=>{var Ae=qt(),Fe=y(Ae);Z(Fe,()=>Ke,(ge,Se)=>{Se(ge,{})});var We=X(Fe,2),Ce=_e(We,!0);oe(()=>{Ne(We,"id",`${we}-${e(r).id}-note`),xe(We,1,`type-caption px-2 py-1 ${ze}`),de(Ce,e(r).note)}),c(re,Ae)};M(le,re=>{e(r).note&&re(Oe)})}c(ve,t)},$$slots:{default:!0}})})}c(B,$)},$$slots:{default:!0}})}),c(g,C)},ue=g=>{var C=U(),P=y(C);{let I=k(()=>e(S)?O:void 0);Z(P,()=>Tt,(D,B)=>{B(D,{get leading(){return e(I)},get value(){return e(r).id},get disabled(){return e(j)},get"aria-describedby"(){return e(R)},closeOnSelect:!0,onSelect:()=>Q(e(r)),get"data-action-id"(){return e(r).id},children:(Y,$)=>{ne(Y,()=>e(r))},$$slots:{default:!0}})})}c(g,C)},a=g=>{var C=U(),P=y(C);{let I=k(()=>e(S)?O:void 0);Z(P,()=>Bt,(D,B)=>{B(D,{get leading(){return e(I)},get checked(){return e(r).checked},get disabled(){return e(j)},get"aria-describedby"(){return e(R)},closeOnSelect:!0,onSelect:()=>Q(e(r)),get"data-action-id"(){return e(r).id},children:(Y,$)=>{ne(Y,()=>e(r))},$$slots:{default:!0}})})}c(g,C)},n=g=>{var C=U(),P=y(C);{let I=k(()=>e(S)?O:void 0),D=k(()=>e(r).variant==="destructive");Z(P,()=>zt,(B,Y)=>{Y(B,{get leading(){return e(I)},get destructive(){return e(D)},get disabled(){return e(j)},get"aria-describedby"(){return e(R)},onSelect:()=>Q(e(r)),get"data-action-id"(){return e(r).id},children:($,pe)=>{ne($,()=>e(r))},$$slots:{default:!0}})})}c(g,C)};M(T,g=>{e(r).submenu?g(ae):A()==="single"&&e(r).checked!==void 0?g(ue,1):e(r).checked!==void 0?g(a,2):g(n,-1)})}c(i,b)},f=i=>{me(i,{get actions(){return e(r).submenu},get menu(){return E()},get iconWeight(){return J()},get onClose(){return u()}})},o=i=>{var b=Me(),T=y(b);{let a=k(()=>e(r).variant==="destructive"?"text-danger hover:text-danger":""),n=k(()=>e(r).submenu?e(F)===e(r).id:void 0);Mt(T,{variant:"ghost",size:"sm",get class(){return`w-full justify-start gap-2 ${e(a)??""}`},get disabled(){return e(j)},get"aria-describedby"(){return e(R)},get"aria-expanded"(){return e(n)},onclick:()=>e(r).submenu?V(F,e(F)===e(r).id?null:e(r).id,!0):Q(e(r)),children:(g,C)=>{var P=Gt(),I=y(P),D=Pe(I);Ie(D,()=>e(r)),De(I);var B=X(I,2);ne(B,()=>e(r));var Y=X(B,2);{var $=ee=>{{let te=k(()=>e(F)===e(r).id?bt:wt);Re(ee,{get icon(){return e(te)},size:12})}},pe=ee=>{var te=U(),fe=y(te);{let he=k(()=>e(r).checked?"checked":"empty");Z(fe,()=>Vt,(ve,ye)=>{ye(ve,{get state(){return e(he)}})})}c(ee,te)};M(Y,ee=>{e(r).submenu?ee($):e(r).checked!==void 0&&ee(pe,1)})}c(g,P)},$$slots:{default:!0}})}var ae=X(T,2);{var ue=a=>{var n=Zt(),g=Pe(n);me(g,{get actions(){return e(r).submenu},get menu(){return E()},get iconWeight(){return J()},get onClose(){return u()}});var C=X(g,2);{var P=I=>{var D=Kt(),B=_e(D,!0);oe(()=>{xe(D,1,`type-caption px-2 py-1 ${ze}`),de(B,e(r).note)}),c(I,D)};M(C,I=>{e(r).note&&I(P)})}De(n),c(a,n)};M(ae,a=>{e(r).submenu&&e(F)===e(r).id&&a(ue)})}c(i,b)};M(L,i=>{E()?i(m):e(r).id==="open-in"&&e(r).submenu?i(f,1):i(o,-1)})}var N=X(L,2);{var s=i=>{var b=Qt(),T=_e(b,!0);oe(()=>{Ne(b,"id",e(R)),de(T,e(r).disabledReason)}),c(i,b)};M(N,i=>{e(r).disabledReason&&i(s)})}c(p,q)}),c(be,se),tt(ce)}function Yt(be,d){if(new.target)return Qe({component:Yt,...be});et(d,!0);const we=()=>Ve(T,"$installedEditors$",ne),Ie=()=>Ve(ue,"$isWorkspaceHostLocal$",ne),[ne,ke]=nt();let E=h(d,"layout",7,"list"),J=h(d,"iconWeight",7),u=h(d,"filePath",7,""),A=h(d,"workspaceId",7,""),F=h(d,"isDirectory",7,!0),Q=h(d,"onDelete",7,void 0),ce=h(d,"onArchive",7,void 0),se=h(d,"onUnarchive",7,void 0),ie=h(d,"isArchived",7,!1),p=h(d,"onClose",7,void 0),r=h(d,"showDeleteOption",7,!0),O=h(d,"showArchiveOption",7,!1),S=h(d,"showPathCopy",7,!0),j=h(d,"showFileNameCopy",7,!1),R=h(d,"showFileActions",7,!0),q=h(d,"workspaceFolderPath",7,""),W=h(d,"isDiff",7,!1),x=h(d,"isWorkspaceRoot",7,!1),L=h(d,"additionalActions",23,()=>[]),m=h(d,"showDeleteFileOption",7,!1),f=h(d,"onFileDeleted",7,void 0);const o=gt("WorkspaceActionsMenu");let N=!1;dt(()=>{N=!0});function s(){N||p()?.()}const i=_t("externalEditors"),b=ct(A());Le(()=>{b.set(A())});const T=ht(b),ae=k(we),ue=vt(b);let a=Ee(""),n=Ee(""),g=Ee(!1);ut(()=>{Ue.dispatch(pt())}),Le(()=>{u()&&A()?G("workspace:get",{id:A()}).then(t=>{if(t&&t.success&&t.data){const l=t.data,_=l.worktreePath||l.repositoryPath||l.path,z=q()==="__WORKSPACE_ROOT__"?_:q()||_;if(z){const le=z.replace(/\\/g,"/");x()?V(a,le,!0):Xe(u())?V(a,u().replace(/\\/g,"/"),!0):V(a,`${le}/${u()}`.replace(/\/+/g,"/"),!0),V(n,le,!0),o.info("[WorkspaceActionsMenu] Resolved file path:",{filePath:u(),workspacePath:z,resolvedPath:e(a)})}else V(a,u()),V(n,""),l.status!=="archived"&&l.status!=="deleted"&&o.warn("[WorkspaceActionsMenu] No workspace path found:",l)}else V(a,u()),V(n,""),t?.error&&!t.error.includes("not found")&&o.warn("[WorkspaceActionsMenu] Workspace not available:",t)}).catch(t=>{V(a,u()),V(n,""),t?.message?.includes("not found")||o.error("[WorkspaceActionsMenu] Failed to resolve path:",t)}):(V(a,u()),o.info("[WorkspaceActionsMenu] Using filePath directly:",{filePath:u(),workspaceId:A()}))});async function C(){if(!e(a)){o.warn("[WorkspaceActionsMenu] No resolved path for VSCode");return}try{if(W()&&!F()){o.info("[WorkspaceActionsMenu] Opening diff in VSCode:",{resolvedPath:e(a)}),await G("vscode:open-git-diff",{filePath:e(a),workspacePath:e(n)||void 0}),s();return}let t=e(a);if(e(n))!F()&&!x()?t={folder:e(n),file:e(a)}:t=e(n);else if(!F()){const l=e(a).includes("\\")?"\\":"/",_=e(a).split(l);_.length>1&&(t={folder:_.slice(0,-1).join(l),file:e(a)})}await G("vscode:open",t),s()}catch(t){o.error("Failed to open in VSCode:",t),K.error(t instanceof Error?t.message:w.ui_workspaceActions_openFailed_error({name:"VS Code"}))}}async function P(){if(!e(a)){o.warn("[WorkspaceActionsMenu] No resolved path for JetBrains");return}try{let t=e(a);e(n)&&!F()?t={folder:e(n),file:e(a)}:e(n)&&(t=e(n)),await G("jetbrains:open",t),s()}catch(t){o.error("Failed to open in JetBrains:",t),K.error(t instanceof Error?t.message:w.ui_workspaceActions_openFailed_error({name:"JetBrains"}))}}async function I(){if(!e(a)){o.warn("[WorkspaceActionsMenu] No resolved path for Xcode");return}try{if(A()&&e(n)){Ue.dispatch(ft(A(),e(n),F()?void 0:e(a))),s();return}let t=e(a);e(n)&&!F()?t={folder:e(n),file:e(a)}:e(n)&&(t={folder:e(n)}),await G("xcode:open",t),s()}catch(t){o.error("Failed to open in Xcode:",t),K.error(t instanceof Error?t.message:w.ui_workspaceActions_openFailed_error({name:"Xcode"}))}}async function D(t){if(o.info("[WorkspaceActionsMenu] openInEditor called",{editorId:t.id,appName:t.appName,handlerType:t.handlerType,resolvedPath:e(a),isDirectory:F()}),!e(a)){o.warn("[WorkspaceActionsMenu] openInEditor: No resolved path, aborting");return}const l=F()?e(a):e(a).substring(0,e(a).lastIndexOf("/"));o.info(`[WorkspaceActionsMenu] openInEditor: targetPath=${l}, handlerType=${t.handlerType}`);try{switch(t.handlerType){case"finder":o.info("[WorkspaceActionsMenu] openInEditor: Invoking shell:showItemInFolder"),await G("shell:showItemInFolder",{path:l});break;case"vscode":o.info("[WorkspaceActionsMenu] openInEditor: Delegating to openInVSCode"),await C();return;case"jetbrains":o.info("[WorkspaceActionsMenu] openInEditor: Delegating to openInJetBrains"),await P();return;case"xcode":o.info("[WorkspaceActionsMenu] openInEditor: Delegating to openInXcode"),await I();return;case"generic":default:{o.info(`[WorkspaceActionsMenu] openInEditor: Invoking external-editors:open for ${t.id}`);const _=await G("external-editors:open",{editorId:t.id,path:l});o.info("[WorkspaceActionsMenu] openInEditor: external-editors:open result",_);break}}s()}catch(_){o.error(`[WorkspaceActionsMenu] Failed to open in ${t.appName}:`,_),K.error(_ instanceof Error?_.message:w.ui_workspaceActions_openFailed_error({name:t.appName}))}}async function B(){if(!e(a)){o.warn("No resolved path for openWithOther");return}try{let t=e(a);F()&&e(n)&&(t=e(n));const l=await G("external-editors:open-with-other",{path:t});if(!l?.success){l?.error!=="No application selected"&&(o.error("Failed to open with other app:",l?.error),K.error(l?.error||w.ui_workspaceActions_openOtherFailed_error()));return}s()}catch(t){o.error("Failed to open with other app:",t),K.error(t instanceof Error?t.message:w.ui_workspaceActions_openOtherFailed_error())}}async function Y(){if(e(a))try{await navigator.clipboard.writeText(He(e(a))),s()}catch(t){o.error("Failed to copy path:",t)}}async function $(){if(u())try{let t=u().replace(/\\/g,"/");if(Xe(u())&&e(n)){const l=e(n).endsWith("/")?e(n):e(n)+"/";t.startsWith(l)&&(t=t.slice(l.length))}await navigator.clipboard.writeText(He(t)),s()}catch(t){o.error("Failed to copy workspace path:",t)}}async function pe(){if(u())try{const t=u().split(/[/\\]/).pop()||"";await navigator.clipboard.writeText(t),s()}catch(t){o.error("Failed to copy file name:",t)}}function ee(){Q()&&(Q()(),s())}async function te(){if(!(!A()||!e(a)||e(g))){V(g,!0);try{const t=u().split(/[/\\]/).pop()||"file",l=e(a);let _="";try{_=(await G("file:read",{path:l,workspaceId:A()}))?.data?.content??""}catch{}const z=await G("file:delete",{path:l,workspaceId:A()});if(z?.success){f()?.(),s();const le=K.warning(w.ui_workspaceActions_deletedFile_label({name:t}),Ft({duration:15e3,action:{label:w.ui_workspaceActions_undo_label(),onClick:async()=>{try{await G("file:write",{path:l,content:_,workspaceId:A()}),mt("file:changed",{workspaceId:A(),type:"create",filePath:l}),K.dismiss(le)}catch(Oe){o.error("[WorkspaceActionsMenu] Failed to restore file",Oe),K.error(w.ui_workspaceActions_restoreFileFailed_error())}}}}))}else K.error(w.ui_workspaceActions_deleteFileFailedDetail_error({error:z?.error||w.ui_workspaceActions_unknown_error()}))}catch(t){o.error("[WorkspaceActionsMenu] Error deleting file",t),K.error(w.ui_workspaceActions_deleteFileFailed_error())}finally{V(g,!1)}}}function fe(){ie()&&se()?(se()(),s()):!ie()&&ce()&&(ce()(),s())}const he=k(()=>{const t=[];R()&&(i&&Ie()&&t.push({id:"open-in",label:w.ui_openCombo_openInApp_tooltip(),icon:Je,onClick:()=>{},submenu:[...e(ae).map(_=>({id:`editor:${_.id}`,label:w.ui_workspaceActions_openIn_label({name:_.name}),editor:_,onClick:()=>{D(_)}})),{id:"choose-app",label:w.ui_workspaceActions_chooseApp_label(),icon:Je,onClick:()=>{B()}}]}),S()&&t.push({id:"copy-absolute-path",label:w.ui_workspaceActions_copyAbsolutePath_label(),icon:qe,disabled:!e(a),dividerBefore:t.length>0,onClick:()=>{Y()}}),S()&&!x()&&t.push({id:"copy-relative-path",label:w.ui_workspaceActions_copyRelativePath_label(),icon:qe,disabled:!u(),onClick:()=>{$()}}),j()&&!F()&&t.push({id:"copy-file-name",label:w.ui_workspaceActions_copyFileName_label(),icon:kt,disabled:!u(),onClick:()=>{pe()}}));const l=_=>_.map(z=>({...z,submenu:z.submenu?l(z.submenu):void 0,onClick:()=>{z.onClick(),s()}}));return t.push(...l(L())),O()&&(ce()||se())&&t.push({id:"archive-workspace",label:ie()?w.ui_workspaceActions_unarchiveSpace_label():w.ui_workspaceActions_archiveSpace_label(),icon:ie()?yt:At,dividerBefore:t.length>0,onClick:fe}),r()&&Q()&&t.push({id:"delete-workspace",label:w.ui_workspaceActions_deleteSpace_label(),icon:Ge,variant:"destructive",dividerBefore:t.length>0&&t.at(-1)?.id!=="archive-workspace",onClick:ee}),m()&&!F()&&t.push({id:"delete-file",label:w.ui_workspaceActions_deleteFile_label(),icon:Ge,variant:"destructive",disabled:e(g)||!e(a)||!A(),dividerBefore:t.length>0,onClick:()=>{te()}}),t});var ve={get layout(){return E()},set layout(t="list"){E(t),v()},get iconWeight(){return J()},set iconWeight(t){J(t),v()},get filePath(){return u()},set filePath(t=""){u(t),v()},get workspaceId(){return A()},set workspaceId(t=""){A(t),v()},get isDirectory(){return F()},set isDirectory(t=!0){F(t),v()},get onDelete(){return Q()},set onDelete(t=void 0){Q(t),v()},get onArchive(){return ce()},set onArchive(t=void 0){ce(t),v()},get onUnarchive(){return se()},set onUnarchive(t=void 0){se(t),v()},get isArchived(){return ie()},set isArchived(t=!1){ie(t),v()},get onClose(){return p()},set onClose(t=void 0){p(t),v()},get showDeleteOption(){return r()},set showDeleteOption(t=!0){r(t),v()},get showArchiveOption(){return O()},set showArchiveOption(t=!1){O(t),v()},get showPathCopy(){return S()},set showPathCopy(t=!0){S(t),v()},get showFileNameCopy(){return j()},set showFileNameCopy(t=!1){j(t),v()},get showFileActions(){return R()},set showFileActions(t=!0){R(t),v()},get workspaceFolderPath(){return q()},set workspaceFolderPath(t=""){q(t),v()},get isDiff(){return W()},set isDiff(t=!1){W(t),v()},get isWorkspaceRoot(){return x()},set isWorkspaceRoot(t=!1){x(t),v()},get additionalActions(){return L()},set additionalActions(t=[]){L(t),v()},get showDeleteFileOption(){return m()},set showDeleteFileOption(t=!1){m(t),v()},get onFileDeleted(){return f()},set onFileDeleted(t=void 0){f(t),v()},$set:Ye,$on:(t,l)=>$e(d,t,l)};{let t=k(()=>E()!=="list");me(be,{get actions(){return e(he)},get menu(){return e(t)},get iconWeight(){return J()}})}var ye=tt(ve);return ke(),ye}export{Yt as default};
|
|
1
|
+
import{t as Qe,bo as h,bw as Ye,b as $e,bq as nt,bm as w,bs as Ve}from"./DUPdECze.js";import{bo as st,bs as et,a7 as U,ay as y,aD as e,bS as X,W as c,a5 as Pe,bA as De,bH as V,bl as _e,b_ as oe,bO as de,bn as tt,bf as je,bV as Ee,aA as v,c9 as k,aB as H,be as it,b$ as lt,bj as dt,cd as ct,ca as Le,bk as ut}from"./CJxGDkBm.js";import{i as G}from"./1d4tWxyl.js";import{I$ as Ue,n4 as pt,u$ as ft}from"./Dou_hoaA.js";import{aN as ht}from"./21sFenOt.js";import{cy as vt}from"./R5qsERXh.js";import{c as gt}from"./ChTqQfQN.js";import{i as Xe,t as He}from"./H2jLkRRS.js";import{w as _t}from"./gsFx6FSh.js";import{d as mt}from"./B0Z-1lwJ.js";import{F as Re,aw as bt,ax as wt,cV as Je,aZ as qe,bg as kt,ao as yt,an as At,cS as Ge}from"./DWlZtz5u.js";import{m as K,w as Ft}from"./BDjmUG9E.js";import{s as Ne,f as xe,c as Wt}from"./DYGZj8tM.js";import{s as Ct}from"./NvPqoUzX.js";import{w as xt}from"./DeOvWG_V.js";import"./CtnMBSuA.js";import{i as M}from"./BxPVGrtc.js";import{g as It,e as Te}from"./CDDY7bU6.js";import{c as Z}from"./DKOGfBeL.js";import{a as Pt,r as Dt}from"./fVUImVux.js";import{f as Mt,aa as Et}from"./CdO4czEi.js";import{t as Be}from"./DAsc1V4f.js";import{h as Ke,k as Ot,j as St,R as Rt,i as Nt,g as Tt,c as Bt,e as zt}from"./B5sCzlWo.js";import{M as Vt}from"./DR6lkAOz.js";import{m as ze}from"./BlNY__m5.js";var jt=H('<img alt="" class="size-4"/>'),Lt=H('<span class="min-w-0 flex-1 text-left"><span class="block truncate"> </span> <span class="block text-muted-foreground" aria-hidden="true" data-menu-action-reason=""> </span></span>'),Ut=H("<span> </span>"),Xt=H('<span data-menu-action-detail=""> </span>'),Ht=H('<span aria-hidden="true"><!></span>'),Ze=H("<!> <!> <!>",1),Jt=H('<div class="my-1 h-px bg-border" role="separator"></div>'),Me=H("<!> <!>",1),qt=H('<!> <p data-menu-action-note=""> </p>',1),Gt=H('<span class="flex size-4 shrink-0 items-center justify-center" aria-hidden="true"><!></span> <!> <!>',1),Kt=H('<p data-menu-action-note=""> </p>'),Zt=H('<div class="pl-4"><!> <!></div>'),Qt=H('<span class="sr-only"> </span>');function me(be,d){const we=st();if(new.target)return Qe({component:me,...be});et(d,!0);const Ie=(p,r=je)=>{var O=U(),S=y(O);{var j=W=>{const x=k(()=>Pt(r().editor));var L=U(),m=y(L);{var f=s=>{var i=jt();oe(()=>Ne(i,"src",`data:image/png;base64,${r().editor.iconBase64??""}`)),c(s,i)},o=s=>{var i=U(),b=y(i);Z(b,()=>e(x),(T,ae)=>{ae(T,{size:16})}),c(s,i)},N=s=>{{let i=k(()=>Dt(r().editor.category));Re(s,{get icon(){return e(i)},size:16})}};M(m,s=>{r().editor.iconBase64?s(f):e(x)?s(o,1):s(N,-1)})}c(W,L)},R=W=>{var x=U(),L=y(x);Ct(L,()=>r().iconSnippet),c(W,x)},q=W=>{{let x=k(()=>r().variant==="destructive"?"text-current":"text-muted-foreground");Re(W,{get icon(){return r().icon},get weight(){return J()},size:16,get class(){return e(x)}})}};M(S,W=>{r().editor?W(j):r().iconSnippet?W(R,1):r().icon&&W(q,2)})}c(p,O)},ne=(p,r=je)=>{var O=Ze(),S=y(O);{var j=m=>{var f=Lt(),o=Pe(f),N=_e(o,!0);Te(o,(b,T)=>Be?.(b,T),()=>r().label);var s=X(o,2),i=_e(s,!0);De(f),oe(()=>{de(N,r().label),de(i,r().disabledReason)}),c(m,f)},R=m=>{var f=Ut(),o=_e(f,!0);Te(f,(N,s)=>Be?.(N,s),()=>r().label),oe(()=>{xe(f,1,`min-w-0 truncate text-left ${r().detail?"flex-[1_0_auto]":"flex-1"}`),de(o,r().label)}),c(m,f)};M(S,m=>{r().disabledReason?m(j):m(R,-1)})}var q=X(S,2);{var W=m=>{var f=Xt(),o=_e(f,!0);Te(f,(N,s)=>Be?.(N,s),()=>r().detail),oe(()=>{xe(f,1,`ml-4 min-w-0 truncate ${(r().detailTone==="danger"?"text-danger":ze)??""}`),de(o,r().detail)}),c(m,f)};M(q,m=>{r().detail&&m(W)})}var x=X(q,2);{var L=m=>{var f=Ht(),o=Pe(f);Et(o,{children:(N,s)=>{it();var i=lt();oe(b=>de(i,b),[()=>xt(r().shortcut)]),c(N,i)},$$slots:{default:!0}}),De(f),oe(()=>xe(f,1,Wt(E()?"ml-4 flex h-lh shrink-0 items-center":"ml-4"))),c(m,f)};M(x,m=>{r().shortcut&&m(L)})}c(p,O)};let ke=h(d,"actions",7),E=h(d,"menu",7),J=h(d,"iconWeight",7),u=h(d,"onClose",7),A=h(d,"selection",7),F=Ee(null);function Q(p){p.disabled||p.disabledReason!==void 0||(p.onClick(),u()?.())}var ce={get actions(){return ke()},set actions(p){ke(p),v()},get menu(){return E()},set menu(p){E(p),v()},get iconWeight(){return J()},set iconWeight(p){J(p),v()},get onClose(){return u()},set onClose(p){u(p),v()},get selection(){return A()},set selection(p){A(p),v()},$set:Ye,$on:(p,r)=>$e(d,p,r)},se=U(),ie=y(se);return It(ie,17,ke,p=>p.id,(p,r)=>{const O=i=>{Ie(i,()=>e(r))},S=k(()=>!!(e(r).editor||e(r).iconSnippet||e(r).icon)),j=k(()=>e(r).disabled||e(r).disabledReason!==void 0),R=k(()=>e(r).disabledReason?`${we}-${e(r).id}-reason`:void 0);var q=Ze(),W=y(q);{var x=i=>{var b=U(),T=y(b);{var ae=a=>{var n=U(),g=y(n);Z(g,()=>Ke,(C,P)=>{P(C,{})}),c(a,n)},ue=a=>{var n=Jt();c(a,n)};M(T,a=>{E()?a(ae):a(ue,-1)})}c(i,b)};M(W,i=>{e(r).dividerBefore&&i(x)})}var L=X(W,2);{var m=i=>{var b=U(),T=y(b);{var ae=g=>{var C=U(),P=y(C);Z(P,()=>Nt,(I,D)=>{D(I,{children:(B,Y)=>{var $=Me(),pe=y($);{let te=k(()=>e(S)?O:void 0);Z(pe,()=>Ot,(fe,he)=>{he(fe,{get leading(){return e(te)},get disabled(){return e(j)},get"aria-describedby"(){return e(R)},get"data-action-id"(){return e(r).id},children:(ve,ye)=>{ne(ve,()=>e(r))},$$slots:{default:!0}})})}var ee=X(pe,2);{let te=k(()=>e(r).note?`${we}-${e(r).id}-note`:void 0);Z(ee,()=>St,(fe,he)=>{he(fe,{class:"w-60",get"aria-describedby"(){return e(te)},children:(ve,ye)=>{var t=Me(),l=y(t);{var _=re=>{var Ae=Me(),Fe=y(Ae);{let Ce=k(()=>e(r).submenu.find(ge=>ge.checked)?.id??"");Z(Fe,()=>Rt,(ge,Se)=>{Se(ge,{get value(){return e(Ce)},get"aria-label"(){return e(r).label},children:(rt,$t)=>{{let at=k(()=>e(r).submenu.filter(ot=>ot.checked!==void 0));me(rt,{get actions(){return e(at)},selection:"single",get menu(){return E()},get iconWeight(){return J()},get onClose(){return u()}})}},$$slots:{default:!0}})})}var We=X(Fe,2);{let Ce=k(()=>e(r).submenu.filter(ge=>ge.checked===void 0));me(We,{get actions(){return e(Ce)},get menu(){return E()},get iconWeight(){return J()},get onClose(){return u()}})}c(re,Ae)},z=re=>{me(re,{get actions(){return e(r).submenu},get menu(){return E()},get iconWeight(){return J()},get onClose(){return u()}})};M(l,re=>{e(r).selection==="single"?re(_):re(z,-1)})}var le=X(l,2);{var Oe=re=>{var Ae=qt(),Fe=y(Ae);Z(Fe,()=>Ke,(ge,Se)=>{Se(ge,{})});var We=X(Fe,2),Ce=_e(We,!0);oe(()=>{Ne(We,"id",`${we}-${e(r).id}-note`),xe(We,1,`type-caption px-2 py-1 ${ze}`),de(Ce,e(r).note)}),c(re,Ae)};M(le,re=>{e(r).note&&re(Oe)})}c(ve,t)},$$slots:{default:!0}})})}c(B,$)},$$slots:{default:!0}})}),c(g,C)},ue=g=>{var C=U(),P=y(C);{let I=k(()=>e(S)?O:void 0);Z(P,()=>Tt,(D,B)=>{B(D,{get leading(){return e(I)},get value(){return e(r).id},get disabled(){return e(j)},get"aria-describedby"(){return e(R)},closeOnSelect:!0,onSelect:()=>Q(e(r)),get"data-action-id"(){return e(r).id},children:(Y,$)=>{ne(Y,()=>e(r))},$$slots:{default:!0}})})}c(g,C)},a=g=>{var C=U(),P=y(C);{let I=k(()=>e(S)?O:void 0);Z(P,()=>Bt,(D,B)=>{B(D,{get leading(){return e(I)},get checked(){return e(r).checked},get disabled(){return e(j)},get"aria-describedby"(){return e(R)},closeOnSelect:!0,onSelect:()=>Q(e(r)),get"data-action-id"(){return e(r).id},children:(Y,$)=>{ne(Y,()=>e(r))},$$slots:{default:!0}})})}c(g,C)},n=g=>{var C=U(),P=y(C);{let I=k(()=>e(S)?O:void 0),D=k(()=>e(r).variant==="destructive");Z(P,()=>zt,(B,Y)=>{Y(B,{get leading(){return e(I)},get destructive(){return e(D)},get disabled(){return e(j)},get"aria-describedby"(){return e(R)},onSelect:()=>Q(e(r)),get"data-action-id"(){return e(r).id},children:($,pe)=>{ne($,()=>e(r))},$$slots:{default:!0}})})}c(g,C)};M(T,g=>{e(r).submenu?g(ae):A()==="single"&&e(r).checked!==void 0?g(ue,1):e(r).checked!==void 0?g(a,2):g(n,-1)})}c(i,b)},f=i=>{me(i,{get actions(){return e(r).submenu},get menu(){return E()},get iconWeight(){return J()},get onClose(){return u()}})},o=i=>{var b=Me(),T=y(b);{let a=k(()=>e(r).variant==="destructive"?"text-danger hover:text-danger":""),n=k(()=>e(r).submenu?e(F)===e(r).id:void 0);Mt(T,{variant:"ghost",size:"sm",get class(){return`w-full justify-start gap-2 ${e(a)??""}`},get disabled(){return e(j)},get"aria-describedby"(){return e(R)},get"aria-expanded"(){return e(n)},onclick:()=>e(r).submenu?V(F,e(F)===e(r).id?null:e(r).id,!0):Q(e(r)),children:(g,C)=>{var P=Gt(),I=y(P),D=Pe(I);Ie(D,()=>e(r)),De(I);var B=X(I,2);ne(B,()=>e(r));var Y=X(B,2);{var $=ee=>{{let te=k(()=>e(F)===e(r).id?bt:wt);Re(ee,{get icon(){return e(te)},size:12})}},pe=ee=>{var te=U(),fe=y(te);{let he=k(()=>e(r).checked?"checked":"empty");Z(fe,()=>Vt,(ve,ye)=>{ye(ve,{get state(){return e(he)}})})}c(ee,te)};M(Y,ee=>{e(r).submenu?ee($):e(r).checked!==void 0&&ee(pe,1)})}c(g,P)},$$slots:{default:!0}})}var ae=X(T,2);{var ue=a=>{var n=Zt(),g=Pe(n);me(g,{get actions(){return e(r).submenu},get menu(){return E()},get iconWeight(){return J()},get onClose(){return u()}});var C=X(g,2);{var P=I=>{var D=Kt(),B=_e(D,!0);oe(()=>{xe(D,1,`type-caption px-2 py-1 ${ze}`),de(B,e(r).note)}),c(I,D)};M(C,I=>{e(r).note&&I(P)})}De(n),c(a,n)};M(ae,a=>{e(r).submenu&&e(F)===e(r).id&&a(ue)})}c(i,b)};M(L,i=>{E()?i(m):e(r).id==="open-in"&&e(r).submenu?i(f,1):i(o,-1)})}var N=X(L,2);{var s=i=>{var b=Qt(),T=_e(b,!0);oe(()=>{Ne(b,"id",e(R)),de(T,e(r).disabledReason)}),c(i,b)};M(N,i=>{e(r).disabledReason&&i(s)})}c(p,q)}),c(be,se),tt(ce)}function Yt(be,d){if(new.target)return Qe({component:Yt,...be});et(d,!0);const we=()=>Ve(T,"$installedEditors$",ne),Ie=()=>Ve(ue,"$isWorkspaceHostLocal$",ne),[ne,ke]=nt();let E=h(d,"layout",7,"list"),J=h(d,"iconWeight",7),u=h(d,"filePath",7,""),A=h(d,"workspaceId",7,""),F=h(d,"isDirectory",7,!0),Q=h(d,"onDelete",7,void 0),ce=h(d,"onArchive",7,void 0),se=h(d,"onUnarchive",7,void 0),ie=h(d,"isArchived",7,!1),p=h(d,"onClose",7,void 0),r=h(d,"showDeleteOption",7,!0),O=h(d,"showArchiveOption",7,!1),S=h(d,"showPathCopy",7,!0),j=h(d,"showFileNameCopy",7,!1),R=h(d,"showFileActions",7,!0),q=h(d,"workspaceFolderPath",7,""),W=h(d,"isDiff",7,!1),x=h(d,"isWorkspaceRoot",7,!1),L=h(d,"additionalActions",23,()=>[]),m=h(d,"showDeleteFileOption",7,!1),f=h(d,"onFileDeleted",7,void 0);const o=gt("WorkspaceActionsMenu");let N=!1;dt(()=>{N=!0});function s(){N||p()?.()}const i=_t("externalEditors"),b=ct(A());Le(()=>{b.set(A())});const T=ht(b),ae=k(we),ue=vt(b);let a=Ee(""),n=Ee(""),g=Ee(!1);ut(()=>{Ue.dispatch(pt())}),Le(()=>{u()&&A()?G("workspace:get",{id:A()}).then(t=>{if(t&&t.success&&t.data){const l=t.data,_=l.worktreePath||l.repositoryPath||l.path,z=q()==="__WORKSPACE_ROOT__"?_:q()||_;if(z){const le=z.replace(/\\/g,"/");x()?V(a,le,!0):Xe(u())?V(a,u().replace(/\\/g,"/"),!0):V(a,`${le}/${u()}`.replace(/\/+/g,"/"),!0),V(n,le,!0),o.info("[WorkspaceActionsMenu] Resolved file path:",{filePath:u(),workspacePath:z,resolvedPath:e(a)})}else V(a,u()),V(n,""),l.status!=="archived"&&l.status!=="deleted"&&o.warn("[WorkspaceActionsMenu] No workspace path found:",l)}else V(a,u()),V(n,""),t?.error&&!t.error.includes("not found")&&o.warn("[WorkspaceActionsMenu] Workspace not available:",t)}).catch(t=>{V(a,u()),V(n,""),t?.message?.includes("not found")||o.error("[WorkspaceActionsMenu] Failed to resolve path:",t)}):(V(a,u()),o.info("[WorkspaceActionsMenu] Using filePath directly:",{filePath:u(),workspaceId:A()}))});async function C(){if(!e(a)){o.warn("[WorkspaceActionsMenu] No resolved path for VSCode");return}try{if(W()&&!F()){o.info("[WorkspaceActionsMenu] Opening diff in VSCode:",{resolvedPath:e(a)}),await G("vscode:open-git-diff",{filePath:e(a),workspacePath:e(n)||void 0}),s();return}let t=e(a);if(e(n))!F()&&!x()?t={folder:e(n),file:e(a)}:t=e(n);else if(!F()){const l=e(a).includes("\\")?"\\":"/",_=e(a).split(l);_.length>1&&(t={folder:_.slice(0,-1).join(l),file:e(a)})}await G("vscode:open",t),s()}catch(t){o.error("Failed to open in VSCode:",t),K.error(t instanceof Error?t.message:w.ui_workspaceActions_openFailed_error({name:"VS Code"}))}}async function P(){if(!e(a)){o.warn("[WorkspaceActionsMenu] No resolved path for JetBrains");return}try{let t=e(a);e(n)&&!F()?t={folder:e(n),file:e(a)}:e(n)&&(t=e(n)),await G("jetbrains:open",t),s()}catch(t){o.error("Failed to open in JetBrains:",t),K.error(t instanceof Error?t.message:w.ui_workspaceActions_openFailed_error({name:"JetBrains"}))}}async function I(){if(!e(a)){o.warn("[WorkspaceActionsMenu] No resolved path for Xcode");return}try{if(A()&&e(n)){Ue.dispatch(ft(A(),e(n),F()?void 0:e(a))),s();return}let t=e(a);e(n)&&!F()?t={folder:e(n),file:e(a)}:e(n)&&(t={folder:e(n)}),await G("xcode:open",t),s()}catch(t){o.error("Failed to open in Xcode:",t),K.error(t instanceof Error?t.message:w.ui_workspaceActions_openFailed_error({name:"Xcode"}))}}async function D(t){if(o.info("[WorkspaceActionsMenu] openInEditor called",{editorId:t.id,appName:t.appName,handlerType:t.handlerType,resolvedPath:e(a),isDirectory:F()}),!e(a)){o.warn("[WorkspaceActionsMenu] openInEditor: No resolved path, aborting");return}const l=F()?e(a):e(a).substring(0,e(a).lastIndexOf("/"));o.info(`[WorkspaceActionsMenu] openInEditor: targetPath=${l}, handlerType=${t.handlerType}`);try{switch(t.handlerType){case"finder":o.info("[WorkspaceActionsMenu] openInEditor: Invoking shell:showItemInFolder"),await G("shell:showItemInFolder",{path:l});break;case"vscode":o.info("[WorkspaceActionsMenu] openInEditor: Delegating to openInVSCode"),await C();return;case"jetbrains":o.info("[WorkspaceActionsMenu] openInEditor: Delegating to openInJetBrains"),await P();return;case"xcode":o.info("[WorkspaceActionsMenu] openInEditor: Delegating to openInXcode"),await I();return;case"generic":default:{o.info(`[WorkspaceActionsMenu] openInEditor: Invoking external-editors:open for ${t.id}`);const _=await G("external-editors:open",{editorId:t.id,path:l});o.info("[WorkspaceActionsMenu] openInEditor: external-editors:open result",_);break}}s()}catch(_){o.error(`[WorkspaceActionsMenu] Failed to open in ${t.appName}:`,_),K.error(_ instanceof Error?_.message:w.ui_workspaceActions_openFailed_error({name:t.appName}))}}async function B(){if(!e(a)){o.warn("No resolved path for openWithOther");return}try{let t=e(a);F()&&e(n)&&(t=e(n));const l=await G("external-editors:open-with-other",{path:t});if(!l?.success){l?.error!=="No application selected"&&(o.error("Failed to open with other app:",l?.error),K.error(l?.error||w.ui_workspaceActions_openOtherFailed_error()));return}s()}catch(t){o.error("Failed to open with other app:",t),K.error(t instanceof Error?t.message:w.ui_workspaceActions_openOtherFailed_error())}}async function Y(){if(e(a))try{await navigator.clipboard.writeText(He(e(a))),s()}catch(t){o.error("Failed to copy path:",t)}}async function $(){if(u())try{let t=u().replace(/\\/g,"/");if(Xe(u())&&e(n)){const l=e(n).endsWith("/")?e(n):e(n)+"/";t.startsWith(l)&&(t=t.slice(l.length))}await navigator.clipboard.writeText(He(t)),s()}catch(t){o.error("Failed to copy workspace path:",t)}}async function pe(){if(u())try{const t=u().split(/[/\\]/).pop()||"";await navigator.clipboard.writeText(t),s()}catch(t){o.error("Failed to copy file name:",t)}}function ee(){Q()&&(Q()(),s())}async function te(){if(!(!A()||!e(a)||e(g))){V(g,!0);try{const t=u().split(/[/\\]/).pop()||"file",l=e(a);let _="";try{_=(await G("file:read",{path:l,workspaceId:A()}))?.data?.content??""}catch{}const z=await G("file:delete",{path:l,workspaceId:A()});if(z?.success){f()?.(),s();const le=K.warning(w.ui_workspaceActions_deletedFile_label({name:t}),Ft({duration:15e3,action:{label:w.ui_workspaceActions_undo_label(),onClick:async()=>{try{await G("file:write",{path:l,content:_,workspaceId:A()}),mt("file:changed",{workspaceId:A(),type:"create",filePath:l}),K.dismiss(le)}catch(Oe){o.error("[WorkspaceActionsMenu] Failed to restore file",Oe),K.error(w.ui_workspaceActions_restoreFileFailed_error())}}}}))}else K.error(w.ui_workspaceActions_deleteFileFailedDetail_error({error:z?.error||w.ui_workspaceActions_unknown_error()}))}catch(t){o.error("[WorkspaceActionsMenu] Error deleting file",t),K.error(w.ui_workspaceActions_deleteFileFailed_error())}finally{V(g,!1)}}}function fe(){ie()&&se()?(se()(),s()):!ie()&&ce()&&(ce()(),s())}const he=k(()=>{const t=[];R()&&(i&&Ie()&&t.push({id:"open-in",label:w.ui_openCombo_openInApp_tooltip(),icon:Je,onClick:()=>{},submenu:[...e(ae).map(_=>({id:`editor:${_.id}`,label:w.ui_workspaceActions_openIn_label({name:_.name}),editor:_,onClick:()=>{D(_)}})),{id:"choose-app",label:w.ui_workspaceActions_chooseApp_label(),icon:Je,onClick:()=>{B()}}]}),S()&&t.push({id:"copy-absolute-path",label:w.ui_workspaceActions_copyAbsolutePath_label(),icon:qe,disabled:!e(a),dividerBefore:t.length>0,onClick:()=>{Y()}}),S()&&!x()&&t.push({id:"copy-relative-path",label:w.ui_workspaceActions_copyRelativePath_label(),icon:qe,disabled:!u(),onClick:()=>{$()}}),j()&&!F()&&t.push({id:"copy-file-name",label:w.ui_workspaceActions_copyFileName_label(),icon:kt,disabled:!u(),onClick:()=>{pe()}}));const l=_=>_.map(z=>({...z,submenu:z.submenu?l(z.submenu):void 0,onClick:()=>{z.onClick(),s()}}));return t.push(...l(L())),O()&&(ce()||se())&&t.push({id:"archive-workspace",label:ie()?w.ui_workspaceActions_unarchiveSpace_label():w.ui_workspaceActions_archiveSpace_label(),icon:ie()?yt:At,dividerBefore:t.length>0,onClick:fe}),r()&&Q()&&t.push({id:"delete-workspace",label:w.ui_workspaceActions_deleteSpace_label(),icon:Ge,variant:"destructive",dividerBefore:t.length>0&&t.at(-1)?.id!=="archive-workspace",onClick:ee}),m()&&!F()&&t.push({id:"delete-file",label:w.ui_workspaceActions_deleteFile_label(),icon:Ge,variant:"destructive",disabled:e(g)||!e(a)||!A(),dividerBefore:t.length>0,onClick:()=>{te()}}),t});var ve={get layout(){return E()},set layout(t="list"){E(t),v()},get iconWeight(){return J()},set iconWeight(t){J(t),v()},get filePath(){return u()},set filePath(t=""){u(t),v()},get workspaceId(){return A()},set workspaceId(t=""){A(t),v()},get isDirectory(){return F()},set isDirectory(t=!0){F(t),v()},get onDelete(){return Q()},set onDelete(t=void 0){Q(t),v()},get onArchive(){return ce()},set onArchive(t=void 0){ce(t),v()},get onUnarchive(){return se()},set onUnarchive(t=void 0){se(t),v()},get isArchived(){return ie()},set isArchived(t=!1){ie(t),v()},get onClose(){return p()},set onClose(t=void 0){p(t),v()},get showDeleteOption(){return r()},set showDeleteOption(t=!0){r(t),v()},get showArchiveOption(){return O()},set showArchiveOption(t=!1){O(t),v()},get showPathCopy(){return S()},set showPathCopy(t=!0){S(t),v()},get showFileNameCopy(){return j()},set showFileNameCopy(t=!1){j(t),v()},get showFileActions(){return R()},set showFileActions(t=!0){R(t),v()},get workspaceFolderPath(){return q()},set workspaceFolderPath(t=""){q(t),v()},get isDiff(){return W()},set isDiff(t=!1){W(t),v()},get isWorkspaceRoot(){return x()},set isWorkspaceRoot(t=!1){x(t),v()},get additionalActions(){return L()},set additionalActions(t=[]){L(t),v()},get showDeleteFileOption(){return m()},set showDeleteFileOption(t=!1){m(t),v()},get onFileDeleted(){return f()},set onFileDeleted(t=void 0){f(t),v()},$set:Ye,$on:(t,l)=>$e(d,t,l)};{let t=k(()=>E()!=="list");me(be,{get actions(){return e(he)},get menu(){return e(t)},get iconWeight(){return J()}})}var ye=tt(ve);return ke(),ye}export{Yt as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{t as D,bo as d,bw as P,b}from"./DUPdECze.js";import{bs as S,a7 as A,ay as C,W as M,bn as $,aA as m,aD as i,c9 as l}from"./CJxGDkBm.js";import{i as x}from"./BxPVGrtc.js";import{D as f,M as z}from"./
|
|
1
|
+
import{t as D,bo as d,bw as P,b}from"./DUPdECze.js";import{bs as S,a7 as A,ay as C,W as M,bn as $,aA as m,aD as i,c9 as l}from"./CJxGDkBm.js";import{i as x}from"./BxPVGrtc.js";import{D as f,M as z}from"./BMfv2h4V.js";import{S as B,p as N}from"./_vlUWDHN.js";import{N as W}from"./Dao2qcXJ.js";import{I$ as j,vs as E,bl as J}from"./Dou_hoaA.js";import{h as K}from"./BM_VA785.js";import{a9 as O}from"./R5qsERXh.js";function R(c,s){if(new.target)return D({component:R,...c});S(s,!0);let o=d(s,"kind",7),t=d(s,"source",7),a=d(s,"workspaceId",7);const g=new W,p=l(()=>{if(o()==="mermaid")return null;const e=g.parseMarkdown(`\`\`\`ws-block:diagram
|
|
2
2
|
${t()}
|
|
3
3
|
\`\`\``)[0],r=e?.primitive.type==="diagram"?JSON.stringify(e.primitive):t();return N(r,!0)});function k(e,r){if(!a()||!r.target)return;const n={openInAdjacentPanel:e.metaKey||e.ctrlKey,sourcePanelId:e.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0};r.type==="file"?j.dispatch(E(a(),r.target,n)):r.type==="note"&&K(O(r.target,a()),{...n,workspaceId:J(a()),event:e})}var w={get kind(){return o()},set kind(e){o(e),m()},get source(){return t()},set source(e){t(e),m()},get workspaceId(){return a()},set workspaceId(e){a(e),m()},$set:P,$on:(e,r)=>b(s,e,r)},u=A(),y=C(u);{var I=e=>{f(e,{kind:"mermaid",rendererOwnsActions:!0,children:(r,n)=>{z(r,{get code(){return t()},showExportButton:!0})},$$slots:{default:!0}})},h=e=>{f(e,{kind:"custom",children:(r,n)=>{{let v=l(()=>i(p)?.diagram??null),_=l(()=>i(p)?.error);B(r,{get diagram(){return i(v)},get source(){return t()},get sourceError(){return i(_)},onBindingClick:k})}},$$slots:{default:!0}})};x(y,e=>{o()==="mermaid"?e(I):e(h,-1)})}return M(c,u),$(w)}export{R as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as Mt}from"./
|
|
1
|
+
import{p as Mt}from"./DP8R2A_9.js";import{aZ as Nt,U as zt,Y as Lt,b0 as Tt,V as Xt,a_ as At,b as u,a6 as Et,W as Yt,q as J,ay as Q,aX as It,B as Bt,r as Ft,X as V}from"./BMfv2h4V.js";import{p as Rt}from"./B6Lw5fq5.js";var G=u((o,r)=>{const e=o<=1?o*100:o;if(e<0||e>100)throw new Error(`${r} must be between 0-1 (decimal) or 0-100 (percentage). Received: ${o}`);return e},"toPercent"),X=u((o,r,e)=>({x:G(r,`${e} evolution`),y:G(o,`${e} visibility`)}),"toCoordinates"),K=u(o=>{if(o){if(o==="+<>")return"bidirectional";if(o==="+<")return"backward";if(o==="+>")return"forward"}},"getFlowFromPort"),Ot=u(o=>{if(!o?.startsWith("+"))return{};const e=/^\+'([^']*)'/.exec(o)?.[1];return o.includes("<>")?{flow:"bidirectional",label:e}:o.includes("<")?{flow:"backward",label:e}:o.includes(">")?{flow:"forward",label:e}:{label:e}},"extractFlowFromArrow"),Wt=u((o,r)=>{if(Mt(o,r),o.size&&r.setSize(o.size.width,o.size.height),o.evolution){const e=o.evolution.stages.map(a=>a.secondName?`${a.name.trim()} / ${a.secondName.trim()}`:a.name.trim()),h=o.evolution.stages.filter(a=>a.boundary!==void 0).map(a=>a.boundary);r.updateAxes({stages:e,stageBoundaries:h})}if(o.anchors.forEach(e=>{const h=X(e.visibility,e.evolution,`Anchor "${e.name}"`);r.addNode(e.name,e.name,h.x,h.y,"anchor")}),o.components.forEach(e=>{const h=X(e.visibility,e.evolution,`Component "${e.name}"`),a=e.label?(e.label.negX?-1:1)*e.label.offsetX:void 0,d=e.label?(e.label.negY?-1:1)*e.label.offsetY:void 0,w=e.decorator?.strategy;r.addNode(e.name,e.name,h.x,h.y,"component",a,d,e.inertia,w)}),o.notes.forEach(e=>{const h=X(e.visibility,e.evolution,`Note "${e.text}"`);r.addNote(e.text,h.x,h.y)}),o.pipelines.forEach(e=>{const h=r.getNode(e.parent);if(!h||typeof h.y!="number")throw new Error(`Pipeline "${e.parent}" must reference an existing component with coordinates.`);const a=h.y;r.startPipeline(e.parent),e.components.forEach(d=>{const w=`${e.parent}_${d.name}`,C=d.label?(d.label.negX?-1:1)*d.label.offsetX:void 0,g=d.label?(d.label.negY?-1:1)*d.label.offsetY:void 0,R=G(d.evolution,`Pipeline component "${d.name}" evolution`);r.addNode(w,d.name,R,a,"pipeline-component",C,g),r.addPipelineComponent(e.parent,w)})}),o.links.forEach(e=>{const h=!!e.arrow&&(e.arrow.includes("-.->")||e.arrow.includes(".-."));let a=K(e.fromPort)??K(e.toPort);const{flow:d,label:w}=Ot(e.arrow);!a&&d&&(a=d);const C=e.linkLabel,g=w??C;r.addLink(r.resolveNodeId(e.from),r.resolveNodeId(e.to),h,g,a)}),o.evolves.forEach(e=>{const h=r.getNode(e.component);if(h?.y!==void 0){const a=G(e.target,`Evolve target for "${e.component}"`);r.addTrend(e.component,a,h.y)}}),o.annotations.length>0){const e=o.annotations[0],h=X(e.x,e.y,"Annotations box");r.setAnnotationsBox(h.x,h.y)}o.annotation.forEach(e=>{const h=X(e.x,e.y,`Annotation ${e.number}`);r.addAnnotation(e.number,[{x:h.x,y:h.y}],e.text)}),o.accelerators.forEach(e=>{const h=X(e.x,e.y,`Accelerator "${e.name}"`);r.addAccelerator(e.name,h.x,h.y)}),o.deaccelerators.forEach(e=>{const h=X(e.x,e.y,`Deaccelerator "${e.name}"`);r.addDeaccelerator(e.name,h.x,h.y)})},"populateDb"),tt={parser:{yy:void 0},parse:u(async o=>{const r=await Rt("wardley",o);Q.debug(r);const e=tt.parser?.yy;if(!e||typeof e.addNode!="function")throw new Error("parser.parser?.yy was not a WardleyDB. This is due to a bug within Mermaid, please report this issue at https://github.com/mermaid-js/mermaid/issues.");Wt(r,e)},"parse")},E,Dt=(E=class{constructor(){this.nodes=new Map,this.links=[],this.trends=new Map,this.pipelines=new Map,this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.axes={}}addNode(r){const e=this.nodes.get(r.id)??{id:r.id,label:r.label},h={...e,...r,className:r.className??e.className,labelOffsetX:r.labelOffsetX??e.labelOffsetX,labelOffsetY:r.labelOffsetY??e.labelOffsetY};this.nodes.set(r.id,h)}addLink(r){this.links.push(r)}addTrend(r){this.trends.set(r.nodeId,r)}startPipeline(r){this.pipelines.set(r,{nodeId:r,componentIds:[]});const e=this.nodes.get(r);e&&(e.isPipelineParent=!0)}addPipelineComponent(r,e){const h=this.pipelines.get(r);h&&h.componentIds.push(e);const a=this.nodes.get(e);a&&(a.inPipeline=!0)}addAnnotation(r){this.annotations.push(r)}addNote(r){this.notes.push(r)}addAccelerator(r){this.accelerators.push(r)}addDeaccelerator(r){this.deaccelerators.push(r)}setAnnotationsBox(r,e){this.annotationsBox={x:r,y:e}}setAxes(r){this.axes={...this.axes,...r}}setSize(r,e){this.size={width:r,height:e}}getNode(r){return this.nodes.get(r)}resolveNodeId(r){if(this.nodes.has(r))return r;for(const[e,h]of this.nodes)if(h.label===r)return e;return r}build(){const r=[];for(const e of this.nodes.values()){if(typeof e.x!="number"||typeof e.y!="number")throw new Error(`Node "${e.label}" is missing coordinates`);r.push(e)}return{nodes:r,links:[...this.links],trends:[...this.trends.values()],pipelines:[...this.pipelines.values()],annotations:[...this.annotations],notes:[...this.notes],accelerators:[...this.accelerators],deaccelerators:[...this.deaccelerators],annotationsBox:this.annotationsBox,axes:{...this.axes},size:this.size}}clear(){this.nodes.clear(),this.links=[],this.trends.clear(),this.pipelines.clear(),this.annotations=[],this.notes=[],this.accelerators=[],this.deaccelerators=[],this.annotationsBox=void 0,this.axes={},this.size=void 0}},u(E,"WardleyBuilder"),E),k=new Dt;function et(){return V()["wardley-beta"]}u(et,"getConfig");function at(o,r,e,h,a,d,w,C,g){k.addNode({id:o,label:r,x:e,y:h,className:a,labelOffsetX:d,labelOffsetY:w,inertia:C,sourceStrategy:g})}u(at,"addNode");function rt(o,r,e=!1,h,a){k.addLink({source:o,target:r,dashed:e,label:h,flow:a})}u(rt,"addLink");function ot(o,r,e){k.addTrend({nodeId:o,targetX:r,targetY:e})}u(ot,"addTrend");function nt(o,r,e){k.addAnnotation({number:o,coordinates:r,text:e})}u(nt,"addAnnotation");function st(o,r,e){k.addNote({text:o,x:r,y:e})}u(st,"addNote");function it(o,r,e){k.addAccelerator({name:o,x:r,y:e})}u(it,"addAccelerator");function dt(o,r,e){k.addDeaccelerator({name:o,x:r,y:e})}u(dt,"addDeaccelerator");function lt(o,r){k.setAnnotationsBox(o,r)}u(lt,"setAnnotationsBox");function ct(o,r){k.setSize(o,r)}u(ct,"setSize");function pt(o){k.startPipeline(o)}u(pt,"startPipeline");function ft(o,r){k.addPipelineComponent(o,r)}u(ft,"addPipelineComponent");function ht(o){k.setAxes(o)}u(ht,"updateAxes");function xt(o){return k.getNode(o)}u(xt,"getNode");function gt(o){return k.resolveNodeId(o)}u(gt,"resolveNodeId");function yt(){return k.build()}u(yt,"getWardleyData");function ut(){k.clear(),Ft()}u(ut,"clear");var Gt={getConfig:et,addNode:at,addLink:rt,addTrend:ot,addAnnotation:nt,addNote:st,addAccelerator:it,addDeaccelerator:dt,setAnnotationsBox:lt,setSize:ct,startPipeline:pt,addPipelineComponent:ft,updateAxes:ht,getNode:xt,resolveNodeId:gt,getWardleyData:yt,clear:ut,setAccTitle:At,getAccTitle:Xt,setDiagramTitle:Tt,getDiagramTitle:Lt,getAccDescription:zt,setAccDescription:Nt},qt=["Genesis","Custom Built","Product","Commodity"],Ht=u(()=>{const{themeVariables:o}=V();return{backgroundColor:o.wardley?.backgroundColor??o.background??"#fff",axisColor:o.wardley?.axisColor??"#000",axisTextColor:o.wardley?.axisTextColor??o.primaryTextColor??"#222",gridColor:o.wardley?.gridColor??"rgba(100, 100, 100, 0.2)",componentFill:o.wardley?.componentFill??"#fff",componentStroke:o.wardley?.componentStroke??"#000",componentLabelColor:o.wardley?.componentLabelColor??o.primaryTextColor??"#222",linkStroke:o.wardley?.linkStroke??"#000",evolutionStroke:o.wardley?.evolutionStroke??"#dc3545",annotationStroke:o.wardley?.annotationStroke??"#000",annotationTextColor:o.wardley?.annotationTextColor??o.primaryTextColor??"#222",annotationFill:o.wardley?.annotationFill??o.background??"#fff"}},"getTheme"),jt=u(()=>{const o=V()["wardley-beta"];return{width:o?.width??900,height:o?.height??600,padding:o?.padding??48,nodeRadius:o?.nodeRadius??6,nodeLabelOffset:o?.nodeLabelOffset??8,axisFontSize:o?.axisFontSize??12,labelFontSize:o?.labelFontSize??10,showGrid:o?.showGrid??!1,useMaxWidth:o?.useMaxWidth??!0}},"getConfigValues"),Vt=u((o,r,e,h)=>{Q.debug(`Rendering Wardley map
|
|
2
2
|
`+o);const a=jt(),d=Ht(),w=a.nodeRadius*1.6,C=h.db,g=C.getWardleyData(),R=C.getDiagramTitle(),S=g.size?.width??a.width,b=g.size?.height??a.height,Y=It(r);Y.selectAll("*").remove(),Bt(Y,b,S,a.useMaxWidth),Y.attr("viewBox",`0 0 ${S} ${b}`);const v=Y.append("g").attr("class","wardley-map"),q=Y.append("defs");q.append("marker").attr("id",`arrow-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",6).attr("markerHeight",6).attr("orient","auto-start-reverse").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.evolutionStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-end-${r}`).attr("viewBox","0 0 10 10").attr("refX",9).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 0 0 L 10 5 L 0 10 z").attr("fill",d.linkStroke).attr("stroke","none"),q.append("marker").attr("id",`link-arrow-start-${r}`).attr("viewBox","0 0 10 10").attr("refX",1).attr("refY",5).attr("markerWidth",5).attr("markerHeight",5).attr("orient","auto").append("path").attr("d","M 10 0 L 0 5 L 10 10 z").attr("fill",d.linkStroke).attr("stroke","none"),v.append("rect").attr("class","wardley-background").attr("width",S).attr("height",b).attr("fill",d.backgroundColor);const I=S-a.padding*2,B=b-a.padding*2;R&&v.append("text").attr("class","wardley-title").attr("x",S/2).attr("y",a.padding/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize*1.05).attr("font-weight","bold").attr("text-anchor","middle").attr("dominant-baseline","middle").text(R);const z=u(t=>a.padding+t/100*I,"projectX"),L=u(t=>b-a.padding-t/100*B,"projectY"),O=v.append("g").attr("class","wardley-axes");O.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1),O.append("line").attr("x1",a.padding).attr("x2",a.padding).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.axisColor).attr("stroke-width",1);const wt=g.axes.xLabel??"Evolution",mt=g.axes.yLabel??"Visibility";O.append("text").attr("class","wardley-axis-label wardley-axis-label-x").attr("x",a.padding+I/2).attr("y",b-a.padding/4).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").text(wt),O.append("text").attr("class","wardley-axis-label wardley-axis-label-y").attr("x",a.padding/3).attr("y",a.padding+B/2).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize).attr("font-weight","bold").attr("text-anchor","middle").attr("transform",`rotate(-90 ${a.padding/3} ${a.padding+B/2})`).text(mt);const F=g.axes.stages&&g.axes.stages.length>0?g.axes.stages:qt;if(F.length>0){const t=v.append("g").attr("class","wardley-stages"),s=g.axes.stageBoundaries,n=[];if(s&&s.length===F.length){let i=0;s.forEach(p=>{n.push({start:i,end:p}),i=p})}else{const i=1/F.length;F.forEach((p,l)=>{n.push({start:l*i,end:(l+1)*i})})}F.forEach((i,p)=>{const l=n[p],f=a.padding+l.start*I,x=a.padding+l.end*I,y=(f+x)/2;p>0&&t.append("line").attr("x1",f).attr("x2",f).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke","#000").attr("stroke-width",1).attr("stroke-dasharray","5 5").attr("opacity",.8),t.append("text").attr("class","wardley-stage-label").attr("x",y).attr("y",b-a.padding/1.5).attr("fill",d.axisTextColor).attr("font-size",a.axisFontSize-2).attr("text-anchor","middle").text(i)})}if(a.showGrid){const t=v.append("g").attr("class","wardley-grid");for(let s=1;s<4;s++){const n=s/4,i=a.padding+I*n;t.append("line").attr("x1",i).attr("x2",i).attr("y1",a.padding).attr("y2",b-a.padding).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6"),t.append("line").attr("x1",a.padding).attr("x2",S-a.padding).attr("y1",b-a.padding-B*n).attr("y2",b-a.padding-B*n).attr("stroke",d.gridColor).attr("stroke-dasharray","2 6")}}const c=new Map;if(g.nodes.forEach(t=>{c.set(t.id,{x:z(t.x),y:L(t.y),node:t})}),g.pipelines.length>0){const t=v.append("g").attr("class","wardley-pipelines"),s=v.append("g").attr("class","wardley-pipeline-links");g.pipelines.forEach(n=>{if(n.componentIds.length===0)return;const i=n.componentIds.map(x=>({id:x,pos:c.get(x),node:g.nodes.find(y=>y.id===x)})).filter(x=>x.pos&&x.node).sort((x,y)=>x.node.x-y.node.x);for(let x=0;x<i.length-1;x++){const y=i[x],m=i[x+1];s.append("line").attr("class","wardley-pipeline-evolution-link").attr("x1",y.pos.x).attr("y1",y.pos.y).attr("x2",m.pos.x).attr("y2",m.pos.y).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4")}let p=1/0,l=-1/0,f=0;if(n.componentIds.forEach(x=>{const y=c.get(x);y&&(p=Math.min(p,y.x),l=Math.max(l,y.x),f=y.y)}),p!==1/0&&l!==-1/0){const y=a.nodeRadius*4,m=f-y/2,P=c.get(n.nodeId);if(P){const N=(p+l)/2;P.x=N,P.y=m-w/6}t.append("rect").attr("class","wardley-pipeline-box").attr("x",p-15).attr("y",m).attr("width",l-p+30).attr("height",y).attr("fill","none").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}})}const _=v.append("g").attr("class","wardley-links"),Z=new Map;g.pipelines.forEach(t=>{Z.set(t.nodeId,new Set(t.componentIds))});const U=g.links.filter(t=>!(!c.has(t.source)||!c.has(t.target)||Z.get(t.target)?.has(t.source)));_.selectAll("line").data(U).enter().append("line").attr("class",t=>`wardley-link${t.dashed?" wardley-link--dashed":""}`).attr("x1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.x+l/x*p}).attr("y1",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.source).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f);return s.y+f/x*p}).attr("x2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.x+l/x*p}).attr("y2",t=>{const s=c.get(t.source),n=c.get(t.target),p=g.nodes.find(y=>y.id===t.target).isPipelineParent?w/Math.sqrt(2):a.nodeRadius,l=s.x-n.x,f=s.y-n.y,x=Math.sqrt(l*l+f*f);return n.y+f/x*p}).attr("stroke",d.linkStroke).attr("stroke-width",1).attr("stroke-dasharray",t=>t.dashed?"6 6":null).attr("marker-end",t=>t.flow==="forward"||t.flow==="bidirectional"?`url(#link-arrow-end-${r})`:null).attr("marker-start",t=>t.flow==="backward"||t.flow==="bidirectional"?`url(#link-arrow-start-${r})`:null),_.selectAll("text").data(U.filter(t=>t.label)).enter().append("text").attr("class","wardley-link-label").attr("x",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=n.y-s.y,l=n.x-s.x,f=Math.sqrt(l*l+p*p),x=8,y=p/f;return i+y*x}).attr("y",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.y+n.y)/2,p=n.x-s.x,l=n.y-s.y,f=Math.sqrt(p*p+l*l),x=8,y=-p/f;return i+y*x}).attr("fill",d.axisTextColor).attr("font-size",a.labelFontSize).attr("text-anchor","middle").attr("dominant-baseline","middle").attr("transform",t=>{const s=c.get(t.source),n=c.get(t.target),i=(s.x+n.x)/2,p=(s.y+n.y)/2,l=n.x-s.x,f=n.y-s.y,x=Math.sqrt(l*l+f*f),y=8,m=f/x,P=-l/x,N=i+m*y,W=p+P*y;let A=Math.atan2(f,l)*180/Math.PI;return(A>90||A<-90)&&(A+=180),`rotate(${A} ${N} ${W})`}).text(t=>t.label);const kt=v.append("g").attr("class","wardley-trends"),bt=g.trends.map(t=>{const s=c.get(t.nodeId);if(!s)return null;const n=z(t.targetX),i=L(t.targetY),p=n-s.x,l=i-s.y,f=Math.sqrt(p*p+l*l),x=a.nodeRadius+2,y=f>x?n-p/f*x:n,m=f>x?i-l/f*x:i;return{origin:s,targetX:n,targetY:i,adjustedX2:y,adjustedY2:m}}).filter(t=>t!==null);kt.selectAll("line").data(bt).enter().append("line").attr("class","wardley-trend").attr("x1",t=>t.origin.x).attr("y1",t=>t.origin.y).attr("x2",t=>t.adjustedX2).attr("y2",t=>t.adjustedY2).attr("stroke",d.evolutionStroke).attr("stroke-width",1).attr("stroke-dasharray","4 4").attr("marker-end",`url(#arrow-${r})`);const M=v.append("g").attr("class","wardley-nodes").selectAll("g").data(g.nodes).enter().append("g").attr("class",t=>["wardley-node",t.className?`wardley-node--${t.className}`:""].filter(Boolean).join(" "));M.filter(t=>t.sourceStrategy==="outsource").append("circle").attr("class","wardley-outsource-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#666").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="buy").append("circle").attr("class","wardley-buy-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#ccc").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.sourceStrategy==="build").append("circle").attr("class","wardley-build-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","#eee").attr("stroke","#000").attr("stroke-width",1);const T=M.filter(t=>t.sourceStrategy==="market");T.append("circle").attr("class","wardley-market-overlay").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius*2).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>!t.isPipelineParent&&t.sourceStrategy!=="market"&&t.className!=="anchor").append("circle").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y).attr("r",a.nodeRadius).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1);const H=a.nodeRadius*.7,$=a.nodeRadius*1.2;if(T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x).attr("y1",t=>c.get(t.id).y-$).attr("x2",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y2",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("line").attr("class","wardley-market-line").attr("x1",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("y1",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("x2",t=>c.get(t.id).x).attr("y2",t=>c.get(t.id).y-$).attr("stroke",d.componentStroke).attr("stroke-width",1),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x).attr("cy",t=>c.get(t.id).y-$).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x-$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),T.append("circle").attr("class","wardley-market-dot").attr("cx",t=>c.get(t.id).x+$*Math.cos(Math.PI/6)).attr("cy",t=>c.get(t.id).y+$*Math.sin(Math.PI/6)).attr("r",H).attr("fill","white").attr("stroke",d.componentStroke).attr("stroke-width",2),M.filter(t=>t.isPipelineParent===!0).append("rect").attr("x",t=>c.get(t.id).x-w/2).attr("y",t=>c.get(t.id).y-w/2).attr("width",w).attr("height",w).attr("fill",d.componentFill).attr("stroke",d.componentStroke).attr("stroke-width",1),M.filter(t=>t.inertia===!0).append("line").attr("class","wardley-inertia").attr("x1",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y1",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y-n/2}).attr("x2",t=>{const s=c.get(t.id);let n=t.isPipelineParent?w/2+15:a.nodeRadius+15;return t.sourceStrategy&&(n+=a.nodeRadius+10),s.x+n}).attr("y2",t=>{const s=c.get(t.id),n=t.isPipelineParent?w:a.nodeRadius*2;return s.y+n/2}).attr("stroke",d.componentStroke).attr("stroke-width",6),M.append("text").attr("x",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetX!==void 0?s.x+t.labelOffsetX:s.x;let n=a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetX===void 0&&(n+=10);const i=t.labelOffsetX??n;return s.x+i}).attr("y",t=>{const s=c.get(t.id);if(t.className==="anchor")return t.labelOffsetY!==void 0?s.y+t.labelOffsetY:s.y-3;let n=-a.nodeLabelOffset;t.sourceStrategy&&t.labelOffsetY===void 0&&(n-=10);const i=t.labelOffsetY??n;return s.y+i}).attr("class","wardley-node-label").attr("fill",t=>t.className==="evolved"?d.evolutionStroke:t.className==="anchor"?"#000":d.componentLabelColor).attr("font-size",a.labelFontSize).attr("font-weight",t=>t.className==="anchor"?"bold":"normal").attr("text-anchor",t=>t.className==="anchor"?"middle":"start").attr("dominant-baseline",t=>t.className==="anchor"?"middle":"auto").text(t=>t.label),g.annotations.length>0){const t=v.append("g").attr("class","wardley-annotations");if(g.annotations.forEach(s=>{const n=s.coordinates.map(i=>({x:z(i.x),y:L(i.y)}));if(n.length>1)for(let i=0;i<n.length-1;i++)t.append("line").attr("class","wardley-annotation-line").attr("x1",n[i].x).attr("y1",n[i].y).attr("x2",n[i+1].x).attr("y2",n[i+1].y).attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("stroke-dasharray","4 4");n.forEach(i=>{const p=t.append("g").attr("class","wardley-annotation");p.append("circle").attr("cx",i.x).attr("cy",i.y).attr("r",10).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5),p.append("text").attr("x",i.x).attr("y",i.y).attr("text-anchor","middle").attr("dominant-baseline","central").attr("font-size",10).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.number)})}),g.annotationsBox){let s=z(g.annotationsBox.x),n=L(g.annotationsBox.y);const i=10,p=16,l=11,f=t.append("g").attr("class","wardley-annotations-box"),x=[...g.annotations].filter(m=>m.text).sort((m,P)=>m.number-P.number),y=[];if(x.forEach((m,P)=>{const N=f.append("text").attr("x",s+i).attr("y",n+i+(P+1)*p).attr("font-size",l).attr("fill",d.axisTextColor).attr("text-anchor","start").attr("dominant-baseline","middle").text(`${m.number}. ${m.text}`);y.push(N)}),y.length>0){let m=0,P=0;y.forEach(j=>{const D=j.node(),Ct=D.getComputedTextLength();m=Math.max(m,Ct);const St=D.getBBox();P=Math.max(P,St.height)});const N=m+i*2+105,W=x.length*p+i*2+P/2,A=a.padding,$t=S-a.padding-N,vt=a.padding,Pt=b-a.padding-W;s=Math.max(A,Math.min(s,$t)),n=Math.max(vt,Math.min(n,Pt)),y.forEach((j,D)=>{j.attr("x",s+i).attr("y",n+i+(D+1)*p)}),f.insert("rect","text").attr("x",s).attr("y",n).attr("width",N).attr("height",W).attr("fill","white").attr("stroke",d.axisColor).attr("stroke-width",1.5).attr("rx",4).attr("ry",4)}}}if(g.notes.length>0){const t=v.append("g").attr("class","wardley-notes");g.notes.forEach(s=>{const n=z(s.x),i=L(s.y);t.append("text").attr("x",n).attr("y",i).attr("text-anchor","start").attr("font-size",11).attr("fill",d.axisTextColor).attr("font-weight","bold").text(s.text)})}if(g.accelerators.length>0){const t=v.append("g").attr("class","wardley-accelerators");g.accelerators.forEach(s=>{const n=z(s.x),i=L(s.y),p=60,l=30,f=20,x=`
|
|
3
3
|
M ${n} ${i-l/2}
|
|
4
4
|
L ${n+p-f} ${i-l/2}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as pt,bo as S,bw as bt,bq as Pt,b as Ct,bm as vt,bs as h}from"./DUPdECze.js";import{bs as $t,ca as E,aD as n,c9 as i,a7 as L,ay as w,W as _,bn as kt,bS as yt,aA as B,aB as St}from"./CJxGDkBm.js";import{i as J}from"./BxPVGrtc.js";import{k as wt}from"./Db6vgmuJ.js";import{c as _t}from"./DKOGfBeL.js";import{t as Bt}from"./D2MmXC4A.js";import{I$ as u,eB as It,eC as Wt,Jz as Tt,JO as Ut,JE as Dt,vg as Rt,og as O}from"./Dou_hoaA.js";import{g as At}from"./BrMXrCxP.js";import{bL as Ft,bN as Ht,dD as Nt}from"./R5qsERXh.js";import{C as f}from"./DypB-Dwi.js";import"./
|
|
1
|
+
import{t as pt,bo as S,bw as bt,bq as Pt,b as Ct,bm as vt,bs as h}from"./DUPdECze.js";import{bs as $t,ca as E,aD as n,c9 as i,a7 as L,ay as w,W as _,bn as kt,bS as yt,aA as B,aB as St}from"./CJxGDkBm.js";import{i as J}from"./BxPVGrtc.js";import{k as wt}from"./Db6vgmuJ.js";import{c as _t}from"./DKOGfBeL.js";import{t as Bt}from"./D2MmXC4A.js";import{I$ as u,eB as It,eC as Wt,Jz as Tt,JO as Ut,JE as Dt,vg as Rt,og as O}from"./Dou_hoaA.js";import{g as At}from"./BrMXrCxP.js";import{bL as Ft,bN as Ht,dD as Nt}from"./R5qsERXh.js";import{C as f}from"./DypB-Dwi.js";import"./DcdXOwGw.js";import"./DYGZj8tM.js";import"./NvPqoUzX.js";import{bg as Mt}from"./DWlZtz5u.js";import"./DeOvWG_V.js";/* empty css */import{T as xt}from"./DAV1dgP_.js";import"./BlNY__m5.js";import{M as qt}from"./D2QYaH-I.js";import{V as Et}from"./Cpjf0qUO.js";import{O as Lt}from"./fVUImVux.js";import{bT as Jt,bN as Ot,b8 as Vt}from"./Dao2qcXJ.js";import{i as Kt}from"./H2jLkRRS.js";var zt=St("<!> <!>",1);function Gt(I,p){if(new.target)return pt({component:Gt,...I});$t(p,!0);const W=()=>h(et,"$workspace",l),P=()=>h(Y,"$ftChanges$",l),V=()=>h(Z,"$ftCommits$",l),T=()=>h(Q,"$foldUnchanged",l),U=()=>h(j,"$lineWrapping",l),D=()=>h(X,"$diffSideBySide",l),[l,K]=Pt(),z=t=>{Et(t,{embedded:!0,get foldEnabled(){return T()},onToggleFold:()=>u.dispatch(Dt()),get wrapEnabled(){return U()},onToggleWrap:()=>u.dispatch(Ut()),get splitEnabled(){return D()},onToggleSplit:()=>u.dispatch(Tt())})},G=t=>{var e=zt(),r=w(e);{let m=i(()=>vt.layout_diffHeader_goToFile_tooltip());_t(r,()=>qt,(y,ht)=>{ht(y,{get icon(){return Mt},get label(){return n(m)},onclick:jt=>ft()})})}var s=yt(r,2);{var d=m=>{Lt(m,{get filePath(){return n($)},get workspaceId(){return o()},isDirectory:!1,embedded:!0,get workspaceFolderPath(){return n(v)}})};J(s,m=>{n($)&&m(d)})}_(t,e)},j=Jt(),Q=Ot(),X=Vt();let a=S(p,"tab",7),o=S(p,"workspaceId",7),b=S(p,"isActive",7);const C=Bt(()=>o()),Y=Ft(C),Z=Ht(C),tt=new Set([f.Committed,f.Pushed,f.PullRequest,f.Merged,f.Trunk]),R=At(),et=Nt(C),nt=i(()=>W()?.worktreePath||W()?.repositoryPath||void 0);E(()=>{const t=o();if(!(!b()||!t||n(c)))return u.dispatch(It(t,"all")),()=>u.dispatch(Wt(t,"all"))});const c=i(()=>a().data?.gitRootId),A=i(()=>a().data?.gitRootPath),v=i(()=>n(A)||n(nt)),$=i(()=>a().diffPath&&n(v)?Kt(a().diffPath)?a().diffPath:`${n(v)}/${a().diffPath}`:null);function F(t,e){return!!(t.file===e||t.relativePath===e||t.relativePath&&e.endsWith("/"+t.relativePath)||t.file&&e.endsWith("/"+t.file)||t.relativePath&&t.relativePath.endsWith("/"+e)||t.file&&t.file.endsWith("/"+e))}function H(t){return!t||n(c)?null:P().find(e=>F(e,t)&&(e.stage==="staged"||e.stage==="unstaged"))??null}function at(t){if(!t||n(c))return null;let e=null,r=-1/0;for(const s of P()){if(!F(s,t)||!tt.has(s.stage)||!s.commitHash)continue;const d=s.attribution?.timestamp??0;d>=r&&(e=s,r=d)}return e}function it(t,e){return!!(t===e||e.endsWith("/"+t)||t.endsWith("/"+e))}function rt(t){if(!t||n(c))return null;for(const e of V())if(e?.hash&&e.files?.some(r=>r?.path&&it(r.path,t)))return{id:`diff-${t}-${e.hash}`,file:t,relativePath:t,status:"modified",stage:f.Committed,commitHash:e.hash,stats:{additions:0,deletions:0},attribution:{timestamp:e.timestamp??Date.now()}};return null}const N=i(()=>a().diffPath?H(a().diffPath):null),st=i(()=>{if(!a().diffPath)return 0;const t=H(a().diffPath),e=P().length;if(t){const r=t.stage==="staged"?1:t.stage==="unstaged"?2:3,s=(t.stats?.additions||0)+(t.stats?.deletions||0),d=t.attribution?.timestamp?t.attribution.timestamp%1e5:0;return r*1e6+s*1e3+d+e}return e}),g=i(()=>a().data?.change),M=i(()=>a().data?.branchBaseRef),x=i(()=>a().data?.branchBaseCommitSha),ot=i(()=>!!(n(M)||n(x))),k=i(()=>{if(n(g)?.commitHash)return n(g);if(n(N))return n(N);if(n(ot)&&n(g))return n(g);const t=at(a().diffPath??null);if(t)return t;const e=rt(a().diffPath??null);return e||(n(g)?n(g):{id:`diff-${a().diffPath}`,file:a().diffPath||"",relativePath:a().diffPath||"",status:"modified",stage:f.Unstaged,stats:{additions:0,deletions:0},attribution:{timestamp:Date.now()}})});function ft(t){if(!a().diffPath)return;const r={type:"file",title:a().diffPath.split("/").pop()||a().diffPath,closable:!0,filePath:n($)||a().diffPath,workspaceId:o()};u.dispatch(Rt(o(),r))}E(()=>{!R||!b()||R.registerActions({display:z,actions:G})});function dt(t,e){u.dispatch(O(o(),crypto.randomUUID(),{kind:"stageHunk",filePath:t,hunkPatch:e,source:"diff"}))}function ut(t,e){u.dispatch(O(o(),crypto.randomUUID(),{kind:"unstageHunk",filePath:t,hunkPatch:e,source:"diff"}))}var ct={get tab(){return a()},set tab(t){a(t),B()},get workspaceId(){return o()},set workspaceId(t){o(t),B()},get isActive(){return b()},set isActive(t){b(t),B()},$set:bt,$on:(t,e)=>Ct(p,t,e)},q=L(),mt=w(q);{var lt=t=>{var e=L(),r=w(e);wt(r,()=>a().diffPath,s=>{{let d=i(()=>D()?"split":"unified"),m=i(()=>!n(c)&&n(k).stage===f.Unstaged?dt:void 0),y=i(()=>!n(c)&&n(k).stage===f.Staged?ut:void 0);xt(s,{get active(){return b()},get change(){return n(k)},get workspaceId(){return o()},get viewMode(){return n(d)},get foldUnchanged(){return T()},get lineWrapping(){return U()},get refreshKey(){return n(st)},get branchBaseRef(){return n(M)},get branchBaseCommitSha(){return n(x)},get gitRootId(){return n(c)},get gitRootPath(){return n(A)},get onStageHunk(){return n(m)},get onUnstageHunk(){return n(y)}})}}),_(t,e)};J(mt,t=>{a().diffPath&&t(lt)})}_(I,q);var gt=kt(ct);return K(),gt}export{Gt as default};
|