@intent-hq/web 2.374.1 → 2.374.2
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/{VgpkVPqy.js → 3cKBmyAG.js} +1 -1
- package/web/app/immutable/chunks/{cZ6WbhzF.js → 4QO0cu3z.js} +4 -4
- package/web/app/immutable/chunks/{B5RGOddd.js → 5ubKG1fw.js} +2 -2
- package/web/app/immutable/chunks/{C1VzVy_T.js → 7u4ZW-_Z.js} +1 -1
- package/web/app/immutable/chunks/{CI03it4q.js → 85wf0Cv8.js} +1 -1
- package/web/app/immutable/chunks/{BFBRQlnB.js → A9zSZ8H9.js} +1 -1
- package/web/app/immutable/chunks/{DqeGDed0.js → ATfBW89h.js} +1 -1
- package/web/app/immutable/chunks/{ChuuGcaj.js → B-4SMsb_.js} +3 -3
- package/web/app/immutable/chunks/{DfrnAh60.js → B0GuR3bJ.js} +13 -13
- package/web/app/immutable/chunks/{CMSXP3JK.js → B1JbKfg-.js} +1 -1
- package/web/app/immutable/chunks/{BFSIy5Dg.js → B3U3T8_Z.js} +3 -3
- package/web/app/immutable/chunks/{JJ3RCq0j.js → B7M-47Is.js} +1 -1
- package/web/app/immutable/chunks/{Dya4in_M.js → B8jCEPhi.js} +1 -1
- package/web/app/immutable/chunks/{D-_a8-qv.js → B9BY7BTd.js} +1 -1
- package/web/app/immutable/chunks/{qZOpciCD.js → BA5rGp3P.js} +1 -1
- package/web/app/immutable/chunks/{Bu_b7Geq.js → BAUDY8ju.js} +1 -1
- package/web/app/immutable/chunks/{DWiCzmLc.js → BCAvWplY.js} +1 -1
- package/web/app/immutable/chunks/{C4qomPfT.js → BDX_Xsmi.js} +1 -1
- package/web/app/immutable/chunks/{CykMvH93.js → BEs8P5qJ.js} +1 -1
- package/web/app/immutable/chunks/{8iM9mVCJ.js → BGUKyP63.js} +1 -1
- package/web/app/immutable/chunks/{CZA7HKg8.js → BIkmu8XX.js} +1 -1
- package/web/app/immutable/chunks/{D91ZkM-_.js → BMrvDo7v.js} +1 -1
- package/web/app/immutable/chunks/{BfjyDFQP.js → BOf4ykdJ.js} +1 -1
- package/web/app/immutable/chunks/{B1WcmQpq.js → BPK1anoi.js} +1 -1
- package/web/app/immutable/chunks/{CcBYgr_O.js → BQWRYuYV.js} +1 -1
- package/web/app/immutable/chunks/{CBFYLXFF.js → BTLE7W-J.js} +1 -1
- package/web/app/immutable/chunks/{C8IXZPNs.js → BVhdEiOI.js} +2 -2
- package/web/app/immutable/chunks/{DyvQorI4.js → BVpl8e4e.js} +1 -1
- package/web/app/immutable/chunks/{QVs7xD_-.js → BXm1LOV6.js} +1 -1
- package/web/app/immutable/chunks/{CkF26rCa.js → BYoDJRDO.js} +1 -1
- package/web/app/immutable/chunks/{DGGMIXhj.js → B_T-BNgN.js} +2 -2
- package/web/app/immutable/chunks/{MvtlzB8k.js → B_rOdNUT.js} +1 -1
- package/web/app/immutable/chunks/{I0qWsqIQ.js → BaUyyVaF.js} +2 -2
- package/web/app/immutable/chunks/{zLwkenCD.js → BalRQ77x.js} +1 -1
- package/web/app/immutable/chunks/{CiJzGYSi.js → Bb8U_oXl.js} +1 -1
- package/web/app/immutable/chunks/{Dfqr3ucI.js → BcCmxwSj.js} +1 -1
- package/web/app/immutable/chunks/{AWXowPxU.js → BcM59Lcv.js} +1 -1
- package/web/app/immutable/chunks/{Bnhl7xZz.js → BdtL69yP.js} +1 -1
- package/web/app/immutable/chunks/{D5wSh12h.js → Be3ctlCz.js} +1 -1
- package/web/app/immutable/chunks/{CHfIP-Ca.js → Bg5oaQDG.js} +1 -1
- package/web/app/immutable/chunks/{IOUuDzhl.js → BiVcCGFj.js} +3 -3
- package/web/app/immutable/chunks/{BdEeTGSl.js → BiekSSQx.js} +1 -1
- package/web/app/immutable/chunks/{QWptVHsb.js → Bj-YBxcA.js} +1 -1
- package/web/app/immutable/chunks/{Cn1QrsR7.js → Bm8gOyQA.js} +1 -1
- package/web/app/immutable/chunks/{M2ziLO4-.js → Bo-dnNXZ.js} +1 -1
- package/web/app/immutable/chunks/{R7rkruRO.js → BoIx_pzM.js} +1 -1
- package/web/app/immutable/chunks/{DcgZLPGn.js → Boj7sQg1.js} +1 -1
- package/web/app/immutable/chunks/{DwGC3Qoc.js → BsmtfVfM.js} +1 -1
- package/web/app/immutable/chunks/{Dhf5PPGB.js → BtIGJq9M.js} +1 -1
- package/web/app/immutable/chunks/{DAbdqRSx.js → Bw79RGVy.js} +4 -4
- package/web/app/immutable/chunks/{C0urABBN.js → BwxJWPNn.js} +1 -1
- package/web/app/immutable/chunks/{CI8lfy7e.js → BzsWb2DZ.js} +1 -1
- package/web/app/immutable/chunks/{iwYLzKdV.js → Bzwng2vU.js} +1 -1
- package/web/app/immutable/chunks/{B2Arx0ZF.js → C23BHMTF.js} +1 -1
- package/web/app/immutable/chunks/{B9zxG49e.js → C2RXgXeo.js} +1 -1
- package/web/app/immutable/chunks/{BPqj6Qvi.js → C7p2lOwL.js} +1 -1
- package/web/app/immutable/chunks/{C-1CqQ1f.js → CAYmzy7n.js} +1 -1
- package/web/app/immutable/chunks/{CkGI1ZG-.js → CDt7gkIg.js} +1 -1
- package/web/app/immutable/chunks/{o1xI68Cv.js → CFd4ikzx.js} +3 -3
- package/web/app/immutable/chunks/{CU4TDhZp.js → CKLF9hRU.js} +2 -2
- package/web/app/immutable/chunks/{C6Y4L69O.js → COUouSsQ.js} +1 -1
- package/web/app/immutable/chunks/{BlbJ4pnj.js → CPloqKhj.js} +1 -1
- package/web/app/immutable/chunks/{CeAbChdf.js → CTAiPv85.js} +1 -1
- package/web/app/immutable/chunks/{DhTidcoi.js → CTKxd-aq.js} +1 -1
- package/web/app/immutable/chunks/{CG5Ujj5n.js → CTc2r7_5.js} +1 -1
- package/web/app/immutable/chunks/{5JkhMlm8.js → CVA4h5nu.js} +1 -1
- package/web/app/immutable/chunks/{Bx_Vy-8F.js → CWAFstnw.js} +1 -1
- package/web/app/immutable/chunks/{BE6Jwt_-.js → CWdVki31.js} +2 -2
- package/web/app/immutable/chunks/{eUuFvR6M.js → CY3iiE5t.js} +1 -1
- package/web/app/immutable/chunks/{BlBjpUY-.js → CYrmrI7Y.js} +2 -2
- package/web/app/immutable/chunks/{JFDbnVgN.js → C_lt_MLT.js} +1 -1
- package/web/app/immutable/chunks/{Dm8F4oqT.js → CaA0sSW1.js} +2 -2
- package/web/app/immutable/chunks/{KLcMYBf-.js → CeKzyAwj.js} +1 -1
- package/web/app/immutable/chunks/{BXUbR1fc.js → CgrfkEos.js} +1 -1
- package/web/app/immutable/chunks/{DaNITilt.js → ColX8Rl-.js} +1 -1
- package/web/app/immutable/chunks/{jbqICVar.js → CrkK-7cq.js} +2 -2
- package/web/app/immutable/chunks/{Cfbp4n6F.js → CtA5V2Vr.js} +2 -2
- package/web/app/immutable/chunks/{CyyQuDJ2.js → Cyu5F7IF.js} +1 -1
- package/web/app/immutable/chunks/{D76tHJtr.js → D0nMX7Fy.js} +1 -1
- package/web/app/immutable/chunks/{D4X5QfgO.js → D48rWb8_.js} +3 -3
- package/web/app/immutable/chunks/{BHMaHtb7.js → D4Ynme_h.js} +3 -3
- package/web/app/immutable/chunks/{TRC-1MZ6.js → D6KeRVx3.js} +1 -1
- package/web/app/immutable/chunks/{TZXFgAt8.js → D6l063h1.js} +1 -1
- package/web/app/immutable/chunks/{YTYw24Kl.js → D7zF8mVD.js} +1 -1
- package/web/app/immutable/chunks/{D8KugJqg.js → D7zs1WNS.js} +1 -1
- package/web/app/immutable/chunks/{BazydCWO.js → DApALACW.js} +1 -1
- package/web/app/immutable/chunks/{BuWZ2vPD.js → DBwPHDLx.js} +1 -1
- package/web/app/immutable/chunks/{B2wZ0Bb3.js → DFO9hn7q.js} +1 -1
- package/web/app/immutable/chunks/{BtBMs8pl.js → DHQlFr3x.js} +1 -1
- package/web/app/immutable/chunks/{A3itjZn8.js → DJVOcVb6.js} +3 -3
- package/web/app/immutable/chunks/{Cox9QorC.js → DJmFFfBr.js} +1 -1
- package/web/app/immutable/chunks/{CNsG6rqe.js → DKqiEltW.js} +1 -1
- package/web/app/immutable/chunks/{UBi_ObtY.js → DVZxKzOj.js} +1 -1
- package/web/app/immutable/chunks/{LcfcL_-4.js → DYtp8pRu.js} +1 -1
- package/web/app/immutable/chunks/{Dw5mZcm5.js → DYw1r29m.js} +1 -1
- package/web/app/immutable/chunks/{DQn-1ubH.js → D_Ck4oYy.js} +1 -1
- package/web/app/immutable/chunks/{DjKYseTS.js → Daka7UwW.js} +1 -1
- package/web/app/immutable/chunks/{BU_lcjuY.js → Daz1QCGS.js} +1 -1
- package/web/app/immutable/chunks/{CDYjKRWo.js → DbKwos66.js} +1 -1
- package/web/app/immutable/chunks/{BMLCt23V.js → DecRlFIH.js} +1 -1
- package/web/app/immutable/chunks/{Csr-rIZF.js → DfmpMhdc.js} +1 -1
- package/web/app/immutable/chunks/{B6ZYX7Y8.js → Dh0g4rYu.js} +1 -1
- package/web/app/immutable/chunks/{BPU4O8X2.js → DhfRQpUa.js} +1 -1
- package/web/app/immutable/chunks/{-GzAayRi.js → DkgA-dp6.js} +1 -1
- package/web/app/immutable/chunks/{1PBEbLiL.js → DwwhuCym.js} +1 -1
- package/web/app/immutable/chunks/{K-0xnE6j.js → DwxO0CzF.js} +1 -1
- package/web/app/immutable/chunks/{C8vjEKe_.js → Dx94_CW7.js} +1 -1
- package/web/app/immutable/chunks/{hf11ueQS.js → DxHDxHbR.js} +1 -1
- package/web/app/immutable/chunks/{D8-vtN74.js → IyDGTGib.js} +4 -4
- package/web/app/immutable/chunks/{7N4d1SHx.js → KqnunP55.js} +1 -1
- package/web/app/immutable/chunks/{CiasNS4Y.js → PAMGn91D.js} +1 -1
- package/web/app/immutable/chunks/{D1p7bFmY.js → YxIlUfko.js} +1 -1
- package/web/app/immutable/chunks/{DDt9eLZK.js → ZxE81vSk.js} +3 -3
- package/web/app/immutable/chunks/{CnAm8UDm.js → _a6vNmVW.js} +1 -1
- package/web/app/immutable/chunks/{Dm3SETfX.js → _zL9bNp2.js} +6 -6
- package/web/app/immutable/chunks/{C-IFS50X.js → d6_ZY1Pu.js} +1 -1
- package/web/app/immutable/chunks/{Rar9KqJV.js → eDLszxKs.js} +1 -1
- package/web/app/immutable/chunks/{Cm47R70f.js → eMk2ArKz.js} +1 -1
- package/web/app/immutable/chunks/{BWuBGnGl.js → jX0VhUGG.js} +1 -1
- package/web/app/immutable/chunks/{B14ddEbH.js → jgG3dE9T.js} +1 -1
- package/web/app/immutable/chunks/{C1kgjET0.js → k6oRCp56.js} +1 -1
- package/web/app/immutable/chunks/{DvyPNixU.js → piMAhJa1.js} +1 -1
- package/web/app/immutable/chunks/{H-xlkAY8.js → tNwydG8P.js} +1 -1
- package/web/app/immutable/chunks/{DYuqveqh.js → tnMWXb13.js} +1 -1
- package/web/app/immutable/chunks/{DL1sQHpf.js → x4xTOnLp.js} +1 -1
- package/web/app/immutable/chunks/{CheTmX4x.js → y-zFXgFQ.js} +1 -1
- package/web/app/immutable/chunks/{Cvxp3hv6.js → z37DF9wR.js} +1 -1
- package/web/app/immutable/entry/{app.CSmhn5IS.js → app.BbxDhWp9.js} +2 -2
- package/web/app/immutable/entry/start.BnlppRR8.js +1 -0
- package/web/app/immutable/nodes/{0.BJ-vuqyF.js → 0.DSIplukO.js} +1 -1
- package/web/app/immutable/nodes/{1.K8N2U7fJ.js → 1.CXRUG1SB.js} +1 -1
- package/web/app/immutable/nodes/{10.R5acEqWk.js → 10.DxleRET6.js} +4 -4
- package/web/app/immutable/nodes/{11.4wdFN3fm.js → 11.CbSyrlEM.js} +1 -1
- package/web/app/immutable/nodes/{15.N_o5QWkl.js → 15.keGRwwSO.js} +1 -1
- package/web/app/immutable/nodes/{19.DRknpyiO.js → 19.NgmHhhjU.js} +2 -2
- package/web/app/immutable/nodes/{2.MIO2fuwM.js → 2.BKQlffFF.js} +4 -4
- package/web/app/immutable/nodes/{3.-a-xJZ2X.js → 3.Bdi4F8FT.js} +1 -1
- package/web/app/immutable/nodes/{4.Cp7W3COg.js → 4.AJeYxvcn.js} +1 -1
- package/web/app/immutable/nodes/{5.gJXhj0lL.js → 5.Wga00_ld.js} +1 -1
- package/web/app/immutable/nodes/{6.DKNQvcTz.js → 6.0Su9KBVy.js} +1 -1
- package/web/app/immutable/nodes/{7.CxbGknsS.js → 7.Dq7qh1Tw.js} +1 -1
- package/web/app/immutable/nodes/{8.C-MNb_3a.js → 8.BC8OLPhP.js} +1 -1
- package/web/app/immutable/nodes/{9.5VNiGtUs.js → 9.BAS_V8so.js} +4 -4
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/entry/start.9LRUpX9-.js +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{p as re}from"./
|
|
1
|
+
import{p as re}from"./C7p2lOwL.js";import{Y as oe,b0 as se,aZ as de,U as le,V as ce,a_ as me,b as o,ay as g,X as R,aW as ue,b4 as xe,r as fe,q as ge,W as B,O as he,aV as P,bi as S,m as pe}from"./Bw79RGVy.js";import{p as be,i as ve}from"./Co5Wv5vC.js";var D="position frame",N="frame positioned",k="position relation",T="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){w={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...B().eventmodeling}),"getConfig"),w={};function O(){let e=Fe;const{ast:n}=w,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=L(i,n.dataEntities,t);e=v(e,{$kind:D,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:k,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:k,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function W(e){w.ast=void 0;const n=new Set;for(const t of e.frames){if(n.has(t.name)){const i=t.$cstNode?.range.start.line,a=i===void 0?"":` on line ${i+1}`;throw new Error(`Duplicate event modeling frame ID "${t.name}"${a}`)}n.add(t.name)}w.ast=e}o(W,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function I(e){const n=e.split(".");if(n.length===2)return n[0]}o(I,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&a<t}).map(i=>Number.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=I(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function V(e){const{themeVariables:n}=B();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(V,"calculateEntityVisualProps");function L(e,n,t){const i=B(),a=P(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"};let c=`<b>${S(a,t.textMaxWidth,d)}</b>`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(y=>y.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{
|
|
2
2
|
`)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" "," "),r+="<br/>")}const m=r!==void 0;m&&(c+=`<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${r}</code>`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(L,"calculateTextProps");function G(e,n){const t=n,i=V(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:N,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(G,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function Y(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(Y,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function j(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,d,r),m=c+l.width+s.boxPadding,x=Y(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p<f.length;p++){const y=f[p],$=f[p-1];y.y=$.y+$.height+s.swimlaneGap}return h}o(j,"evolveFramePositioned");function z(e,n){return e===0&&n.sourceFrames.length===0}o(z,"isFirstFrame");function K(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}o(K,"hasSourceFrame");function F(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(F,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function Z(e,n){const t=n;if(z(t.index,t.frame))return[];const i=F(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;if(t.sourceFrame)a=F(e.boxes,t.sourceFrame);else{if(ve(t.frame))return[];a=q(e.boxes,i.swimlane.index,t.index-1)}return a===void 0?[]:[{$kind:T,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(Z,"decidePositionRelation");function J(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(J,"evolveRelationPositioned");var Me={[D]:G,[k]:Z},Be={[N]:j,[T]:J};function Q(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Q,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Q(e,n);return ee(e,t)}o(v,"dispatch");var M={getConfig:ke,preserveCommentsWhenParsing:!0,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:le,setAccDescription:de,setDiagramTitle:se,getDiagramTitle:oe,setAst:W,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),M.setAst(n),re(n,M)},"parse")},Ae=R(),$e=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(ae,"renderD3Swimlane");var Re=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+`
|
|
3
3
|
`,"id:",n,t),!$e)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=R(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),De={draw:Re},Ne=o(e=>"","getStyles"),Te=Ne,Ie={parser:Ee,db:M,renderer:De,styles:Te};export{Ie as diagram};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/BfQPFCP7.js","/app/immutable/chunks/DxxarOOi.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/C0_snm4j.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Ch-D6DCZ.js","/app/immutable/chunks/C600Ggsz.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/CsI7oUrd.js","/app/immutable/chunks/Zs30783q.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/50l-lj9m.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/B_QPRXJ5.js","/app/immutable/chunks/BfdTnj-p.js","/app/immutable/chunks/B5yEHkSy.js","/app/immutable/chunks/CruJ4jyB.js","/app/immutable/chunks/DzAQQ1i-.js","/app/immutable/chunks/BUT4El0L.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/CkbzWFJM.js","/app/immutable/chunks/BqJSWZOr.js","/app/immutable/chunks/BfmZaG-s.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/BXwdEeCG.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/CAeNUoVv.js","/app/immutable/chunks/sX1SzO2T.js","/app/immutable/chunks/Ax2B7QQh.js","/app/immutable/chunks/Cft5DaOC.js","/app/immutable/chunks/CGDwhMyu.js","/app/immutable/assets/register.CUyDR59i.css","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/CQ409-Pj.js","/app/immutable/chunks/C33vrAzQ.js","/app/immutable/assets/terminal-manager.MhP_vFvK.css","/app/immutable/chunks/
|
|
2
|
-
var F=Object.defineProperty;var $=(c,e,r)=>e in c?F(c,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):c[e]=r;var u=(c,e,r)=>$(c,typeof e!="symbol"?e+"":e,r);import{l as _}from"./ChTqQfQN.js";import{bm as b,_ as y}from"./DxxarOOi.js";import{Jq as k,CA as M}from"./Zs30783q.js";import{h as O}from"./BfQPFCP7.js";import{O as W}from"./BmO6NekI.js";import{cO as L}from"./D5wSh12h.js";import{v as x,b7 as U,be as j}from"./DvyPNixU.js";import{a as z}from"./CGCLUZ3o.js";const N={USE_DEFAULT_CONTEXT:{id:"use-default-context",type:"command",get label(){return b.chat_mentions_useDefaultContext_label()},get description(){return b.chat_mentions_useDefaultContext_description()},icon:"🔄",uri:"devspace://command/use-default-context"},CLEAR_CONTEXT:{id:"clear-context",type:"command",get label(){return b.chat_mentions_clearContext_label()},get description(){return b.chat_mentions_clearContext_description()},icon:"🗑️",uri:"devspace://command/clear-context"}};function ke(c){return"items"in c||"subgroups"in c}function B(c){if(!c||typeof c!="object")return!1;const e=c;return!(typeof e.id!="string"||typeof e.label!="string"||typeof e.uri!="string"||typeof e.type!="string"||e.subtitle!==void 0&&typeof e.subtitle!="string"||e.description!==void 0&&typeof e.description!="string"||e.icon!==void 0&&typeof e.icon!="string"||e.score!==void 0&&typeof e.score!="number"||e.group!==void 0&&typeof e.group!="string")}function g(c,e){if(!c||!e)return null;const r=c.toLowerCase(),s=e.toLowerCase();let t=0;for(let a=0;a<s.length&&t<r.length;a++)s[a]===r[t]&&t++;if(t!==r.length)return null;const i=K(r,s);return i?{score:V(r,s,i),matches:i}:null}function K(c,e){const r=[];let s=0;for(let t=0;t<c.length;t++){const i=c[t];let n=!1;for(let a=s;a<e.length;a++)if(e[a]===i){r.push(a),s=a+1,n=!0;break}if(!n)return null}return r}function V(c,e,r){let s=0;s+=1;let t=0;for(let l=1;l<r.length;l++)r[l]===r[l-1]+1&&(t+=.1);s+=t;let i=0;for(const l of r)(l===0||J(e,l))&&(i+=.15);s+=i,r[0]===0&&(s+=.2);const a=(r[r.length-1]-r[0])/e.length*.3;return s-=a,Math.min(s/2.5,1)}function J(c,e){if(e===0)return!0;const r=c[e],s=c[e-1];return r===r.toUpperCase()&&s===s.toLowerCase()||!/[a-z0-9]/i.test(s)}function G(c,e){if(!c||!e)return null;if(!c.includes("/"))return g(c,e);const r=c.split("/").filter(n=>n.length>0),s=e.split("/").filter(n=>n.length>0);if(r.length===0||s.length===0)return null;const t=H(r,s);return t?{score:X(r,s,t),matches:[]}:null}function H(c,e){const r=[];let s=0;for(let t=0;t<c.length;t++){const i=c[t];let n=!1;const a=t===c.length-1;for(let o=s;o<e.length;o++){const l=e[o];if(g(i,l)){r.push(o),s=o+1,n=!0;break}if(a){const p=l.split(".")[0],m=l.includes(".")?l.split(".").pop():"";if(m&&g(i,m)){r.push(o),s=o+1,n=!0;break}if(p&&g(i,p)){r.push(o),s=o+1,n=!0;break}}}if(!n)return null}return r}function X(c,e,r){let s=0;s+=1,s+=r.length*.2;let t=0;for(let n=1;n<r.length;n++)r[n]===r[n-1]+1&&(t+=.15);s+=t,r.length>0&&r[r.length-1]===e.length-1&&(s+=.3);for(let n=0;n<c.length&&n<r.length;n++){const a=c[n],o=e[r[n]];a.toLowerCase()===o.toLowerCase()&&(s+=.2)}return Math.min(s/3,1)}function R(c,e,r){return JSON.stringify({query:c,workspaceId:r.workspaceId,repoPath:r.repoPath,currentFile:r.currentFile,currentNote:r.currentNote,providers:e.map(s=>[s.id,s.getCacheKey?.(r)])})}const D="*",Ce=["member","note","agent","file","folder","script","terminal",D,"specialist"];function Q(c,e){if(e.length===0)return[...c].sort((t,i)=>(i.score??0)-(t.score??0));const r=new Map(e.map((t,i)=>[t,i])),s=r.get(D)??e.length;return c.map(t=>({candidate:t,rank:r.get(t.type)??s})).sort((t,i)=>t.rank-i.rank||(i.candidate.score??0)-(t.candidate.score??0)).map(({candidate:t})=>t)}function Y(c,e){const r=new Map;return c.filter(s=>{const t=r.get(s.type)??0;return r.set(s.type,t+1),t<e})}class Ie{constructor(e={}){u(this,"searchDebounceTimer",null);u(this,"currentAbortController",null);u(this,"cache",new Map);u(this,"config");u(this,"isSearching",!1);this.config={debounceMs:e.debounceMs??100,maxResults:e.maxResults??50,cacheMaxAge:e.cacheMaxAge??3e4,enableSemantic:e.enableSemantic??!1,enableLivePreview:e.enableLivePreview??!0,enableCollaboration:e.enableCollaboration??!1,typeOrder:e.typeOrder??[],maxResultsPerKind:e.maxResultsPerKind??20}}async search(e,r,s){this.cancelPendingSearch();const t=R(e,r,s),i=this.cache.get(t);if(i&&!this.isCacheExpired(i))return _.debug("[SearchService] Returning cached results for:",e),i.results;const n=new AbortController;this.currentAbortController=n;const a=n.signal;return new Promise((o,l)=>{this.isSearching=!0;let p=!1;const m=()=>{a.removeEventListener("abort",v),this.currentAbortController===n&&(this.currentAbortController=null,this.searchDebounceTimer=null,this.isSearching=!1)},w=f=>{p||(p=!0,m(),o(f))},d=f=>{p||(p=!0,m(),l(f))},v=()=>d(new DOMException("Search cancelled","AbortError"));a.addEventListener("abort",v,{once:!0});const h=async()=>{try{if(a.aborted){d(new DOMException("Search cancelled","AbortError"));return}_.debug("[SearchService] Searching with providers:",r.map(C=>C.id));const f=R(e,r,s),P=await Promise.all(r.map(C=>this.searchWithProvider(C,e,s,a)));if(a.aborted)return;if(f!==R(e,r,s)){w([]);return}const S=this.combineResults(P.flat()).filter(C=>B(C)),A=this.applyFuzzyMatching(e,S),E=Q(A,this.config.typeOrder),T=this.config.typeOrder.length>0?Y(E,this.config.maxResultsPerKind):E.slice(0,this.config.maxResults);this.cache.set(f,{results:T,timestamp:Date.now()}),_.debug(`[SearchService] Found ${T.length} results`),w(T)}catch(f){a.aborted?d(new DOMException("Search cancelled","AbortError")):(_.error("[SearchService] Search error:",f),d(f instanceof Error?f:new Error(String(f))))}};e?this.searchDebounceTimer=setTimeout(h,this.config.debounceMs):h()})}async searchWithProvider(e,r,s,t){try{const i={...s,signal:t},n=await e.search(r,i),a=e.scoreRelevance?.bind(e);return a?n.map(o=>({...o,score:a(o,s)})):n}catch(i){return t.aborted||_.error(`[SearchService] Provider ${e.id} search failed:`,i),[]}}combineResults(e){const r=new Set,s=[];for(const t of e){const i=`${t.type}:${t.uri}`;r.has(i)||(r.add(i),s.push(t))}return s}applyFuzzyMatching(e,r){if(!e||e.length===0)return r;const t=r.map(i=>{let n=0;const a=i.meta?.path||i.meta?.fullPath||(i.subtitle?`${i.subtitle}/${i.label}`:i.label);if(a){const l=G(e,a);l&&(n=Math.max(n,l.score*1.8))}const o=g(e,i.label);if(o&&(n=Math.max(n,o.score*1.5)),i.subtitle){const l=g(e,i.subtitle);l&&(n=Math.max(n,l.score))}if(i.description){const l=g(e,i.description);l&&(n=Math.max(n,l.score*.5))}return{...i,score:n>0?n:i.score??0}}).filter(i=>i.score>0);return t.length>0?t:r}cancelPendingSearch(){this.searchDebounceTimer&&(clearTimeout(this.searchDebounceTimer),this.searchDebounceTimer=null),this.currentAbortController&&(this.currentAbortController.abort(),this.currentAbortController=null)}isCacheExpired(e){return Date.now()-e.timestamp>this.config.cacheMaxAge}clearCache(){this.cache.clear()}isLoading(){return this.isSearching}destroy(){this.cancelPendingSearch(),this.clearCache()}}class Z{constructor(){u(this,"id","file");u(this,"triggers",["@file","@f"]);u(this,"default",!0);u(this,"supportsRanges",!0);u(this,"supportsLivePreview",!0);u(this,"recentFiles",new Set);u(this,"fileIconMap",{ts:"📘",tsx:"⚛️",js:"📜",jsx:"⚛️",svelte:"🔥",vue:"💚",py:"🐍",rs:"🦀",go:"🐹",java:"☕",cpp:"⚙️",c:"⚙️",h:"📎",md:"📝",json:"📋",yaml:"📋",yml:"📋",toml:"📋",xml:"📋",html:"🌐",css:"🎨",scss:"🎨",sass:"🎨",less:"🎨",sql:"🗃️",sh:"🖥️",bash:"🖥️",zsh:"🖥️",fish:"🖥️",dockerfile:"🐳",docker:"🐳",gitignore:"🚫",env:"🔐",lock:"🔒",test:"🧪",spec:"🧪"})}async search(e,r){_.debug("[FileProvider] Searching for:",{query:e,context:{workspaceId:r.workspaceId}});const s=r.workspaceId;if(!s)return[];try{const t=await O("search.fileNames",{workspaceId:s,pattern:e||"",limit:10}),n=(Array.isArray(t?.files)?t.files:[]).map(a=>{const o=a.split("/").pop()||a,l=o.split(".").pop()||"";return{id:`file-${a}`,label:o,type:"file",uri:`file:${a}`,description:a,subtitle:a,score:.5,meta:{path:a,fullPath:a,relativePath:a,extension:l,language:this.getLanguageFromExtension(l)}}});return this.deduplicateAndDistinguish(n)}catch(t){return _.error("[FileProvider] Search failed:",t),[]}}async searchRecent(e,r){if(!r.recentFiles||r.recentFiles.length===0)return[];const s=await Promise.all(r.recentFiles.filter(t=>e?g(e,t)!==null:!0).slice(0,3).map(t=>{const i=t.split("/").pop()||t,n=i.split(".").pop()||"";return this.fileToCandidate({path:t,name:i,extension:n})}));return s.forEach(t=>{this.recentFiles.add(t.uri)}),s}async searchContextual(e,r){return r.currentFile?[]:[]}async fileToCandidate(e){const r=this.getFileIcon(e.extension),s=e.path,t=this.formatPath(s);return{id:`file-${e.path}`,type:"file",label:e.name,subtitle:t,description:s,icon:r,uri:`devspace://file/${encodeURIComponent(e.path)}`,meta:{path:s,fullPath:e.path,lastModified:e.lastModified,size:e.size,language:e.language||this.getLanguageFromExtension(e.extension)}}}combineResults(...e){const r=new Set,s=[];for(const t of e)for(const i of t)r.has(i.uri)||(r.add(i.uri),s.push(i));return this.deduplicateAndDistinguish(s)}deduplicateAndDistinguish(e){const r=new Map;for(const t of e){const i=t.label;let n=r.get(i);n||(n=[],r.set(i,n)),n.push(t)}const s=[];for(const[t,i]of r.entries())if(i.length===1)s.push(i[0]);else{const n=this.distinguishDuplicates(i);s.push(...n)}return s}distinguishDuplicates(e){const r=e.map(t=>t.description||t.meta?.path||"");return e.map((t,i)=>{const n=r[i],a=r.filter((p,m)=>m!==i),o=n.split("/");let l="";for(let p=o.length;p>0;p--){const m=o.slice(-p).join("/");if(!a.some(d=>d.split("/").slice(-p).join("/")===m)||p===1){l=m;break}}return{...t,subtitle:l}})}groupResults(e){const r={recent:[],relevant:[],other:[]};for(const t of e)this.recentFiles.has(t.uri)?r.recent.push(t):(t.score??0)>.7?r.relevant.push(t):r.other.push(t);const s=[];return r.recent.length>0&&s.push(...r.recent.slice(0,3).map(t=>({...t,group:b.chat_mentions_recentFiles_group()}))),r.relevant.length>0&&s.push(...r.relevant.slice(0,5).map(t=>({...t,group:b.chat_mentions_mostRelevant_group()}))),r.other.length>0&&s.push(...r.other.slice(0,10).map(t=>({...t,group:b.chat_mentions_otherFiles_group()}))),s}scoreRelevance(e,r){let s=.5;if(this.recentFiles.has(e.uri)&&(s+=.2),r.currentFile&&e.meta?.path){const t=r.currentFile.substring(0,r.currentFile.lastIndexOf("/")),i=e.meta.path.substring(0,e.meta.path.lastIndexOf("/"));t===i&&(s+=.15)}return r.imports?.includes(e.meta?.path||"")&&(s+=.25),r.currentFile?.includes(".test.")&&e.meta?.path?.includes(".test.")&&(s+=.1),Math.min(s,1)}getGroups(){return[{id:"files-recent",label:b.chat_mentions_recentFiles_group(),icon:"🕐"},{id:"files-all",label:b.chat_mentions_allFiles_group(),icon:"📁"},{id:"files-tests",label:b.chat_mentions_testFiles_group(),icon:"🧪"}]}getFileIcon(e){return this.fileIconMap[e.toLowerCase()]||"📄"}formatPath(e){if(e.length>40){const r=e.split("/");if(r.length>2)return`.../${r.slice(-2).join("/")}`}return e}getLanguageFromExtension(e){return{ts:"typescript",tsx:"typescriptreact",js:"javascript",jsx:"javascriptreact",py:"python",rs:"rust",go:"go",java:"java",cpp:"cpp",c:"c",svelte:"svelte",vue:"vue",md:"markdown",json:"json",yaml:"yaml",yml:"yaml",html:"html",css:"css",scss:"scss",sql:"sql",sh:"shellscript"}[e.toLowerCase()]||"plaintext"}}class q{constructor(){u(this,"id","member")}getCacheKey(e){const r=k.state;return JSON.stringify({backendId:W.select(r),ownPrincipalId:r.presence.ownPrincipalId,members:e.workspaceId?L.select(r,e.workspaceId):[]})}async search(e,r){const{workspaceId:s}=r;if(!s)return[];const t=e.replace(/^@/,"").toLowerCase();return L.select(k.state,s).filter(i=>i.login.toLowerCase().includes(t)).map(i=>({id:`member-${i.principalId}`,type:"member",label:i.login,subtitle:i.identity?`${i.identity.provider==="github"?"GitHub":"GitLab"} · ${i.identity.host}`:void 0,description:i.displayName??void 0,icon:"👤",uri:`devspace://member/${encodeURIComponent(i.principalId)}?workspaceId=${encodeURIComponent(s)}`,score:.8,meta:{workspaceId:s,principalId:i.principalId,identity:i.identity,avatarUrl:i.avatarUrl??void 0}}))}}class ee{constructor(){u(this,"id","folder");u(this,"triggers",["@folder","@dir"])}async search(e,r){const s=r.workspaceId;if(!s)return[];try{const{backendRequest:t}=await y(async()=>{const{backendRequest:o}=await import("./BfQPFCP7.js").then(l=>l.j);return{backendRequest:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url),i=await t("search.fileNames",{workspaceId:s,pattern:e||"",limit:200}),n=Array.isArray(i?.files)?i.files:[],a=new Set;for(const o of n){const l=o.split("/");for(let p=1;p<l.length;p++)a.add(l.slice(0,p).join("/"))}return[...a].filter(o=>e?g(e,o.split("/").pop()||o)!==null:!0).slice(0,10).map(o=>({id:`folder-${o}`,type:"folder",label:o.split("/").pop()||o,description:o,icon:"📁",uri:`devspace://folder/${encodeURIComponent(o)}`,meta:{path:o,fullPath:o,relativePath:o}}))}catch(t){return _.debug("[FolderProvider] Failed to get folders:",t),[]}}}const te=10,re=.3;function se(c){const e=c.toLowerCase().split(/\s+/).filter(Boolean);return(r,s)=>{const t=r?g(c,r):null;if(t)return 1+t.score;if(s){const i=s.toLowerCase();if(e.every(n=>i.includes(n)))return re}return 0}}class ie{constructor(){u(this,"id","note");u(this,"triggers",["@note","@n"]);u(this,"supportsRanges",!0);u(this,"cachedNotes",[]);u(this,"lastCacheUpdate",0);u(this,"cacheTimeout",5e3)}async getSiblingWorkspaces(e){if(!e)return[];try{const[{store:r},{selectWorkspaceItems:s}]=await Promise.all([y(()=>import("./CsI7oUrd.js"),__vite__mapDeps([11,12,13,2,14,15,4,8,1,16,6,3,17,18]),import.meta.url),y(()=>import("./BfdTnj-p.js").then(n=>n.ea),__vite__mapDeps([19,6,4,1,2,12,13,14,15,8,16,3,20,21,22,7,9,23,24,0,5,10,25,26]),import.meta.url)]),t=s.select(r.state),i=t.find(n=>n.id===e);return!i||!i.repositoryPath?[]:t.filter(n=>n.id!==e&&n.repositoryPath===i.repositoryPath)}catch(r){return _.debug("[NoteProvider] Failed to get sibling workspaces:",r),[]}}async fetchNotesFromWorkspace(e,r){try{const[{store:s},{listSlimNotesRequested:t}]=await Promise.all([y(()=>import("./CsI7oUrd.js"),__vite__mapDeps([11,12,13,2,14,15,4,8,1,16,6,3,17,18]),import.meta.url),y(()=>import("./Zs30783q.js").then(n=>n.My),__vite__mapDeps([12,13,2,14,15,4,8,1,16,6,3]),import.meta.url)]);return(await s.dispatch(t(e))).map(n=>({note:n,workspaceId:e,workspaceTitle:r}))}catch(s){_.debug(`[NoteProvider] Failed to fetch notes from workspace ${e}:`,s)}return[]}async search(e,r){if(!r.workspaceId)return[];const s=e.trim(),t=s?se(s):null;try{const i=await this.fetchNotesFromWorkspace(r.workspaceId),a=(await this.getSiblingWorkspaces(r.workspaceId)).map(d=>this.fetchNotesFromWorkspace(d.id,d.title)),l=(await Promise.all(a)).flat(),p=[...i,...l],w=(t?p.map(d=>({entry:d,score:t(d.note.title,d.note.content||d.note.contentPreview)})).filter(({score:d})=>d>0).sort((d,v)=>v.score-d.score):p.map(d=>({entry:d,score:void 0}))).slice(0,te).map(({entry:{note:d,workspaceId:v,workspaceTitle:h},score:f})=>{const P=v===r.workspaceId,I=P?void 0:b.chat_mentions_fromWorkspace_subtitle({workspace:h||v}),S=d.content||d.contentPreview;return{candidate:{id:d.id,type:"note",label:d.title||d.id||b.chat_mentions_untitledNote_label(),subtitle:I,description:S?`${S.substring(0,100)}...`:"",icon:"📝",uri:`devspace://note/${d.id}`,meta:{preview:S?.substring(0,200)||"",workspaceId:v,...P?{}:{isExternalLink:!0}}},score:f}});if(this.cachedNotes=w.map(({candidate:d})=>d),this.lastCacheUpdate=Date.now(),w.length>0)return w.map(({candidate:d,score:v})=>v!==void 0?{...d,score:v}:d)}catch(i){_.debug("[NoteProvider] Failed to fetch notes:",i)}return this.cachedNotes.length>0?t?this.cachedNotes.map(i=>({...i,score:t(i.label,i.meta?.preview)})).filter(i=>i.score>0).sort((i,n)=>n.score-i.score):this.cachedNotes:[]}getCachedNotes(){return Date.now()-this.lastCacheUpdate>this.cacheTimeout?[]:this.cachedNotes}}class ne{constructor(){u(this,"id","external");u(this,"triggers",["@docs","@external"])}async search(e,r){return[{id:"react-docs",label:"React Documentation",url:"https://react.dev",description:"Official React documentation"},{id:"mdn",label:"MDN Web Docs",url:"https://developer.mozilla.org",description:"Web technology documentation"},{id:"typescript",label:"TypeScript Handbook",url:"https://www.typescriptlang.org/docs/",description:"TypeScript documentation"}].filter(t=>!e||g(e,t.label)!==null).map(t=>({id:`external-${t.id}`,type:"external-source",label:t.label,description:t.description,icon:"📚",uri:`devspace://external/${t.id}`,meta:{url:t.url}}))}}class oe{constructor(){u(this,"id","rule");u(this,"triggers",["@rule","@intent"])}async search(e,r){return[{path:".intent/rules/cli.md",label:"CLI Rules"},{path:".intent/rules/frontend.md",label:"Frontend Rules"},{path:".intent/rules/python.md",label:"Python Rules"},{path:".intent/rules/sidecar.md",label:"Sidecar Rules"},{path:".intent/rules/systems.md",label:"Systems Rules"}].filter(t=>!e||g(e,t.label)!==null).map(t=>({id:t.path,type:"rule",label:t.label,subtitle:t.path,icon:"📚",uri:`devspace://rule/${encodeURIComponent(t.path)}`,meta:{path:t.path}}))}}class ae{constructor(){u(this,"id","task");u(this,"triggers",["@task","@todo"])}async search(e,r){return[{id:"task-1",label:"Implement authentication",status:"in_progress",assignee:"John Doe"},{id:"task-2",label:"Write tests",status:"not_started",assignee:"Jane Smith"},{id:"task-3",label:"Deploy to production",status:"completed",assignee:"Bob Johnson"}].filter(t=>!e||g(e,t.label)!==null).map(t=>({id:`task-${t.id}`,type:"task",label:t.label,subtitle:`${t.status} • ${t.assignee}`,icon:"📋",uri:`devspace://task/${t.id}`,meta:{taskStatus:t.status,assignee:t.assignee}}))}}class ce{constructor(){u(this,"id","personality");u(this,"triggers",["@personality","@persona"]);u(this,"personalities",[{id:"auggie-personality-agent-default",name:"Agent Auggie",description:"Default helpful AI assistant",icon:"🤖",temperature:.7,model:"default",promptToken:"auggie-personality-agent-default"},{id:"auggie-personality-prototyper",name:"Prototyper Auggie",description:"Specialized in rapid prototyping",icon:"⚡",temperature:.7,model:"default",promptToken:"auggie-personality-prototyper"},{id:"auggie-personality-brainstorm",name:"Brainstorm Auggie",description:"Creative ideation and exploration",icon:"💡",temperature:.7,model:"default",promptToken:"auggie-personality-brainstorm"},{id:"auggie-personality-reviewer",name:"Reviewer Auggie",description:"Code review and feedback",icon:"🔍",temperature:.7,model:"default",promptToken:"auggie-personality-reviewer"}])}async search(e,r){return this.personalities.filter(s=>!e||g(e,s.name)!==null).map(s=>({id:s.id,type:"personality",label:s.name,subtitle:`${s.model}`,description:s.description,icon:s.icon,uri:`devspace://personality/${s.id}`,meta:{promptToken:s.promptToken}}))}}class le{constructor(){u(this,"id","command");u(this,"triggers",["@cmd","@command"])}async search(e,r){return[N.USE_DEFAULT_CONTEXT,N.CLEAR_CONTEXT].filter(t=>!e||t.label.toLowerCase().includes(e.toLowerCase()))}}class ue{constructor(){u(this,"id","terminal");u(this,"triggers",["@terminal","@term"])}async search(e,r){try{const{terminalManager:s}=await y(async()=>{const{terminalManager:h}=await import("./BfmZaG-s.js").then(f=>f.b);return{terminalManager:h}},__vite__mapDeps([27,2,1,28,29,3,4,30,31,12,13,14,15,8,16,6,0,5,7,9,10,32,24,33,34,35,36,37,38,39,40,25,41,42]),import.meta.url),{selectTerminals:t,selectTerminalDisplayName:i}=await y(async()=>{const{selectTerminals:h,selectTerminalDisplayName:f}=await import("./C33vrAzQ.js").then(P=>P.i);return{selectTerminals:h,selectTerminalDisplayName:f}},__vite__mapDeps([41,12,13,2,14,15,4,8,1,16,6,3]),import.meta.url),a=k.state;if(!r.workspaceId)return[];const o=t.select(a,r.workspaceId),l=s.loadTerminalMetadata(r.workspaceId),p=new Set,m=[];for(const h of o)p.add(h.id),m.push({id:h.id,name:i.select(a,r.workspaceId,h.id)});for(const h of l)p.has(h.terminalId)||(p.add(h.terminalId),m.push({id:h.terminalId,name:h.title||b.terminal_quakeOverlay_terminal_fallback()}));if(m.length===0)return[];const d=e?["terminal","term"].some(h=>h.startsWith(e.toLowerCase())||e.toLowerCase().startsWith(h)):!1;return(e&&!d?m.filter(h=>g(e,h.name)!==null):m).slice(0,10).map((h,f)=>({id:h.id,type:"terminal",label:h.name,subtitle:b.chat_mentions_terminalIndex_subtitle({index:f+1}),description:b.chat_mentions_terminalOutput_description(),icon:"💻",uri:`devspace://terminal/${encodeURIComponent(h.id)}`,meta:{workspaceId:r.workspaceId}}))}catch(s){return _.debug("[TerminalProvider] Failed to get terminals:",s),[]}}}class de{constructor(){u(this,"id","script");u(this,"triggers",["@script","@scripts"])}async search(e,r){try{const{selectScriptEntries:s}=await y(async()=>{const{selectScriptEntries:o}=await import("./QWptVHsb.js");return{selectScriptEntries:o}},__vite__mapDeps([43,12,13,2,14,15,4,8,1,16,6,3,44,45,22,7,9,46,47,23,0,5,10,21,48,26,49,50,20,51,52,53,54,19,24,25,55,29,28,56,57,58,59,33,60,61,31]),import.meta.url);if(!r.workspaceId)return[];const t=s.select(k.state,r.workspaceId);if(t.length===0)return[];const n=e?["script","scripts"].some(o=>o.startsWith(e.toLowerCase())||e.toLowerCase().startsWith(o)):!1;return(e&&!n?t.filter(o=>g(e,o.name)!==null||g(e,M(o))!==null):t).slice(0,10).map(o=>{const l=o.runtime.status,p=x(l)?b.chat_mentions_scriptRunning_label():l==="exited"?b.chat_mentions_scriptExited_label():b.chat_mentions_scriptIdle_label();return{id:o.id,type:"script",label:o.name,subtitle:`${p} · ${M(o)}`,description:b.chat_mentions_scriptOutput_description(),icon:"▶️",uri:`devspace://script/${encodeURIComponent(o.id)}`,meta:{workspaceId:r.workspaceId,command:o.command,status:x(l)?"ok":l==="exited"?"warning":void 0}}})}catch(s){return _.debug("[ScriptProvider] Failed to get scripts:",s),[]}}}class pe{constructor(){u(this,"id","specialist");u(this,"triggers",["@specialist","@spec"])}async search(e,r){try{const s=j.select(k.state);return!s||s.length===0?[]:s.filter(t=>e?g(e,t.name)!==null||g(e,t.id)!==null||g(e,t.description)!==null||g(e,"specialist")!==null:!0).map(t=>({id:`specialist-${t.id}`,type:"specialist",label:t.name,subtitle:t.description,description:t.description,icon:"👤",uri:`devspace://specialist/${encodeURIComponent(t.id)}`,group:"Specialists",score:.8,meta:{promptToken:`specialist/${t.id}`}})).slice(0,10)}catch(s){return _.debug("[SpecialistProvider] Failed to get specialists:",s),[]}}}class he{constructor(){u(this,"id","agent");u(this,"triggers",["@agent"])}async search(e,r){try{const{selectAllWorkspaceAgents:s}=await y(async()=>{const{selectAllWorkspaceAgents:a}=await import("./BfdTnj-p.js").then(o=>o.e7);return{selectAllWorkspaceAgents:a}},__vite__mapDeps([19,6,4,1,2,12,13,14,15,8,16,3,20,21,22,7,9,23,24,0,5,10,25,26]),import.meta.url),t=r.workspaceId;if(!t)return[];const i=s.select(k.state,t);if(i.length===0)return[];const n=[];for(const a of i){const o=a.id,l=a.name||o,p=a.metadata?.specialist||"";let m=a.metadata?.specialistName||"";if(p&&!m){const f=U.select(k.state,p);f&&(m=f.name)}if(e){const f=g(e,l)!==null,P=g(e,"agent")!==null,I=m&&g(e,m)!==null,S=p&&g(e,p)!==null;if(!f&&!P&&!I&&!S)continue}const w=a.isStreaming?"responding":a.status||"active",d=[];m?d.push(m):d.push("Agent"),d.push(w);const v=a.messages?.length||0;v>0&&d.push(`${v} msg${v!==1?"s":""}`);const h=a.lastActivity||a.lastModified;h&&!a.isStreaming&&d.push(z(new Date(h))),n.push({id:o,type:"agent",label:l,subtitle:d.join(" · "),description:m?b.chat_mentions_specialistAgentInWorkspace_description({specialist:m}):b.chat_mentions_agentInWorkspace_description(),icon:"🤖",uri:`devspace://agent/${encodeURIComponent(o)}`,group:b.chat_mentions_agents_group(),score:.7,meta:{workspaceId:t}})}return n.slice(0,10)}catch(s){return _.debug("[AgentProvider] Failed to get agents:",s),[]}}}class me{constructor(){u(this,"providers",new Map);u(this,"defaultProviders",[]);this.register(new Z),this.register(new ee),this.register(new ie),this.register(new ne),this.register(new oe),this.register(new ae),this.register(new ce),this.register(new le),this.register(new ue),this.register(new de),this.register(new he),this.register(new pe),this.register(new q),this.defaultProviders=["file","folder","note","terminal","script","agent","specialist","member"]}register(e){this.providers.set(e.id,e),_.debug("[ProviderRegistry] Registered provider:",e.id)}unregister(e){this.providers.delete(e)}get(e){return this.providers.get(e)}getAll(){return Array.from(this.providers.values())}getDefault(){return this.defaultProviders.map(e=>this.providers.get(e)).filter(Boolean)}getByTrigger(e){return Array.from(this.providers.values()).filter(r=>r.triggers?.includes(e))}async searchAll(e,r){const s=e.startsWith("@")?this.getByTrigger(e.split(" ")[0]):this.getDefault();return(await Promise.all(s.map(i=>i.search(e,r)))).flat()}}const Te=new me;export{Ie as D,Ce as M,Q as a,ke as i,Te as p,R as s};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/BfQPFCP7.js","/app/immutable/chunks/DxxarOOi.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/C0_snm4j.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Ch-D6DCZ.js","/app/immutable/chunks/C600Ggsz.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/CsI7oUrd.js","/app/immutable/chunks/Zs30783q.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/50l-lj9m.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/B_QPRXJ5.js","/app/immutable/chunks/BfdTnj-p.js","/app/immutable/chunks/B5yEHkSy.js","/app/immutable/chunks/CruJ4jyB.js","/app/immutable/chunks/DzAQQ1i-.js","/app/immutable/chunks/BUT4El0L.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/CkbzWFJM.js","/app/immutable/chunks/BqJSWZOr.js","/app/immutable/chunks/BfmZaG-s.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/BXwdEeCG.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/CAeNUoVv.js","/app/immutable/chunks/sX1SzO2T.js","/app/immutable/chunks/Ax2B7QQh.js","/app/immutable/chunks/Cft5DaOC.js","/app/immutable/chunks/CGDwhMyu.js","/app/immutable/assets/register.CUyDR59i.css","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/CQ409-Pj.js","/app/immutable/chunks/C33vrAzQ.js","/app/immutable/assets/terminal-manager.MhP_vFvK.css","/app/immutable/chunks/Bj-YBxcA.js","/app/immutable/chunks/piMAhJa1.js","/app/immutable/chunks/DkkzFfYK.js","/app/immutable/chunks/D5eCb9SA.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/ByAetY4P.js","/app/immutable/chunks/BWsFbeUj.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/DSjVYlVX.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/CL3a4Hm1.js","/app/immutable/chunks/CYrmrI7Y.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/BmO6NekI.js","/app/immutable/chunks/D1E_1zhz.js","/app/immutable/chunks/DhNEeuS_.js","/app/immutable/chunks/Hxdz4eYy.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var F=Object.defineProperty;var $=(c,e,r)=>e in c?F(c,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):c[e]=r;var u=(c,e,r)=>$(c,typeof e!="symbol"?e+"":e,r);import{l as _}from"./ChTqQfQN.js";import{bm as b,_ as y}from"./DxxarOOi.js";import{Jq as k,CA as M}from"./Zs30783q.js";import{h as O}from"./BfQPFCP7.js";import{O as W}from"./BmO6NekI.js";import{cO as L}from"./Be3ctlCz.js";import{v as x,b7 as U,be as j}from"./piMAhJa1.js";import{a as z}from"./CGCLUZ3o.js";const N={USE_DEFAULT_CONTEXT:{id:"use-default-context",type:"command",get label(){return b.chat_mentions_useDefaultContext_label()},get description(){return b.chat_mentions_useDefaultContext_description()},icon:"🔄",uri:"devspace://command/use-default-context"},CLEAR_CONTEXT:{id:"clear-context",type:"command",get label(){return b.chat_mentions_clearContext_label()},get description(){return b.chat_mentions_clearContext_description()},icon:"🗑️",uri:"devspace://command/clear-context"}};function ke(c){return"items"in c||"subgroups"in c}function B(c){if(!c||typeof c!="object")return!1;const e=c;return!(typeof e.id!="string"||typeof e.label!="string"||typeof e.uri!="string"||typeof e.type!="string"||e.subtitle!==void 0&&typeof e.subtitle!="string"||e.description!==void 0&&typeof e.description!="string"||e.icon!==void 0&&typeof e.icon!="string"||e.score!==void 0&&typeof e.score!="number"||e.group!==void 0&&typeof e.group!="string")}function g(c,e){if(!c||!e)return null;const r=c.toLowerCase(),s=e.toLowerCase();let t=0;for(let a=0;a<s.length&&t<r.length;a++)s[a]===r[t]&&t++;if(t!==r.length)return null;const i=K(r,s);return i?{score:V(r,s,i),matches:i}:null}function K(c,e){const r=[];let s=0;for(let t=0;t<c.length;t++){const i=c[t];let n=!1;for(let a=s;a<e.length;a++)if(e[a]===i){r.push(a),s=a+1,n=!0;break}if(!n)return null}return r}function V(c,e,r){let s=0;s+=1;let t=0;for(let l=1;l<r.length;l++)r[l]===r[l-1]+1&&(t+=.1);s+=t;let i=0;for(const l of r)(l===0||J(e,l))&&(i+=.15);s+=i,r[0]===0&&(s+=.2);const a=(r[r.length-1]-r[0])/e.length*.3;return s-=a,Math.min(s/2.5,1)}function J(c,e){if(e===0)return!0;const r=c[e],s=c[e-1];return r===r.toUpperCase()&&s===s.toLowerCase()||!/[a-z0-9]/i.test(s)}function G(c,e){if(!c||!e)return null;if(!c.includes("/"))return g(c,e);const r=c.split("/").filter(n=>n.length>0),s=e.split("/").filter(n=>n.length>0);if(r.length===0||s.length===0)return null;const t=H(r,s);return t?{score:X(r,s,t),matches:[]}:null}function H(c,e){const r=[];let s=0;for(let t=0;t<c.length;t++){const i=c[t];let n=!1;const a=t===c.length-1;for(let o=s;o<e.length;o++){const l=e[o];if(g(i,l)){r.push(o),s=o+1,n=!0;break}if(a){const p=l.split(".")[0],m=l.includes(".")?l.split(".").pop():"";if(m&&g(i,m)){r.push(o),s=o+1,n=!0;break}if(p&&g(i,p)){r.push(o),s=o+1,n=!0;break}}}if(!n)return null}return r}function X(c,e,r){let s=0;s+=1,s+=r.length*.2;let t=0;for(let n=1;n<r.length;n++)r[n]===r[n-1]+1&&(t+=.15);s+=t,r.length>0&&r[r.length-1]===e.length-1&&(s+=.3);for(let n=0;n<c.length&&n<r.length;n++){const a=c[n],o=e[r[n]];a.toLowerCase()===o.toLowerCase()&&(s+=.2)}return Math.min(s/3,1)}function R(c,e,r){return JSON.stringify({query:c,workspaceId:r.workspaceId,repoPath:r.repoPath,currentFile:r.currentFile,currentNote:r.currentNote,providers:e.map(s=>[s.id,s.getCacheKey?.(r)])})}const D="*",Ce=["member","note","agent","file","folder","script","terminal",D,"specialist"];function Q(c,e){if(e.length===0)return[...c].sort((t,i)=>(i.score??0)-(t.score??0));const r=new Map(e.map((t,i)=>[t,i])),s=r.get(D)??e.length;return c.map(t=>({candidate:t,rank:r.get(t.type)??s})).sort((t,i)=>t.rank-i.rank||(i.candidate.score??0)-(t.candidate.score??0)).map(({candidate:t})=>t)}function Y(c,e){const r=new Map;return c.filter(s=>{const t=r.get(s.type)??0;return r.set(s.type,t+1),t<e})}class Ie{constructor(e={}){u(this,"searchDebounceTimer",null);u(this,"currentAbortController",null);u(this,"cache",new Map);u(this,"config");u(this,"isSearching",!1);this.config={debounceMs:e.debounceMs??100,maxResults:e.maxResults??50,cacheMaxAge:e.cacheMaxAge??3e4,enableSemantic:e.enableSemantic??!1,enableLivePreview:e.enableLivePreview??!0,enableCollaboration:e.enableCollaboration??!1,typeOrder:e.typeOrder??[],maxResultsPerKind:e.maxResultsPerKind??20}}async search(e,r,s){this.cancelPendingSearch();const t=R(e,r,s),i=this.cache.get(t);if(i&&!this.isCacheExpired(i))return _.debug("[SearchService] Returning cached results for:",e),i.results;const n=new AbortController;this.currentAbortController=n;const a=n.signal;return new Promise((o,l)=>{this.isSearching=!0;let p=!1;const m=()=>{a.removeEventListener("abort",v),this.currentAbortController===n&&(this.currentAbortController=null,this.searchDebounceTimer=null,this.isSearching=!1)},w=f=>{p||(p=!0,m(),o(f))},d=f=>{p||(p=!0,m(),l(f))},v=()=>d(new DOMException("Search cancelled","AbortError"));a.addEventListener("abort",v,{once:!0});const h=async()=>{try{if(a.aborted){d(new DOMException("Search cancelled","AbortError"));return}_.debug("[SearchService] Searching with providers:",r.map(C=>C.id));const f=R(e,r,s),P=await Promise.all(r.map(C=>this.searchWithProvider(C,e,s,a)));if(a.aborted)return;if(f!==R(e,r,s)){w([]);return}const S=this.combineResults(P.flat()).filter(C=>B(C)),A=this.applyFuzzyMatching(e,S),E=Q(A,this.config.typeOrder),T=this.config.typeOrder.length>0?Y(E,this.config.maxResultsPerKind):E.slice(0,this.config.maxResults);this.cache.set(f,{results:T,timestamp:Date.now()}),_.debug(`[SearchService] Found ${T.length} results`),w(T)}catch(f){a.aborted?d(new DOMException("Search cancelled","AbortError")):(_.error("[SearchService] Search error:",f),d(f instanceof Error?f:new Error(String(f))))}};e?this.searchDebounceTimer=setTimeout(h,this.config.debounceMs):h()})}async searchWithProvider(e,r,s,t){try{const i={...s,signal:t},n=await e.search(r,i),a=e.scoreRelevance?.bind(e);return a?n.map(o=>({...o,score:a(o,s)})):n}catch(i){return t.aborted||_.error(`[SearchService] Provider ${e.id} search failed:`,i),[]}}combineResults(e){const r=new Set,s=[];for(const t of e){const i=`${t.type}:${t.uri}`;r.has(i)||(r.add(i),s.push(t))}return s}applyFuzzyMatching(e,r){if(!e||e.length===0)return r;const t=r.map(i=>{let n=0;const a=i.meta?.path||i.meta?.fullPath||(i.subtitle?`${i.subtitle}/${i.label}`:i.label);if(a){const l=G(e,a);l&&(n=Math.max(n,l.score*1.8))}const o=g(e,i.label);if(o&&(n=Math.max(n,o.score*1.5)),i.subtitle){const l=g(e,i.subtitle);l&&(n=Math.max(n,l.score))}if(i.description){const l=g(e,i.description);l&&(n=Math.max(n,l.score*.5))}return{...i,score:n>0?n:i.score??0}}).filter(i=>i.score>0);return t.length>0?t:r}cancelPendingSearch(){this.searchDebounceTimer&&(clearTimeout(this.searchDebounceTimer),this.searchDebounceTimer=null),this.currentAbortController&&(this.currentAbortController.abort(),this.currentAbortController=null)}isCacheExpired(e){return Date.now()-e.timestamp>this.config.cacheMaxAge}clearCache(){this.cache.clear()}isLoading(){return this.isSearching}destroy(){this.cancelPendingSearch(),this.clearCache()}}class Z{constructor(){u(this,"id","file");u(this,"triggers",["@file","@f"]);u(this,"default",!0);u(this,"supportsRanges",!0);u(this,"supportsLivePreview",!0);u(this,"recentFiles",new Set);u(this,"fileIconMap",{ts:"📘",tsx:"⚛️",js:"📜",jsx:"⚛️",svelte:"🔥",vue:"💚",py:"🐍",rs:"🦀",go:"🐹",java:"☕",cpp:"⚙️",c:"⚙️",h:"📎",md:"📝",json:"📋",yaml:"📋",yml:"📋",toml:"📋",xml:"📋",html:"🌐",css:"🎨",scss:"🎨",sass:"🎨",less:"🎨",sql:"🗃️",sh:"🖥️",bash:"🖥️",zsh:"🖥️",fish:"🖥️",dockerfile:"🐳",docker:"🐳",gitignore:"🚫",env:"🔐",lock:"🔒",test:"🧪",spec:"🧪"})}async search(e,r){_.debug("[FileProvider] Searching for:",{query:e,context:{workspaceId:r.workspaceId}});const s=r.workspaceId;if(!s)return[];try{const t=await O("search.fileNames",{workspaceId:s,pattern:e||"",limit:10}),n=(Array.isArray(t?.files)?t.files:[]).map(a=>{const o=a.split("/").pop()||a,l=o.split(".").pop()||"";return{id:`file-${a}`,label:o,type:"file",uri:`file:${a}`,description:a,subtitle:a,score:.5,meta:{path:a,fullPath:a,relativePath:a,extension:l,language:this.getLanguageFromExtension(l)}}});return this.deduplicateAndDistinguish(n)}catch(t){return _.error("[FileProvider] Search failed:",t),[]}}async searchRecent(e,r){if(!r.recentFiles||r.recentFiles.length===0)return[];const s=await Promise.all(r.recentFiles.filter(t=>e?g(e,t)!==null:!0).slice(0,3).map(t=>{const i=t.split("/").pop()||t,n=i.split(".").pop()||"";return this.fileToCandidate({path:t,name:i,extension:n})}));return s.forEach(t=>{this.recentFiles.add(t.uri)}),s}async searchContextual(e,r){return r.currentFile?[]:[]}async fileToCandidate(e){const r=this.getFileIcon(e.extension),s=e.path,t=this.formatPath(s);return{id:`file-${e.path}`,type:"file",label:e.name,subtitle:t,description:s,icon:r,uri:`devspace://file/${encodeURIComponent(e.path)}`,meta:{path:s,fullPath:e.path,lastModified:e.lastModified,size:e.size,language:e.language||this.getLanguageFromExtension(e.extension)}}}combineResults(...e){const r=new Set,s=[];for(const t of e)for(const i of t)r.has(i.uri)||(r.add(i.uri),s.push(i));return this.deduplicateAndDistinguish(s)}deduplicateAndDistinguish(e){const r=new Map;for(const t of e){const i=t.label;let n=r.get(i);n||(n=[],r.set(i,n)),n.push(t)}const s=[];for(const[t,i]of r.entries())if(i.length===1)s.push(i[0]);else{const n=this.distinguishDuplicates(i);s.push(...n)}return s}distinguishDuplicates(e){const r=e.map(t=>t.description||t.meta?.path||"");return e.map((t,i)=>{const n=r[i],a=r.filter((p,m)=>m!==i),o=n.split("/");let l="";for(let p=o.length;p>0;p--){const m=o.slice(-p).join("/");if(!a.some(d=>d.split("/").slice(-p).join("/")===m)||p===1){l=m;break}}return{...t,subtitle:l}})}groupResults(e){const r={recent:[],relevant:[],other:[]};for(const t of e)this.recentFiles.has(t.uri)?r.recent.push(t):(t.score??0)>.7?r.relevant.push(t):r.other.push(t);const s=[];return r.recent.length>0&&s.push(...r.recent.slice(0,3).map(t=>({...t,group:b.chat_mentions_recentFiles_group()}))),r.relevant.length>0&&s.push(...r.relevant.slice(0,5).map(t=>({...t,group:b.chat_mentions_mostRelevant_group()}))),r.other.length>0&&s.push(...r.other.slice(0,10).map(t=>({...t,group:b.chat_mentions_otherFiles_group()}))),s}scoreRelevance(e,r){let s=.5;if(this.recentFiles.has(e.uri)&&(s+=.2),r.currentFile&&e.meta?.path){const t=r.currentFile.substring(0,r.currentFile.lastIndexOf("/")),i=e.meta.path.substring(0,e.meta.path.lastIndexOf("/"));t===i&&(s+=.15)}return r.imports?.includes(e.meta?.path||"")&&(s+=.25),r.currentFile?.includes(".test.")&&e.meta?.path?.includes(".test.")&&(s+=.1),Math.min(s,1)}getGroups(){return[{id:"files-recent",label:b.chat_mentions_recentFiles_group(),icon:"🕐"},{id:"files-all",label:b.chat_mentions_allFiles_group(),icon:"📁"},{id:"files-tests",label:b.chat_mentions_testFiles_group(),icon:"🧪"}]}getFileIcon(e){return this.fileIconMap[e.toLowerCase()]||"📄"}formatPath(e){if(e.length>40){const r=e.split("/");if(r.length>2)return`.../${r.slice(-2).join("/")}`}return e}getLanguageFromExtension(e){return{ts:"typescript",tsx:"typescriptreact",js:"javascript",jsx:"javascriptreact",py:"python",rs:"rust",go:"go",java:"java",cpp:"cpp",c:"c",svelte:"svelte",vue:"vue",md:"markdown",json:"json",yaml:"yaml",yml:"yaml",html:"html",css:"css",scss:"scss",sql:"sql",sh:"shellscript"}[e.toLowerCase()]||"plaintext"}}class q{constructor(){u(this,"id","member")}getCacheKey(e){const r=k.state;return JSON.stringify({backendId:W.select(r),ownPrincipalId:r.presence.ownPrincipalId,members:e.workspaceId?L.select(r,e.workspaceId):[]})}async search(e,r){const{workspaceId:s}=r;if(!s)return[];const t=e.replace(/^@/,"").toLowerCase();return L.select(k.state,s).filter(i=>i.login.toLowerCase().includes(t)).map(i=>({id:`member-${i.principalId}`,type:"member",label:i.login,subtitle:i.identity?`${i.identity.provider==="github"?"GitHub":"GitLab"} · ${i.identity.host}`:void 0,description:i.displayName??void 0,icon:"👤",uri:`devspace://member/${encodeURIComponent(i.principalId)}?workspaceId=${encodeURIComponent(s)}`,score:.8,meta:{workspaceId:s,principalId:i.principalId,identity:i.identity,avatarUrl:i.avatarUrl??void 0}}))}}class ee{constructor(){u(this,"id","folder");u(this,"triggers",["@folder","@dir"])}async search(e,r){const s=r.workspaceId;if(!s)return[];try{const{backendRequest:t}=await y(async()=>{const{backendRequest:o}=await import("./BfQPFCP7.js").then(l=>l.j);return{backendRequest:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10]),import.meta.url),i=await t("search.fileNames",{workspaceId:s,pattern:e||"",limit:200}),n=Array.isArray(i?.files)?i.files:[],a=new Set;for(const o of n){const l=o.split("/");for(let p=1;p<l.length;p++)a.add(l.slice(0,p).join("/"))}return[...a].filter(o=>e?g(e,o.split("/").pop()||o)!==null:!0).slice(0,10).map(o=>({id:`folder-${o}`,type:"folder",label:o.split("/").pop()||o,description:o,icon:"📁",uri:`devspace://folder/${encodeURIComponent(o)}`,meta:{path:o,fullPath:o,relativePath:o}}))}catch(t){return _.debug("[FolderProvider] Failed to get folders:",t),[]}}}const te=10,re=.3;function se(c){const e=c.toLowerCase().split(/\s+/).filter(Boolean);return(r,s)=>{const t=r?g(c,r):null;if(t)return 1+t.score;if(s){const i=s.toLowerCase();if(e.every(n=>i.includes(n)))return re}return 0}}class ie{constructor(){u(this,"id","note");u(this,"triggers",["@note","@n"]);u(this,"supportsRanges",!0);u(this,"cachedNotes",[]);u(this,"lastCacheUpdate",0);u(this,"cacheTimeout",5e3)}async getSiblingWorkspaces(e){if(!e)return[];try{const[{store:r},{selectWorkspaceItems:s}]=await Promise.all([y(()=>import("./CsI7oUrd.js"),__vite__mapDeps([11,12,13,2,14,15,4,8,1,16,6,3,17,18]),import.meta.url),y(()=>import("./BfdTnj-p.js").then(n=>n.ea),__vite__mapDeps([19,6,4,1,2,12,13,14,15,8,16,3,20,21,22,7,9,23,24,0,5,10,25,26]),import.meta.url)]),t=s.select(r.state),i=t.find(n=>n.id===e);return!i||!i.repositoryPath?[]:t.filter(n=>n.id!==e&&n.repositoryPath===i.repositoryPath)}catch(r){return _.debug("[NoteProvider] Failed to get sibling workspaces:",r),[]}}async fetchNotesFromWorkspace(e,r){try{const[{store:s},{listSlimNotesRequested:t}]=await Promise.all([y(()=>import("./CsI7oUrd.js"),__vite__mapDeps([11,12,13,2,14,15,4,8,1,16,6,3,17,18]),import.meta.url),y(()=>import("./Zs30783q.js").then(n=>n.My),__vite__mapDeps([12,13,2,14,15,4,8,1,16,6,3]),import.meta.url)]);return(await s.dispatch(t(e))).map(n=>({note:n,workspaceId:e,workspaceTitle:r}))}catch(s){_.debug(`[NoteProvider] Failed to fetch notes from workspace ${e}:`,s)}return[]}async search(e,r){if(!r.workspaceId)return[];const s=e.trim(),t=s?se(s):null;try{const i=await this.fetchNotesFromWorkspace(r.workspaceId),a=(await this.getSiblingWorkspaces(r.workspaceId)).map(d=>this.fetchNotesFromWorkspace(d.id,d.title)),l=(await Promise.all(a)).flat(),p=[...i,...l],w=(t?p.map(d=>({entry:d,score:t(d.note.title,d.note.content||d.note.contentPreview)})).filter(({score:d})=>d>0).sort((d,v)=>v.score-d.score):p.map(d=>({entry:d,score:void 0}))).slice(0,te).map(({entry:{note:d,workspaceId:v,workspaceTitle:h},score:f})=>{const P=v===r.workspaceId,I=P?void 0:b.chat_mentions_fromWorkspace_subtitle({workspace:h||v}),S=d.content||d.contentPreview;return{candidate:{id:d.id,type:"note",label:d.title||d.id||b.chat_mentions_untitledNote_label(),subtitle:I,description:S?`${S.substring(0,100)}...`:"",icon:"📝",uri:`devspace://note/${d.id}`,meta:{preview:S?.substring(0,200)||"",workspaceId:v,...P?{}:{isExternalLink:!0}}},score:f}});if(this.cachedNotes=w.map(({candidate:d})=>d),this.lastCacheUpdate=Date.now(),w.length>0)return w.map(({candidate:d,score:v})=>v!==void 0?{...d,score:v}:d)}catch(i){_.debug("[NoteProvider] Failed to fetch notes:",i)}return this.cachedNotes.length>0?t?this.cachedNotes.map(i=>({...i,score:t(i.label,i.meta?.preview)})).filter(i=>i.score>0).sort((i,n)=>n.score-i.score):this.cachedNotes:[]}getCachedNotes(){return Date.now()-this.lastCacheUpdate>this.cacheTimeout?[]:this.cachedNotes}}class ne{constructor(){u(this,"id","external");u(this,"triggers",["@docs","@external"])}async search(e,r){return[{id:"react-docs",label:"React Documentation",url:"https://react.dev",description:"Official React documentation"},{id:"mdn",label:"MDN Web Docs",url:"https://developer.mozilla.org",description:"Web technology documentation"},{id:"typescript",label:"TypeScript Handbook",url:"https://www.typescriptlang.org/docs/",description:"TypeScript documentation"}].filter(t=>!e||g(e,t.label)!==null).map(t=>({id:`external-${t.id}`,type:"external-source",label:t.label,description:t.description,icon:"📚",uri:`devspace://external/${t.id}`,meta:{url:t.url}}))}}class oe{constructor(){u(this,"id","rule");u(this,"triggers",["@rule","@intent"])}async search(e,r){return[{path:".intent/rules/cli.md",label:"CLI Rules"},{path:".intent/rules/frontend.md",label:"Frontend Rules"},{path:".intent/rules/python.md",label:"Python Rules"},{path:".intent/rules/sidecar.md",label:"Sidecar Rules"},{path:".intent/rules/systems.md",label:"Systems Rules"}].filter(t=>!e||g(e,t.label)!==null).map(t=>({id:t.path,type:"rule",label:t.label,subtitle:t.path,icon:"📚",uri:`devspace://rule/${encodeURIComponent(t.path)}`,meta:{path:t.path}}))}}class ae{constructor(){u(this,"id","task");u(this,"triggers",["@task","@todo"])}async search(e,r){return[{id:"task-1",label:"Implement authentication",status:"in_progress",assignee:"John Doe"},{id:"task-2",label:"Write tests",status:"not_started",assignee:"Jane Smith"},{id:"task-3",label:"Deploy to production",status:"completed",assignee:"Bob Johnson"}].filter(t=>!e||g(e,t.label)!==null).map(t=>({id:`task-${t.id}`,type:"task",label:t.label,subtitle:`${t.status} • ${t.assignee}`,icon:"📋",uri:`devspace://task/${t.id}`,meta:{taskStatus:t.status,assignee:t.assignee}}))}}class ce{constructor(){u(this,"id","personality");u(this,"triggers",["@personality","@persona"]);u(this,"personalities",[{id:"auggie-personality-agent-default",name:"Agent Auggie",description:"Default helpful AI assistant",icon:"🤖",temperature:.7,model:"default",promptToken:"auggie-personality-agent-default"},{id:"auggie-personality-prototyper",name:"Prototyper Auggie",description:"Specialized in rapid prototyping",icon:"⚡",temperature:.7,model:"default",promptToken:"auggie-personality-prototyper"},{id:"auggie-personality-brainstorm",name:"Brainstorm Auggie",description:"Creative ideation and exploration",icon:"💡",temperature:.7,model:"default",promptToken:"auggie-personality-brainstorm"},{id:"auggie-personality-reviewer",name:"Reviewer Auggie",description:"Code review and feedback",icon:"🔍",temperature:.7,model:"default",promptToken:"auggie-personality-reviewer"}])}async search(e,r){return this.personalities.filter(s=>!e||g(e,s.name)!==null).map(s=>({id:s.id,type:"personality",label:s.name,subtitle:`${s.model}`,description:s.description,icon:s.icon,uri:`devspace://personality/${s.id}`,meta:{promptToken:s.promptToken}}))}}class le{constructor(){u(this,"id","command");u(this,"triggers",["@cmd","@command"])}async search(e,r){return[N.USE_DEFAULT_CONTEXT,N.CLEAR_CONTEXT].filter(t=>!e||t.label.toLowerCase().includes(e.toLowerCase()))}}class ue{constructor(){u(this,"id","terminal");u(this,"triggers",["@terminal","@term"])}async search(e,r){try{const{terminalManager:s}=await y(async()=>{const{terminalManager:h}=await import("./BfmZaG-s.js").then(f=>f.b);return{terminalManager:h}},__vite__mapDeps([27,2,1,28,29,3,4,30,31,12,13,14,15,8,16,6,0,5,7,9,10,32,24,33,34,35,36,37,38,39,40,25,41,42]),import.meta.url),{selectTerminals:t,selectTerminalDisplayName:i}=await y(async()=>{const{selectTerminals:h,selectTerminalDisplayName:f}=await import("./C33vrAzQ.js").then(P=>P.i);return{selectTerminals:h,selectTerminalDisplayName:f}},__vite__mapDeps([41,12,13,2,14,15,4,8,1,16,6,3]),import.meta.url),a=k.state;if(!r.workspaceId)return[];const o=t.select(a,r.workspaceId),l=s.loadTerminalMetadata(r.workspaceId),p=new Set,m=[];for(const h of o)p.add(h.id),m.push({id:h.id,name:i.select(a,r.workspaceId,h.id)});for(const h of l)p.has(h.terminalId)||(p.add(h.terminalId),m.push({id:h.terminalId,name:h.title||b.terminal_quakeOverlay_terminal_fallback()}));if(m.length===0)return[];const d=e?["terminal","term"].some(h=>h.startsWith(e.toLowerCase())||e.toLowerCase().startsWith(h)):!1;return(e&&!d?m.filter(h=>g(e,h.name)!==null):m).slice(0,10).map((h,f)=>({id:h.id,type:"terminal",label:h.name,subtitle:b.chat_mentions_terminalIndex_subtitle({index:f+1}),description:b.chat_mentions_terminalOutput_description(),icon:"💻",uri:`devspace://terminal/${encodeURIComponent(h.id)}`,meta:{workspaceId:r.workspaceId}}))}catch(s){return _.debug("[TerminalProvider] Failed to get terminals:",s),[]}}}class de{constructor(){u(this,"id","script");u(this,"triggers",["@script","@scripts"])}async search(e,r){try{const{selectScriptEntries:s}=await y(async()=>{const{selectScriptEntries:o}=await import("./Bj-YBxcA.js");return{selectScriptEntries:o}},__vite__mapDeps([43,12,13,2,14,15,4,8,1,16,6,3,44,45,22,7,9,46,47,23,0,5,10,21,48,26,49,50,20,51,52,53,54,19,24,25,55,29,28,56,57,58,59,33,60,61,31]),import.meta.url);if(!r.workspaceId)return[];const t=s.select(k.state,r.workspaceId);if(t.length===0)return[];const n=e?["script","scripts"].some(o=>o.startsWith(e.toLowerCase())||e.toLowerCase().startsWith(o)):!1;return(e&&!n?t.filter(o=>g(e,o.name)!==null||g(e,M(o))!==null):t).slice(0,10).map(o=>{const l=o.runtime.status,p=x(l)?b.chat_mentions_scriptRunning_label():l==="exited"?b.chat_mentions_scriptExited_label():b.chat_mentions_scriptIdle_label();return{id:o.id,type:"script",label:o.name,subtitle:`${p} · ${M(o)}`,description:b.chat_mentions_scriptOutput_description(),icon:"▶️",uri:`devspace://script/${encodeURIComponent(o.id)}`,meta:{workspaceId:r.workspaceId,command:o.command,status:x(l)?"ok":l==="exited"?"warning":void 0}}})}catch(s){return _.debug("[ScriptProvider] Failed to get scripts:",s),[]}}}class pe{constructor(){u(this,"id","specialist");u(this,"triggers",["@specialist","@spec"])}async search(e,r){try{const s=j.select(k.state);return!s||s.length===0?[]:s.filter(t=>e?g(e,t.name)!==null||g(e,t.id)!==null||g(e,t.description)!==null||g(e,"specialist")!==null:!0).map(t=>({id:`specialist-${t.id}`,type:"specialist",label:t.name,subtitle:t.description,description:t.description,icon:"👤",uri:`devspace://specialist/${encodeURIComponent(t.id)}`,group:"Specialists",score:.8,meta:{promptToken:`specialist/${t.id}`}})).slice(0,10)}catch(s){return _.debug("[SpecialistProvider] Failed to get specialists:",s),[]}}}class he{constructor(){u(this,"id","agent");u(this,"triggers",["@agent"])}async search(e,r){try{const{selectAllWorkspaceAgents:s}=await y(async()=>{const{selectAllWorkspaceAgents:a}=await import("./BfdTnj-p.js").then(o=>o.e7);return{selectAllWorkspaceAgents:a}},__vite__mapDeps([19,6,4,1,2,12,13,14,15,8,16,3,20,21,22,7,9,23,24,0,5,10,25,26]),import.meta.url),t=r.workspaceId;if(!t)return[];const i=s.select(k.state,t);if(i.length===0)return[];const n=[];for(const a of i){const o=a.id,l=a.name||o,p=a.metadata?.specialist||"";let m=a.metadata?.specialistName||"";if(p&&!m){const f=U.select(k.state,p);f&&(m=f.name)}if(e){const f=g(e,l)!==null,P=g(e,"agent")!==null,I=m&&g(e,m)!==null,S=p&&g(e,p)!==null;if(!f&&!P&&!I&&!S)continue}const w=a.isStreaming?"responding":a.status||"active",d=[];m?d.push(m):d.push("Agent"),d.push(w);const v=a.messages?.length||0;v>0&&d.push(`${v} msg${v!==1?"s":""}`);const h=a.lastActivity||a.lastModified;h&&!a.isStreaming&&d.push(z(new Date(h))),n.push({id:o,type:"agent",label:l,subtitle:d.join(" · "),description:m?b.chat_mentions_specialistAgentInWorkspace_description({specialist:m}):b.chat_mentions_agentInWorkspace_description(),icon:"🤖",uri:`devspace://agent/${encodeURIComponent(o)}`,group:b.chat_mentions_agents_group(),score:.7,meta:{workspaceId:t}})}return n.slice(0,10)}catch(s){return _.debug("[AgentProvider] Failed to get agents:",s),[]}}}class me{constructor(){u(this,"providers",new Map);u(this,"defaultProviders",[]);this.register(new Z),this.register(new ee),this.register(new ie),this.register(new ne),this.register(new oe),this.register(new ae),this.register(new ce),this.register(new le),this.register(new ue),this.register(new de),this.register(new he),this.register(new pe),this.register(new q),this.defaultProviders=["file","folder","note","terminal","script","agent","specialist","member"]}register(e){this.providers.set(e.id,e),_.debug("[ProviderRegistry] Registered provider:",e.id)}unregister(e){this.providers.delete(e)}get(e){return this.providers.get(e)}getAll(){return Array.from(this.providers.values())}getDefault(){return this.defaultProviders.map(e=>this.providers.get(e)).filter(Boolean)}getByTrigger(e){return Array.from(this.providers.values()).filter(r=>r.triggers?.includes(e))}async searchAll(e,r){const s=e.startsWith("@")?this.getByTrigger(e.split(" ")[0]):this.getDefault();return(await Promise.all(s.map(i=>i.search(e,r)))).flat()}}const Te=new me;export{Ie as D,Ce as M,Q as a,ke as i,Te as p,R as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as i,aW as l,aw as d,P as o}from"./
|
|
1
|
+
import{b as i,aW as l,aw as d,P as o}from"./Bw79RGVy.js";var x=i((r,t)=>{const e=r.append("rect");if(e.attr("x",t.x),e.attr("y",t.y),e.attr("fill",t.fill),e.attr("stroke",t.stroke),e.attr("width",t.width),e.attr("height",t.height),t.name&&e.attr("name",t.name),t.rx&&e.attr("rx",t.rx),t.ry&&e.attr("ry",t.ry),t.attrs!==void 0)for(const s in t.attrs)e.attr(s,t.attrs[s]);return t.class&&e.attr("class",t.class),e},"drawRect"),p=i((r,t)=>{const e={x:t.startx,y:t.starty,width:t.stopx-t.startx,height:t.stopy-t.starty,fill:t.fill,stroke:t.stroke,class:"rect"};x(r,e).lower()},"drawBackgroundRect"),y=i((r,t)=>{const e=t.text.replace(d," "),s=r.append("text");s.attr("x",t.x),s.attr("y",t.y),s.attr("class","legend"),s.style("text-anchor",t.anchor),t.class&&s.attr("class",t.class);const a=s.append("tspan");return a.attr("x",t.x+t.textMargin*2),a.text(e),s},"drawText"),m=i((r,t,e,s)=>{const a=r.append("image");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",n)},"drawImage"),g=i((r,t,e,s)=>{const a=r.append("use");a.attr("x",t),a.attr("y",e);const n=o.sanitizeUrl(s);a.attr("xlink:href",`#${n}`)},"drawEmbeddedImage"),h=i(()=>({x:0,y:0,width:100,height:100,fill:"#EDF2AE",stroke:"#666",anchor:"start",rx:0,ry:0}),"getNoteRect"),f=i(()=>({x:0,y:0,width:100,height:100,"text-anchor":"start",style:"#666",textMargin:0,rx:0,ry:0,tspan:!0}),"getTextObj"),w=i(()=>{let r=l(".mermaidTooltip");return r.empty()&&(r=l("body").append("div").attr("class","mermaidTooltip").style("opacity",0).style("position","absolute").style("text-align","center").style("max-width","200px").style("padding","2px").style("font-size","12px").style("background","#ffffde").style("border","1px solid #333").style("border-radius","2px").style("pointer-events","none").style("z-index","100")),r},"createTooltip");export{g as a,m as b,w as c,p as d,x as e,y as f,h as g,f as h};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as p}from"./BXwdEeCG.js";import{A as s,z as l}from"./
|
|
1
|
+
import{d as p}from"./BXwdEeCG.js";import{A as s,z as l}from"./CTKxd-aq.js";import{selectScriptOutput as o,selectScriptById as f,selectCanReadScriptDefinition as m}from"./Bj-YBxcA.js";async function a(i,t,e,r=100){const n=s(o.select(i,t,e)).slice(-r);if(!t||!e)return n;const u=f.select(i,t,e);if(!m.select(i,t,u))return[];try{const c=l(await p.scripts.output(t,e,r));return c.length>0?c.slice(-r):n}catch{return n}}export{a as readScriptContextOutputLines};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{d as l,v as h,t as k}from"./Dms_DO28.js";import{Jq as s,vJ as w}from"./Zs30783q.js";import{i as W,d as E,e as c,n as i,b as m}from"./
|
|
1
|
+
import{d as l,v as h,t as k}from"./Dms_DO28.js";import{Jq as s,vJ as w}from"./Zs30783q.js";import{i as W,d as E,e as c,n as i,b as m}from"./CYrmrI7Y.js";const A=new Set(["new","creating"]);function g(n){let t;try{t=decodeURIComponent(n)}catch{return null}return t.length===0||A.has(t)?null:t}function f(n){const t=/^\/workspace\/([^/?#]+)\/?(?:[?#].*)?$/.exec(n);return t?g(t[1]):null}function I(n){const t=/^\/workspace\/([^/?#]+)(?:[/?#].*)?$/.exec(n);return t?g(t[1]):null}function N(n,t){return t.length>0&&I(n)===t}function p(){return typeof window>"u"?null:window.location?.pathname??null}function d(n,t){const e=`/workspace/${encodeURIComponent(n)}`,a=t?new URLSearchParams(t).toString():"";return a?`${e}?${a}`:e}function R(n,t){const e=t?.presenceFollowRequestId;return e?w(n,e):w(n)}function P(n,t){return t?i(n,{state:t}):i(n)}function o(n){return n?.tabState?.currentTabId??null}async function S(n,t,e,a){m();const u=P(t,e),r={workspaceId:n,epoch:c(),startTabId:a};return await u,r}function b(n){return!n||W()||E()}function y(n,t){if(c()!==n.epoch||t!==n.startTabId&&t!==n.workspaceId)return!1;const e=p();return e===null||f(e)===n.workspaceId}async function v(n,t,e){if(b(n))return!1;const a=await S(n,t,e,o(s.state));return y(a,o(s.state))?(s.dispatch(R(n,e)),!0):!1}function*T(n,t,e){if(b(n))return!1;const a=o(yield*h(r=>r)),u=yield*l(S,n,t,e,a);return y(u,o(yield*h(r=>r)))?(yield*k(R(n,e)),!0):!1}function _(){m();const n=c(),t=o(s.state),e=p();return()=>c()===n&&o(s.state)===t&&p()===e}function O(n,t={}){return v(n,d(n,t.query),t.state)}function $(n,t={}){return T(n,d(n,t.query),t.state)}async function q(n){const t=f(n);t?await v(t,n,void 0):await i(n)}function*J(n){const t=f(n);t?yield*l(T,t,n,void 0):yield*l(i,n)}const U=Object.freeze(Object.defineProperty({__proto__:null,claimNavigation:_,navigateToAppRoute:q,navigateToAppRouteSaga:J,openAndShowWorkspace:O,showWorkspaceSaga:$,workspaceRoute:d},Symbol.toStringTag,{value:"Module"}));export{p as a,J as b,_ as c,$ as d,d as e,N as i,q as n,O as o,f as p,U as s,I as w};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/
|
|
2
|
-
import{_ as Z}from"./DxxarOOi.js";import{b as u,ay as o,aD as I,ah as ee,s as te,t as ne,u as se,aL as L,ad as re,ae as ie,a9 as D,Q as S,af as R,X as ae,W as oe,a4 as ce,aR as le,ba as ue,at as de,bh as fe}from"./DAbdqRSx.js";import{G as k}from"./-xK_vQQs.js";function P(e,{edgePathsClass:n="edges edgePaths"}={}){const t=e.insert("g").attr("class","root"),r=t.insert("g").attr("class","clusters"),s=t.insert("g").attr("class",n),i=t.insert("g").attr("class","edgeLabels"),c=t.insert("g").attr("class","nodes");return{clusters:r,edgePaths:s,edgeLabels:i,nodes:c,rootGroups:t}}u(P,"createLayoutElementGroups");async function T(e,n,t){if(n.label){const{shapeSvg:r,bbox:s}=await de(e,t===void 0?n:{...n,width:t});n.labelBBox={width:s.width,height:s.height},r.remove()}else n.labelBBox={width:0,height:0}}u(T,"measureGroupLabel");async function _(e,n,t){const r=await ee(e,n,t),s=r.node()?.getBBox()??{width:0,height:0};return n.width=s.width,n.height=s.height,r}u(_,"insertMeasuredNode");function B(e,n,t){let r=e;const s=new Set;for(;r;){if(r.dir)return r.dir;if(!r.parentId||s.has(r.parentId))break;s.add(r.parentId),r=n.get(r.parentId)}return t}u(B,"resolveNodeDir");async function M(e,n,t={}){const r=new k({multigraph:!0,compound:!0}),s=[...n.edges],i=ae(),c=P(e),{edgeLabels:f,nodes:a}=c,g=new Map,m=new Map(n.nodes.map(d=>[d.id,d])),C=n.direction,w=e.node()!=null;await Promise.all(n.nodes.map(async d=>{if(d.isGroup){if(w){const b=t.unwrapGroupLabels&&d.labelType!=="markdown";await T(a,d,b?Number.POSITIVE_INFINITY:void 0)}r.setNode(d.id,{...d})}else{if(w){const b=await _(a,d,{config:i,dir:B(d,m,C)});g.set(d.id,b)}r.setNode(d.id,{...d})}}));for(const d of s)w&&D(d)&&await R(f,d),r.setEdge(d.start,d.end,{...d},d.id),n.edges.some(E=>E.id===d.id)||n.edges.push(d);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:d}=await Z(async()=>{const{captureNodeSizes:b}=await import("./eUuFvR6M.js");return{captureNodeSizes:b}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78]),import.meta.url);d(e,n)}return{graph:r,groups:c,nodeElements:g}}u(M,"createGraphWithElements");var l=new Map,h=new Map,A=new Map,ge=u(()=>{h.clear(),A.clear(),l.clear()},"clear"),v=u((e,n)=>{const t=h.get(n)||[];return o.trace("In isDescendant",n," ",e," = ",t.includes(e)),t.includes(e)},"isDescendant"),be=u((e,n)=>{const t=h.get(n)||[];return o.info("Descendants of ",n," is ",t),o.info("Edge is ",e),e.v===n||e.w===n?!1:t?t.includes(e.v)||v(e.v,n)||v(e.w,n)||t.includes(e.w):(o.debug("Tilt, ",n,",not in descendants"),!1)},"edgeInCluster"),X=u((e,n,t,r)=>{o.debug("Copying children of ",e,"root",r,"data",n.node(e),r);const s=n.children(e)||[];e!==r&&s.push(e),o.debug("Copying (nodes) clusterId",e,"nodes",s),s.forEach(i=>{if(n.children(i).length>0)X(i,n,t,r);else{const c=n.node(i);o.info("cp ",i," to ",r," with parent ",e),t.setNode(i,c),r!==n.parent(i)&&(o.debug("Setting parent",i,n.parent(i)),t.setParent(i,n.parent(i))),e!==r&&i!==e?(o.debug("Setting parent",i,e),t.setParent(i,e)):(o.info("In copy ",e,"root",r,"data",n.node(e),r),o.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==r,"node!==clusterId",i!==e));const f=n.edges(i);o.debug("Copying Edges",f),f.forEach(a=>{o.info("Edge",a);const g=n.edge(a.v,a.w,a.name);o.info("Edge data",g,r);try{be(a,r)?(o.info("Copying as ",a.v,a.w,g,a.name),t.setEdge(a.v,a.w,g,a.name),o.info("newGraph edges ",t.edges(),t.edge(t.edges()[0]))):o.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",r," clusterId:",e)}catch(m){o.error(m)}})}o.debug("Removing node",i),n.removeNode(i)})},"copy"),G=u((e,n)=>{const t=n.children(e);let r=[...t];for(const s of t)A.set(s,e),r=[...r,...G(s,n)];return r},"extractDescendants"),he=u((e,n,t)=>{const r=e.edges().filter(a=>a.v===n||a.w===n),s=e.edges().filter(a=>a.v===t||a.w===t),i=r.map(a=>({v:a.v===n?t:a.v,w:a.w===n?n:a.w})),c=s.map(a=>({v:a.v,w:a.w}));return i.filter(a=>c.some(g=>a.v===g.v&&a.w===g.w))},"findCommonEdges"),p=u((e,n,t)=>{const r=n.children(e);if(o.trace("Searching children of id ",e,r),r.length<1)return e;let s;for(const i of r){const c=p(i,n,t),f=he(n,t,c);if(c)if(f.length>0)s=c;else return c}return s},"findNonClusterChild"),x=u(e=>!l.has(e)||!l.get(e).externalConnections?e:l.has(e)?l.get(e).id:e,"getAnchorId"),Ne=u((e,n)=>{if(!e||n>10){o.debug("Opting out, no graph ");return}else o.debug("Opting in, graph ");e.nodes().forEach(function(t){e.children(t).length>0&&(o.debug("Cluster identified",t," Replacement id in edges: ",p(t,e,t)),h.set(t,G(t,e)),l.set(t,{id:p(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){const r=e.children(t),s=e.edges();r.length>0?(o.debug("Cluster identified",t,h),s.forEach(i=>{const c=v(i.v,t),f=v(i.w,t);c^f&&(o.debug("Edge: ",i," leaves cluster ",t),o.debug("Descendants of XXX ",t,": ",h.get(t)),l.get(t).externalConnections=!0)})):o.debug("Not a cluster ",t,h)});for(let t of l.keys()){const r=l.get(t).id,s=e.parent(r);s!==t&&l.has(s)&&!l.get(s).externalConnections&&(l.get(t).id=s);const i=e.edges().some(c=>c.v===t);if(r&&l.get(t)?.externalConnections&&i&&$(e,r,t)){const c=me(e,t,e.parent(r));c&&(l.get(t).id=c)}}e.edges().forEach(function(t){const r=e.edge(t);o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let s=t.v,i=t.w;if(o.debug("Fix XXX",l,"ids:",t.v,t.w,"Translating: ",l.get(t.v)," --- ",l.get(t.w)),l.get(t.v)||l.get(t.w)){if(o.debug("Fixing and trying - removing XXX",t.v,t.w,t.name),s=x(t.v),i=x(t.w),e.removeEdge(t.v,t.w,t.name),s!==t.v){const c=e.parent(s);l.get(c).externalConnections=!0,r.fromCluster=t.v}if(i!==t.w){const c=e.parent(i);l.get(c).externalConnections=!0,r.toCluster=t.w}o.debug("Fix Replacing with XXX",s,i,t.name),e.setEdge(s,i,r,t.name)}}),O(e,0),o.trace(l)},"adjustClustersAndEdges"),O=u((e,n)=>{if(n>10){o.error("Bailing out");return}let t=e.nodes(),r=!1;for(const s of t){const i=e.children(s);r=r||i.length>0}if(!r){o.debug("Done, no node has children",e.nodes());return}o.debug("Nodes = ",t,n);for(const s of t)if(o.debug("Extracting node",s,l,l.has(s)&&!l.get(s).externalConnections,!e.parent(s),e.node(s),e.children("D")," Depth ",n),!l.has(s))o.debug("Not a cluster",s,n);else if(!l.get(s).externalConnections&&e.children(s)&&e.children(s).length>0){o.debug("Cluster without external connections, without a parent and with children",s,n);let c=e.graph().rankdir==="TB"?"LR":"TB";l.get(s)?.clusterData?.dir&&(c=l.get(s).clusterData.dir,o.debug("Fixing dir",l.get(s).clusterData.dir,c));const f=new k({multigraph:!0,compound:!0}).setGraph({rankdir:c,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});X(s,e,f,s),e.setNode(s,{clusterNode:!0,id:s,clusterData:l.get(s).clusterData,label:l.get(s).label,graph:f})}else o.debug("Cluster ** ",s," **not meeting the criteria !externalConnections:",!l.get(s).externalConnections," no parent: ",!e.parent(s)," children ",e.children(s)&&e.children(s).length>0,e.children("D"),n),o.debug(l);t=e.nodes(),o.debug("New list of nodes",t);for(const s of t){const i=e.node(s);o.debug(" Now next level",s,i),i?.clusterNode&&O(i.graph,n+1)}},"extractor"),F=u((e,n)=>{if(n.length===0)return[];let t=Object.assign([],n);return n.forEach(r=>{const s=e.children(r),i=F(e,s);t=[...t,...i]}),t},"sorter"),ye=u(e=>F(e,e.children()),"sortNodesByHierarchy"),$=u((e,n,t)=>{let r=e.parent(n);for(;r&&r!==t;){const s=l.get(r);if(s&&!s.externalConnections)return!0;r=e.parent(r)}return!1},"isNodeInExtractableCluster"),me=u((e,n,t)=>{const r=e.children(n)??[];for(const s of r){if(s===t||v(s,t))continue;const i=p(s,e,n);if(i&&!$(e,i,n))return i}return null},"findSafeAnchorNode");function we({prepareLayout:e,measureLayout:n,runLayoutCore:t,paintLayout:r,afterPaint:s,paintOptions:i}){const c=n??z;return u(async function(a,g,m,C){const w=g.select("g");(m?.insertMarkers??I)(w,a.markers,a.type,a.diagramId),j();const d={element:w,helpers:m,options:C};d.preparedLayout=await e?.(a,d);const b=await c(a,d),E=await t(a,d),N={...d,measure:b};r?await r(a,N,E):await H(a,N,i),await s?.(a,N,E)},"render")}u(we,"createCommonLayoutRenderer");function j(){te(),ne(),se(),ge()}u(j,"clearLayoutRenderState");async function z(e,{element:n},t){return await M(n,e,t)}u(z,"defaultMeasureLayout");async function H(e,n,t={}){const{measure:r}=n,{groups:s}=r;for(const c of t.getNodes?.(e,n)??e.nodes)t.skipNode?.(c,n)||await W(s,c,n,t);const i=V(e.nodes);for(const c of e.edges)Q(c,t)||await Y(s,c,i,e,t,n)}u(H,"paintLayoutData");async function W(e,n,t,r){n.clusterNode?L(n):J(n,t,r)?await re(e.clusters,n):L(n)}u(W,"paintLayoutNode");function J(e,n,t){return e.isGroup===!0&&(t.isCluster?.(e,n)??!0)}u(J,"shouldPaintAsCluster");function V(e){const n=new Map;for(const t of e)t?.id&&n.set(t.id,t);return n}u(V,"buildNodeLookup");function Q(e,n){return e.isLayoutOnly||!!n.skipEdge?.(e)}u(Q,"shouldSkipPaintEdge");async function Y(e,n,t,r,s,i){const c=ie(e.edgePaths,{...n},s.clusterDb??new Map,r.type,y(n.start,n,t,i,s),y(n.end,n,t,i,s),r.diagramId,q(n,s),r.layoutAlgorithm);D(n)&&(S.has(n.id)||await R(e.edgeLabels,n),K(n,c))}u(Y,"paintLayoutEdge");function y(e,n,t,r,s){return s.getEdgeNode?.(e,n,r)??(e?t.get(e)??{}:{})}u(y,"getRenderedNode");function q(e,n){return typeof n.skipIntersect=="function"?n.skipIntersect(e):n.skipIntersect??!1}u(q,"shouldSkipIntersect");function K(e,n){const t=n?.updatedPath??n?.originalPath,r=oe(),{subGraphTitleTotalMargin:s}=ce({flowchart:r.flowchart??{}});if(e.label){const i=S.get(e.id),{x:c,y:f}=le(e,n);i.attr("transform",`translate(${c}, ${f+s/2})`)}for(const[i,c]of[["startLeft",e.startLabelLeft],["startRight",e.startLabelRight],["endLeft",e.endLabelLeft],["endRight",e.endLabelRight]])if(c){const{x:f,y:a}=U(e,i,t);ue.get(e.id)[i].attr("transform",`translate(${f}, ${a})`)}}u(K,"positionRenderedEdgeLabel");var ve={startLeft:"start_left",startRight:"start_right",endLeft:"end_left",endRight:"end_right"};function U(e,n,t){const r=e.terminalLabelCenters?.[n];if(r)return{...r};if(!t)return{x:e.x,y:e.y};const s=n.startsWith("start")?e.arrowTypeStart:e.arrowTypeEnd;return fe.calcTerminalLabelPosition(s?10:0,ve[n],t)}u(U,"terminalLabelTranslate");export{Ne as a,we as b,l as c,P as d,z as e,p as f,_ as i,ye as s};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/CY3iiE5t.js","/app/immutable/chunks/Bw79RGVy.js","/app/immutable/chunks/DxxarOOi.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/Be3ctlCz.js","/app/immutable/chunks/BfdTnj-p.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/Zs30783q.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/50l-lj9m.js","/app/immutable/chunks/C600Ggsz.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/B5yEHkSy.js","/app/immutable/chunks/CruJ4jyB.js","/app/immutable/chunks/DzAQQ1i-.js","/app/immutable/chunks/Ch-D6DCZ.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/BUT4El0L.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/BfQPFCP7.js","/app/immutable/chunks/C0_snm4j.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/CkbzWFJM.js","/app/immutable/chunks/BqJSWZOr.js","/app/immutable/chunks/piMAhJa1.js","/app/immutable/chunks/DkkzFfYK.js","/app/immutable/chunks/D5eCb9SA.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/ByAetY4P.js","/app/immutable/chunks/BWsFbeUj.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/DSjVYlVX.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/CL3a4Hm1.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/CYrmrI7Y.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/BmO6NekI.js","/app/immutable/chunks/D1E_1zhz.js","/app/immutable/chunks/CAeNUoVv.js","/app/immutable/chunks/DhNEeuS_.js","/app/immutable/chunks/Hxdz4eYy.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/BXwdEeCG.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/BKD7o1lQ.js","/app/immutable/chunks/C23BHMTF.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/CvP7-iXZ.js","/app/immutable/chunks/DBEo2Y3v.js","/app/immutable/chunks/VlOW_lom.js","/app/immutable/chunks/Cncxuk-H.js","/app/immutable/chunks/DeaknxEN.js","/app/immutable/chunks/BrfF5NLx.js","/app/immutable/assets/menu-footer.Ck5GCpgU.css","/app/immutable/chunks/DBI9dTMM.js","/app/immutable/assets/dialog.BtQTVchw.css","/app/immutable/chunks/euI_ACTK.js","/app/immutable/assets/confirm.UE5obH5A.css","/app/immutable/chunks/Dep4c5m-.js","/app/immutable/chunks/B55Lo0FS.js","/app/immutable/chunks/BLKGmMKH.js","/app/immutable/chunks/CC7to1B5.js","/app/immutable/chunks/BzL9Egzq.js","/app/immutable/assets/slider.kL-wkHnx.css","/app/immutable/chunks/DYME5vl6.js","/app/immutable/chunks/BaUyyVaF.js","/app/immutable/chunks/DAsc1V4f.js","/app/immutable/chunks/BsieX9dN.js","/app/immutable/chunks/BbIcudMY.js","/app/immutable/chunks/qM_0Sky2.js","/app/immutable/chunks/BYqiRSP_.js","/app/immutable/assets/DiagramPresentation.C2GLYoBN.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as Z}from"./DxxarOOi.js";import{b as u,ay as o,aD as I,ah as ee,s as te,t as ne,u as se,aL as L,ad as re,ae as ie,a9 as D,Q as S,af as R,X as ae,W as oe,a4 as ce,aR as le,ba as ue,at as de,bh as fe}from"./Bw79RGVy.js";import{G as k}from"./-xK_vQQs.js";function P(e,{edgePathsClass:n="edges edgePaths"}={}){const t=e.insert("g").attr("class","root"),r=t.insert("g").attr("class","clusters"),s=t.insert("g").attr("class",n),i=t.insert("g").attr("class","edgeLabels"),c=t.insert("g").attr("class","nodes");return{clusters:r,edgePaths:s,edgeLabels:i,nodes:c,rootGroups:t}}u(P,"createLayoutElementGroups");async function T(e,n,t){if(n.label){const{shapeSvg:r,bbox:s}=await de(e,t===void 0?n:{...n,width:t});n.labelBBox={width:s.width,height:s.height},r.remove()}else n.labelBBox={width:0,height:0}}u(T,"measureGroupLabel");async function _(e,n,t){const r=await ee(e,n,t),s=r.node()?.getBBox()??{width:0,height:0};return n.width=s.width,n.height=s.height,r}u(_,"insertMeasuredNode");function B(e,n,t){let r=e;const s=new Set;for(;r;){if(r.dir)return r.dir;if(!r.parentId||s.has(r.parentId))break;s.add(r.parentId),r=n.get(r.parentId)}return t}u(B,"resolveNodeDir");async function M(e,n,t={}){const r=new k({multigraph:!0,compound:!0}),s=[...n.edges],i=ae(),c=P(e),{edgeLabels:f,nodes:a}=c,g=new Map,m=new Map(n.nodes.map(d=>[d.id,d])),C=n.direction,w=e.node()!=null;await Promise.all(n.nodes.map(async d=>{if(d.isGroup){if(w){const b=t.unwrapGroupLabels&&d.labelType!=="markdown";await T(a,d,b?Number.POSITIVE_INFINITY:void 0)}r.setNode(d.id,{...d})}else{if(w){const b=await _(a,d,{config:i,dir:B(d,m,C)});g.set(d.id,b)}r.setNode(d.id,{...d})}}));for(const d of s)w&&D(d)&&await R(f,d),r.setEdge(d.start,d.end,{...d},d.id),n.edges.some(E=>E.id===d.id)||n.edges.push(d);if(globalThis.mermaidCaptureSizes){const{captureNodeSizes:d}=await Z(async()=>{const{captureNodeSizes:b}=await import("./CY3iiE5t.js");return{captureNodeSizes:b}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78]),import.meta.url);d(e,n)}return{graph:r,groups:c,nodeElements:g}}u(M,"createGraphWithElements");var l=new Map,h=new Map,A=new Map,ge=u(()=>{h.clear(),A.clear(),l.clear()},"clear"),v=u((e,n)=>{const t=h.get(n)||[];return o.trace("In isDescendant",n," ",e," = ",t.includes(e)),t.includes(e)},"isDescendant"),be=u((e,n)=>{const t=h.get(n)||[];return o.info("Descendants of ",n," is ",t),o.info("Edge is ",e),e.v===n||e.w===n?!1:t?t.includes(e.v)||v(e.v,n)||v(e.w,n)||t.includes(e.w):(o.debug("Tilt, ",n,",not in descendants"),!1)},"edgeInCluster"),X=u((e,n,t,r)=>{o.debug("Copying children of ",e,"root",r,"data",n.node(e),r);const s=n.children(e)||[];e!==r&&s.push(e),o.debug("Copying (nodes) clusterId",e,"nodes",s),s.forEach(i=>{if(n.children(i).length>0)X(i,n,t,r);else{const c=n.node(i);o.info("cp ",i," to ",r," with parent ",e),t.setNode(i,c),r!==n.parent(i)&&(o.debug("Setting parent",i,n.parent(i)),t.setParent(i,n.parent(i))),e!==r&&i!==e?(o.debug("Setting parent",i,e),t.setParent(i,e)):(o.info("In copy ",e,"root",r,"data",n.node(e),r),o.debug("Not Setting parent for node=",i,"cluster!==rootId",e!==r,"node!==clusterId",i!==e));const f=n.edges(i);o.debug("Copying Edges",f),f.forEach(a=>{o.info("Edge",a);const g=n.edge(a.v,a.w,a.name);o.info("Edge data",g,r);try{be(a,r)?(o.info("Copying as ",a.v,a.w,g,a.name),t.setEdge(a.v,a.w,g,a.name),o.info("newGraph edges ",t.edges(),t.edge(t.edges()[0]))):o.info("Skipping copy of edge ",a.v,"-->",a.w," rootId: ",r," clusterId:",e)}catch(m){o.error(m)}})}o.debug("Removing node",i),n.removeNode(i)})},"copy"),G=u((e,n)=>{const t=n.children(e);let r=[...t];for(const s of t)A.set(s,e),r=[...r,...G(s,n)];return r},"extractDescendants"),he=u((e,n,t)=>{const r=e.edges().filter(a=>a.v===n||a.w===n),s=e.edges().filter(a=>a.v===t||a.w===t),i=r.map(a=>({v:a.v===n?t:a.v,w:a.w===n?n:a.w})),c=s.map(a=>({v:a.v,w:a.w}));return i.filter(a=>c.some(g=>a.v===g.v&&a.w===g.w))},"findCommonEdges"),p=u((e,n,t)=>{const r=n.children(e);if(o.trace("Searching children of id ",e,r),r.length<1)return e;let s;for(const i of r){const c=p(i,n,t),f=he(n,t,c);if(c)if(f.length>0)s=c;else return c}return s},"findNonClusterChild"),x=u(e=>!l.has(e)||!l.get(e).externalConnections?e:l.has(e)?l.get(e).id:e,"getAnchorId"),Ne=u((e,n)=>{if(!e||n>10){o.debug("Opting out, no graph ");return}else o.debug("Opting in, graph ");e.nodes().forEach(function(t){e.children(t).length>0&&(o.debug("Cluster identified",t," Replacement id in edges: ",p(t,e,t)),h.set(t,G(t,e)),l.set(t,{id:p(t,e,t),clusterData:e.node(t)}))}),e.nodes().forEach(function(t){const r=e.children(t),s=e.edges();r.length>0?(o.debug("Cluster identified",t,h),s.forEach(i=>{const c=v(i.v,t),f=v(i.w,t);c^f&&(o.debug("Edge: ",i," leaves cluster ",t),o.debug("Descendants of XXX ",t,": ",h.get(t)),l.get(t).externalConnections=!0)})):o.debug("Not a cluster ",t,h)});for(let t of l.keys()){const r=l.get(t).id,s=e.parent(r);s!==t&&l.has(s)&&!l.get(s).externalConnections&&(l.get(t).id=s);const i=e.edges().some(c=>c.v===t);if(r&&l.get(t)?.externalConnections&&i&&$(e,r,t)){const c=me(e,t,e.parent(r));c&&(l.get(t).id=c)}}e.edges().forEach(function(t){const r=e.edge(t);o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(t)),o.debug("Edge "+t.v+" -> "+t.w+": "+JSON.stringify(e.edge(t)));let s=t.v,i=t.w;if(o.debug("Fix XXX",l,"ids:",t.v,t.w,"Translating: ",l.get(t.v)," --- ",l.get(t.w)),l.get(t.v)||l.get(t.w)){if(o.debug("Fixing and trying - removing XXX",t.v,t.w,t.name),s=x(t.v),i=x(t.w),e.removeEdge(t.v,t.w,t.name),s!==t.v){const c=e.parent(s);l.get(c).externalConnections=!0,r.fromCluster=t.v}if(i!==t.w){const c=e.parent(i);l.get(c).externalConnections=!0,r.toCluster=t.w}o.debug("Fix Replacing with XXX",s,i,t.name),e.setEdge(s,i,r,t.name)}}),O(e,0),o.trace(l)},"adjustClustersAndEdges"),O=u((e,n)=>{if(n>10){o.error("Bailing out");return}let t=e.nodes(),r=!1;for(const s of t){const i=e.children(s);r=r||i.length>0}if(!r){o.debug("Done, no node has children",e.nodes());return}o.debug("Nodes = ",t,n);for(const s of t)if(o.debug("Extracting node",s,l,l.has(s)&&!l.get(s).externalConnections,!e.parent(s),e.node(s),e.children("D")," Depth ",n),!l.has(s))o.debug("Not a cluster",s,n);else if(!l.get(s).externalConnections&&e.children(s)&&e.children(s).length>0){o.debug("Cluster without external connections, without a parent and with children",s,n);let c=e.graph().rankdir==="TB"?"LR":"TB";l.get(s)?.clusterData?.dir&&(c=l.get(s).clusterData.dir,o.debug("Fixing dir",l.get(s).clusterData.dir,c));const f=new k({multigraph:!0,compound:!0}).setGraph({rankdir:c,nodesep:50,ranksep:50,marginx:8,marginy:8}).setDefaultEdgeLabel(function(){return{}});X(s,e,f,s),e.setNode(s,{clusterNode:!0,id:s,clusterData:l.get(s).clusterData,label:l.get(s).label,graph:f})}else o.debug("Cluster ** ",s," **not meeting the criteria !externalConnections:",!l.get(s).externalConnections," no parent: ",!e.parent(s)," children ",e.children(s)&&e.children(s).length>0,e.children("D"),n),o.debug(l);t=e.nodes(),o.debug("New list of nodes",t);for(const s of t){const i=e.node(s);o.debug(" Now next level",s,i),i?.clusterNode&&O(i.graph,n+1)}},"extractor"),F=u((e,n)=>{if(n.length===0)return[];let t=Object.assign([],n);return n.forEach(r=>{const s=e.children(r),i=F(e,s);t=[...t,...i]}),t},"sorter"),ye=u(e=>F(e,e.children()),"sortNodesByHierarchy"),$=u((e,n,t)=>{let r=e.parent(n);for(;r&&r!==t;){const s=l.get(r);if(s&&!s.externalConnections)return!0;r=e.parent(r)}return!1},"isNodeInExtractableCluster"),me=u((e,n,t)=>{const r=e.children(n)??[];for(const s of r){if(s===t||v(s,t))continue;const i=p(s,e,n);if(i&&!$(e,i,n))return i}return null},"findSafeAnchorNode");function we({prepareLayout:e,measureLayout:n,runLayoutCore:t,paintLayout:r,afterPaint:s,paintOptions:i}){const c=n??z;return u(async function(a,g,m,C){const w=g.select("g");(m?.insertMarkers??I)(w,a.markers,a.type,a.diagramId),j();const d={element:w,helpers:m,options:C};d.preparedLayout=await e?.(a,d);const b=await c(a,d),E=await t(a,d),N={...d,measure:b};r?await r(a,N,E):await H(a,N,i),await s?.(a,N,E)},"render")}u(we,"createCommonLayoutRenderer");function j(){te(),ne(),se(),ge()}u(j,"clearLayoutRenderState");async function z(e,{element:n},t){return await M(n,e,t)}u(z,"defaultMeasureLayout");async function H(e,n,t={}){const{measure:r}=n,{groups:s}=r;for(const c of t.getNodes?.(e,n)??e.nodes)t.skipNode?.(c,n)||await W(s,c,n,t);const i=V(e.nodes);for(const c of e.edges)Q(c,t)||await Y(s,c,i,e,t,n)}u(H,"paintLayoutData");async function W(e,n,t,r){n.clusterNode?L(n):J(n,t,r)?await re(e.clusters,n):L(n)}u(W,"paintLayoutNode");function J(e,n,t){return e.isGroup===!0&&(t.isCluster?.(e,n)??!0)}u(J,"shouldPaintAsCluster");function V(e){const n=new Map;for(const t of e)t?.id&&n.set(t.id,t);return n}u(V,"buildNodeLookup");function Q(e,n){return e.isLayoutOnly||!!n.skipEdge?.(e)}u(Q,"shouldSkipPaintEdge");async function Y(e,n,t,r,s,i){const c=ie(e.edgePaths,{...n},s.clusterDb??new Map,r.type,y(n.start,n,t,i,s),y(n.end,n,t,i,s),r.diagramId,q(n,s),r.layoutAlgorithm);D(n)&&(S.has(n.id)||await R(e.edgeLabels,n),K(n,c))}u(Y,"paintLayoutEdge");function y(e,n,t,r,s){return s.getEdgeNode?.(e,n,r)??(e?t.get(e)??{}:{})}u(y,"getRenderedNode");function q(e,n){return typeof n.skipIntersect=="function"?n.skipIntersect(e):n.skipIntersect??!1}u(q,"shouldSkipIntersect");function K(e,n){const t=n?.updatedPath??n?.originalPath,r=oe(),{subGraphTitleTotalMargin:s}=ce({flowchart:r.flowchart??{}});if(e.label){const i=S.get(e.id),{x:c,y:f}=le(e,n);i.attr("transform",`translate(${c}, ${f+s/2})`)}for(const[i,c]of[["startLeft",e.startLabelLeft],["startRight",e.startLabelRight],["endLeft",e.endLabelLeft],["endRight",e.endLabelRight]])if(c){const{x:f,y:a}=U(e,i,t);ue.get(e.id)[i].attr("transform",`translate(${f}, ${a})`)}}u(K,"positionRenderedEdgeLabel");var ve={startLeft:"start_left",startRight:"start_right",endLeft:"end_left",endRight:"end_right"};function U(e,n,t){const r=e.terminalLabelCenters?.[n];if(r)return{...r};if(!t)return{x:e.x,y:e.y};const s=n.startsWith("start")?e.arrowTypeStart:e.arrowTypeEnd;return fe.calcTerminalLabelPosition(s?10:0,ve[n],t)}u(U,"terminalLabelTranslate");export{Ne as a,we as b,l as c,P as d,z as e,p as f,_ as i,ye as s};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as bt,bo as b,bw as _t,bq as gt,b as vt,bm as x,bs as me,br as Te}from"./DxxarOOi.js";import{bs as ht,cd as yt,ca as wt,bk as xt,a7 as B,ay as _,W as r,bn as It,aA as g,aD as t,bS as N,a5 as be,bH as De,bA as _e,b_ as W,aB as E,c9 as o,bf as kt,bl as oe,bO as ae,bV as Ct}from"./3SdAC2_C.js";import{i as z}from"./DzAQQ1i-.js";import{g as $t}from"./BUT4El0L.js";import{s as We}from"./C600Ggsz.js";import{c as S}from"./CruJ4jyB.js";import{f as Pt,s as Le,b as At}from"./Ch-D6DCZ.js";import{cK as Et,bn as Ot,aM as Ft,F as ne,aZ as Tt,aN as Dt,bo as Lt,a8 as Ge,aw as Bt}from"./B5yEHkSy.js";import{W as Nt,T as zt,G as St,C as Rt,X as Ht,J as Mt,V as Wt}from"./Dgmf4O3-.js";import{f as ge}from"./D5eCb9SA.js";import"./BfQPFCP7.js";import{D as Gt}from"./_NdZi_dM.js";import{g as Vt,R as jt,k as qt,j as Jt,i as Kt,h as Ve}from"./CvP7-iXZ.js";import{m as ve}from"./DkkzFfYK.js";import{c as Ut}from"./ChTqQfQN.js";import"./BWsFbeUj.js";import{Jq as je,ne as Xt,G6 as Yt}from"./Zs30783q.js";import{w as Zt}from"./Bqd7fdCF.js";import{i as U}from"./CL3a4Hm1.js";import{b3 as Qt,aN as er,aL as tr}from"./DvyPNixU.js";import{cy as rr}from"./BfdTnj-p.js";import{t as or}from"./H2jLkRRS.js";const ar={cursor:Rt,ghostty:St,terminal:zt,warp:Nt},nr={vscode:Wt,jetbrains:Mt,xcode:Ht};function sr(O){return ar[O.id]??nr[O.handlerType]??null}function qe(O){return O==="terminal"?Et:O==="finder"?Ot:Ft}const ir="shrink-0 text-muted-foreground hover:text-foreground focus-visible:text-foreground [&_svg]:size-4",Be="finder",lr={id:Be,name:"Finder",shortLabel:"Finder",appName:"Finder",category:"finder",handlerType:"finder",installed:!0,priority:0};function cr(O,s=[]){const se=new Set(s),X=O.filter(({installed:Y,id:ye})=>Y&&!se.has(ye));return X.some(({id:Y})=>Y===Be)||se.has(Be)?X:[...X,lr]}var dr=E('<img alt="" class="size-4"/>'),ur=E('<kbd class="type-caption ml-4 text-muted-foreground" aria-hidden="true"> </kbd>'),pr=E('<span class="min-w-0 flex-1 truncate"> </span> <!>',1),fr=E("<span> </span>"),he=E("<!> <!>",1),mr=E("<span><!></span>"),br=E('<img class="w-4 h-4"/>'),_r=E('<!> <span class="text-muted-foreground"> </span>',1),gr=E('<div class="inline-flex items-stretch rounded-md border border-border" data-open-combo-control=""><!> <!></div>'),vr=E('<div class="type-caption px-2 py-1.5 text-subtle"> </div>'),hr=E('<div class="w-60 max-w-full"><!> <!> <!></div>'),yr=E("<div><!></div>");function wr(O,s){if(new.target)return bt({component:wr,...O});ht(s,!0);const se=()=>me(Ue,"$installedEditors$",ie),X=()=>me(Xe,"$hiddenEditorIds$",ie),Y=()=>me(Ye,"$isWorkspaceHostLocal$",ie),ye=()=>me(Ke,"$openAction",ie),[ie,Je]=gt(),le=(e,d=kt)=>{var u=B(),p=_(u);S(p,()=>jt,(te,j)=>{j(te,{get value(){return t(v).id},children:(F,L)=>{var k=B(),T=_(k);$t(T,17,d,C=>C.id,(C,c)=>{var q=B(),h=_(q);{const $=a=>{var i=B(),y=_(i);{var H=l=>{var A=dr();W(()=>Le(A,"src",`data:image/png;base64,${t(c).iconBase64??""}`)),r(l,A)},m=l=>{const A=o(()=>t(c).icon);var M=B(),D=_(M);S(D,()=>t(A),(J,re)=>{re(J,{size:16})}),r(l,M)},P=l=>{{let A=o(()=>t(c).faIcon??qe(t(c).category));ne(l,{get icon(){return t(A)},class:"size-4 text-muted-foreground"})}};z(y,l=>{t(c).iconBase64?l(H):t(c).icon?l(m,1):l(P,-1)})}r(a,i)};let n=o(()=>!I());S(h,()=>Vt,(a,i)=>{i(a,{get value(){return t(c).id},closeOnSelect:!0,get disabled(){return t(n)},onSelect:()=>tt(t(c).id),get textValue(){return t(c).label},leading:$,children:(y,H)=>{var m=pr(),P=_(m),l=oe(P,!0),A=N(P,2);{var M=D=>{var J=ur(),re=oe(J,!0);W(()=>ae(re,t(c).shortcut)),r(D,J)};z(A,D=>{t(c).shortcut&&D(M)})}W(()=>ae(l,t(c).label)),r(y,m)},$$slots:{leading:!0,default:!0}})})}r(C,q)}),r(F,k)},$$slots:{default:!0}})}),r(e,u)},Ne=Ut("OpenComboButton");let I=b(s,"filePath",7),ce=b(s,"workspaceId",7,""),de=b(s,"isDirectory",7,!0),we=b(s,"workspaceFolderPath",7),xe=b(s,"class",7,""),ue=b(s,"headerText",7),Ie=b(s,"usePortal",7,!0),ke=b(s,"side",7,"bottom"),G=b(s,"variant",7,"default"),Z=b(s,"branchName",7),Ce=b(s,"compact",7,!1),$e=b(s,"embedded",7,!1),Q=b(s,"inline",7,!1),V=b(s,"iconOnly",7,!1),R=b(s,"children",7,void 0);const ze=o(()=>G()==="sidebar"?"bg-sidebar hover:bg-sidebar/80":"bg-background hover:bg-muted"),Pe=yt(ce());wt(()=>{Pe.set(ce())});const Ke=Qt(),Ue=er(Pe),Xe=tr(),Ye=rr(Pe);let ee=Ct(!1);xt(()=>{je.dispatch(Xt())});function Ze(e){return{id:e.id,label:e.name,shortLabel:e.shortLabel,icon:sr(e),shortcut:e.shortcut,handlerType:e.handlerType,appName:e.appName,category:e.category,iconBase64:e.iconBase64}}const Qe=Zt("externalEditors");let f=o(()=>{const e=se(),d=cr(e,X()).map(Ze),u={id:"other",label:x.ui_openCombo_other_label(),shortLabel:x.ui_openCombo_other_label(),icon:null,faIcon:Lt,handlerType:"generic"},p=[{id:"copy",label:x.ui_openCombo_copyPath_label(),shortLabel:x.ui_openCombo_copy_shortLabel(),icon:null,faIcon:Tt},...Z()?[{id:"copy-branch",label:x.ui_openCombo_copyBranch_label(),shortLabel:x.ui_openCombo_copyBranch_shortLabel(),icon:null,faIcon:Dt}]:[]];return!Qe||!Y()?p:[...d,u,...p]});const pe=o(()=>t(f).some(e=>e.id!=="copy"&&e.id!=="copy-branch")),fe=o(()=>t(f).filter(e=>e.id!=="copy"&&e.id!=="copy-branch")),Se=o(()=>t(f).filter(e=>e.id==="copy"||e.id==="copy-branch")),v=o(()=>t(pe)?t(f).find(e=>e.id===ye())||t(f)[0]:t(f).find(e=>e.id==="copy")||t(f)[0]),Ae=o(()=>t(pe)?x.ui_openCombo_openIn_tooltip({name:t(v).label}):t(v).label);function Ee(){if(de())return I();const e=we()||I().substring(0,I().lastIndexOf("/"));return e?{folder:e,file:I()}:I()}async function Oe(e){if(!I())return;const d=de()?I():I().substring(0,I().lastIndexOf("/"));try{if(e==="copy"){await navigator.clipboard.writeText(or(I())),ve.success(x.ui_openCombo_pathCopied_label());return}if(e==="copy-branch"){Z()&&(await navigator.clipboard.writeText(Z()),ve.success(x.ui_openCombo_branchCopied_label()));return}if(e==="other"){const p=await U("external-editors:open-with-other",{path:d});p?.success?De(ee,!1):p?.error&&p.error!=="No application selected"&&ve.error(p.error);return}const u=t(f).find(p=>p.id===e);if(!u){Ne.warn(`Unknown action: ${e}`);return}switch(u.handlerType){case"finder":await U("shell:showItemInFolder",{path:d});break;case"vscode":await U("vscode:open",Ee());break;case"jetbrains":await U("jetbrains:open",Ee());break;case"xcode":await U("xcode:open",Ee());break;case"generic":default:{await U("external-editors:open",{editorId:u.id,path:d});break}}}catch(u){Ne.error(`Failed to execute action ${e}:`,u),ve.error(u instanceof Error?u.message:x.ui_openCombo_openFailed_error({name:e}))}}function Fe(e){e.stopPropagation(),Oe(t(v).id)}function et(e){e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),e.stopPropagation(),Oe(t(v).id))}function Re(e){e.stopPropagation()}function tt(e){je.dispatch(Yt(e)),Oe(e),De(ee,!1)}var rt={get filePath(){return I()},set filePath(e){I(e),g()},get workspaceId(){return ce()},set workspaceId(e=""){ce(e),g()},get isDirectory(){return de()},set isDirectory(e=!0){de(e),g()},get workspaceFolderPath(){return we()},set workspaceFolderPath(e){we(e),g()},get class(){return xe()},set class(e=""){xe(e),g()},get headerText(){return ue()},set headerText(e){ue(e),g()},get usePortal(){return Ie()},set usePortal(e=!0){Ie(e),g()},get side(){return ke()},set side(e="bottom"){ke(e),g()},get variant(){return G()},set variant(e="default"){G(e),g()},get branchName(){return Z()},set branchName(e){Z(e),g()},get compact(){return Ce()},set compact(e=!1){Ce(e),g()},get embedded(){return $e()},set embedded(e=!1){$e(e),g()},get inline(){return Q()},set inline(e=!1){Q(e),g()},get iconOnly(){return V()},set iconOnly(e=!1){V(e),g()},get children(){return R()},set children(e=void 0){R(e),g()},$set:_t,$on:(e,d)=>vt(s,e,d)},He=B(),ot=_(He);{var at=e=>{var d=he(),u=_(d);{var p=j=>{var F=he(),L=_(F);S(L,()=>Kt,(T,C)=>{C(T,{children:(c,q)=>{var h=he(),$=_(h);S($,()=>qt,(a,i)=>{i(a,{get icon(){return Ge},children:(y,H)=>{var m=fr(),P=oe(m,!0);W(l=>ae(P,l),[()=>x.ui_openCombo_openInApp_tooltip()]),r(y,m)},$$slots:{default:!0}})});var n=N($,2);S(n,()=>Jt,(a,i)=>{i(a,{class:"w-60",children:(y,H)=>{le(y,()=>t(fe))},$$slots:{default:!0}})}),r(c,h)},$$slots:{default:!0}})});var k=N(L,2);S(k,()=>Ve,(T,C)=>{C(T,{})}),r(j,F)};z(u,j=>{t(fe).length&&j(p)})}var te=N(u,2);le(te,()=>t(Se)),r(e,d)},nt=e=>{var d=yr(),u=be(d);{const p=(F,L)=>{let k=()=>(L?.()).props;var T=B(),C=_(T);{var c=n=>{var a=mr();At(a,()=>({role:"button",tabindex:"0",onclick:t(f).length>1?void 0:Fe,onkeydown:t(f).length>1?void 0:et,...t(f).length>1?k():{},class:"cursor-pointer break-words rounded-sm text-inherit underline decoration-muted-foreground/20 underline-offset-2 hover:decoration-current focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",title:t(Ae)}));var i=be(a);We(i,R),_e(a),r(n,a)},q=n=>{{let a=o(()=>t(f).length>1?void 0:Fe),i=o(()=>V()&&G()!=="sidebar"?"plain":"ghost"),y=o(()=>V()?G()==="sidebar"?"icon-compact":"icon-sm":void 0),H=o(()=>V()&&G()==="sidebar"&&t(ee)),m=o(()=>!V()),P=o(()=>V()?G()==="sidebar"?ir:"cursor-pointer text-muted-foreground hover:text-foreground focus-visible:text-foreground":"cursor-pointer");ge(n,Te({type:"button",get onclick(){return t(a)}},()=>t(f).length>1?k():{},{get variant(){return t(i)},get size(){return t(y)},get active(){return t(H)},get wrapContent(){return t(m)},get class(){return t(P)},get title(){return t(Ae)},children:(l,A)=>{var M=B(),D=_(M);We(D,R),r(l,M)},$$slots:{default:!0}}))}},h=n=>{{let a=o(()=>x.ui_openCombo_openInApp_tooltip());ge(n,Te(k,{variant:"ghost-light",size:"icon-xs",get tooltip(){return t(a)},tooltipSide:"bottom",children:(i,y)=>{ne(i,{get icon(){return Ge},size:"xs"})},$$slots:{default:!0}}))}},$=n=>{var a=gr(),i=be(a);{let m=o(()=>t(f).length>1?"rounded-r-none":""),P=o(()=>t(ze)),l=o(()=>t(pe)?t(Ae):void 0);ge(i,{type:"button",variant:"ghost",size:"sm",get class(){return`gap-1.5 px-2 ${t(m)??""} ${t(P)??""}`},onpointerdown:Re,onkeydown:Re,onclick:Fe,get title(){return t(l)},children:(A,M)=>{var D=_r(),J=_(D);{var re=w=>{var K=br();W(()=>{Le(K,"src",`data:image/png;base64,${t(v).iconBase64??""}`),Le(K,"alt",t(v).label)}),r(w,K)},it=w=>{const K=o(()=>t(v).icon);var Me=B(),pt=_(Me);S(pt,()=>t(K),(ft,mt)=>{mt(ft,{size:14})}),r(w,Me)},lt=w=>{ne(w,{get icon(){return t(v).faIcon},class:"w-3.5 h-3.5 opacity-60"})},ct=w=>{{let K=o(()=>qe(t(v).category));ne(w,{get icon(){return t(K)},class:"w-3.5 h-3.5 opacity-60"})}};z(J,w=>{t(v).iconBase64?w(re):t(v).icon?w(it,1):t(v).faIcon?w(lt,2):w(ct,-1)})}var dt=N(J,2),ut=oe(dt,!0);W(w=>ae(ut,w),[()=>t(pe)?x.ui_openCombo_open_label():t(v).label]),r(A,D)},$$slots:{default:!0}})}var y=N(i,2);{var H=m=>{{let P=o(()=>x.ui_openCombo_openInApp_tooltip());ge(m,Te(k,{type:"button",variant:"ghost",size:"icon-sm",get"aria-label"(){return t(P)},get class(){return`rounded-l-none border-l border-border ${t(ze)??""}`},children:(l,A)=>{ne(l,{get icon(){return Bt},class:"size-3! text-muted-foreground"})},$$slots:{default:!0}}))}};z(y,m=>{t(f).length>1&&m(H)})}_e(a),r(n,a)};z(C,n=>{Q()&&R()?n(c):R()?n(q,1):Ce()?n(h,2):n($,-1)})}r(F,T)},te=F=>{var L=hr(),k=be(L);{var T=h=>{var $=vr(),n=oe($,!0);W(()=>ae(n,ue())),r(h,$)};z(k,h=>{ue()&&h(T)})}var C=N(k,2);{var c=h=>{var $=he(),n=_($);le(n,()=>t(fe));var a=N(n,2);S(a,()=>Ve,(i,y)=>{y(i,{})}),r(h,$)};z(C,h=>{t(fe).length&&h(c)})}var q=N(C,2);le(q,()=>t(Se)),_e(L),r(F,L)};let j=o(()=>Q()&&R()?"contents!":"");Gt(u,{align:"end",get portal(){return Ie()},get side(){return ke()},get class(){return t(j)},get open(){return t(ee)},set open(F){De(ee,F,!0)},trigger:p,content:te,$$slots:{trigger:!0,content:!0}})}_e(d),W(()=>Pt(d,1,`${Q()&&R()?"contents":"inline-flex items-center"} ${xe()??""}`)),r(e,d)};z(ot,e=>{$e()?e(at):e(nt,-1)})}r(O,He);var st=It(rt);return Je(),st}export{wr as O,sr as a,qe as r,ir as s};
|
|
1
|
+
import{t as bt,bo as b,bw as _t,bq as gt,b as vt,bm as x,bs as me,br as Te}from"./DxxarOOi.js";import{bs as ht,cd as yt,ca as wt,bk as xt,a7 as B,ay as _,W as r,bn as It,aA as g,aD as t,bS as N,a5 as be,bH as De,bA as _e,b_ as W,aB as E,c9 as o,bf as kt,bl as oe,bO as ae,bV as Ct}from"./3SdAC2_C.js";import{i as z}from"./DzAQQ1i-.js";import{g as $t}from"./BUT4El0L.js";import{s as We}from"./C600Ggsz.js";import{c as S}from"./CruJ4jyB.js";import{f as Pt,s as Le,b as At}from"./Ch-D6DCZ.js";import{cK as Et,bn as Ot,aM as Ft,F as ne,aZ as Tt,aN as Dt,bo as Lt,a8 as Ge,aw as Bt}from"./B5yEHkSy.js";import{W as Nt,T as zt,G as St,C as Rt,X as Ht,J as Mt,V as Wt}from"./Dgmf4O3-.js";import{f as ge}from"./D5eCb9SA.js";import"./BfQPFCP7.js";import{D as Gt}from"./_NdZi_dM.js";import{g as Vt,R as jt,k as qt,j as Jt,i as Kt,h as Ve}from"./CvP7-iXZ.js";import{m as ve}from"./DkkzFfYK.js";import{c as Ut}from"./ChTqQfQN.js";import"./BWsFbeUj.js";import{Jq as je,ne as Xt,G6 as Yt}from"./Zs30783q.js";import{w as Zt}from"./Bqd7fdCF.js";import{i as U}from"./CL3a4Hm1.js";import{b3 as Qt,aN as er,aL as tr}from"./piMAhJa1.js";import{cy as rr}from"./BfdTnj-p.js";import{t as or}from"./H2jLkRRS.js";const ar={cursor:Rt,ghostty:St,terminal:zt,warp:Nt},nr={vscode:Wt,jetbrains:Mt,xcode:Ht};function sr(O){return ar[O.id]??nr[O.handlerType]??null}function qe(O){return O==="terminal"?Et:O==="finder"?Ot:Ft}const ir="shrink-0 text-muted-foreground hover:text-foreground focus-visible:text-foreground [&_svg]:size-4",Be="finder",lr={id:Be,name:"Finder",shortLabel:"Finder",appName:"Finder",category:"finder",handlerType:"finder",installed:!0,priority:0};function cr(O,s=[]){const se=new Set(s),X=O.filter(({installed:Y,id:ye})=>Y&&!se.has(ye));return X.some(({id:Y})=>Y===Be)||se.has(Be)?X:[...X,lr]}var dr=E('<img alt="" class="size-4"/>'),ur=E('<kbd class="type-caption ml-4 text-muted-foreground" aria-hidden="true"> </kbd>'),pr=E('<span class="min-w-0 flex-1 truncate"> </span> <!>',1),fr=E("<span> </span>"),he=E("<!> <!>",1),mr=E("<span><!></span>"),br=E('<img class="w-4 h-4"/>'),_r=E('<!> <span class="text-muted-foreground"> </span>',1),gr=E('<div class="inline-flex items-stretch rounded-md border border-border" data-open-combo-control=""><!> <!></div>'),vr=E('<div class="type-caption px-2 py-1.5 text-subtle"> </div>'),hr=E('<div class="w-60 max-w-full"><!> <!> <!></div>'),yr=E("<div><!></div>");function wr(O,s){if(new.target)return bt({component:wr,...O});ht(s,!0);const se=()=>me(Ue,"$installedEditors$",ie),X=()=>me(Xe,"$hiddenEditorIds$",ie),Y=()=>me(Ye,"$isWorkspaceHostLocal$",ie),ye=()=>me(Ke,"$openAction",ie),[ie,Je]=gt(),le=(e,d=kt)=>{var u=B(),p=_(u);S(p,()=>jt,(te,j)=>{j(te,{get value(){return t(v).id},children:(F,L)=>{var k=B(),T=_(k);$t(T,17,d,C=>C.id,(C,c)=>{var q=B(),h=_(q);{const $=a=>{var i=B(),y=_(i);{var H=l=>{var A=dr();W(()=>Le(A,"src",`data:image/png;base64,${t(c).iconBase64??""}`)),r(l,A)},m=l=>{const A=o(()=>t(c).icon);var M=B(),D=_(M);S(D,()=>t(A),(J,re)=>{re(J,{size:16})}),r(l,M)},P=l=>{{let A=o(()=>t(c).faIcon??qe(t(c).category));ne(l,{get icon(){return t(A)},class:"size-4 text-muted-foreground"})}};z(y,l=>{t(c).iconBase64?l(H):t(c).icon?l(m,1):l(P,-1)})}r(a,i)};let n=o(()=>!I());S(h,()=>Vt,(a,i)=>{i(a,{get value(){return t(c).id},closeOnSelect:!0,get disabled(){return t(n)},onSelect:()=>tt(t(c).id),get textValue(){return t(c).label},leading:$,children:(y,H)=>{var m=pr(),P=_(m),l=oe(P,!0),A=N(P,2);{var M=D=>{var J=ur(),re=oe(J,!0);W(()=>ae(re,t(c).shortcut)),r(D,J)};z(A,D=>{t(c).shortcut&&D(M)})}W(()=>ae(l,t(c).label)),r(y,m)},$$slots:{leading:!0,default:!0}})})}r(C,q)}),r(F,k)},$$slots:{default:!0}})}),r(e,u)},Ne=Ut("OpenComboButton");let I=b(s,"filePath",7),ce=b(s,"workspaceId",7,""),de=b(s,"isDirectory",7,!0),we=b(s,"workspaceFolderPath",7),xe=b(s,"class",7,""),ue=b(s,"headerText",7),Ie=b(s,"usePortal",7,!0),ke=b(s,"side",7,"bottom"),G=b(s,"variant",7,"default"),Z=b(s,"branchName",7),Ce=b(s,"compact",7,!1),$e=b(s,"embedded",7,!1),Q=b(s,"inline",7,!1),V=b(s,"iconOnly",7,!1),R=b(s,"children",7,void 0);const ze=o(()=>G()==="sidebar"?"bg-sidebar hover:bg-sidebar/80":"bg-background hover:bg-muted"),Pe=yt(ce());wt(()=>{Pe.set(ce())});const Ke=Qt(),Ue=er(Pe),Xe=tr(),Ye=rr(Pe);let ee=Ct(!1);xt(()=>{je.dispatch(Xt())});function Ze(e){return{id:e.id,label:e.name,shortLabel:e.shortLabel,icon:sr(e),shortcut:e.shortcut,handlerType:e.handlerType,appName:e.appName,category:e.category,iconBase64:e.iconBase64}}const Qe=Zt("externalEditors");let f=o(()=>{const e=se(),d=cr(e,X()).map(Ze),u={id:"other",label:x.ui_openCombo_other_label(),shortLabel:x.ui_openCombo_other_label(),icon:null,faIcon:Lt,handlerType:"generic"},p=[{id:"copy",label:x.ui_openCombo_copyPath_label(),shortLabel:x.ui_openCombo_copy_shortLabel(),icon:null,faIcon:Tt},...Z()?[{id:"copy-branch",label:x.ui_openCombo_copyBranch_label(),shortLabel:x.ui_openCombo_copyBranch_shortLabel(),icon:null,faIcon:Dt}]:[]];return!Qe||!Y()?p:[...d,u,...p]});const pe=o(()=>t(f).some(e=>e.id!=="copy"&&e.id!=="copy-branch")),fe=o(()=>t(f).filter(e=>e.id!=="copy"&&e.id!=="copy-branch")),Se=o(()=>t(f).filter(e=>e.id==="copy"||e.id==="copy-branch")),v=o(()=>t(pe)?t(f).find(e=>e.id===ye())||t(f)[0]:t(f).find(e=>e.id==="copy")||t(f)[0]),Ae=o(()=>t(pe)?x.ui_openCombo_openIn_tooltip({name:t(v).label}):t(v).label);function Ee(){if(de())return I();const e=we()||I().substring(0,I().lastIndexOf("/"));return e?{folder:e,file:I()}:I()}async function Oe(e){if(!I())return;const d=de()?I():I().substring(0,I().lastIndexOf("/"));try{if(e==="copy"){await navigator.clipboard.writeText(or(I())),ve.success(x.ui_openCombo_pathCopied_label());return}if(e==="copy-branch"){Z()&&(await navigator.clipboard.writeText(Z()),ve.success(x.ui_openCombo_branchCopied_label()));return}if(e==="other"){const p=await U("external-editors:open-with-other",{path:d});p?.success?De(ee,!1):p?.error&&p.error!=="No application selected"&&ve.error(p.error);return}const u=t(f).find(p=>p.id===e);if(!u){Ne.warn(`Unknown action: ${e}`);return}switch(u.handlerType){case"finder":await U("shell:showItemInFolder",{path:d});break;case"vscode":await U("vscode:open",Ee());break;case"jetbrains":await U("jetbrains:open",Ee());break;case"xcode":await U("xcode:open",Ee());break;case"generic":default:{await U("external-editors:open",{editorId:u.id,path:d});break}}}catch(u){Ne.error(`Failed to execute action ${e}:`,u),ve.error(u instanceof Error?u.message:x.ui_openCombo_openFailed_error({name:e}))}}function Fe(e){e.stopPropagation(),Oe(t(v).id)}function et(e){e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),e.stopPropagation(),Oe(t(v).id))}function Re(e){e.stopPropagation()}function tt(e){je.dispatch(Yt(e)),Oe(e),De(ee,!1)}var rt={get filePath(){return I()},set filePath(e){I(e),g()},get workspaceId(){return ce()},set workspaceId(e=""){ce(e),g()},get isDirectory(){return de()},set isDirectory(e=!0){de(e),g()},get workspaceFolderPath(){return we()},set workspaceFolderPath(e){we(e),g()},get class(){return xe()},set class(e=""){xe(e),g()},get headerText(){return ue()},set headerText(e){ue(e),g()},get usePortal(){return Ie()},set usePortal(e=!0){Ie(e),g()},get side(){return ke()},set side(e="bottom"){ke(e),g()},get variant(){return G()},set variant(e="default"){G(e),g()},get branchName(){return Z()},set branchName(e){Z(e),g()},get compact(){return Ce()},set compact(e=!1){Ce(e),g()},get embedded(){return $e()},set embedded(e=!1){$e(e),g()},get inline(){return Q()},set inline(e=!1){Q(e),g()},get iconOnly(){return V()},set iconOnly(e=!1){V(e),g()},get children(){return R()},set children(e=void 0){R(e),g()},$set:_t,$on:(e,d)=>vt(s,e,d)},He=B(),ot=_(He);{var at=e=>{var d=he(),u=_(d);{var p=j=>{var F=he(),L=_(F);S(L,()=>Kt,(T,C)=>{C(T,{children:(c,q)=>{var h=he(),$=_(h);S($,()=>qt,(a,i)=>{i(a,{get icon(){return Ge},children:(y,H)=>{var m=fr(),P=oe(m,!0);W(l=>ae(P,l),[()=>x.ui_openCombo_openInApp_tooltip()]),r(y,m)},$$slots:{default:!0}})});var n=N($,2);S(n,()=>Jt,(a,i)=>{i(a,{class:"w-60",children:(y,H)=>{le(y,()=>t(fe))},$$slots:{default:!0}})}),r(c,h)},$$slots:{default:!0}})});var k=N(L,2);S(k,()=>Ve,(T,C)=>{C(T,{})}),r(j,F)};z(u,j=>{t(fe).length&&j(p)})}var te=N(u,2);le(te,()=>t(Se)),r(e,d)},nt=e=>{var d=yr(),u=be(d);{const p=(F,L)=>{let k=()=>(L?.()).props;var T=B(),C=_(T);{var c=n=>{var a=mr();At(a,()=>({role:"button",tabindex:"0",onclick:t(f).length>1?void 0:Fe,onkeydown:t(f).length>1?void 0:et,...t(f).length>1?k():{},class:"cursor-pointer break-words rounded-sm text-inherit underline decoration-muted-foreground/20 underline-offset-2 hover:decoration-current focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",title:t(Ae)}));var i=be(a);We(i,R),_e(a),r(n,a)},q=n=>{{let a=o(()=>t(f).length>1?void 0:Fe),i=o(()=>V()&&G()!=="sidebar"?"plain":"ghost"),y=o(()=>V()?G()==="sidebar"?"icon-compact":"icon-sm":void 0),H=o(()=>V()&&G()==="sidebar"&&t(ee)),m=o(()=>!V()),P=o(()=>V()?G()==="sidebar"?ir:"cursor-pointer text-muted-foreground hover:text-foreground focus-visible:text-foreground":"cursor-pointer");ge(n,Te({type:"button",get onclick(){return t(a)}},()=>t(f).length>1?k():{},{get variant(){return t(i)},get size(){return t(y)},get active(){return t(H)},get wrapContent(){return t(m)},get class(){return t(P)},get title(){return t(Ae)},children:(l,A)=>{var M=B(),D=_(M);We(D,R),r(l,M)},$$slots:{default:!0}}))}},h=n=>{{let a=o(()=>x.ui_openCombo_openInApp_tooltip());ge(n,Te(k,{variant:"ghost-light",size:"icon-xs",get tooltip(){return t(a)},tooltipSide:"bottom",children:(i,y)=>{ne(i,{get icon(){return Ge},size:"xs"})},$$slots:{default:!0}}))}},$=n=>{var a=gr(),i=be(a);{let m=o(()=>t(f).length>1?"rounded-r-none":""),P=o(()=>t(ze)),l=o(()=>t(pe)?t(Ae):void 0);ge(i,{type:"button",variant:"ghost",size:"sm",get class(){return`gap-1.5 px-2 ${t(m)??""} ${t(P)??""}`},onpointerdown:Re,onkeydown:Re,onclick:Fe,get title(){return t(l)},children:(A,M)=>{var D=_r(),J=_(D);{var re=w=>{var K=br();W(()=>{Le(K,"src",`data:image/png;base64,${t(v).iconBase64??""}`),Le(K,"alt",t(v).label)}),r(w,K)},it=w=>{const K=o(()=>t(v).icon);var Me=B(),pt=_(Me);S(pt,()=>t(K),(ft,mt)=>{mt(ft,{size:14})}),r(w,Me)},lt=w=>{ne(w,{get icon(){return t(v).faIcon},class:"w-3.5 h-3.5 opacity-60"})},ct=w=>{{let K=o(()=>qe(t(v).category));ne(w,{get icon(){return t(K)},class:"w-3.5 h-3.5 opacity-60"})}};z(J,w=>{t(v).iconBase64?w(re):t(v).icon?w(it,1):t(v).faIcon?w(lt,2):w(ct,-1)})}var dt=N(J,2),ut=oe(dt,!0);W(w=>ae(ut,w),[()=>t(pe)?x.ui_openCombo_open_label():t(v).label]),r(A,D)},$$slots:{default:!0}})}var y=N(i,2);{var H=m=>{{let P=o(()=>x.ui_openCombo_openInApp_tooltip());ge(m,Te(k,{type:"button",variant:"ghost",size:"icon-sm",get"aria-label"(){return t(P)},get class(){return`rounded-l-none border-l border-border ${t(ze)??""}`},children:(l,A)=>{ne(l,{get icon(){return Bt},class:"size-3! text-muted-foreground"})},$$slots:{default:!0}}))}};z(y,m=>{t(f).length>1&&m(H)})}_e(a),r(n,a)};z(C,n=>{Q()&&R()?n(c):R()?n(q,1):Ce()?n(h,2):n($,-1)})}r(F,T)},te=F=>{var L=hr(),k=be(L);{var T=h=>{var $=vr(),n=oe($,!0);W(()=>ae(n,ue())),r(h,$)};z(k,h=>{ue()&&h(T)})}var C=N(k,2);{var c=h=>{var $=he(),n=_($);le(n,()=>t(fe));var a=N(n,2);S(a,()=>Ve,(i,y)=>{y(i,{})}),r(h,$)};z(C,h=>{t(fe).length&&h(c)})}var q=N(C,2);le(q,()=>t(Se)),_e(L),r(F,L)};let j=o(()=>Q()&&R()?"contents!":"");Gt(u,{align:"end",get portal(){return Ie()},get side(){return ke()},get class(){return t(j)},get open(){return t(ee)},set open(F){De(ee,F,!0)},trigger:p,content:te,$$slots:{trigger:!0,content:!0}})}_e(d),W(()=>Pt(d,1,`${Q()&&R()?"contents":"inline-flex items-center"} ${xe()??""}`)),r(e,d)};z(ot,e=>{$e()?e(at):e(nt,-1)})}r(O,He);var st=It(rt);return Je(),st}export{wr as O,sr as a,qe as r,ir as s};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/
|
|
2
|
-
import{bm as v,_ as h}from"./DxxarOOi.js";import{a as S}from"./BdWqymET.js";import{bq as A,Jq as k,m as T,HW as C,GW as D,vr as j,vp as B,vG as V,nC as z}from"./Zs30783q.js";import{bL as $}from"./DvyPNixU.js";import{m as R}from"./DkkzFfYK.js";import"./3SdAC2_C.js";import"./Ch-D6DCZ.js";import"./C600Ggsz.js";import{R as N,F as g,E as G,Q as O}from"./BfQPFCP7.js";import"./ChTqQfQN.js";import"./BWsFbeUj.js";import{o as q}from"./CkbzWFJM.js";import{i as F}from"./BBWuirRW.js";const y=new WeakMap;function ye(e,t){const a=n=>{n&&n!=="new"?y.set(e,n):y.delete(e)};return a(t),{update:a,destroy(){y.delete(e)}}}function K(e){for(let t=e;t;t=t.parentElement){const a=y.get(t);if(a)return a}}function J(e,t){const a=e?.closest("[data-workspace-link-target]")?.dataset.workspaceLinkTarget;return{openInWorkspace:!!t&&a===t,panelId:e?.closest("[data-panel-id]")?.dataset.panelId,assistantLayoutId:e?.closest("[data-assistant-layout-id]")?.dataset.assistantLayoutId,surfaceWorkspaceId:K(e)}}const s=new S("LinkHandler");async function Q(e,t){try{const a=t.event?.target,n=J(a instanceof Element?a:null,t.workspaceId),o=t.openInWorkspace??n.openInWorkspace,r=o?void 0:t.sourcePanelId||n.panelId,{assistantLayoutId:l}=n,u=t.workspaceId??(n.surfaceWorkspaceId?A(n.surfaceWorkspaceId):void 0);if(t={...t,workspaceId:u,openInWorkspace:o,sourcePanelId:r},t.customHandler&&await t.customHandler(e))return s.debug("Link handled by custom handler",{url:e}),!0;if(/^workspace-asset:/i.test(e.trim()))return R.error(v.ui_linkHandler_assetUnavailable_error()),!1;const i=N(e),{event:d}=t,f=i&&d&&!g(t)?t.githubLinkDefaultAction??q.select(k.state):void 0,c=!f||f==="open-in-app";if(t.workspaceId===T&&!t.forceExternal&&c){const{showAssistantContent:m}=await h(async()=>{const{showAssistantContent:_}=await import("./B5RGOddd.js");return{showAssistantContent:_}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]),import.meta.url),I=t.rawHref?.startsWith("/workspace/")?t.rawHref:e;if(await m(I,{layoutId:l}))return!0}if(e.startsWith("intent://"))return await X(e,{...t,sourcePanelId:r});if(e.startsWith("devspace://"))return await Y(e,{...t,sourcePanelId:r});const p=ne(e,t.rawHref);if(p)return await re(p.path,{...t,sourcePanelId:r},p.fromResolvedUrl);if(e.startsWith("http://")||e.startsWith("https://")){if(G(e))return s.debug("Auth URL detected, opening in external browser",{url:e}),await w(e);if(t.forceExternal)return await w(e);if(o&&c||g(t))return t.workspaceId?await E(e,t.workspaceId,{...t,assistantLayoutId:l}):(s.debug("No workspaceId available, opening in external browser",{url:e}),await w(e));if(i&&d&&f)switch(f){case"open-in-browser":return await w(e);case"open-in-app":return t.workspaceId?await E(e,t.workspaceId,{...t,assistantLayoutId:l}):await w(e);case"copy-link":return await $(e),!0;case"start-workspace":return k.dispatch(C({...i,url:e})),k.dispatch(D(!0)),!0;case"show-choices":return await oe(e,i,d,t,l)}return await w(e)}return e.startsWith("file://")?t.canOpenFile?.()===!1?!1:await H(e):(s.warn("Unknown link type, falling back to external browser",{url:e}),await w(e))}catch(a){return s.error("Failed to handle link",{url:e,error:a}),!1}}async function X(e,t){try{const{parseIntentLink:a,handleIntentLink:n}=await h(async()=>{const{parseIntentLink:l,handleIntentLink:u}=await import("./jbqICVar.js");return{parseIntentLink:l,handleIntentLink:u}},__vite__mapDeps([24,1,2,25,11,7,26,16,8,17,27,28,29,14,15,10,18,30,31,32,33,3,4,5,6,9,34,35,36,37,38,39,40,22,41,42,23]),import.meta.url),o=a(e);if(t.canOpenFile&&o.type==="file"&&!t.canOpenFile())return!1;const r=o.workspaceId?A(o.workspaceId):t.workspaceId;return o.valid&&o.type!=="workspace"&&await L(r,t),P(t),await n(e,{workspaceId:t.openInWorkspace?r:t.workspaceId,sourcePanelId:t.sourcePanelId,openInAdjacentPanel:t.openInAdjacentPanel??g(t),openInNewAdjacentPanel:t.openInNewAdjacentPanel??!1})}catch(a){return s.error("Failed to handle intent link",{url:e,error:a}),!1}}async function Y(e,t){try{const a=e.match(/^devspace:\/\/terminal\/(.+)$/);if(a){if(!t.workspaceId)return s.warn("Cannot open terminal without workspaceId",{url:e}),!1;const n=decodeURIComponent(a[1]);s.debug("Opening terminal from devspace link",{terminalId:n,workspaceId:t.workspaceId}),await L(t.workspaceId,t),P(t);const o={type:"terminal",title:v.layout_tabTypes_terminal_title(),terminalId:n,closable:!0};return g(t)?k.dispatch(j(t.workspaceId,o,t.sourcePanelId)):k.dispatch(B(t.workspaceId,o)),!0}return s.warn("Unhandled devspace:// link type",{url:e}),!1}catch(a){return s.error("Failed to handle devspace link",{url:e,error:a}),!1}}const Z=/^[a-z][a-z0-9+.-]*:/i,x=/^[a-z]:\/(?!\/)/i;function W(e){return e.replace(/\\/g,"/")}function ee(e){try{return W(decodeURIComponent(e))}catch{return null}}function te(e){return e.split("/").some(t=>t==="..")}function ae(e){const t=e.split("/").filter(a=>a&&a!==".");return t.length===0||t.some(a=>a==="..")?null:t.join("/")}async function L(e,t){if(!t.openInWorkspace||!e)return;const{openAndShowWorkspace:a}=await h(async()=>{const{openAndShowWorkspace:n}=await import("./CkF26rCa.js").then(o=>o.s);return{openAndShowWorkspace:n}},__vite__mapDeps([45,4,2,3,5,6,7,8,1,9,10,11,46,47]),import.meta.url);try{await a(e)}catch(n){throw R.error(v.ui_linkHandler_navigationFailed_title(),{description:n instanceof Error?n.message:v.ui_linkHandler_unknownError_label()}),n}}function P(e){!e.workspaceId||!e.sourcePanelId||k.dispatch(z(e.workspaceId,e.sourcePanelId))}function ne(e,t){const a=t??e;if(a){if(a.startsWith("#"))return null;const n=O(a).path;if(!a.startsWith("//")&&(x.test(W(n))||!Z.test(n)))return{path:a,fromResolvedUrl:!1}}if((e.startsWith("http://")||e.startsWith("https://"))&&typeof window<"u")try{const n=new URL(e);if(n.origin===window.location.origin)return{path:n.pathname+n.hash,fromResolvedUrl:!0}}catch{}return null}async function re(e,t,a){try{if(t.canOpenFile?.()===!1)return!1;const n=O(e),o=ee(n.path);if(!o||o.includes("\0"))return!1;let r=o;const{line:l,column:u}=n,{workspaceId:i}=t;if(!i)return s.warn("Cannot open file link without workspaceId",{path:r}),!1;if(te(r))return s.warn("Rejected file link with path traversal",{path:r}),!1;if(r.startsWith("/")||x.test(r)){const{selectWorkspaceById:c}=await h(async()=>{const{selectWorkspaceById:b}=await import("./BfdTnj-p.js").then(M=>M.ea);return{selectWorkspaceById:b}},__vite__mapDeps([40,10,7,1,2,3,4,5,6,8,9,11,35,30,26,16,17,29,22,14,15,18,41,32]),import.meta.url),p=c.select(k.state,i),m=p?.worktreePath??p?.path,I=m?W(m):void 0,_=I?.endsWith("/")?I.slice(0,-1):I;if(_&&r.startsWith(`${_}/`))r=r.slice(_.length+1);else if(a)r=r.replace(/^\/+/,"");else{s.debug("Absolute path outside workspace root, opening in external editor",{path:r});const b=l===void 0?"":`:${l}${u===void 0?"":`:${u}`}`;return await H(`file://${r}${b}`)}}const d=ae(r);if(!d)return s.warn("Rejected invalid workspace file link",{path:r}),!1;r=d;const f=g(t);return await L(i,t),P(t),k.dispatch(V(i,r,{filePathIsLiteral:!0,line:l,openInAdjacentPanel:f,...t.sourcePanelId?{sourcePanelId:t.sourcePanelId}:{}})),s.debug("Opened file link in workspace file viewer",{path:r,workspaceId:i,line:l}),!0}catch(n){return s.error("Failed to open file link",{target:e,error:n}),!1}}async function oe(e,t,a,{workspaceId:n,openInWorkspace:o,sourcePanelId:r},l){try{const{showLinkActionMenu:u}=await h(async()=>{const{showLinkActionMenu:p}=await import("./CGcJ5lqH.js");return{showLinkActionMenu:p}},__vite__mapDeps([48,2]),import.meta.url),i=a.target instanceof HTMLElement?a.target:null;let d=a instanceof MouseEvent?a.clientX:0,f=a instanceof MouseEvent?a.clientY:0;if(d===0&&f===0&&i){const p=i.getBoundingClientRect();d=p.left,f=p.bottom}const c=u({url:e,gitHubRef:t,x:d,y:f,workspaceId:n,anchorElement:i,openInWorkspace:o??!1,sourcePanelId:r,assistantLayoutId:l});return t.kind==="pr"&&se(c,e),s.debug("Opened link action menu",{url:e,workspaceId:n}),!0}catch(u){return s.warn("Failed to open link action menu, falling back to external browser",{url:e,error:u}),await w(e)}}function se(e,t){h(async()=>{const{loadLinkActionMenuLinkedWorkspaces:a}=await import("./BWxQ5UZF.js");return{loadLinkActionMenuLinkedWorkspaces:a}},__vite__mapDeps([49,12,13,1,2,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,40,35,30,26,29,41,32,48]),import.meta.url).then(({loadLinkActionMenuLinkedWorkspaces:a})=>a(e,t)).catch(a=>{s.debug("PR workspace lookup unavailable",{url:t,error:a})})}async function ie(e){try{return await L(e,{openInWorkspace:!0}),!0}catch(t){return s.warn("Failed to open linked workspace",{workspaceId:e,error:t}),!1}}async function E(e,t,a={}){if(t===T){try{const{showAssistantContent:o}=await h(async()=>{const{showAssistantContent:r}=await import("./B5RGOddd.js");return{showAssistantContent:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]),import.meta.url);if(await o(e,{layoutId:a.assistantLayoutId}))return!0}catch(o){s.warn("Assistant panel unavailable, opening in external browser",{url:e,error:o})}return await w(e)}try{await L(t,a)}catch(o){return s.warn("Failed to enter workspace for in-app link",{url:e,workspaceId:t,error:o}),!1}const n=a.openInWorkspace?void 0:a.sourcePanelId;return await U(e,t,n)}async function U(e,t,a){let n=e,o;try{const{resolveBrowserLinkForOpen:r}=await h(async()=>{const{resolveBrowserLinkForOpen:u}=await import("./C5DeEaYP.js").then(i=>i.b);return{resolveBrowserLinkForOpen:u}},__vite__mapDeps([50,25,11,7,1,2,26,16,8,17,27,28,29,14,15,10,18,30,31,32,33,3,4,5,6,9,34,35,36,37,38,39]),import.meta.url),l=await r(e);n=l.url,o=l.requestedUrl}catch(r){s.warn("URL resolution failed, opening the URL unresolved",{url:e,error:r})}try{P({workspaceId:t,sourcePanelId:a});const{getPanelLayoutManager:r}=await h(async()=>{const{getPanelLayoutManager:u}=await import("./CmHh0Wvy.js").then(i=>i.p);return{getPanelLayoutManager:u}},__vite__mapDeps([51,3,4,2,5,6,7,8,1,9,10,11,43]),import.meta.url);return r(t).openBrowserPanel(n,void 0,a,o),s.debug("Opened URL in browser panel",{url:e,targetUrl:n,workspaceId:t}),!0}catch(r){return s.warn("Failed to open URL in browser panel, falling back to external browser",{url:e,error:r}),await w(n)}}async function w(e){try{return await F("shell:openExternal",{url:e}),s.debug("Opened URL in external browser",{url:e}),!0}catch(t){return s.error("Failed to open URL in external browser",{url:e,error:t}),!1}}async function H(e){try{const t=e.replace("file://","");return typeof window<"u"&&window.electronAPI?(await F("shell:openExternal",{url:`vscode://file/${t}`}),s.debug("Opened file in external editor",{filePath:t}),!0):!1}catch(t){return s.error("Failed to open file in external editor",{url:e,error:t}),!1}}function ce(e,t={}){let a=null,n=null,o=null;async function r(){if(!n||!o){const d=await h(()=>import("./BfQPFCP7.js").then(f=>f.K),__vite__mapDeps([14,1,2,11,7,15,10,16,8,17,18]),import.meta.url);n=d.showLinkTooltip,o=d.hideLinkTooltip}}function l(d){const c=d.target.closest("a");if(c?.href&&!c.href.startsWith("intent://")&&!c.href.startsWith("devspace://")){if(c===a)return;a=c;const p=t.workspaceId??c.closest("[data-workspace-id]")?.dataset.workspaceId??c.closest("[data-workspace-surface]")?.dataset.workspaceSurface;r().then(()=>{a===c&&n&&n(c,c.href,p)})}else a&&(a=null,o?.())}function u(d){const c=d.target.closest("a");if(c&&c===a){const p=d.relatedTarget;if(p&&c.contains(p))return;a=null,o?.()}}function i(){a&&(a=null,o?.())}return e.addEventListener("mouseover",l),e.addEventListener("mouseout",u),e.addEventListener("click",i),()=>{e.removeEventListener("mouseover",l),e.removeEventListener("mouseout",u),e.removeEventListener("click",i),o?.()}}const ve=Object.freeze(Object.defineProperty({__proto__:null,createLinkTooltipHandler:ce,handleLink:Q,openInBrowserPanel:U,openInExternalBrowser:w,openLinkInApp:E,openLinkedWorkspace:ie},Symbol.toStringTag,{value:"Module"}));export{E as a,ie as b,ce as c,Q as h,ve as l,w as o,J as r,ye as w};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/5ubKG1fw.js","/app/immutable/chunks/DxxarOOi.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/Zs30783q.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/50l-lj9m.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/C600Ggsz.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/BXwdEeCG.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/BfQPFCP7.js","/app/immutable/chunks/C0_snm4j.js","/app/immutable/chunks/Ch-D6DCZ.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/CAeNUoVv.js","/app/immutable/chunks/CrkK-7cq.js","/app/immutable/chunks/DkkzFfYK.js","/app/immutable/chunks/DzAQQ1i-.js","/app/immutable/chunks/D5eCb9SA.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/BUT4El0L.js","/app/immutable/chunks/CruJ4jyB.js","/app/immutable/chunks/ByAetY4P.js","/app/immutable/chunks/BqJSWZOr.js","/app/immutable/chunks/BWsFbeUj.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/B5yEHkSy.js","/app/immutable/chunks/DSjVYlVX.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/BfdTnj-p.js","/app/immutable/chunks/CkbzWFJM.js","/app/immutable/chunks/D1E_1zhz.js","/app/immutable/chunks/DhNEeuS_.js","/app/immutable/chunks/Cij6f88k.js","/app/immutable/chunks/BYoDJRDO.js","/app/immutable/chunks/CYrmrI7Y.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/CGcJ5lqH.js","/app/immutable/chunks/BWxQ5UZF.js","/app/immutable/chunks/C5DeEaYP.js","/app/immutable/chunks/CmHh0Wvy.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{bm as v,_ as h}from"./DxxarOOi.js";import{a as S}from"./BdWqymET.js";import{bq as A,Jq as k,m as T,HW as C,GW as D,vr as j,vp as B,vG as V,nC as z}from"./Zs30783q.js";import{bL as $}from"./piMAhJa1.js";import{m as R}from"./DkkzFfYK.js";import"./3SdAC2_C.js";import"./Ch-D6DCZ.js";import"./C600Ggsz.js";import{R as N,F as g,E as G,Q as O}from"./BfQPFCP7.js";import"./ChTqQfQN.js";import"./BWsFbeUj.js";import{o as q}from"./CkbzWFJM.js";import{i as F}from"./BBWuirRW.js";const y=new WeakMap;function ye(e,t){const a=n=>{n&&n!=="new"?y.set(e,n):y.delete(e)};return a(t),{update:a,destroy(){y.delete(e)}}}function K(e){for(let t=e;t;t=t.parentElement){const a=y.get(t);if(a)return a}}function J(e,t){const a=e?.closest("[data-workspace-link-target]")?.dataset.workspaceLinkTarget;return{openInWorkspace:!!t&&a===t,panelId:e?.closest("[data-panel-id]")?.dataset.panelId,assistantLayoutId:e?.closest("[data-assistant-layout-id]")?.dataset.assistantLayoutId,surfaceWorkspaceId:K(e)}}const s=new S("LinkHandler");async function Q(e,t){try{const a=t.event?.target,n=J(a instanceof Element?a:null,t.workspaceId),o=t.openInWorkspace??n.openInWorkspace,r=o?void 0:t.sourcePanelId||n.panelId,{assistantLayoutId:l}=n,u=t.workspaceId??(n.surfaceWorkspaceId?A(n.surfaceWorkspaceId):void 0);if(t={...t,workspaceId:u,openInWorkspace:o,sourcePanelId:r},t.customHandler&&await t.customHandler(e))return s.debug("Link handled by custom handler",{url:e}),!0;if(/^workspace-asset:/i.test(e.trim()))return R.error(v.ui_linkHandler_assetUnavailable_error()),!1;const i=N(e),{event:d}=t,f=i&&d&&!g(t)?t.githubLinkDefaultAction??q.select(k.state):void 0,c=!f||f==="open-in-app";if(t.workspaceId===T&&!t.forceExternal&&c){const{showAssistantContent:m}=await h(async()=>{const{showAssistantContent:_}=await import("./5ubKG1fw.js");return{showAssistantContent:_}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]),import.meta.url),I=t.rawHref?.startsWith("/workspace/")?t.rawHref:e;if(await m(I,{layoutId:l}))return!0}if(e.startsWith("intent://"))return await X(e,{...t,sourcePanelId:r});if(e.startsWith("devspace://"))return await Y(e,{...t,sourcePanelId:r});const p=ne(e,t.rawHref);if(p)return await re(p.path,{...t,sourcePanelId:r},p.fromResolvedUrl);if(e.startsWith("http://")||e.startsWith("https://")){if(G(e))return s.debug("Auth URL detected, opening in external browser",{url:e}),await w(e);if(t.forceExternal)return await w(e);if(o&&c||g(t))return t.workspaceId?await E(e,t.workspaceId,{...t,assistantLayoutId:l}):(s.debug("No workspaceId available, opening in external browser",{url:e}),await w(e));if(i&&d&&f)switch(f){case"open-in-browser":return await w(e);case"open-in-app":return t.workspaceId?await E(e,t.workspaceId,{...t,assistantLayoutId:l}):await w(e);case"copy-link":return await $(e),!0;case"start-workspace":return k.dispatch(C({...i,url:e})),k.dispatch(D(!0)),!0;case"show-choices":return await oe(e,i,d,t,l)}return await w(e)}return e.startsWith("file://")?t.canOpenFile?.()===!1?!1:await H(e):(s.warn("Unknown link type, falling back to external browser",{url:e}),await w(e))}catch(a){return s.error("Failed to handle link",{url:e,error:a}),!1}}async function X(e,t){try{const{parseIntentLink:a,handleIntentLink:n}=await h(async()=>{const{parseIntentLink:l,handleIntentLink:u}=await import("./CrkK-7cq.js");return{parseIntentLink:l,handleIntentLink:u}},__vite__mapDeps([24,1,2,25,11,7,26,16,8,17,27,28,29,14,15,10,18,30,31,32,33,3,4,5,6,9,34,35,36,37,38,39,40,22,41,42,23]),import.meta.url),o=a(e);if(t.canOpenFile&&o.type==="file"&&!t.canOpenFile())return!1;const r=o.workspaceId?A(o.workspaceId):t.workspaceId;return o.valid&&o.type!=="workspace"&&await L(r,t),P(t),await n(e,{workspaceId:t.openInWorkspace?r:t.workspaceId,sourcePanelId:t.sourcePanelId,openInAdjacentPanel:t.openInAdjacentPanel??g(t),openInNewAdjacentPanel:t.openInNewAdjacentPanel??!1})}catch(a){return s.error("Failed to handle intent link",{url:e,error:a}),!1}}async function Y(e,t){try{const a=e.match(/^devspace:\/\/terminal\/(.+)$/);if(a){if(!t.workspaceId)return s.warn("Cannot open terminal without workspaceId",{url:e}),!1;const n=decodeURIComponent(a[1]);s.debug("Opening terminal from devspace link",{terminalId:n,workspaceId:t.workspaceId}),await L(t.workspaceId,t),P(t);const o={type:"terminal",title:v.layout_tabTypes_terminal_title(),terminalId:n,closable:!0};return g(t)?k.dispatch(j(t.workspaceId,o,t.sourcePanelId)):k.dispatch(B(t.workspaceId,o)),!0}return s.warn("Unhandled devspace:// link type",{url:e}),!1}catch(a){return s.error("Failed to handle devspace link",{url:e,error:a}),!1}}const Z=/^[a-z][a-z0-9+.-]*:/i,x=/^[a-z]:\/(?!\/)/i;function W(e){return e.replace(/\\/g,"/")}function ee(e){try{return W(decodeURIComponent(e))}catch{return null}}function te(e){return e.split("/").some(t=>t==="..")}function ae(e){const t=e.split("/").filter(a=>a&&a!==".");return t.length===0||t.some(a=>a==="..")?null:t.join("/")}async function L(e,t){if(!t.openInWorkspace||!e)return;const{openAndShowWorkspace:a}=await h(async()=>{const{openAndShowWorkspace:n}=await import("./BYoDJRDO.js").then(o=>o.s);return{openAndShowWorkspace:n}},__vite__mapDeps([45,4,2,3,5,6,7,8,1,9,10,11,46,47]),import.meta.url);try{await a(e)}catch(n){throw R.error(v.ui_linkHandler_navigationFailed_title(),{description:n instanceof Error?n.message:v.ui_linkHandler_unknownError_label()}),n}}function P(e){!e.workspaceId||!e.sourcePanelId||k.dispatch(z(e.workspaceId,e.sourcePanelId))}function ne(e,t){const a=t??e;if(a){if(a.startsWith("#"))return null;const n=O(a).path;if(!a.startsWith("//")&&(x.test(W(n))||!Z.test(n)))return{path:a,fromResolvedUrl:!1}}if((e.startsWith("http://")||e.startsWith("https://"))&&typeof window<"u")try{const n=new URL(e);if(n.origin===window.location.origin)return{path:n.pathname+n.hash,fromResolvedUrl:!0}}catch{}return null}async function re(e,t,a){try{if(t.canOpenFile?.()===!1)return!1;const n=O(e),o=ee(n.path);if(!o||o.includes("\0"))return!1;let r=o;const{line:l,column:u}=n,{workspaceId:i}=t;if(!i)return s.warn("Cannot open file link without workspaceId",{path:r}),!1;if(te(r))return s.warn("Rejected file link with path traversal",{path:r}),!1;if(r.startsWith("/")||x.test(r)){const{selectWorkspaceById:c}=await h(async()=>{const{selectWorkspaceById:b}=await import("./BfdTnj-p.js").then(M=>M.ea);return{selectWorkspaceById:b}},__vite__mapDeps([40,10,7,1,2,3,4,5,6,8,9,11,35,30,26,16,17,29,22,14,15,18,41,32]),import.meta.url),p=c.select(k.state,i),m=p?.worktreePath??p?.path,I=m?W(m):void 0,_=I?.endsWith("/")?I.slice(0,-1):I;if(_&&r.startsWith(`${_}/`))r=r.slice(_.length+1);else if(a)r=r.replace(/^\/+/,"");else{s.debug("Absolute path outside workspace root, opening in external editor",{path:r});const b=l===void 0?"":`:${l}${u===void 0?"":`:${u}`}`;return await H(`file://${r}${b}`)}}const d=ae(r);if(!d)return s.warn("Rejected invalid workspace file link",{path:r}),!1;r=d;const f=g(t);return await L(i,t),P(t),k.dispatch(V(i,r,{filePathIsLiteral:!0,line:l,openInAdjacentPanel:f,...t.sourcePanelId?{sourcePanelId:t.sourcePanelId}:{}})),s.debug("Opened file link in workspace file viewer",{path:r,workspaceId:i,line:l}),!0}catch(n){return s.error("Failed to open file link",{target:e,error:n}),!1}}async function oe(e,t,a,{workspaceId:n,openInWorkspace:o,sourcePanelId:r},l){try{const{showLinkActionMenu:u}=await h(async()=>{const{showLinkActionMenu:p}=await import("./CGcJ5lqH.js");return{showLinkActionMenu:p}},__vite__mapDeps([48,2]),import.meta.url),i=a.target instanceof HTMLElement?a.target:null;let d=a instanceof MouseEvent?a.clientX:0,f=a instanceof MouseEvent?a.clientY:0;if(d===0&&f===0&&i){const p=i.getBoundingClientRect();d=p.left,f=p.bottom}const c=u({url:e,gitHubRef:t,x:d,y:f,workspaceId:n,anchorElement:i,openInWorkspace:o??!1,sourcePanelId:r,assistantLayoutId:l});return t.kind==="pr"&&se(c,e),s.debug("Opened link action menu",{url:e,workspaceId:n}),!0}catch(u){return s.warn("Failed to open link action menu, falling back to external browser",{url:e,error:u}),await w(e)}}function se(e,t){h(async()=>{const{loadLinkActionMenuLinkedWorkspaces:a}=await import("./BWxQ5UZF.js");return{loadLinkActionMenuLinkedWorkspaces:a}},__vite__mapDeps([49,12,13,1,2,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,40,35,30,26,29,41,32,48]),import.meta.url).then(({loadLinkActionMenuLinkedWorkspaces:a})=>a(e,t)).catch(a=>{s.debug("PR workspace lookup unavailable",{url:t,error:a})})}async function ie(e){try{return await L(e,{openInWorkspace:!0}),!0}catch(t){return s.warn("Failed to open linked workspace",{workspaceId:e,error:t}),!1}}async function E(e,t,a={}){if(t===T){try{const{showAssistantContent:o}=await h(async()=>{const{showAssistantContent:r}=await import("./5ubKG1fw.js");return{showAssistantContent:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]),import.meta.url);if(await o(e,{layoutId:a.assistantLayoutId}))return!0}catch(o){s.warn("Assistant panel unavailable, opening in external browser",{url:e,error:o})}return await w(e)}try{await L(t,a)}catch(o){return s.warn("Failed to enter workspace for in-app link",{url:e,workspaceId:t,error:o}),!1}const n=a.openInWorkspace?void 0:a.sourcePanelId;return await U(e,t,n)}async function U(e,t,a){let n=e,o;try{const{resolveBrowserLinkForOpen:r}=await h(async()=>{const{resolveBrowserLinkForOpen:u}=await import("./C5DeEaYP.js").then(i=>i.b);return{resolveBrowserLinkForOpen:u}},__vite__mapDeps([50,25,11,7,1,2,26,16,8,17,27,28,29,14,15,10,18,30,31,32,33,3,4,5,6,9,34,35,36,37,38,39]),import.meta.url),l=await r(e);n=l.url,o=l.requestedUrl}catch(r){s.warn("URL resolution failed, opening the URL unresolved",{url:e,error:r})}try{P({workspaceId:t,sourcePanelId:a});const{getPanelLayoutManager:r}=await h(async()=>{const{getPanelLayoutManager:u}=await import("./CmHh0Wvy.js").then(i=>i.p);return{getPanelLayoutManager:u}},__vite__mapDeps([51,3,4,2,5,6,7,8,1,9,10,11,43]),import.meta.url);return r(t).openBrowserPanel(n,void 0,a,o),s.debug("Opened URL in browser panel",{url:e,targetUrl:n,workspaceId:t}),!0}catch(r){return s.warn("Failed to open URL in browser panel, falling back to external browser",{url:e,error:r}),await w(n)}}async function w(e){try{return await F("shell:openExternal",{url:e}),s.debug("Opened URL in external browser",{url:e}),!0}catch(t){return s.error("Failed to open URL in external browser",{url:e,error:t}),!1}}async function H(e){try{const t=e.replace("file://","");return typeof window<"u"&&window.electronAPI?(await F("shell:openExternal",{url:`vscode://file/${t}`}),s.debug("Opened file in external editor",{filePath:t}),!0):!1}catch(t){return s.error("Failed to open file in external editor",{url:e,error:t}),!1}}function ce(e,t={}){let a=null,n=null,o=null;async function r(){if(!n||!o){const d=await h(()=>import("./BfQPFCP7.js").then(f=>f.K),__vite__mapDeps([14,1,2,11,7,15,10,16,8,17,18]),import.meta.url);n=d.showLinkTooltip,o=d.hideLinkTooltip}}function l(d){const c=d.target.closest("a");if(c?.href&&!c.href.startsWith("intent://")&&!c.href.startsWith("devspace://")){if(c===a)return;a=c;const p=t.workspaceId??c.closest("[data-workspace-id]")?.dataset.workspaceId??c.closest("[data-workspace-surface]")?.dataset.workspaceSurface;r().then(()=>{a===c&&n&&n(c,c.href,p)})}else a&&(a=null,o?.())}function u(d){const c=d.target.closest("a");if(c&&c===a){const p=d.relatedTarget;if(p&&c.contains(p))return;a=null,o?.()}}function i(){a&&(a=null,o?.())}return e.addEventListener("mouseover",l),e.addEventListener("mouseout",u),e.addEventListener("click",i),()=>{e.removeEventListener("mouseover",l),e.removeEventListener("mouseout",u),e.removeEventListener("click",i),o?.()}}const ve=Object.freeze(Object.defineProperty({__proto__:null,createLinkTooltipHandler:ce,handleLink:Q,openInBrowserPanel:U,openInExternalBrowser:w,openLinkInApp:E,openLinkedWorkspace:ie},Symbol.toStringTag,{value:"Module"}));export{E as a,ie as b,ce as c,Q as h,ve as l,w as o,J as r,ye as w};
|