@intent-hq/web 2.357.0 → 2.357.1
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/{DyqsXXds.js → 66_rhosy.js} +1 -1
- package/web/app/immutable/chunks/{XTUjVC3s.js → 7y7832WT.js} +1 -1
- package/web/app/immutable/chunks/{CREdX7EY.js → 9P6ZvzvD.js} +1 -1
- package/web/app/immutable/chunks/{hZnA3cdC.js → AQD9ZwKP.js} +1 -1
- package/web/app/immutable/chunks/{BsoU3ZI2.js → B2LPQxIt.js} +1 -1
- package/web/app/immutable/chunks/{CSVv71j6.js → B3SPWmt-.js} +1 -1
- package/web/app/immutable/chunks/{BX3WN5kC.js → BCoXAz1U.js} +1 -1
- package/web/app/immutable/chunks/{CmBCvv92.js → BDjg6KKO.js} +1 -1
- package/web/app/immutable/chunks/{BXgckBJT.js → BG6kMtPP.js} +1 -1
- package/web/app/immutable/chunks/{1tg8Mdjb.js → BGJfXAWv.js} +1 -1
- package/web/app/immutable/chunks/{-p1BY2nb.js → BLxae2bF.js} +1 -1
- package/web/app/immutable/chunks/{CRlego-x.js → BMvS7SgR.js} +3 -3
- package/web/app/immutable/chunks/{DfG1FsDK.js → BMyQIDAo.js} +4 -4
- package/web/app/immutable/chunks/{DiLP5819.js → BQ23qfTF.js} +1 -1
- package/web/app/immutable/chunks/{hcSSFtOe.js → BTGEGvnD.js} +1 -1
- package/web/app/immutable/chunks/{Bzimqqxc.js → BVeQxmcO.js} +1 -1
- package/web/app/immutable/chunks/{CzVeHBPR.js → BVoA79wA.js} +1 -1
- package/web/app/immutable/chunks/{VNMm_PPx.js → BYHbCXEy.js} +1 -1
- package/web/app/immutable/chunks/{VdF5zrMU.js → BZCD0L1_.js} +1 -1
- package/web/app/immutable/chunks/{BAQ_0gFW.js → BZQo8LNo.js} +1 -1
- package/web/app/immutable/chunks/{CGnPIR9g.js → B_3_o4NM.js} +1 -1
- package/web/app/immutable/chunks/{Ct4AQosP.js → Ba0vVpgz.js} +1 -1
- package/web/app/immutable/chunks/{DwIt5YzD.js → Bd1ZbfsE.js} +1 -1
- package/web/app/immutable/chunks/{DZflJ7Rw.js → Bd3Jv-O1.js} +1 -1
- package/web/app/immutable/chunks/{Bfjz63Rs.js → Bjw3ENRr.js} +1 -1
- package/web/app/immutable/chunks/{BMZ0t1iW.js → BmkId4Xs.js} +1 -1
- package/web/app/immutable/chunks/{f4FaHo0d.js → BnnkDYnu.js} +1 -1
- package/web/app/immutable/chunks/{BNMSrBKr.js → BpTd99tA.js} +1 -1
- package/web/app/immutable/chunks/{D1eZCGCC.js → Bqt9Orfw.js} +1 -1
- package/web/app/immutable/chunks/{C-ITJ-M0.js → Bsx9tus4.js} +1 -1
- package/web/app/immutable/chunks/{Dse_C5ka.js → BxRqO5xf.js} +1 -1
- package/web/app/immutable/chunks/{DzVwqiSG.js → C-ExwGaf.js} +1 -1
- package/web/app/immutable/chunks/{BhqI687N.js → C3G5lO0X.js} +1 -1
- package/web/app/immutable/chunks/{B5E75mYn.js → C5zadSpA.js} +3 -3
- package/web/app/immutable/chunks/{CUcdKSIk.js → CBPCiMxB.js} +1 -1
- package/web/app/immutable/chunks/{BiYndv31.js → CCdcqA0c.js} +1 -1
- package/web/app/immutable/chunks/{DQT2HseM.js → CFf_TK-h.js} +1 -1
- package/web/app/immutable/chunks/{BufA67uC.js → CHK4FXDC.js} +1 -1
- package/web/app/immutable/chunks/{t0Sry9wB.js → CKmIcPAK.js} +1 -1
- package/web/app/immutable/chunks/{trDHZFy5.js → CKpm8C6c.js} +1 -1
- package/web/app/immutable/chunks/{CDop75lD.js → CLmt7ktX.js} +4 -4
- package/web/app/immutable/chunks/{BO4DijuW.js → CS9ie09_.js} +1 -1
- package/web/app/immutable/chunks/{DYZ9p4gw.js → CSE73PBJ.js} +1 -1
- package/web/app/immutable/chunks/{B2tWwOjs.js → CTGUTBCN.js} +1 -1
- package/web/app/immutable/chunks/{COrU_zos.js → CV16Bucz.js} +4 -4
- package/web/app/immutable/chunks/{C0p8wayb.js → CYAcOUio.js} +1 -1
- package/web/app/immutable/chunks/{CapRHp-3.js → C_wivZis.js} +1 -1
- package/web/app/immutable/chunks/{B4pmsBqR.js → Cb2A7MN0.js} +1 -1
- package/web/app/immutable/chunks/{BSDfJm3v.js → Cb3IR_gP.js} +2 -2
- package/web/app/immutable/chunks/{BWa7My9c.js → CdvOr8yA.js} +1 -1
- package/web/app/immutable/chunks/{DIq_NgVD.js → Cha39o9r.js} +1 -1
- package/web/app/immutable/chunks/{DcyLYuvX.js → ChoJBBfE.js} +1 -1
- package/web/app/immutable/chunks/{C75uVfAk.js → Ci9WXQ89.js} +1 -1
- package/web/app/immutable/chunks/{Bj1ZRGMd.js → CjYdM0YD.js} +1 -1
- package/web/app/immutable/chunks/{XvB_C6E3.js → CrxXInxf.js} +1 -1
- package/web/app/immutable/chunks/{BR8MYFvM.js → Cs6WGZex.js} +1 -1
- package/web/app/immutable/chunks/{Zo8Uabvb.js → Ct7QNzzh.js} +12 -12
- package/web/app/immutable/chunks/{DrK8t3w6.js → CwJEu8cK.js} +1 -1
- package/web/app/immutable/chunks/{BIJ9yl2O.js → Cx0yZw2_.js} +1 -1
- package/web/app/immutable/chunks/{DPdE8XN1.js → Cx9nP__t.js} +1 -1
- package/web/app/immutable/chunks/{Bpu4KV0h.js → Cy-rVXS3.js} +1 -1
- package/web/app/immutable/chunks/{_ncQX04u.js → CyBdhy5_.js} +1 -1
- package/web/app/immutable/chunks/{qiMxzrto.js → CzeIL_6z.js} +1 -1
- package/web/app/immutable/chunks/{DW6txncK.js → D-EgBFka.js} +1 -1
- package/web/app/immutable/chunks/{CPNM0qrd.js → D024cEiO.js} +2 -2
- package/web/app/immutable/chunks/{Cy7DFJe5.js → D0orvEYB.js} +1 -1
- package/web/app/immutable/chunks/{CSa-Sqaw.js → D2P0fD42.js} +4 -4
- package/web/app/immutable/chunks/{BFsFAs4c.js → D6j3Zn1d.js} +1 -1
- package/web/app/immutable/chunks/{BcfSFmD3.js → D8aSK4oD.js} +1 -1
- package/web/app/immutable/chunks/{DsqE_Bdq.js → DGaw_Pt8.js} +1 -1
- package/web/app/immutable/chunks/{y6whrxEh.js → DIC5rFND.js} +1 -1
- package/web/app/immutable/chunks/{Ohf7jFka.js → DIKVXlyt.js} +2 -2
- package/web/app/immutable/chunks/{DE3MDhxe.js → DJbKSkhu.js} +1 -1
- package/web/app/immutable/chunks/{CH24rXW_.js → DKOCXDff.js} +1 -1
- package/web/app/immutable/chunks/{C8A6q25O.js → DLG3MCT8.js} +1 -1
- package/web/app/immutable/chunks/{BQJBTOJl.js → DLIvmKAR.js} +1 -1
- package/web/app/immutable/chunks/{BALn2OfB.js → DLmwZnzr.js} +5 -5
- package/web/app/immutable/chunks/{6j0Bv6V-.js → DOs89s1W.js} +1 -1
- package/web/app/immutable/chunks/{D4S_b9kl.js → DPirTM_u.js} +1 -1
- package/web/app/immutable/chunks/{B-byhlrG.js → DQIS1MQd.js} +1 -1
- package/web/app/immutable/chunks/{BPivozdw.js → DQMWee-l.js} +3 -3
- package/web/app/immutable/chunks/{BoedJ8yq.js → DUGMxl18.js} +1 -1
- package/web/app/immutable/chunks/{BQkfaPle.js → DUQ8HfFA.js} +1 -1
- package/web/app/immutable/chunks/{1nnk-Wsk.js → DUq_tiZf.js} +1 -1
- package/web/app/immutable/chunks/{Bi3vpVI6.js → D_HBCPjs.js} +1 -1
- package/web/app/immutable/chunks/{BAWksQvp.js → DbPDpNcg.js} +1 -1
- package/web/app/immutable/chunks/{BpqOTexP.js → DbSMHaNK.js} +1 -1
- package/web/app/immutable/chunks/{B9A7zPdb.js → DcGNquRL.js} +1 -1
- package/web/app/immutable/chunks/{JZzD0yFI.js → Dcvn1tie.js} +2 -2
- package/web/app/immutable/chunks/{DcW_Q-_L.js → DdIYz1zo.js} +1 -1
- package/web/app/immutable/chunks/{BIVrIHM0.js → DeYzpxan.js} +1 -1
- package/web/app/immutable/chunks/{jqpS-Qmo.js → DffSA-Qz.js} +1 -1
- package/web/app/immutable/chunks/{DrpfvH93.js → Djfmc_ao.js} +1 -1
- package/web/app/immutable/chunks/{Djn-kDZ4.js → DnD4hxy7.js} +1 -1
- package/web/app/immutable/chunks/{BGhV0sdL.js → DnJtXsWm.js} +1 -1
- package/web/app/immutable/chunks/{CxN-SpwP.js → Dto5_TqF.js} +1 -1
- package/web/app/immutable/chunks/{DcjHFaNi.js → DvMvrFFa.js} +1 -1
- package/web/app/immutable/chunks/{C6jDNmrt.js → DvhhQYfO.js} +1 -1
- package/web/app/immutable/chunks/{9LFJ_Q3r.js → DvjZKcqd.js} +1 -1
- package/web/app/immutable/chunks/{DYGZ9sTv.js → EPCnwBto.js} +1 -1
- package/web/app/immutable/chunks/{C1zvEWGg.js → HJvhI2th.js} +2 -2
- package/web/app/immutable/chunks/{CDBU9mtE.js → IDaGSd8y.js} +1 -1
- package/web/app/immutable/chunks/{Osmv5gZI.js → IRSIweMK.js} +2 -2
- package/web/app/immutable/chunks/{BUj9gSzV.js → OBaERIRu.js} +1 -1
- package/web/app/immutable/chunks/{CccZ7iCE.js → OtZHxuvr.js} +1 -1
- package/web/app/immutable/chunks/{ChM2jeRS.js → P93gVaLu.js} +1 -1
- package/web/app/immutable/chunks/{Bk14cxcJ.js → PRunkvIA.js} +1 -1
- package/web/app/immutable/chunks/{D-oI-oRa.js → Q_7q1g1V.js} +1 -1
- package/web/app/immutable/chunks/{Cf_Jryir.js → WHFDPTSN.js} +1 -1
- package/web/app/immutable/chunks/{B4ODjo1_.js → WSJurcVg.js} +1 -1
- package/web/app/immutable/chunks/{0sUdCOJj.js → _QB9q3ka.js} +2 -2
- package/web/app/immutable/chunks/{Chtu4V3e.js → aB88tX8Q.js} +1 -1
- package/web/app/immutable/chunks/{DhigC4WI.js → hWXfsV3F.js} +2 -2
- package/web/app/immutable/chunks/{iXONcEpN.js → iarSknrC.js} +1 -1
- package/web/app/immutable/chunks/{DHS6-YDt.js → q66ttt22.js} +3 -3
- package/web/app/immutable/chunks/{UfZ1-ewn.js → r5eyOwTV.js} +1 -1
- package/web/app/immutable/chunks/{Ck6v_gHY.js → s3cC8o8y.js} +1 -1
- package/web/app/immutable/chunks/{B6Xz_h0x.js → sVbFdYPp.js} +1 -1
- package/web/app/immutable/chunks/{CQTLfLe-.js → scctxWgb.js} +1 -1
- package/web/app/immutable/chunks/{CYqk2Hhu.js → u4HT3usu.js} +3 -3
- package/web/app/immutable/chunks/{gz1pzjmr.js → v4Y0eqyL.js} +1 -1
- package/web/app/immutable/chunks/{CmoBfnbr.js → wegJMlUp.js} +1 -1
- package/web/app/immutable/chunks/{ecq9AzSs.js → wf2_U67h.js} +1 -1
- package/web/app/immutable/chunks/{ds28TSQT.js → xermZvR1.js} +1 -1
- package/web/app/immutable/entry/{app.DzIpDnb7.js → app.B9pbttZz.js} +2 -2
- package/web/app/immutable/entry/start.LGV8aa5W.js +1 -0
- package/web/app/immutable/nodes/{0.D9XYE-Ct.js → 0.BuaXl3Zn.js} +1 -1
- package/web/app/immutable/nodes/{1.miAECHse.js → 1.C0hTLxrG.js} +1 -1
- package/web/app/immutable/nodes/{10.D--eaewT.js → 10.BYoBAwS8.js} +1 -1
- package/web/app/immutable/nodes/{14.DUejalGq.js → 14.qZIH60wN.js} +1 -1
- package/web/app/immutable/nodes/{18.DJqNUReE.js → 18.Cz3sqM0n.js} +2 -2
- package/web/app/immutable/nodes/{2.CoGuMWzq.js → 2._25AU1Pu.js} +4 -4
- package/web/app/immutable/nodes/{3.BFJD36tC.js → 3.RDPPYmES.js} +1 -1
- package/web/app/immutable/nodes/{4.B2Xl_W0u.js → 4.Demyxi_h.js} +1 -1
- package/web/app/immutable/nodes/{5.BbLYjFzb.js → 5.ylO_Qjm7.js} +1 -1
- package/web/app/immutable/nodes/{6.8KJ44jJu.js → 6.CJQj_6nS.js} +1 -1
- package/web/app/immutable/nodes/{7.DM8B7EL6.js → 7.BP9EIVoN.js} +1 -1
- package/web/app/immutable/nodes/{8.CM-MwROR.js → 8.qL2AO5Vz.js} +4 -4
- package/web/app/immutable/nodes/{9.CaTY2WNw.js → 9.CH8_E86R.js} +4 -4
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/entry/start._AX5mAyc.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{bm as y,t as wt,bo as J,bw as Tt,bq as xt,b as kt,bs as D}from"./BkULGdgB.js";import{bs as It,ca as K,aD as t,a7 as At,ay as Q,W as w,bn as Pt,bS as N,c9 as f,aA as M,aB as x,a5 as I,bA as A,bl as P,b_ as F,bO as S}from"./DYhIMPy1.js";import{i as L}from"./CVqc5kFv.js";import{k as St}from"./Cx2QERlx.js";import{c as Wt}from"./dqNuna_B.js";import{C as V}from"./DypB-Dwi.js";import{L as $t}from"./CSiaiLHL.js";import"./
|
|
1
|
+
import{bm as y,t as wt,bo as J,bw as Tt,bq as xt,b as kt,bs as D}from"./BkULGdgB.js";import{bs as It,ca as K,aD as t,a7 as At,ay as Q,W as w,bn as Pt,bS as N,c9 as f,aA as M,aB as x,a5 as I,bA as A,bl as P,b_ as F,bO as S}from"./DYhIMPy1.js";import{i as L}from"./CVqc5kFv.js";import{k as St}from"./Cx2QERlx.js";import{c as Wt}from"./dqNuna_B.js";import{C as V}from"./DypB-Dwi.js";import{L as $t}from"./CSiaiLHL.js";import"./DvhhQYfO.js";import"./BkQ2g3_N.js";import"./DdvXzOsp.js";import{bd as Dt}from"./DcwBt__E.js";import"./CjRRnXFa.js";import"./Dcvn1tie.js";import{IH as B,Jc as Nt,Js as Ft,Jh as Lt,uZ as Bt}from"./DZwGQbE8.js";import{T as Et}from"./BDjg6KKO.js";import{g as Ut}from"./DfN8_dcw.js";import{dr as Ot}from"./D4U_w4GT.js";import{bR as jt,bL as Ht,b6 as Jt}from"./aB88tX8Q.js";import"./B491IXH3.js";import{M as Mt}from"./C9gg-9EN.js";import{V as Rt}from"./CG40U4Lm.js";import{O as Vt}from"./BpTd99tA.js";import{c as qt}from"./ChTqQfQN.js";import{i as Gt}from"./H2jLkRRS.js";const T=new $t({category:"change-converters"});function R(e,n){return e.path||e.file||e.filePath||e.relativePath||n?.filePath}function X(e,n){return{additions:e.additions??n?.additions??0,deletions:e.deletions??n?.deletions??0,binary:e.binary??!1}}function Zt(e,n){if(n.actor?.type==="agent"&&n.actor.id){const r=n.actor;return{agentId:r.id,agentName:r.name||y.fileTracking_changeTimeline_agent_fallback(),sessionId:r.sessionId||e.sessionId||"",turnNumber:r.turnNumber??e.turnNumber??0,messageId:r.messageId,timestamp:new Date(n.timestamp).getTime()}}if(e.agentId)return{agentId:e.agentId,agentName:e.agentName||y.fileTracking_changeTimeline_agent_fallback(),sessionId:e.sessionId||"",turnNumber:e.turnNumber||0,timestamp:new Date(n.timestamp).getTime()}}function Y(e,n){return{timestamp:new Date(e.timestamp).getTime(),manual:e.actor?.type==="user",agent:Zt(n,e)}}function tt(e,n){return{oldContent:n?.oldContent??e.oldContent,newContent:n?.newContent??e.newContent,diff:e.diff??n?.diff}}function et(e,n,r){return r!==void 0?`${e}-${n}-${r}`:`${e}-${n}`}function zt(e){try{const n=e.data||{},r=e.codeChange;T.debug("Converting event to TrackedChange",{eventType:e.type,eventId:e.id,hasData:!!n,hasCodeChange:!!r});const c=R(n,r);if(e.type.startsWith("file:")&&c){const d=X(n,r);return T.debug("Creating TrackedChange for file event",{filePath:c,stats:d,hasDiff:!!(n.diff||r?.diff)}),[{id:et("event",e.id),file:c,relativePath:c,stage:V.Unstaged,stats:d,attribution:Y(e,n),content:tt(n,r)}]}return(e.type==="agent:completed"||e.type.startsWith("agent:"))&&n.fileChanges&&Array.isArray(n.fileChanges)?(T.debug("Creating TrackedChanges for agent event",{eventType:e.type,fileChangesCount:n.fileChanges.length,agentId:n.agentId}),n.fileChanges.filter(d=>R(d)?!0:(T.warn("Skipping file change without path",{change:d}),!1)).map((d,s)=>{const v=R(d);if(!v)throw new Error("file change without path");return{id:et("event",e.id,s),file:v,relativePath:v,stage:V.Unstaged,stats:X(d),attribution:Y(e,n),content:tt(d)}})):(T.debug("No TrackedChanges created for event",{eventType:e.type,eventId:e.id,hasFilePath:!!c,hasFileChanges:!!(n.fileChanges&&Array.isArray(n.fileChanges))}),[])}catch(n){return T.error("Error converting event to TrackedChange",n instanceof Error?n:new Error(String(n)),{eventType:e.type,eventId:e.id}),[]}}function Kt(e){if(!e)return{oldContent:"",newContent:""};const n=[],r=[],c=e.split(`
|
|
2
2
|
`);c.length>0&&c[c.length-1]===""&&c.pop();let d=!1;for(const s of c)if(!(s.startsWith("diff --git")||s.startsWith("index ")||s.startsWith("--- ")||s.startsWith("+++ ")||s.startsWith("\"))){if(s.startsWith("@@")){d=!0;continue}d&&(s.startsWith("+")?r.push(s.slice(1)):s.startsWith("-")?n.push(s.slice(1)):s.startsWith(" ")?(n.push(s.slice(1)),r.push(s.slice(1))):s===""&&(n.push(""),r.push("")))}return{oldContent:n.join(`
|
|
3
3
|
`),newContent:r.join(`
|
|
4
4
|
`)}}var Qt=x("<!> <!>",1),Xt=x('<div class="flex items-center gap-1.5 px-3 py-1.5 text-xs text-subtle bg-muted/50 border-b border-border"><span> </span></div>'),Yt=x('<div class="flex flex-col h-full"><!> <div class="flex-1 min-h-0"><!></div></div>'),te=x('<div class="flex flex-col items-center justify-center h-full text-subtle gap-4"><p class="text-sm"> </p> <p class="text-xs opacity-70"> </p></div>'),ee=x('<p class="text-xs opacity-70"> </p>'),ne=x('<div class="flex flex-col items-center justify-center h-full text-subtle gap-4"><p class="text-sm"> </p> <!></div>');function ae(e,n){if(new.target)return wt({component:ae,...e});It(n,!0);const r=()=>D(lt,"$workspace",v),c=()=>D(st,"$foldUnchanged",v),d=()=>D(rt,"$lineWrapping",v),s=()=>D(ot,"$diffSideBySide",v),[v,nt]=xt(),at=a=>{Rt(a,{embedded:!0,get foldEnabled(){return c()},onToggleFold:()=>B.dispatch(Lt()),get wrapEnabled(){return d()},onToggleWrap:()=>B.dispatch(Ft()),get splitEnabled(){return s()},onToggleSplit:()=>B.dispatch(Nt())})},it=a=>{var i=Qt(),g=Q(i);{let m=f(()=>y.layout_diffHeader_goToFile_tooltip());Wt(g,()=>Mt,(l,h)=>{h(l,{get icon(){return Dt},get label(){return t(m)},onclick:$=>ut()})})}var C=N(g,2);{var b=m=>{Vt(m,{get filePath(){return t(G)},get workspaceId(){return _()},isDirectory:!1,embedded:!0,get workspaceFolderPath(){return t(O)}})};L(C,m=>{t(G)&&m(b)})}w(a,i)},rt=jt(),st=Ht(),ot=Jt(),dt=qt("ActivityChangesTabType");let E=J(n,"tab",7),_=J(n,"workspaceId",7),U=J(n,"isActive",7);const q=Ut(),lt=Ot(_()),O=f(()=>r()?.worktreePath||r()?.repositoryPath||void 0),o=f(()=>E().data?.event),ct=f(()=>t(o)?zt(t(o)):[]),u=f(()=>t(ct)[0]),p=f(()=>t(u)?.relativePath||t(u)?.file||null),G=f(()=>t(p)&&t(O)?Gt(t(p))?t(p):`${t(O)}/${t(p)}`:null),j=f(()=>()=>{if(!t(o))return null;const a=t(o).data,i=t(o).codeChange;return a?.diff||i?.diff||t(u)?.content?.diff||null}),Z=f(()=>()=>t(u)?.content?!!(t(u).content.oldContent&&t(u).content.newContent):!1);function ft(a){if(!a)return;const i=a.match(/@@ -(\d+)/);return i?parseInt(i[1],10):void 0}const k=f(()=>{if(t(Z)()&&t(u)?.content)return{oldContent:t(u).content.oldContent??"",newContent:t(u).content.newContent??""};const a=t(j)();return a?Kt(a):null}),W=f(()=>ft(t(j)())),pt=f(()=>t(W)!==void 0&&t(W)>1),gt=f(()=>{const a=t(p)||"",i=t(o)?.data||{};return{id:`activity-${t(o)?.id||"unknown"}-${a}`,file:a,relativePath:a,stage:V.Committed,status:t(u)?.status||"modified",stats:{additions:i?.additions||t(u)?.stats?.additions||0,deletions:i?.deletions||t(u)?.stats?.deletions||0},attribution:{timestamp:t(o)?.timestamp?new Date(t(o).timestamp).getTime():Date.now()},content:t(k)?{oldContent:t(k).oldContent,newContent:t(k).newContent}:void 0}});function ut(a){if(!t(p))return;const g={type:"file",title:t(p).split("/").pop()||t(p),closable:!0,filePath:t(p),workspaceId:_()};B.dispatch(Bt(_(),g))}K(()=>{!q||!U()||q.registerActions({display:at,actions:it})}),K(()=>{if(t(o)){const a=t(o).data;dt.debug("Activity event diff info",{eventType:t(o).type,eventId:t(o).id,filePath:t(p),hasDiffString:!!t(j)(),hasOldNewContent:t(Z)(),hasDiffContents:!!t(k),dataAdditions:a?.additions,dataDeletions:a?.deletions})}});var ht={get tab(){return E()},set tab(a){E(a),M()},get workspaceId(){return _()},set workspaceId(a){_(a),M()},get isActive(){return U()},set isActive(a){U(a),M()},$set:Tt,$on:(a,i)=>kt(n,a,i)},z=At(),mt=Q(z);{var vt=a=>{var i=Yt(),g=I(i);{var C=l=>{var h=Xt(),$=I(h),H=P($,!0);A(h),F(_t=>S(H,_t),[()=>y.layout_activityChanges_partialDiff_label({line:t(W)??0})]),w(l,h)};L(g,l=>{t(pt)&&l(C)})}var b=N(g,2),m=I(b);St(m,()=>`${t(o)?.id}-${t(p)}`,l=>{{let h=f(()=>s()?"split":"unified");Et(l,{get change(){return t(gt)},get workspaceId(){return _()},get viewMode(){return t(h)},get foldUnchanged(){return c()},get lineWrapping(){return d()},get lineOffset(){return t(W)}})}}),A(b),A(i),w(a,i)},Ct=a=>{var i=te(),g=I(i),C=P(g,!0),b=N(g,2),m=P(b,!0);A(i),F((l,h)=>{S(C,l),S(m,h)},[()=>y.layout_activityChanges_noDiffStored_label(),()=>y.layout_activityChanges_diffNotCaptured_description()]),w(a,i)},bt=a=>{var i=ne(),g=I(i),C=P(g,!0),b=N(g,2);{var m=l=>{var h=ee(),$=P(h,!0);F(H=>S($,H),[()=>y.layout_activityChanges_eventType_label({type:t(o).type})]),w(l,h)};L(b,l=>{t(o)&&l(m)})}A(i),F(l=>S(C,l),[()=>y.layout_activityChanges_noChanges_label()]),w(a,i)};L(mt,a=>{t(p)&&t(k)?a(vt):t(p)?a(Ct,1):a(bt,-1)})}w(e,z);var yt=Pt(ht);return nt(),yt}export{ae as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{I as W}from"./
|
|
1
|
+
import{I as W}from"./C-ExwGaf.js";import{p as X}from"./C3G5lO0X.js";import{b0 as z,a_ as G,aZ as Y,Y as P,U as F,V as Z,b as g,q as N,ay as A,aX as q,B as U,W as E,r as j,aV as J,a0 as K,O as Q,aO as ee}from"./D2P0fD42.js";import{p as te}from"./BGC1OvbZ.js";var L=/[─━│┃└┗├┣]/,D=/[└┗├┣]/,ne=/[─━]/,V=/^[\s│┃]+$/,T=/^\s*(title[\t ]|accTitle[\t ]*:|accDescr[\t ]*[:{])/,$=/^\s*%%/,re=" ";function _(n){return n.some(t=>L.test(t))}g(_,"isBoxDrawingFormat");function M(n){for(const t of n){const e=D.exec(t);if(e?.index&&e.index>0)return e.index}return 4}g(M,"inferSegmentWidth");function S(n,t){return n.replace(/\bline\s+(\d+)\b/gi,(e,r)=>{const s=parseInt(r,10),i=t.get(s);return i?`line ${i}`:e})}g(S,"remapErrorLines");function R(n){const t=n.split(`
|
|
2
2
|
`),e=new Map;let r=-1;for(const[p,c]of t.entries())if(c.trim()==="treeView-beta"){r=p;break}if(r===-1)return{text:n,lineMap:e};const s=[];for(let p=r+1;p<t.length;p++){const c=t[p];c.trim()===""||$.test(c)||T.test(c)||V.test(c)||s.push(c.replace(/\t/g," "))}if(!_(s))return{text:n,lineMap:e};const i=M(s),o=[];let a=0;for(let p=0;p<=r;p++)o.push(t[p]),a++,e.set(a,p+1);for(let p=r+1;p<t.length;p++){const c=t[p],d=c.trim(),h=p+1;if(d===""){o.push(c),a++,e.set(a,h);continue}if($.test(c)){o.push(c),a++,e.set(a,h);continue}if(T.test(c)){o.push(c),a++,e.set(a,h);continue}if(V.test(c))continue;const l=c.replace(/\t/g," "),w=D.exec(l);if(w?.index!==void 0){const f=w.index,m=Math.round(f/i)+1;let u=f+1;for(;u<l.length&&ne.test(l[u]);)u++;for(;u<l.length&&l[u]===" ";)u++;const v=l.slice(u).trimEnd();if(!v)throw new Error(`Line ${h}: Empty node — expected a filename or directory name after the box-drawing prefix`);const O=re.repeat(m);o.push(O+v),a++,e.set(a,h)}else{if(/^[\s─━│┃└┗├┣]+$/.test(l))continue;if(L.test(l))o.push(c),a++,e.set(a,h);else{if(/^\s+/.test(l))throw new Error(`Line ${h}: Unexpected indentation without box-drawing characters. In box-drawing format, use ├── or └── prefixes for indented nodes.`);o.push(c),a++,e.set(a,h)}}}return{text:o.join(`
|
|
3
3
|
`),lineMap:e}}g(R,"preprocessBoxDrawing");var x=new W(()=>({cnt:1,stack:[{id:0,level:-1,name:"/",nodeType:"directory",children:[]}]})),ie=g(()=>{x.reset(),j()},"clear"),oe=g(()=>x.records.stack[0],"getRoot"),se=g(()=>x.records.cnt,"getCount"),ae=Q.treeView,ce=g(()=>N(ae,E().treeView),"getConfig"),le=g((n,t,e,r,s,i)=>{for(;n<=x.records.stack[x.records.stack.length-1].level;)x.records.stack.pop();const o={id:x.records.cnt++,level:n,name:t,nodeType:e,icon:s,cssClass:r,description:i,children:[]};x.records.stack[x.records.stack.length-1].children.push(o),x.records.stack.push(o)},"addNode"),de={clear:ie,addNode:le,getRoot:oe,getCount:se,getConfig:ce,getAccTitle:Z,getAccDescription:F,getDiagramTitle:P,setAccDescription:Y,setAccTitle:G,setDiagramTitle:z},I=de,he=g(n=>{X(n,I);for(const t of n.nodes){const e=typeof t.indent=="number"?t.indent:0;let r=t.name;const s=r.endsWith("/");s&&(r=r.slice(0,-1));const i=s?"directory":"file",o=t.classAnnotation||void 0,a=t.iconAnnotation,p=a!==void 0?a||"none":void 0,c=t.descAnnotation||void 0,d=c?J(c,E()):void 0;I.addNode(e,r,i,o,p,d)}},"populate"),pe={parse:g(async n=>{const{text:t,lineMap:e}=R(n);try{const r=await te("treeView",t);A.debug(r),he(r)}catch(r){throw e.size>0&&r instanceof Error&&(r.message=S(r.message,e)),r}},"parse")},b={prefix:"mermaid-treeview",height:24,width:24,icons:{folder:{body:'<path fill="currentColor" d="M10.59 4.59A2 2 0 0 0 9.17 4H4a2 2 0 0 0-2 2v12a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.17z"/>'},file:{body:'<path fill="currentColor" fill-rule="evenodd" d="M6 2a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8.83a2 2 0 0 0-.59-1.42l-4.82-4.82A2 2 0 0 0 13.17 2H6Zm7.5 1.9l4.6 4.6h-3.6a1 1 0 0 1-1-1V3.9Z" clip-rule="evenodd"/>'}}};function H(n,t){const e=t?.filenameIcons?.[n];if(e)return e;const r=n.lastIndexOf(".");if(r>0){const s=n.substring(r).toLowerCase(),i=t?.extensionIcons;return i?.[s]??i?.[s.slice(1)]}}g(H,"detectIcon");function C(n,t){return n.includes(":")?n:n in b.icons||!t?`${b.prefix}:${n}`:`${t}:${n}`}g(C,"qualifyIcon");function B(n,t){if(n.icon!=="none"){if(n.icon)return C(n.icon,t.defaultIconPack);if(t.showIcons){if(n.nodeType==="file"){const e=H(n.name,t);if(e==="none")return;if(e)return C(e,t.defaultIconPack)}return`${b.prefix}:${n.nodeType==="directory"?"folder":"file"}`}}}g(B,"getNodeIcon");ee([{name:b.prefix,icons:b}]);var y=14,ge=4,fe=16,ue=g(async(n,t)=>{const e=[],r=g(i=>{const o=B(i,t);o&&e.push({icon:o,node:i}),i.children.forEach(r)},"collect");r(n);const s=await Promise.all(e.map(async({icon:i,node:o})=>({id:o.id,svg:await K(i,{height:y,width:y})})));return new Map(s.map(({id:i,svg:o})=>[i,o]))},"resolveNodeIcons"),we=g((n,t,e,r,s,i)=>{const o=r.append("g");let a="treeView-node-label";e.nodeType==="directory"&&(a+=" treeView-node-dir"),e.cssClass&&(a+=` ${e.cssClass}`);const p=y+ge,c=B(e,s),d=c!==void 0;c&&o.append("g").attr("class","treeView-node-icon").attr("transform",`translate(${n+s.paddingX}, ${t+s.paddingY})`).html(i.get(e.id)??"");const h=o.append("text").text(e.name).attr("dominant-baseline","middle").attr("class",a),{height:l,width:w}=h.node().getBBox(),f=l+s.paddingY*2,m=n+s.paddingX+(d?p:0);h.attr("x",m),h.attr("y",t+f/2);const u=m+w,v=w+s.paddingX*2+(d?p:0);return e.BBox={x:n,y:t,width:v,height:f},e.cssClass?.split(/\s+/).includes("highlight")&&o.insert("rect",":first-child").attr("x",n).attr("y",t+1).attr("width",0).attr("height",f-2).attr("rx",3).attr("class","treeView-highlight-bg"),{node:e,nodeGroup:o,labelRightEdge:u,centerY:t+f/2}},"positionLabel"),k=g((n,t,e,r,s,i)=>n.append("line").attr("x1",t).attr("y1",e).attr("x2",r).attr("y2",s).attr("stroke-width",i).attr("class","treeView-node-line"),"positionLine"),me=g((n,t,e,r)=>{let s=0,i=0;const o=[],a=g((d,h,l,w)=>{const f=w*(l.rowIndent+l.paddingX),m=we(f,s,h,d,l,r);o.push(m);const{height:u,width:v}=h.BBox;k(d,f-l.rowIndent,s+u/2,f,s+u/2,l.lineThickness),i=Math.max(i,f+v),s+=u},"drawNode"),p=g((d,h=0)=>{a(n,d,e,h),d.children.forEach(m=>{p(m,h+1)});const{x:l,y:w,height:f}=d.BBox;if(d.children.length){const{y:m,height:u}=d.children[d.children.length-1].BBox;k(n,l+e.paddingX,w+f,l+e.paddingX,m+u/2+e.lineThickness/2,e.lineThickness)}},"processNode");p(t);const c=o.filter(d=>d.node.description);if(c.length>0){const h=Math.max(...o.map(l=>l.labelRightEdge))+fe;for(const l of c){const f=l.nodeGroup.append("text").text(l.node.description).attr("dominant-baseline","middle").attr("class","treeView-node-description").attr("x",h).attr("y",l.centerY).node().getBBox();i=Math.max(i,h+f.width+e.paddingX)}}for(const d of o)if(d.node.cssClass?.split(/\s+/).includes("highlight")){const h=d.nodeGroup.select(".treeView-highlight-bg");if(!h.empty()){const l=i-d.node.BBox.x+8;h.attr("width",l),i=Math.max(i,d.node.BBox.x+l+2)}}return{totalHeight:s,totalWidth:i}},"drawTree"),xe=g(async(n,t,e,r)=>{A.debug(`Rendering treeView diagram
|
|
4
4
|
`+n);const s=r.db,i=s.getRoot(),o=s.getConfig(),a=q(t),p=a.append("g");p.attr("class","tree-view");const c=await ue(i,o),{totalHeight:d,totalWidth:h}=me(p,i,o,c);a.attr("viewBox",`-${o.lineThickness/2} 0 ${h} ${d}`),U(a,d,h,o.useMaxWidth)},"draw"),ve={draw:xe},be=ve,Ie={labelFontSize:"16px",labelColor:"black",lineColor:"black",iconColor:"#546e7a",descriptionColor:"#6a9955",highlightBg:"rgba(255, 193, 7, 0.15)",highlightStroke:"#ffc107"},Ce=g(({treeView:n})=>{const{labelFontSize:t,labelColor:e,lineColor:r,iconColor:s,descriptionColor:i,highlightBg:o,highlightStroke:a}=N(Ie,n);return`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Ut}from"./BGhV0sdL.js";import{s as Kt}from"./Cy7DFJe5.js";import{b as f,C as Tt,a_ as Zt,V as jt,aZ as Wt,U as qt,b0 as Ht,Y as Qt,X as tt,ay as F,z as Xt,r as Jt,$ as $t,am as te,aU as ee,ab as se,aG as ie,aT as re,p as ae,_ as ne,a1 as oe,aP as ce,aW as le,bh as he}from"./CSa-Sqaw.js";var Ct=(function(){var s=f(function(G,n,l,d){for(l=l||{},d=G.length;d--;l[G[d]]=n);return l},"o"),a=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],o=[2,2],c=[1,7],r=[1,9],u=[1,10],y=[1,11],g=[1,12],k=[1,30],C=[1,23],p=[1,24],b=[1,25],A=[1,26],v=[1,27],O=[1,19],N=[1,28],I=[1,29],x=[1,20],D=[1,18],L=[1,21],w=[1,22],Ot=[2,6],h=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],dt=[1,36],pt=[1,37],ft=[1,38],bt=[1,39],gt=[1,40],Z=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],V=[1,46],M=[1,47],j=[1,57],W=[43,51,53,54,55,74,75],q=[1,70],H=[1,68],B=[1,65],Q=[1,69],X=[1,71],et=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],st=[1,78],it=[1,77],rt=[1,76],Nt=[69,70,71,72,73],xt=[1,91],At=[6,9,45,50],z=[6,9,12,44,45,50,51,52],at=[1,101],nt=[1,100],ot=[1,99],J=[18,61],It=[1,110],Rt=[1,109],vt=[20,43,51,53,54,55],yt=[18,61,64,66],_t={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:f(function(n,l,d,i,_,t,$){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:this.$=t[e-1].concat(t[e]);break;case 4:this.$=t[e];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[e-4]),i.addEntity(t[e-2]),i.addRelationship(t[e-4],t[e],t[e-2],t[e-3]),this.$=[t[e-4],t[e-2]];break;case 8:i.addEntity(t[e-8]),i.addEntity(t[e-4]),i.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),i.setClass([t[e-8]],t[e-6]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-8],t[e-4]];break;case 9:i.addEntity(t[e-6]),i.addEntity(t[e-2]),i.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),i.setClass([t[e-6]],t[e-4]),this.$=[t[e-6],t[e-2]];break;case 10:i.addEntity(t[e-6]),i.addEntity(t[e-4]),i.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-6],t[e-4]];break;case 11:i.addEntity(t[e-3]),i.addAttributes(t[e-3],t[e-1]),this.$=[t[e-3]];break;case 12:i.addEntity(t[e-5]),i.addAttributes(t[e-5],t[e-1]),i.setClass([t[e-5]],t[e-3]),this.$=[t[e-5]];break;case 13:i.addEntity(t[e-2]),this.$=[t[e-2]];break;case 14:i.addEntity(t[e-4]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-4]];break;case 15:i.addEntity(t[e]),this.$=[t[e]];break;case 16:i.addEntity(t[e-2]),i.setClass([t[e-2]],t[e]),this.$=[t[e-2]];break;case 17:i.addEntity(t[e-6],t[e-4]),i.addAttributes(t[e-6],t[e-1]),this.$=[t[e-6]];break;case 18:i.addEntity(t[e-8],t[e-6]),i.addAttributes(t[e-8],t[e-1]),i.setClass([t[e-8]],t[e-3]),this.$=[t[e-8]];break;case 19:i.addEntity(t[e-5],t[e-3]),this.$=[t[e-5]];break;case 20:i.addEntity(t[e-7],t[e-5]),i.setClass([t[e-7]],t[e-2]),this.$=[t[e-7]];break;case 21:i.addEntity(t[e-3],t[e-1]);break;case 22:i.addEntity(t[e-5],t[e-3]),i.setClass([t[e-5]],t[e]);break;case 23:case 24:this.$=t[e].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=t[e].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=t[e]:(i.setDirection(t[e].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:t[e-2].id},t[e-1],{text:t[e-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-1],text:t[e-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-4],text:t[e-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[e];break;case 35:this.$=t[e-1]+" "+t[e];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[e-3],i.addClass(t[e-2],t[e-1]);break;case 41:case 42:case 63:case 72:this.$=[t[e]];break;case 43:case 44:this.$=t[e-2].concat([t[e]]);break;case 45:this.$=t[e-2],i.setClass(t[e-1],t[e]);break;case 46:this.$=t[e-3],i.addCssStyles(t[e-2],t[e-1]);break;case 47:this.$=[t[e]];break;case 48:t[e-2].push(t[e]),this.$=t[e-2];break;case 50:this.$=t[e-1]+t[e];break;case 58:case 84:case 85:this.$=t[e].replace(/"/g,"");break;case 64:t[e].push(t[e-1]),this.$=t[e];break;case 65:this.$={type:t[e-1],name:t[e]};break;case 66:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 67:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 68:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 69:case 71:case 74:this.$=t[e];break;case 70:this.$=t[e-1]+t[e];break;case 73:t[e-2].push(t[e]),this.$=t[e-2];break;case 75:this.$=t[e].replace(/"/g,"");break;case 76:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(a,o,{5:3}),{6:[1,4],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},s(a,Ot,{1:[2,1]}),s(h,[2,3]),s(h,[2,4]),s(h,[2,5]),s(h,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:dt,70:pt,71:ft,72:bt,73:gt}),{22:[1,41]},{24:[1,42]},{26:[1,43]},s(h,[2,26]),s(h,[2,27]),s(h,[2,28]),s(h,[2,29]),s(h,[2,30]),s(h,o,{5:44}),s(Z,[2,58]),s(Z,[2,59]),s(Z,[2,60]),s(Z,[2,61]),s(Z,[2,62]),s(h,[2,36]),s(h,[2,37]),s(h,[2,38]),s(h,[2,39]),{15:45,43:V,44:M},{15:48,43:V,44:M},{15:49,43:V,44:M},{10:50,43:O,51:x,53:D,54:L,55:w},{10:51,43:O,51:x,53:D,54:L,55:w},{15:52,43:V,44:M},{17:53,18:[1,54],56:55,57:56,61:j},{10:58,43:O,51:x,53:D,54:L,55:w},{68:59,74:[1,60],75:[1,61]},s(W,[2,77]),s(W,[2,78]),s(W,[2,79]),s(W,[2,80]),s(W,[2,81]),s(h,[2,23]),s(h,[2,24]),s(h,[2,25]),{6:[1,63],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},{12:q,42:64,44:H,45:B,48:66,49:67,51:Q,52:X},s(et,[2,41]),s(et,[2,42]),{15:72,43:V,44:M,45:B},{12:q,42:73,44:H,45:B,48:66,49:67,51:Q,52:X},{6:st,9:it,19:[1,75],35:74,50:rt},{12:[1,79],14:[1,80]},s(h,[2,16],{67:35,11:81,16:[1,82],45:B,69:dt,70:pt,71:ft,72:bt,73:gt}),{18:[1,83]},s(h,[2,13]),{17:84,18:[2,63],56:55,57:56,61:j},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:dt,70:pt,71:ft,72:bt,73:gt},s(Nt,[2,82]),s(Nt,[2,83]),s(h,[2,31]),s(h,Ot),{6:st,9:it,35:90,45:xt,50:rt},{43:[1,92],44:[1,93]},s(At,[2,47],{49:94,12:q,44:H,51:Q,52:X}),s(z,[2,49]),s(z,[2,54]),s(z,[2,55]),s(z,[2,56]),s(z,[2,57]),s(h,[2,45],{45:B}),{6:st,9:it,35:95,45:xt,50:rt},s(h,[2,32]),{10:97,36:96,43:O,51:x,53:D,54:L,55:w},s(h,[2,51]),s(h,[2,52]),s(h,[2,53]),{13:98,43:at,53:nt,76:ot},{15:102,43:V,44:M},{10:103,43:O,51:x,53:D,54:L,55:w},{17:104,18:[1,105],56:55,57:56,61:j},s(h,[2,11]),{18:[2,64]},s(J,[2,65],{59:106,60:107,63:108,65:It,66:Rt}),s([18,61,65,66],[2,71]),{61:[2,70]},s(h,[2,21],{14:[1,112],16:[1,111]}),s([43,51,53,54,55],[2,76]),s(h,[2,40]),{12:q,44:H,48:113,49:67,51:Q,52:X},s(et,[2,43]),s(et,[2,44]),s(z,[2,50]),s(h,[2,46]),{10:115,20:[1,114],43:O,51:x,53:D,54:L,55:w},s(vt,[2,34]),s(h,[2,7]),s(h,[2,84]),s(h,[2,85]),s(h,[2,86]),{12:[1,116],45:B},{12:[1,118],14:[1,117]},{18:[1,119]},s(h,[2,14]),s(J,[2,66],{60:120,64:[1,121],66:Rt}),s(J,[2,67]),s(yt,[2,72]),s(J,[2,75]),s(yt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:j},{15:124,43:V,44:M},s(At,[2,48],{49:94,12:q,44:H,51:Q,52:X}),{6:st,9:it,35:125,50:rt},s(vt,[2,35]),{13:126,43:at,53:nt,76:ot},{15:127,43:V,44:M},{13:128,43:at,53:nt,76:ot},s(h,[2,12]),s(J,[2,68]),{63:129,65:It},{18:[1,130]},s(h,[2,19]),s(h,[2,22],{16:[1,131],45:B}),s(h,[2,33]),s(h,[2,10]),{12:[1,132],45:B},s(h,[2,9]),s(yt,[2,73]),s(h,[2,17]),{17:133,18:[1,134],56:55,57:56,61:j},{13:135,43:at,53:nt,76:ot},{18:[1,136]},s(h,[2,20]),s(h,[2,8]),s(h,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:f(function(n,l){if(l.recoverable)this.trace(n);else{var d=new Error(n);throw d.hash=l,d}},"parseError"),parse:f(function(n){var l=this,d=[0],i=[],_=[null],t=[],$=this.table,e="",lt=0,Dt=0,Ft=2,Lt=1,Yt=t.slice.call(arguments,1),m=Object.create(this.lexer),Y={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(Y.yy[kt]=this.yy[kt]);m.setInput(n,Y.yy),Y.yy.lexer=m,Y.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var mt=m.yylloc;t.push(mt);var Pt=m.options&&m.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function zt(S){d.length=d.length-2*S,_.length=_.length-S,t.length=t.length-S}f(zt,"popStack");function wt(){var S;return S=i.pop()||m.lex()||Lt,typeof S!="number"&&(S instanceof Array&&(i=S,S=i.pop()),S=l.symbols_[S]||S),S}f(wt,"lex");for(var E,P,T,Et,U={},ht,R,Vt,ut;;){if(P=d[d.length-1],this.defaultActions[P]?T=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=wt()),T=$[P]&&$[P][E]),typeof T>"u"||!T.length||!T[0]){var St="";ut=[];for(ht in $[P])this.terminals_[ht]&&ht>Ft&&ut.push("'"+this.terminals_[ht]+"'");m.showPosition?St="Parse error on line "+(lt+1)+`:
|
|
1
|
+
import{g as Ut}from"./DnJtXsWm.js";import{s as Kt}from"./D0orvEYB.js";import{b as f,C as Tt,a_ as Zt,V as jt,aZ as Wt,U as qt,b0 as Ht,Y as Qt,X as tt,ay as F,z as Xt,r as Jt,$ as $t,am as te,aU as ee,ab as se,aG as ie,aT as re,p as ae,_ as ne,a1 as oe,aP as ce,aW as le,bh as he}from"./D2P0fD42.js";var Ct=(function(){var s=f(function(G,n,l,d){for(l=l||{},d=G.length;d--;l[G[d]]=n);return l},"o"),a=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],o=[2,2],c=[1,7],r=[1,9],u=[1,10],y=[1,11],g=[1,12],k=[1,30],C=[1,23],p=[1,24],b=[1,25],A=[1,26],v=[1,27],O=[1,19],N=[1,28],I=[1,29],x=[1,20],D=[1,18],L=[1,21],w=[1,22],Ot=[2,6],h=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],dt=[1,36],pt=[1,37],ft=[1,38],bt=[1,39],gt=[1,40],Z=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],V=[1,46],M=[1,47],j=[1,57],W=[43,51,53,54,55,74,75],q=[1,70],H=[1,68],B=[1,65],Q=[1,69],X=[1,71],et=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],st=[1,78],it=[1,77],rt=[1,76],Nt=[69,70,71,72,73],xt=[1,91],At=[6,9,45,50],z=[6,9,12,44,45,50,51,52],at=[1,101],nt=[1,100],ot=[1,99],J=[18,61],It=[1,110],Rt=[1,109],vt=[20,43,51,53,54,55],yt=[18,61,64,66],_t={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:f(function(n,l,d,i,_,t,$){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:this.$=t[e-1].concat(t[e]);break;case 4:this.$=t[e];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[e-4]),i.addEntity(t[e-2]),i.addRelationship(t[e-4],t[e],t[e-2],t[e-3]),this.$=[t[e-4],t[e-2]];break;case 8:i.addEntity(t[e-8]),i.addEntity(t[e-4]),i.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),i.setClass([t[e-8]],t[e-6]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-8],t[e-4]];break;case 9:i.addEntity(t[e-6]),i.addEntity(t[e-2]),i.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),i.setClass([t[e-6]],t[e-4]),this.$=[t[e-6],t[e-2]];break;case 10:i.addEntity(t[e-6]),i.addEntity(t[e-4]),i.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-6],t[e-4]];break;case 11:i.addEntity(t[e-3]),i.addAttributes(t[e-3],t[e-1]),this.$=[t[e-3]];break;case 12:i.addEntity(t[e-5]),i.addAttributes(t[e-5],t[e-1]),i.setClass([t[e-5]],t[e-3]),this.$=[t[e-5]];break;case 13:i.addEntity(t[e-2]),this.$=[t[e-2]];break;case 14:i.addEntity(t[e-4]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-4]];break;case 15:i.addEntity(t[e]),this.$=[t[e]];break;case 16:i.addEntity(t[e-2]),i.setClass([t[e-2]],t[e]),this.$=[t[e-2]];break;case 17:i.addEntity(t[e-6],t[e-4]),i.addAttributes(t[e-6],t[e-1]),this.$=[t[e-6]];break;case 18:i.addEntity(t[e-8],t[e-6]),i.addAttributes(t[e-8],t[e-1]),i.setClass([t[e-8]],t[e-3]),this.$=[t[e-8]];break;case 19:i.addEntity(t[e-5],t[e-3]),this.$=[t[e-5]];break;case 20:i.addEntity(t[e-7],t[e-5]),i.setClass([t[e-7]],t[e-2]),this.$=[t[e-7]];break;case 21:i.addEntity(t[e-3],t[e-1]);break;case 22:i.addEntity(t[e-5],t[e-3]),i.setClass([t[e-5]],t[e]);break;case 23:case 24:this.$=t[e].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=t[e].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=t[e]:(i.setDirection(t[e].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:t[e-2].id},t[e-1],{text:t[e-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-1],text:t[e-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-4],text:t[e-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[e];break;case 35:this.$=t[e-1]+" "+t[e];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[e-3],i.addClass(t[e-2],t[e-1]);break;case 41:case 42:case 63:case 72:this.$=[t[e]];break;case 43:case 44:this.$=t[e-2].concat([t[e]]);break;case 45:this.$=t[e-2],i.setClass(t[e-1],t[e]);break;case 46:this.$=t[e-3],i.addCssStyles(t[e-2],t[e-1]);break;case 47:this.$=[t[e]];break;case 48:t[e-2].push(t[e]),this.$=t[e-2];break;case 50:this.$=t[e-1]+t[e];break;case 58:case 84:case 85:this.$=t[e].replace(/"/g,"");break;case 64:t[e].push(t[e-1]),this.$=t[e];break;case 65:this.$={type:t[e-1],name:t[e]};break;case 66:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 67:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 68:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 69:case 71:case 74:this.$=t[e];break;case 70:this.$=t[e-1]+t[e];break;case 73:t[e-2].push(t[e]),this.$=t[e-2];break;case 75:this.$=t[e].replace(/"/g,"");break;case 76:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(a,o,{5:3}),{6:[1,4],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},s(a,Ot,{1:[2,1]}),s(h,[2,3]),s(h,[2,4]),s(h,[2,5]),s(h,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:dt,70:pt,71:ft,72:bt,73:gt}),{22:[1,41]},{24:[1,42]},{26:[1,43]},s(h,[2,26]),s(h,[2,27]),s(h,[2,28]),s(h,[2,29]),s(h,[2,30]),s(h,o,{5:44}),s(Z,[2,58]),s(Z,[2,59]),s(Z,[2,60]),s(Z,[2,61]),s(Z,[2,62]),s(h,[2,36]),s(h,[2,37]),s(h,[2,38]),s(h,[2,39]),{15:45,43:V,44:M},{15:48,43:V,44:M},{15:49,43:V,44:M},{10:50,43:O,51:x,53:D,54:L,55:w},{10:51,43:O,51:x,53:D,54:L,55:w},{15:52,43:V,44:M},{17:53,18:[1,54],56:55,57:56,61:j},{10:58,43:O,51:x,53:D,54:L,55:w},{68:59,74:[1,60],75:[1,61]},s(W,[2,77]),s(W,[2,78]),s(W,[2,79]),s(W,[2,80]),s(W,[2,81]),s(h,[2,23]),s(h,[2,24]),s(h,[2,25]),{6:[1,63],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},{12:q,42:64,44:H,45:B,48:66,49:67,51:Q,52:X},s(et,[2,41]),s(et,[2,42]),{15:72,43:V,44:M,45:B},{12:q,42:73,44:H,45:B,48:66,49:67,51:Q,52:X},{6:st,9:it,19:[1,75],35:74,50:rt},{12:[1,79],14:[1,80]},s(h,[2,16],{67:35,11:81,16:[1,82],45:B,69:dt,70:pt,71:ft,72:bt,73:gt}),{18:[1,83]},s(h,[2,13]),{17:84,18:[2,63],56:55,57:56,61:j},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:dt,70:pt,71:ft,72:bt,73:gt},s(Nt,[2,82]),s(Nt,[2,83]),s(h,[2,31]),s(h,Ot),{6:st,9:it,35:90,45:xt,50:rt},{43:[1,92],44:[1,93]},s(At,[2,47],{49:94,12:q,44:H,51:Q,52:X}),s(z,[2,49]),s(z,[2,54]),s(z,[2,55]),s(z,[2,56]),s(z,[2,57]),s(h,[2,45],{45:B}),{6:st,9:it,35:95,45:xt,50:rt},s(h,[2,32]),{10:97,36:96,43:O,51:x,53:D,54:L,55:w},s(h,[2,51]),s(h,[2,52]),s(h,[2,53]),{13:98,43:at,53:nt,76:ot},{15:102,43:V,44:M},{10:103,43:O,51:x,53:D,54:L,55:w},{17:104,18:[1,105],56:55,57:56,61:j},s(h,[2,11]),{18:[2,64]},s(J,[2,65],{59:106,60:107,63:108,65:It,66:Rt}),s([18,61,65,66],[2,71]),{61:[2,70]},s(h,[2,21],{14:[1,112],16:[1,111]}),s([43,51,53,54,55],[2,76]),s(h,[2,40]),{12:q,44:H,48:113,49:67,51:Q,52:X},s(et,[2,43]),s(et,[2,44]),s(z,[2,50]),s(h,[2,46]),{10:115,20:[1,114],43:O,51:x,53:D,54:L,55:w},s(vt,[2,34]),s(h,[2,7]),s(h,[2,84]),s(h,[2,85]),s(h,[2,86]),{12:[1,116],45:B},{12:[1,118],14:[1,117]},{18:[1,119]},s(h,[2,14]),s(J,[2,66],{60:120,64:[1,121],66:Rt}),s(J,[2,67]),s(yt,[2,72]),s(J,[2,75]),s(yt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:j},{15:124,43:V,44:M},s(At,[2,48],{49:94,12:q,44:H,51:Q,52:X}),{6:st,9:it,35:125,50:rt},s(vt,[2,35]),{13:126,43:at,53:nt,76:ot},{15:127,43:V,44:M},{13:128,43:at,53:nt,76:ot},s(h,[2,12]),s(J,[2,68]),{63:129,65:It},{18:[1,130]},s(h,[2,19]),s(h,[2,22],{16:[1,131],45:B}),s(h,[2,33]),s(h,[2,10]),{12:[1,132],45:B},s(h,[2,9]),s(yt,[2,73]),s(h,[2,17]),{17:133,18:[1,134],56:55,57:56,61:j},{13:135,43:at,53:nt,76:ot},{18:[1,136]},s(h,[2,20]),s(h,[2,8]),s(h,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:f(function(n,l){if(l.recoverable)this.trace(n);else{var d=new Error(n);throw d.hash=l,d}},"parseError"),parse:f(function(n){var l=this,d=[0],i=[],_=[null],t=[],$=this.table,e="",lt=0,Dt=0,Ft=2,Lt=1,Yt=t.slice.call(arguments,1),m=Object.create(this.lexer),Y={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(Y.yy[kt]=this.yy[kt]);m.setInput(n,Y.yy),Y.yy.lexer=m,Y.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var mt=m.yylloc;t.push(mt);var Pt=m.options&&m.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function zt(S){d.length=d.length-2*S,_.length=_.length-S,t.length=t.length-S}f(zt,"popStack");function wt(){var S;return S=i.pop()||m.lex()||Lt,typeof S!="number"&&(S instanceof Array&&(i=S,S=i.pop()),S=l.symbols_[S]||S),S}f(wt,"lex");for(var E,P,T,Et,U={},ht,R,Vt,ut;;){if(P=d[d.length-1],this.defaultActions[P]?T=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=wt()),T=$[P]&&$[P][E]),typeof T>"u"||!T.length||!T[0]){var St="";ut=[];for(ht in $[P])this.terminals_[ht]&&ht>Ft&&ut.push("'"+this.terminals_[ht]+"'");m.showPosition?St="Parse error on line "+(lt+1)+`:
|
|
2
2
|
`+m.showPosition()+`
|
|
3
3
|
Expecting `+ut.join(", ")+", got '"+(this.terminals_[E]||E)+"'":St="Parse error on line "+(lt+1)+": Unexpected "+(E==Lt?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(St,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:mt,expected:ut})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+E);switch(T[0]){case 1:d.push(E),_.push(m.yytext),t.push(m.yylloc),d.push(T[1]),E=null,Dt=m.yyleng,e=m.yytext,lt=m.yylineno,mt=m.yylloc;break;case 2:if(R=this.productions_[T[1]][1],U.$=_[_.length-R],U._$={first_line:t[t.length-(R||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(R||1)].first_column,last_column:t[t.length-1].last_column},Pt&&(U._$.range=[t[t.length-(R||1)].range[0],t[t.length-1].range[1]]),Et=this.performAction.apply(U,[e,Dt,lt,Y.yy,T[1],_,t].concat(Yt)),typeof Et<"u")return Et;R&&(d=d.slice(0,-1*R*2),_=_.slice(0,-1*R),t=t.slice(0,-1*R)),d.push(this.productions_[T[1]][0]),_.push(U.$),t.push(U._$),Vt=$[d[d.length-2]][d[d.length-1]],d.push(Vt);break;case 3:return!0}}return!0},"parse")},Gt=(function(){var G={EOF:1,parseError:f(function(l,d){if(this.yy.parser)this.yy.parser.parseError(l,d);else throw new Error(l)},"parseError"),setInput:f(function(n,l){return this.yy=l||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var l=n.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:f(function(n){var l=n.length,d=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),d.length-1&&(this.yylineno-=d.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:d?(d.length===i.length?this.yylloc.first_column:0)+i[i.length-d.length].length-d[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(n){this.unput(this.match.slice(n))},"less"),pastInput:f(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var n=this.pastInput(),l=new Array(n.length+1).join("-");return n+this.upcomingInput()+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as l,r as m,d as n}from"./
|
|
1
|
+
import{g as l,r as m,d as n}from"./BTGEGvnD.js";import{p}from"./C3G5lO0X.js";import{b as t,ay as o}from"./D2P0fD42.js";import{M as u,a as f}from"./BGC1OvbZ.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),y=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),d=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(d(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},N={parser:g,db:n,renderer:m,styles:l};export{N as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var Ce=Object.defineProperty;var Pe=(e,t,r)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var d=(e,t,r)=>Pe(e,typeof t!="symbol"?t+"":t,r);import{k as Ie,N as Te,T as Oe,d as Fe,l as Le,w as De}from"./8KpVpm2n.js";import"./DYhIMPy1.js";import{bm as a,_ as xe}from"./BkULGdgB.js";import"./BkQ2g3_N.js";import"./DdvXzOsp.js";import"./CjRRnXFa.js";import{c as K}from"./ChTqQfQN.js";import"./DEAMVhLT.js";import{IH as n,u2 as Ne,nA as w,nz as v,m3 as We,vr as Be,vp as ie,hb as Ve,hc as Ue,e as Ge,Ik as He,a6 as qe,ym as O,yn as q,yk as $e,yl as je,b$ as ze,b_ as Ke,cd as Qe,cc as Xe,nC as R}from"./DZwGQbE8.js";import{cG as Ze,cv as Ye,bv as Je,cj as Q,cL as et,cK as tt,cP as rt,c7 as st,cn as it,c9 as nt,cE as de,ax as at,bR as ot,cM as ct}from"./D4U_w4GT.js";import{aW as lt,a6 as ue,bX as dt,t as ut,$ as pt,c8 as X,l as ft,a7 as gt,c9 as ht,e as mt,aX as bt,bS as Z,aA as St,ba as _t,ab as vt,aS as At,bZ as kt,aa as yt,a8 as Et,a9 as Mt,bV as wt,I as Rt}from"./BqrO7ljl.js";import{x as Ct}from"./BN5JMxvy.js";import{y as T}from"./BGikh8Vc.js";import{a as Pt,i as It}from"./CJ5wd9GV.js";import{i as V}from"./DhnPdhLH.js";import{n as Tt}from"./0sUdCOJj.js";const Ot=Object.freeze(Object.defineProperty({__proto__:null,NOTIFY_DURATION:Te,TOAST_COUNTDOWN_CLASS:Oe,TOAST_COUNTDOWN_NO_HOVER_PAUSE_CLASS:Fe,notify:Ie,notifyMetadata:Le,withToastCountdown:De},Symbol.toStringTag,{value:"Module"})),Os=n.createSelector(e=>Ze.select(e)?.capabilities.gitlabCheckout===!0),Fs=n.createSelector(e=>e.gitlabAuth.host),Ls=n.createSelector(e=>e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host),Ds=n.createSelector(e=>Ne(e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host)??""),xs=n.createSelector(e=>e.gitlabAuth.isCancelling),Ns=n.createSelector(e=>e.gitlabAuth.cancelOutcome),Ws=n.createSelector(e=>e.gitlabAuth.isConfigured),Bs=n.createSelector(e=>e.gitlabAuth.isAuthenticating),Vs=n.createSelector(e=>e.gitlabAuth.deviceFlow),Us=n.createSelector(e=>e.gitlabAuth.deviceGrantSupported),Gs=n.createSelector(e=>e.gitlabAuth.user),Hs=n.createSelector(e=>e.gitlabAuth.error);n.createSelector(e=>e.gitlabAuth.method);const qs=n.createSelector(e=>e.gitlabAuth.statusReady===!0),E=[{id:"pr-reviewer",icon:"pr-reviewer",get name(){return a.specialists_builtin_prReviewer_name()},get description(){return a.specialists_builtin_prReviewer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"ui-designer",icon:"ui-designer",get name(){return a.specialists_builtin_uiDesigner_name()},get description(){return a.specialists_builtin_uiDesigner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"vulnerability-scanner",icon:"pr-reviewer",get name(){return a.specialists_builtin_vulnerabilityScanner_name()},get description(){return a.specialists_builtin_vulnerabilityScanner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"developer",icon:"verifier",get name(){return a.specialists_builtin_developer_name()},get description(){return a.specialists_builtin_developer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"product-manager",icon:"coordinator",get name(){return a.specialists_builtin_productManager_name()},get description(){return a.specialists_builtin_productManager_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"maintenance-coordinator",icon:"ralph",get name(){return a.specialists_builtin_maintenanceCoordinator_name()},get description(){return a.specialists_builtin_maintenanceCoordinator_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"chief-of-staff",icon:"chief-of-staff",get name(){return a.specialists_builtin_chiefOfStaff_name()},get description(){return a.specialists_builtin_chiefOfStaff_description()},hidden:!0,defaultBehaviorPrompt:"",promptUnavailable:!0}],pe=new Set(["pr-reviewer"]),$s="developer";function js(e){return E.find(t=>t.id===e)}const Ft=n.createSelector(e=>e.githubAuth.mutationRequestId),Lt=n.createSelector(e=>e.githubAuth.callbacksCancelled),Dt=n.createSelector(e=>e.githubAuth.isDisconnecting),fe=n.createSelector(e=>e.githubAuth.isAuthenticated),xt=n.createSelector(e=>e.githubAuth.statusSettled===!0),Nt=n.createSelector(e=>e.githubAuth.requiresDaemonAuth),Wt=n.createSelector(e=>e.githubAuth.user),Bt=n.createSelector(e=>e.githubAuth.isAuthenticating),Vt=n.createSelector(e=>e.githubAuth.deviceFlow),Ut=n.createSelector(e=>e.githubAuth.error),zs=Object.freeze(Object.defineProperty({__proto__:null,selectGitHubAuthCallbacksCancelled:Lt,selectGitHubAuthDeviceFlow:Vt,selectGitHubAuthError:Ut,selectGitHubAuthIsAuthenticated:fe,selectGitHubAuthIsAuthenticating:Bt,selectGitHubAuthIsDisconnecting:Dt,selectGitHubAuthMutationRequestId:Ft,selectGitHubAuthRequiresDaemonAuth:Nt,selectGitHubAuthStatusSettled:xt,selectGitHubAuthUser:Wt},Symbol.toStringTag,{value:"Module"}));function f(e){return e??""}function Gt(e,t){const r=e??[],s=t??[];return r.length===s.length&&r.every((i,o)=>f(i.provider)===f(s[o].provider)&&i.model===s[o].model&&i.hint===s[o].hint&&f(i.reasoningEffort)===f(s[o].reasoningEffort))}function ne(e,t){if(e.source!=="user"||!t?.ignoreModelPin&&(e.model||e.codingAgent))return!1;const r=e.bundled;return r?f(e.name)===f(r.name)&&f(e.description)===f(r.description)&&f(e.behaviorPrompt)===f(r.behaviorPrompt)&&f(e.roleReminder)===f(r.roleReminder)&&f(e.reasoningEffort)===f(r.reasoningEffort)&&Gt(e.modelOptions,r.modelOptions):!1}const Ks=n.createSelector(e=>e.specialists.bundledSpecialists),Ht=n.createSelector(e=>e.specialists.fileSpecialists),Qs=n.createSelector(e=>w(Ht.select(e))),Xs=n.createSelector(e=>e.specialists.userOverrides);n.createSelector(e=>e.specialists.overridesLoaded);const Zs=n.createSelector(e=>e.specialists.customSpecialistsLoaded),Ys=n.createSelector(e=>e.specialists.fileSpecialistsLoaded),Js=n.createSelector(e=>e.specialists.bundledSpecialistsLoaded),ei=n.createSelector(e=>e.specialists.specialistsFolderPath),ti=n.createSelector((e,t)=>{if(!t)return e.specialists.defaultSpecialistId??"";const r=e.providerCatalog?.byWorkspaceId?.[t]?.settings.find(s=>s.path==="specialists.default")?.value;return typeof r=="string"?r:""});n.createSelector(e=>e.specialists.providerModelOverrides);const U=n.createSelector((e,t)=>!(pe.has(t)&&!fe.select(e)));function qt(e,t){return t?e:e.filter(r=>!pe.has(r.id))}function $t(e,t){return qt(e,t).filter(r=>!r.hidden)}function ri(e,t){return $t(e,t).filter(r=>r.role!=="internal")}const A=n.createSelector((e,t)=>{if(t)return(e.providerCatalog?.byWorkspaceId?.[t]?.specialists??[]).map(l=>({...l,defaultModel:l.model,defaultBehaviorPrompt:l.behaviorPrompt??l.prompt??"",defaultAgentType:l.agentType}));const r=w(e.specialists.fileSpecialists),s=e.specialists.bundledSpecialists,i=new Set,o=[];for(const l of r)!i.has(l.id)&&U.select(e,l.id)&&(i.add(l.id),o.push({id:l.id,name:l.name,description:l.description,codingAgent:l.codingAgent,defaultModel:l.model||void 0,defaultBehaviorPrompt:l.behaviorPrompt,roleReminder:l.roleReminder,source:l.source,importedFrom:l.importedFrom,unsupportedFields:l.unsupportedFields,requiredSkills:l.requiredSkills,missingSkills:l.missingSkills,hidden:l.hidden,resolvedModel:l.resolvedModel,resolvedProvider:l.resolvedProvider,modelOptions:l.modelOptions,reasoningEffort:l.reasoningEffort,role:l.role,teamAgents:l.teamAgents,icon:l.icon}));for(const l of s)!i.has(l.id)&&U.select(e,l.id)&&(i.add(l.id),o.push(l));if(!e.specialists.bundledSpecialistsLoaded&&r.length===0&&s.length===0)for(const l of E)!i.has(l.id)&&U.select(e,l.id)&&(i.add(l.id),o.push(l));const c=new Map;for(const l of E)c.has(l.id)||c.set(l.id,c.size);for(const l of s)c.has(l.id)||c.set(l.id,c.size);return o.sort((l,p)=>{const S=c.has(l.id),B=c.has(p.id);return S&&B?(c.get(l.id)??0)-(c.get(p.id)??0):S&&!B?-1:!S&&B?1:l.name.localeCompare(p.name)}),o}),si=n.createSelector(e=>{const t=A.select(e).filter(s=>s.role==="orchestrator");if(t.length===0)return null;const r=new Set([...E.map(({id:s})=>s),...e.specialists.bundledSpecialists.map(({id:s})=>s)]);return t.sort((s,i)=>+!r.has(s.id)-+!r.has(i.id)||s.id.localeCompare(i.id)),t[0]}),jt=n.createSelector((e,t)=>{const r=v(e.specialists.fileSpecialists,t);if(r)return{id:r.id,name:r.name,description:r.description,source:r.source};const s=e.specialists.bundledSpecialists.find(i=>i.id===t);if(s)return{id:s.id,name:s.name,description:s.description,source:"builtin"};if(!e.specialists.bundledSpecialistsLoaded&&w(e.specialists.fileSpecialists).length===0&&e.specialists.bundledSpecialists.length===0){const i=E.find(o=>o.id===t);if(i)return{id:i.id,name:i.name,description:i.description,source:"builtin"}}return null}),ii=n.createSelector((e,t)=>jt.select(e,t)?.name??null),ni=n.createSelector((e,t,r)=>{const i=A.select(e,r).find(o=>o.id===t);return i?i.defaultModel?i.defaultModel:i.resolvedModel??"":""}),ai=n.createSelector((e,t,r)=>A.select(e,r).find(o=>o.id===t)?.defaultModel||void 0),oi=n.createSelector((e,t,r)=>A.select(e,r).find(o=>o.id===t)?.reasoningEffort||void 0),ci=n.createSelector((e,t,r)=>{const i=A.select(e,r).find(o=>o.id===t);return i?i.defaultBehaviorPrompt:""});function F(e,t){return t.some(r=>r.id===e)||E.some(r=>r.id===e)}const li=n.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(i=>i.id===t);return!s||s.importedFrom?!1:s.source==="bundled"||s.source==="user"&&F(t,e.specialists.bundledSpecialists)}return F(t,e.specialists.bundledSpecialists)}),di=n.createSelector((e,t,r)=>r?!!Y.select(e,t,r):!!v(e.specialists.fileSpecialists,t)),ui=n.createSelector((e,t,r)=>{if(r){const o=Y.select(e,t,r);return!o||o.importedFrom||o.source==="project"?!1:F(t,e.specialists.bundledSpecialists)&&!ne(o)}if(!F(t,e.specialists.bundledSpecialists))return!1;const i=v(e.specialists.fileSpecialists,t);return!i||i.source!=="user"?!1:!ne(i)}),Y=n.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(i=>i.id===t);return!s||s.source==="bundled"?void 0:{...s,source:s.source,model:s.model??"",behaviorPrompt:s.behaviorPrompt??s.prompt??"",filePath:s.path??""}}return v(e.specialists.fileSpecialists,t)}),pi=n.createSelector((e,t,r)=>{const s=Y.select(e,t,r);return r&&!s?e.providerCatalog?.byWorkspaceId?.[r]?.specialists.some(i=>i.id===t)?"Built-in":null:s?.source==="project"?"Project":s?.source==="user"?"User":e.specialists.bundledSpecialists.some(i=>i.id===t)?"Built-in":null}),fi=n.createSelector((e,t,r)=>{if(r)return e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(o=>o.id===t)?.path;const s=v(e.specialists.fileSpecialists,t);if(s)return s.filePath;const i=e.specialists.bundledSpecialists.find(o=>o.id===t);if(i&&"filePath"in i)return i.filePath}),gi=n.createSelector((e,t,r)=>{if(r){const i=A.select(e,r).find(l=>l.id===t),o=i?.codingAgent||i?.resolvedProvider;if(o)return Ye.select(e,o,r);const c=Je.select(e,r);return e.providerCatalog?.byWorkspaceId?.[r]?.readiness[c]?.available?c:""}const s=v(e.specialists.fileSpecialists,t);return s?.codingAgent?s.codingAgent:zt.select(e,t)}),zt=n.createSelector((e,t)=>{const s=A.select(e).find(i=>i.id===t);return s?.codingAgent?s.codingAgent:lt.select(e)?ue.select(e):""}),hi=n.createSelector((e,t)=>{if(t)return e.providerCatalog?.byWorkspaceId?.[t]?.importDiagnostics??[];const r=e.specialists.importDiagnostics;return r?w(r):[]}),mi=n.createSelector((e,t)=>e.specialists.creationByContext?.[t]??We),bi=n.createSelector(e=>Object.values(e.specialists.creationByContext??{}).flatMap(t=>t.specialistId?[t.specialistId]:[])),Kt=["connected","disconnected","unreachable","revoked","update-required"],M=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),u=e=>typeof e=="string"&&e.length>0,C=e=>typeof e=="string"&&e.length>0?e:void 0,ge=e=>Number.isSafeInteger(e)&&e>=0?e:0;function Qt(e){if(!M(e))return;const t=Array.isArray(e.providers)?e.providers.flatMap(s=>M(s)&&u(s.id)?[{id:s.id,...s.visible===!1?{visible:!1}:{},status:typeof s.status=="string"?s.status:"unknown",models:Array.isArray(s.models)?s.models.filter(i=>u(i)):[],...s.modelsStale===!0?{modelsStale:!0}:{}}]:[]):[],r=C(e.intentdVersion);return{...r?{intentdVersion:r}:{},providers:t}}function Si(e){if(!M(e)||!u(e.id)||!u(e.name)||!u(e.fingerprint)||!Kt.includes(e.state)||!Number.isInteger(e.port)||!u(e.addedAt))return null;const t=M(e.platform)&&u(e.platform.os)&&u(e.platform.arch)?{os:e.platform.os,arch:e.platform.arch}:void 0,r=Qt(e.capabilities),s=C(e.tcAddress),i=C(e.observedAt),o=C(e.lastConnectedAt),c=Be(e.cloud),l=Number.isInteger(e.nodeProtocol)&&e.nodeProtocol>=0?e.nodeProtocol:void 0;return{id:e.id,name:e.name,...t?{platform:t}:{},hosts:Array.isArray(e.hosts)?e.hosts.filter(p=>u(p)):[],port:e.port,...s?{tcAddress:s}:{},fingerprint:e.fingerprint,state:e.state,runningAgents:ge(e.runningAgents),...r?{capabilities:r}:{},...l!==void 0?{nodeProtocol:l}:{},...i?{observedAt:i}:{},addedAt:e.addedAt,...o?{lastConnectedAt:o}:{},...c?{cloud:c}:{}}}function _i(e){if(!M(e)||!u(e.credentialId)||!u(e.backendId)||!u(e.backendName)||!u(e.createdAt))return null;const t=C(e.lastUsedAt);return{credentialId:e.credentialId,backendId:e.backendId,backendName:e.backendName,createdAt:e.createdAt,...t?{lastUsedAt:t}:{},connected:e.connected===!0,runningAgents:ge(e.runningAgents)}}function vi(e){const t=(typeof e=="string"?e:"").trim().toUpperCase();return t===""?null:t}function Xt(e){if(!M(e)||typeof e.name!="string")return null;const t=e.name;return e.kind==="local"?{kind:"local",name:t}:e.kind==="machine"&&u(e.nodeId)?{kind:"machine",nodeId:e.nodeId,name:t}:e.kind==="cloud"&&u(e.cloudMachineId)?{kind:"cloud",cloudMachineId:e.cloudMachineId,name:t}:null}function Ai(e){if(!Array.isArray(e))return null;const t=[];for(const r of e){const s=Xt(r);if(!s)return null;t.push(s)}return t}function Zt(e){return e.kind==="local"?{kind:"local"}:e.kind==="machine"?{kind:"machine",nodeId:e.nodeId}:{kind:"cloud",cloudMachineId:e.cloudMachineId}}function I(e){return e.kind==="local"?"local":e.kind==="machine"?`machine:${e.nodeId}`:`cloud:${e.cloudMachineId}`}const Yt={macos:"macOS",linux:"Linux",windows:"Windows"},Jt={aarch64:"arm64",arm64:"arm64",x86_64:"x64",x64:"x64"};function k(e,t){const r=[e&&(Yt[e]??e),t&&(Jt[t]??t)].filter(s=>!!s);return r.length?r.join(" "):null}function er(e){return e?.placement?.target==="remote"||T(e?.placement?.target)}const tr=new Set(["running","paused","resuming","pausing","stopping"]);function rr(e,t){if(e.placementError)return null;if(e.cloudStart)return"starting";if(!e.nodeId)return e.effectiveIsolation==="pending"?"starting":null;const r=t?.cloud?.state;return r&&tr.has(r)?r:e.effectiveIsolation==="pending"?"starting":null}function he(e,t){if(!e||!er(e))return null;const r=e.nodeId??e.placement?.nodeId??"",s=t&&t.id===r?t:null;if(T(e.placement?.target))return{nodeId:r,name:e.nodeName?.trim()||Ve(s?.cloud?.provider??Ue(e.placement?.cloudMachineId)),platform:k(s?.platform?.os,s?.platform?.arch),state:"ready",cloud:{state:rr(e,s)}};const i=k(e.placement?.os,e.placement?.arch)??k(s?.platform?.os,s?.platform?.arch),o=s?.state==="revoked"?"revoked":s?.state==="unreachable"||e.nodeState==="offline"?"unreachable":"ready";return{nodeId:r,name:e.nodeName?.trim()||s?.name||a.remoteAgent_location_unknownMachine(),platform:i,state:o}}function ki(e,t){if(!e)return null;const r=t&&t.id===e?t:null;return{nodeId:e,name:r?.name||a.remoteAgent_location_unknownMachine(),platform:k(r?.platform?.os,r?.platform?.arch),state:r?.state==="revoked"?"revoked":r?.state==="unreachable"?"unreachable":"ready"}}function me(e){switch(e){case"starting":return a.cloudMachines_agent_starting();case"running":return a.cloudMachines_agent_running();case"paused":return a.cloudMachines_agent_paused();case"resuming":return a.cloudMachines_agent_resuming();case"pausing":return a.cloudMachines_agent_pausing();case"stopping":return a.cloudMachines_agent_stopping();default:return null}}function yi(e){const t=me(e.cloud?.state);return t?a.cloudMachines_agent_chip({machine:e.name,state:t}):e.name}function Ei(e){if(e.cloud){const r=me(e.cloud.state),s=a.remoteAgent_location_tooltipNoPlatform({machine:e.name});return r?a.remoteAgent_location_tooltipWithState({location:s,state:r}):s}const t=e.platform?a.remoteAgent_location_tooltip({machine:e.name,platform:e.platform}):a.remoteAgent_location_tooltipNoPlatform({machine:e.name});switch(e.state){case"unreachable":return a.remoteAgent_location_tooltipWithState({location:t,state:a.remoteMachines_state_unreachable_label()});case"revoked":return a.remoteAgent_location_tooltipWithState({location:t,state:a.remoteMachines_state_revoked_label()});default:return t}}function be(e,t){return!e||!t?null:e.placementError?"failed":t.state==="revoked"?"revoked":t.state==="unreachable"?"unreachable":e.effectiveIsolation==="pending"||e.cloudStart?"starting":e.setup?.state==="failed"?"setup-failed":null}function Se(e){if(!e.endsWith("}"))return null;for(let t=e.indexOf(" {");t>=0;t=e.indexOf(" {",t+1))try{const r=JSON.parse(e.slice(t+1));if(r&&typeof r=="object"&&typeof r.code=="string")return{message:e.slice(0,t).trim(),data:r}}catch{}return null}function sr(e,t){const r=e.detail??"",s=Se(r),i=e.code==="machine-update-required"||s?.data.code==="machine-update-required";if(i&&s?.data.reason==="prepared-checkout")return{updateRequired:i,message:a.remoteAgent_updateRequired_preparedCheckout({machine:t})};const o=ie(s?.data),c=o??(e.code?ie({code:e.code}):null);return c?{updateRequired:i,message:s?.message||r,cloud:c,cloudDetailKnown:!!o}:{updateRequired:i,message:s?.message||r}}function Mi(e){if(!T(e?.placement?.target)||!e.placementError||e.status!==Ge.Error)return null;const t=sr(e.placementError,"");return t.cloud?t:null}const ir=["attachments-too-large-for-machine:","node-prompt-too-large:"],nr="remote-agent-unsupported:";function ae(e){return new Intl.NumberFormat(void 0,{maximumFractionDigits:1}).format(e/1048576)}function wi(e){const t=Se(e)?.message??e;for(const s of ir){const i=t.indexOf(s);if(i<0)continue;const o=t.slice(i+s.length).trim().replace(/^[a-z][\w]*(?:\.[\w]+)+:\s*/i,""),c=/come to (\d+) bytes\b.*?over its (\d+)-byte limit/.exec(o);return c?a.remoteAgent_attachmentsTooLargeSized_error({size:ae(Number(c[1])),limit:ae(Number(c[2]))}):o?a.remoteAgent_attachmentsTooLarge_error({detail:o}):a.remoteAgent_attachmentsTooLargeNoDetail_error()}const r=t.indexOf(nr);return r>=0&&/attachment/i.test(t.slice(r))?a.remoteAgent_attachmentsUnsupported_error():null}function Ri(e){return T(e?.placement?.target)&&be(e,he(e))==="starting"}function Ci(e,t){if(!T(e?.placement?.target))return!1;const r=he(e,t);return r?.cloud?.state==="resuming"&&be(e,r)===null}const m="",$="cloud:";function J(e){return`${$}${e}`}function N(e){return e?.startsWith($)&&e.slice($.length)||null}const Pi=J("e2b");function ar(e,t){return e?.find(r=>J(r.cloudMachineId)===t&&r.unavailableReason===null)}const or=new Set(["connected","disconnected"]);function cr(e){switch(e){case"unreachable":return a.remoteMachines_state_unreachable_label();case"revoked":return a.remoteMachines_state_revoked_label();case"update-required":return a.remoteMachines_state_updateRequired_label();default:return}}function ee(e){return or.has(e.state)}function lr({backendLabel:e,backendPlatform:t,machines:r,cloud:s,orchestrator:i=!1}){const o=[i?{id:m,label:a.remoteMachines_startOn_firstAvailable_label(),platform:null,disabled:!1,hint:a.remoteMachines_startOn_firstAvailable_hint()}:{id:m,label:e,platform:k(t?.os,t?.arch),disabled:!1},...r.map(c=>{const l=k(c.platform?.os,c.platform?.arch);return ee(c)?{id:c.id,label:c.name,platform:l,disabled:!1}:{id:c.id,label:c.name,platform:l,disabled:!0,reason:cr(c.state)}})];for(const c of s??[])o.push({id:J(c.cloudMachineId),label:c.label,platform:null,kind:"cloud",disabled:c.unavailableReason!==null,...c.unavailableReason?{reason:c.unavailableReason}:c.needsProfile?{hint:a.cloudMachines_startOn_hint()}:{}});return o}function Ii(e){return e.find(t=>t.id===m)?.label??""}function Ti(e,t,r){if(e!==m)return N(e)?void 0:e;if(r)return t.find(s=>s.id!==m&&s.kind!=="cloud"&&!s.disabled)?.id}function dr({remoteMachinesVisible:e,supported:t,machines:r,cloud:s}){return e&&t&&(r.some(ee)||(s??[]).some(i=>i.unavailableReason===null))}function ur(e,t,r){if(!e)return m;if(N(e))return ar(r,e)?e:m;const s=t.find(i=>i.id===e);return s&&ee(s)?s.id:m}function Oi(e,{cloudEntries:t=!1,providerOf:r}={}){const s=N(e);if(s){const i=r?.(s);return t&&i&&i!=="e2b"?{target:"cloud",checkout:"isolated",cloudMachineId:s}:t?{target:"e2b",checkout:"isolated",cloudMachineId:s}:{target:"e2b",checkout:"isolated"}}return e?{target:"remote",checkout:"isolated",nodeId:e}:void 0}function Fi({groups:e,providerRef:t,model:r}){const s=c=>c.options.filter(l=>!l.disabled),i=e.find(c=>c.key===t),o=i?s(i):[];if(r){const c=He(r).modelId;if(o.some(l=>l.value===c))return null}else if(o.length>0)return null;if(i&&o.length>0)return{providerId:i.key,modelId:o[0].value};for(const c of e){if(c.key==="default")continue;const l=s(c);if(l.length>0)return{providerId:c.key,modelId:l[0].value}}return null}function pr(e,t,r,s){const i=e.map(I),o=i.indexOf(t),c=i.indexOf(r);if(o<0||c<0||o===c)return null;let l=c+(s==="after"?1:0);if(o<l&&(l-=1),l===o)return null;const p=[...e],[S]=p.splice(o,1);return p.splice(l,0,S),p.map(Zt)}function Li(e,t,r){const s=e.findIndex(o=>I(o)===t),i=e[s+r];return s<0||!i?null:pr(e,t,I(i),r===-1?"before":"after")}function fr(e,t){if(e===m)return"local";const r=t==="cloud"?N(e):null;return I(r?{kind:"cloud",cloudMachineId:r}:{kind:"machine",nodeId:e})}function oe(e,t){const r=new Map(t.map((i,o)=>[I(i),o])),s=i=>r.get(fr(i.id,i.kind))??t.length;return e.map((i,o)=>({option:i,index:o})).sort((i,o)=>s(i.option)-s(o.option)||i.index-o.index).map(({option:i})=>i)}const gr=n.createSelector(e=>Ct.select(e)||Q.select(e)),te=n.createSelector(e=>gr.select(e)&&e.remoteMachines?.supported===!0),Di=n.createSelector(e=>te.select(e)&&dt.select(e)&&!Q.select(e)),_e=n.createSelector(e=>te.select(e)&&e.remoteMachines.machineOrder===!0&&e.remoteMachines.order!==null),ce=n.createSelector(e=>_e.select(e)?e.remoteMachines.order??[]:[]),xi=n.createSelector(e=>e.remoteMachines.orderSaving!==null),re=n.createSelector(e=>Object.values(e.remoteMachines?.machines??{}).sort((t,r)=>t.name.localeCompare(r.name))),Ni=n.createSelector(e=>e.remoteMachines.localFingerprint),Wi=n.createSelector(e=>e.remoteMachines.pending),Bi=n.createSelector(e=>e.remoteMachines.failures),Vi=n.createSelector(e=>e.remoteMachines.executorBackends??[]),hr=n.createSelector((e,t)=>{if(t===qe)return a.layout_daemonStatus_localConnection_label();const r=v(e.connections.connections,t);return r?ut(r):t}),mr=n.createSelector(e=>hr.select(e,e.connections.windowBackendId)),Ui=n.createSelector((e,t)=>(t?e.remoteMachines.machines[t]??e.cloudMachines?.machines[t]:void 0)??null),Gi=n.createSelector((e,t)=>{const r=e.providerSettings?.profiles;return pt({catalogProfiles:rt.select(e,t),defaultRemoteIncompatibility:tt.select(e,t),defaultRemoteLaunch:et.select(e,t),profileDefaults:Object.values(r?.defaults??{}),profilesLoadStatus:r?.loadStatus??"idle"})}),Hi=n.createSelector(e=>Object.fromEntries(Object.values(e.providerSettings?.profiles?.defaults??{}).map(t=>[t.baseProviderId,t.env.length>0]))),ve=n.createSelector(e=>dr({remoteMachinesVisible:te.select(e),supported:e.remoteMachines?.initialAgentPlacement===!0,machines:re.select(e),cloud:X(e)}));function br(e){const t=v(e.connections.connections,e.connections.windowBackendId);return t?.hostOs?{os:t.hostOs,arch:t.hostArch}:void 0}const Sr=n.createSelector(e=>{const t=Q.select(e),r=lr({backendLabel:mr.select(e),backendPlatform:br(e),machines:re.select(e),cloud:X(e),orchestrator:t});if(!_e.select(e))return r;if(!t)return oe(r,ce.select(e));const[s,...i]=r;return[s,...oe(i,ce.select(e))]}),qi=n.createSelector(e=>ve.select(e)?Sr.select(e):[]),$i=n.createSelector(e=>e.remoteMachines?.initialAgentPlacement===!0),ji=n.createSelector((e,t,r)=>ve.select(e)?ur(t,re.select(e),Ae(e,r)):m);function Ae(e,t){const r=X(e);if(!r||!t)return r;const s=e.cloudMachines?.providers??{};return r.map(i=>{if(i.unavailableReason)return i;const o=ft(e,t,s[i.cloudMachineId]??null);return o?{...i,unavailableReason:o}:i})}const zi=n.createSelector((e,t)=>Ae(e,t)),G=K("Clipboard");async function Ki(e){let t;if(Pt())try{const r=await It("system:write-clipboard",{text:e});if(r?.success===!1)throw new Error(r.error||"Electron clipboard write failed");return}catch(r){t=r,G.warn("Electron clipboard write failed; falling back to browser clipboard",{error:r})}if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch(r){throw G.error("Browser clipboard write failed",r,{electronError:t}),r}throw G.error("No clipboard write API is available",void 0,{electronError:t}),t instanceof Error?t:new Error("Clipboard write API unavailable")}const _r=K("WorkspaceValidation");async function Qi(e,t=!1,r=!1){if(!e||e.trim().length===0)return{valid:!1,error:a.workspace_validation_repoPathRequired_error(),suggestion:a.workspace_validation_repoPathRequired_suggestion()};const s=e.trim();return vr(s)?kr(s):yr(s,t,r)}function vr(e){return[/^https?:\/\/github\.com\//i,/^git@github\.com:/i,/^github\.com\//i,/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/].some(r=>r.test(e.trim()))}function Ar(e){const t=e.trim(),r=[/^https?:\/\/github\.com\/([^\/]+)\/([^\/]+)$/i,/^git@github\.com:([^\/]+)\/([^\/]+)$/i,/^github\.com\/([^\/]+)\/([^\/]+)$/i];for(const i of r){const o=t.match(i);if(o){const c=o[2].replace(/\.git$/,"");return c?{owner:o[1],repo:c}:null}}const s=t.match(/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/);if(s&&!t.includes("\\")&&!t.includes(":")){const i=s[2].replace(/\.git$/,"");return i?{owner:s[1],repo:i}:null}return null}async function kr(e){return Ar(e)?{valid:!0,warning:a.workspace_validation_githubCloneLocally_warning()}:{valid:!1,error:a.workspace_validation_invalidGithubUrl_error(),suggestion:a.workspace_validation_invalidGithubUrl_suggestion()}}async function yr(e,t=!1,r=!1){if(e.includes("\0"))return{valid:!1,error:a.workspace_validation_nullCharacters_error()};if(!e.startsWith("/")&&!e.startsWith("~")&&!e.startsWith(".")&&!e.includes(":\\")&&!/^[a-zA-Z]:\//.test(e))return{valid:!1,error:a.workspace_validation_pathNotAbsolute_error(),suggestion:a.workspace_validation_pathNotAbsolute_suggestion()};if(typeof window<"u"&&window.electronAPI)try{const s=await V("file:getDirectoryStatus",{path:e});if(s.success&&s.data){const c=s.data;return c.exists?c.isDirectory?c.isGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:c}:c.isSubdirectoryOfGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:c,warning:a.workspace_validation_insideParentRepo_warning({path:c.parentGitRoot??""})}:r?{valid:!0,isNewRepo:!1,directoryStatus:c}:t?c.isEmpty?{valid:!0,isNewRepo:!0,directoryStatus:c,warning:a.workspace_validation_emptyDirInit_warning()}:{valid:!0,isNewRepo:!0,directoryStatus:c,warning:a.workspace_validation_nonGitDirInit_warning()}:{valid:!1,error:a.workspace_repoSelector_notGitRepository_label(),directoryStatus:c}:{valid:!1,error:a.workspace_validation_notDirectory_error(),suggestion:a.workspace_validation_notDirectory_suggestion(),directoryStatus:c}:t?{valid:!0,isNewRepo:!0,directoryStatus:c,warning:a.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:a.workspace_validation_dirNotExist_error(),suggestion:a.workspace_validation_dirNotExist_suggestion(),directoryStatus:c}}if(!(await V("file:exists",{path:e})).exists)return t?{valid:!0,isNewRepo:!0,warning:a.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:a.workspace_validation_dirNotExist_error(),suggestion:a.workspace_validation_dirNotExistLegacy_suggestion()};const o=await V("git:isRepository",{path:e});if(!t&&o?.isRepository!==!0)return{valid:!1,error:o?.isRepository===!1?a.workspace_repoSelector_notGitRepository_label():a.workspace_compactInitializer_gitCheckUnknown_label()};if(!o.isRepository)return{valid:!0,isNewRepo:!0,warning:a.workspace_validation_nonGitInit_warning()}}catch(s){if(_r.warn("Could not validate path existence",s),!t)return{valid:!1,error:a.workspace_compactInitializer_gitCheckUnknown_label()}}return{valid:!0,isNewRepo:!1}}function Xi(e){if(!e||e.trim().length===0)return{valid:!0};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:a.workspace_validation_branchPrefixInvalidChars_error(),suggestion:a.workspace_validation_branchChars_suggestion()}:t==="."||t===".."||t.startsWith(".")?{valid:!1,error:a.workspace_validation_branchPrefixDot_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:a.workspace_validation_branchPrefixConsecutive_error()}:t.startsWith("/")?{valid:!1,error:a.workspace_validation_branchPrefixSlash_error()}:t.endsWith(".lock")?{valid:!1,error:a.workspace_validation_branchPrefixLock_error()}:t.length>50?{valid:!1,error:a.workspace_validation_branchPrefixTooLong_error()}:{valid:!0}}function Zi(e){if(!e||e.trim().length===0)return"";let t=e.trim().replace(/^[./]+/,"").replace(/[\s~^:?*\[\]\\]/g,"-").replace(/\.{2,}/g,"-").replace(/\/{2,}/g,"/").replace(/-{2,}/g,"-").replace(/^-+/,"").replace(/\.lock$/,"").toLowerCase();return t.length>0&&!t.endsWith("/")&&!t.endsWith("-")&&(t=t.includes("/")?`${t}/`:`${t}/`),t}function Yi(e){if(!e||e.trim().length===0)return{valid:!1,error:a.workspace_validation_branchNameRequired_error()};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:a.workspace_validation_branchNameInvalidChars_error(),suggestion:a.workspace_validation_branchChars_suggestion()}:["HEAD",".",".."].includes(t)?{valid:!1,error:a.workspace_validation_branchNameReserved_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:a.workspace_validation_branchNameConsecutive_error()}:t.startsWith("/")||t.endsWith("/")?{valid:!1,error:a.workspace_validation_branchNameSlash_error()}:t.endsWith(".lock")?{valid:!1,error:a.workspace_validation_branchNameLock_error()}:{valid:!0}}function Ji(e){return!e||e.trim().length===0?{valid:!0}:e.trim().length>1e5?{valid:!1,error:a.workspace_validation_promptTooLong_error(),suggestion:a.workspace_validation_promptTooLong_suggestion()}:{valid:!0}}function en(e){const t=e.toLowerCase();return t.includes("maxbuffer")?a.workspace_gitError_maxBuffer():t.includes("clone")&&t.includes("timed out")?a.workspace_gitError_cloneTimeout():t.includes("json-rpc request timed out: workspace.create")?a.workspace_gitError_createTimeout():t.includes("timed out")&&["git","clone","fetch","worktree","pull","push","rebase","merge"].some(r=>t.includes(r))?a.workspace_gitError_gitTimeout():t.includes("git clone failed")?t.includes("could not read from remote")?a.workspace_gitError_cloneRemote():t.includes("authentication")||t.includes("permission denied")||t.includes("access denied")?a.workspace_gitError_cloneAuth():a.workspace_gitError_cloneFailed():t.includes("could not resolve any ref to create worktree")?a.workspace_gitError_worktreeRef():t.includes("failed to write file")?t.includes("eacces")||t.includes("permission denied")?a.workspace_gitError_writePermission():t.includes("enospc")||t.includes("disk space")?a.workspace_gitError_diskSpaceFree():t.includes("enoent")||t.includes("no such file")?a.workspace_gitError_writeNoEnt():e:t.includes("failed to read file")?t.includes("enoent")||t.includes("no such file")?a.workspace_gitError_readNotFound():t.includes("eacces")||t.includes("permission denied")?a.workspace_gitError_readPermission():e:t.includes("permission denied")?a.workspace_gitError_permissionDenied():t.includes("not found")||t.includes("enoent")?a.workspace_gitError_notFound():t.includes("already exists")?a.workspace_gitError_alreadyExists():t.includes("network")||t.includes("etimedout")?a.workspace_gitError_network():t.includes("authentication")||t.includes("401")?t.includes("private repositor")?e:a.workspace_gitError_authFailed():t.includes("rate limit")||t.includes("403")?a.workspace_gitError_rateLimit():t.includes("disk space")||t.includes("enospc")?a.workspace_gitError_diskSpace():e}const Er=["idle","exited"];function Mr(e){return e===void 0||!Er.includes(e)}function tn(e){return e.status==="restarting"?"restarting":Mr(e.status)?"running":e.status==="idle"?"idle":e.exitCode===0?"succeeded":e.exitCode===null||e.exitCode===void 0?"exited":e.exitCode>=128?"stopped":"failed"}function wr(e){return e.engine==="os"?"os":e.isLoading||e.keyConfigured[e.provider]===!0?"daemon":e.osEngineAvailable?"os":"unavailable"}const rn=n.createSelector(e=>e.voiceSettings.isLoading),sn=n.createSelector(e=>e.voiceSettings.available),nn=n.createSelector(e=>e.voiceSettings.provider),an=n.createSelector(e=>e.voiceSettings.engine),on=n.createSelector(e=>e.voiceSettings.osEngineAvailable),cn=n.createSelector(e=>e.voiceSettings.keyConfigured),ln=n.createSelector(e=>e.voiceSettings.vocabulary),dn=n.createSelector(e=>e.voiceSettings.openaiModel),un=n.createSelector(e=>e.voiceSettings.language),pn=n.createSelector(e=>e.voiceSettings.workspaceVocabularyMaxTerms),fn=n.createSelector(e=>e.voiceSettings.inputDeviceId),gn=n.createSelector(e=>e.voiceSettings.inputDevices),hn=n.createSelector(e=>e.voiceSettings.busyProvider),mn=n.createSelector(e=>e.voiceSettings.error),bn=n.createSelector(e=>st.select(e)?"unavailable":wr(e.voiceSettings)),j="intent.voice.inputDevice";let z;function Rr(){if(z!==void 0)return z;try{const e=localStorage.getItem(j);return typeof e=="string"&&e!==""?e:null}catch{return null}}function Sn(e){z=e;try{e===null?localStorage.removeItem(j):localStorage.setItem(j,e)}catch{}}let L=null;function _n(e){L=e}function vn(){const e=L;return L=null,e}function Cr(){L=null}const Pr=300,Ir=300;class Tr{constructor(t){d(this,"holdThresholdMs");d(this,"doublePressWindowMs");d(this,"onRecordStart");d(this,"onRecordStop");d(this,"currentState","idle");d(this,"timer",null);this.holdThresholdMs=t.holdThresholdMs??Pr,this.doublePressWindowMs=t.doublePressWindowMs??Ir,this.onRecordStart=t.onRecordStart,this.onRecordStop=t.onRecordStop}get state(){return this.currentState}keyDown(){switch(this.currentState){case"idle":this.currentState="first-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding"}),this.onRecordStart();break;case"await-second-press":this.clearTimer(),this.currentState="second-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding-send"});break;case"latched":this.currentState="latched-press";break;case"latched-await-second":this.clearTimer(),this.currentState="draining",this.onRecordStop({stopReason:"double-press",autoSend:!0});break}}keyUp(){switch(this.currentState){case"first-press":this.clearTimer(),this.currentState="await-second-press",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="latched"});break;case"holding":this.currentState="idle",this.onRecordStop({stopReason:"hold-release",autoSend:!1});break;case"second-press":this.clearTimer(),this.currentState="idle",this.onRecordStop({stopReason:"double-press",autoSend:!0});break;case"holding-send":this.currentState="idle",this.onRecordStop({stopReason:"double-hold-release",autoSend:!0});break;case"latched-press":this.currentState="latched-await-second",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="idle",this.onRecordStop({stopReason:"latch-stop",autoSend:!1})});break;case"draining":this.currentState="idle";break}}reset(){this.clearTimer(),this.currentState="idle"}armTimer(t,r){this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,r()},t)}clearTimer(){this.timer!==null&&clearTimeout(this.timer),this.timer=null}}let D=null;function An(e){D=e}function kn(){const e=D;return D=null,e}function Or(){D=null}const Fr=12e4,Lr=["audio/webm;codecs=opus","audio/webm"];function yn(){return typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"&&typeof MediaRecorder<"u"}function Dr(e){return e?{audio:{deviceId:{ideal:e}}}:{audio:!0}}function xr(){if(!(typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"))return Lr.find(e=>MediaRecorder.isTypeSupported(e))}class Nr{constructor(t){d(this,"maxDurationMs");d(this,"now");d(this,"callbacks");d(this,"deviceId");d(this,"currentState","idle");d(this,"recorder",null);d(this,"stream",null);d(this,"chunks",[]);d(this,"startedAt",0);d(this,"maxTimer",null);d(this,"discardRequested",!1);d(this,"cancelRequested",!1);this.maxDurationMs=t.maxDurationMs??Fr,this.now=t.now??Date.now,this.callbacks={onFinished:t.onFinished,onError:t.onError},this.deviceId=t.deviceId??null}get state(){return this.currentState}async start(){if(this.currentState!=="idle")return"discarded";this.currentState="starting";let t;try{t=await navigator.mediaDevices.getUserMedia(Dr(this.deviceId))}catch(i){const o=this.discardRequested;return this.currentState="stopped",o||this.callbacks.onError(i),o?"discarded":"error"}if(this.discardRequested){for(const i of t.getTracks())i.stop();return this.currentState="stopped","discarded"}this.stream=t;const r=xr(),s=r?new MediaRecorder(t,{mimeType:r}):new MediaRecorder(t);return this.recorder=s,s.ondataavailable=i=>{i.data&&i.data.size>0&&this.chunks.push(i.data)},s.onstop=()=>this.handleRecorderStop(),s.onerror=i=>this.handleRecorderError(i),s.start(),this.startedAt=this.now(),this.currentState="recording",this.maxTimer=setTimeout(()=>this.stop(),this.maxDurationMs),"recording"}stop(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&this.recorder?.stop()}cancel(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&(this.cancelRequested=!0,this.recorder?.stop())}handleRecorderStop(){const t=this.now()-this.startedAt,r=this.recorder?.mimeType||"audio/webm",s=this.chunks,i=this.cancelRequested;this.teardown(),!i&&this.callbacks.onFinished({blob:new Blob(s,{type:r}),durationMs:t,mimeType:r})}handleRecorderError(t){const r=t?.error??t;this.teardown(),this.callbacks.onError(r)}teardown(){this.maxTimer!==null&&clearTimeout(this.maxTimer),this.maxTimer=null,this.recorder&&(this.recorder.ondataavailable=null,this.recorder.onstop=null,this.recorder.onerror=null),this.recorder=null;for(const t of this.stream?.getTracks()??[])t.stop();this.stream=null,this.chunks=[],this.currentState="stopped"}}const Wr=300;function Br(e){const t=e?.name;return t==="NotAllowedError"||t==="SecurityError"}const Vr={stopReason:"manual",autoSend:!1};let h=null,_=null,y=0,P=null;const W=new Tr({onRecordStart:()=>{P&&Ur(P)},onRecordStop:e=>{ke(P,e)}});function En(){return h!==null}function Mn(){return h}function wn(e){P=e,y+=1,y===1&&W.keyDown()}function Rn(e){P=e,y!==0&&(y-=1,y===0&&W.keyUp())}function Ur(e){if(h!==null)return;Or(),Cr();const t=new Nr({deviceId:Rr(),onFinished:r=>{h===t&&(h=null);const s=_??{stopReason:"auto-stop",autoSend:!1},i=_!==null;if(_=null,e.dispatch(O()),i||W.reset(),r.durationMs<Wr){s.autoSend&&e.dispatch(q());return}e.dispatch($e({...r,stopReason:s.stopReason,autoSend:s.autoSend}))},onError:r=>{h===t&&(h=null),_=null,e.dispatch(O()),e.showHint(Br(r)?a.hardwareConsole_ptt_micDenied_message():a.hardwareConsole_ptt_recordingFailed_message())}});h=t,e.dispatch(je()),t.start().then(r=>{if(r!=="recording"&&(h===t&&(h=null),r==="discarded")){const s=_?.autoSend===!0;_=null,e.dispatch(O()),s&&e.dispatch(q())}})}function ke(e,t){const r=h;if(r===null){t.autoSend&&e?.dispatch(q());return}_=t,r.stop()}function Cn(){ke(null,Vr)}function Pn(e){W.reset(),y=0,_=null;const t=h;t!==null&&(h=null,t.cancel(),e.dispatch(O()))}const Gr=K("HardwareConsoleVoiceSetupToast"),Hr="hardware-console-voice-setup";let H=null;function qr(){return H||(H=xe(()=>Promise.resolve().then(()=>Ot),void 0,import.meta.url).then(e=>e.notify)),H}function $r(){Tt("/settings?tab=connections#voice").catch(e=>{Gr.error("Failed to open voice settings from setup toast",e)})}function jr(){return{label:a.hardwareConsole_voice_openSettings_label(),onClick:()=>$r()}}function In(){qr().then(e=>{e.error(a.hardwareConsole_voice_noKey_error(),{id:Hr,action:jr()})})}const Tn=n.createSelector(e=>e.externalEditors.selectedAction),zr=n.createSelector(e=>e.externalEditors.editors),Kr=n.createSelector(e=>{const t=w(zr.select(e)),r=e.externalEditors.editorOrder??[];if(!r.length)return t;const s=new Map(t.map(c=>[c.id,c])),i=r.flatMap(c=>{const l=s.get(c);return l?[l]:[]}),o=new Set(r);return[...i,...t.filter(({id:c})=>!o.has(c))]}),On=n.createSelector(e=>e.externalEditors.editorOrder??[]),Fn=n.createSelector(e=>e.externalEditors.loading),Ln=n.createSelector(e=>e.externalEditors.lastFetched),Qr=n.createSelector(e=>e.externalEditors.hiddenEditorIds),Dn=n.createSelector((e,t)=>{if(!(t?it.select(e,t):nt.select(e)))return[];const s=Qr.select(e);return Kr.select(e).filter(i=>i.installed&&!s.includes(i.id))});function xn(e,t){if(!e||!t||t===e.providerId)return!1;const r=e.providerSettings[t];return!!(r&&[r.defaultModel,...Object.values(r.typeOverrides??{})].some(s=>typeof s=="string"&&s.includes(":")))}let Xr=0;function Zr(e,t){const r=++Xr;return n.dispatch(Ke(e,t,r)),r}function Nn(e,t,r){n.dispatch(ze(e,t,r))}async function ye(e,t,r,s){const i=crypto.randomUUID(),o=s?.source??"control";try{return(await n.dispatch(Qe({requestId:i,consumerId:o,agentId:e,workspaceId:t,operation:r,connection:de.select(n.state)},{...s,intent:s?.intent??Zr(e,t)}))).status==="success"}finally{n.dispatch(Xe(i,o))}}async function Wn(e,t,r,s,i){return ye(e,t,{kind:"effort",effort:r,previous:s},i)}async function Bn(e,t,r,s,i){return ye(e,t,{kind:"reconcile",current:r??null,levels:s},i)}const Yr=n.createSelector((e,t)=>w(e.agentModel.mutations).filter(r=>r.consumerId===t)),Vn=n.createSelector((e,t)=>Yr.select(e,t).some(r=>r.status==="pending")),Un=n.createSelector((e,t,r)=>{const s=e.agentSessions.byAgentId[t],i=at.select(e,t),o=gt.select(e,t),c=e.daemonHealth.stats?.protocolVersion,l=ht(c),p=l?mt(s?.model,null,o):s?.model;return{session:s,providerId:i,levels:o,legacy:l,identity:JSON.stringify([p,i]),connection:de.select(e),canWrite:!!s&&s.workspaceId===r&&!ot.select(e,r)}});function Jr(e,t,r=!1){return e!=="auggie"||t===!0||r}const Gn=n.createSelector(e=>bt.select(e)?null:Z.select(e)),es=n.createSelector(e=>e.providerCatalog?.workspaceEpoch??0),b=n.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]:void 0),Hn=n.createSelector(e=>Object.keys(e.providerCatalog?.byWorkspaceId??{})),qn=n.createSelector((e,t)=>!!b.select(e,t)&&e.providerCatalog.workspaceSnapshotEpochs?.[t]===es.select(e)),Ee=n.createSelector((e,t)=>t?b.select(e,t)?.catalog.providers??[]:ct.select(e)),Me=n.createSelector((e,t)=>{if(!t)return ue.select(e);const r=b.select(e,t)?.settings.find(s=>s.path==="model.defaultProvider")?.value;return typeof r=="string"?r:""}),se=n.createSelector((e,t)=>{if(!t)return St.select(e);const r=b.select(e,t)?.settings.find(s=>s.path==="providers.enabled")?.value;return r&&typeof r=="object"?r:{}}),we=n.createSelector((e,t)=>{if(!t)return _t.select(e);const r=se.select(e,t),s=Me.select(e,t),i=b.select(e,t)?.readiness??{};return Ee.select(e,t).filter(o=>o.visible&&(!o.canBeDisabled||r[o.id]||o.id===s)&&i[o.id]?.available).map(o=>o.id)}),$n=n.createSelector((e,t)=>{const r=se.select(e,t),s=t?b.select(e,t)?.readiness??{}:Z.select(e);return Ee.select(e,t).filter(i=>Jr(i.id,s[i.id]?.available,r[i.id]===!0)).map(i=>i.id)}),jn=n.createSelector((e,t)=>t?we.select(e,t):vt.select(e)),zn=n.createSelector((e,t)=>A.select(e,t)),Kn=n.createSelector((e,t)=>t?!!b.select(e,t):At.select(e)),Qn=n.createSelector((e,t)=>{if(!t)return kt.select(e);const r=b.select(e,t)?.settings??[],s=Me.select(e,t),i=r.find(l=>l.path==="model.providerDefaults")?.value,o=i&&typeof i=="object"?i[s]:void 0;if(typeof o=="string")return o;const c=r.find(l=>l.path==="model.default")?.value;return typeof c=="string"?c:""}),Xn=n.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning?[[r,s.warning]]:[])):yt.select(e)),Zn=n.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).map(([r,s])=>[r,s.stale===!0])):Et.select(e)),Yn=n.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning&&s.warningKind?[[r,s.warningKind]]:[])):Mt.select(e)),Jn=n.createSelector((e,t,r)=>{if(!r)return wt.select(e,t);const s=se.select(e,r),i=b.select(e,r);return we.select(e,r).filter(o=>o!==t&&(s[o]||i?.catalog.providers.find(c=>c.id===o)?.canBeDisabled===!1)&&Rt(o,i?.readiness[o]?.authenticated))}),ea=n.createSelector((e,t)=>t?b.select(e,t)?.readiness??{}:Z.select(e)),ts={},ta=n.createSelector(e=>e.providerSettings?.profiles?.status??ts),ra=n.createSelector(e=>e.directoryPicker.listing),sa=n.createSelector(e=>e.directoryPicker.loading),ia=n.createSelector(e=>e.directoryPicker.error),na=n.createSelector(e=>e.directoryPicker.pathError),aa=n.createSelector(e=>e.directoryPicker.createError),le={},rs=n.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]?.mcpServers??[]:e.mcpSettings.servers),oa=n.createSelector((e,t,r)=>{const s=e.providerCatalog?.byWorkspaceId?.[t];return s?s.mcpServers?.find(i=>i.id===r)?.name:e.providerCatalog?.mcpServerNamesByWorkspaceId?.[t]?.[r]}),ca=n.createSelector(e=>e.mcpSettings.loading),la=n.createSelector(e=>e.mcpSettings.error),da=n.createSelector(e=>e.mcpSettings.mutationError??null),ua=n.createSelector(e=>e.mcpSettings.enabled),ss=n.createSelector(e=>e.mcpSettings.disabledServers),is=n.createSelector(e=>e.mcpSettings.statusMap),ns=n.createSelector(e=>e.mcpSettings.toolsMap),as=n.createSelector((e,t)=>{if(!t)return e.mcpSettings.errorMessages;const r=e.providerCatalog?.byWorkspaceId?.[t],s=new Map(r?.mcpServers?.map(i=>[i.id,R(i)])??[]);return Object.fromEntries((r?.mcpStatuses??[]).flatMap(i=>{const o=s.get(i.serverId);return o&&i.lastError?[[o,i.lastError]]:[]}))}),os=n.createSelector((e,t)=>t?e.mcpSettings.byWorkspaceId[t]?.disabledServers??le:le),pa=n.createSelector((e,t)=>Object.keys(os.select(e,t))),fa=n.createSelector(e=>{const t=rs.select(e),r=is.select(e),s=ns.select(e),i=ss.select(e),o=as.select(e);return t.map(c=>{const l=R(c)in i,p=s[R(c)]||[];let S=r[R(c)]||"disconnected";return l&&(S="disabled"),{...c,disabled:l,status:S,tools:p,toolCount:p.length,errorMessage:o[R(c)]}})});n.createSelector((e,t)=>e.mcpSettings.errorMessages[t]);const ga=n.createSelector(e=>e.mcpSettings.lastImportedCount),ha=n.createSelector(e=>e.mcpSettings.advancedSaveStatus),ma=n.createSelector(e=>e.mcpSettings.advancedSaveError);function g(e){return{category:"settings",...e}}const x=[{id:"new-workspace",tab:"",label:"New workspace",route:"/workspace/new",category:"navigation",description:"Create-workspace flow."},g({id:"utility-default-model",tab:"providers",hashAliases:["utility-default-model","default-model","quickActions.defaultModel","backgroundAgents.defaultModel"],scrollSelector:"#utility-default-model",highlightSelector:'[data-highlight-id="utility-default-model"]',label:"Settings: Default model",route:"/settings?tab=providers#utility-default-model",description:"Default AI behavior model selection."}),g({id:"global-instructions",tab:"agent-behavior",hashAliases:["global-instructions","agents","specialists","all-agents"],scrollSelector:"#global-instructions",highlightSelector:'[data-highlight-id="global-instructions"]',label:"Settings: Agent Behavior",route:"/settings?tab=agent-behavior#global-instructions",description:"Global agent instructions and defaults."}),g({id:"create-specialist",tab:"specialists",hashAliases:["create-specialist"],scrollSelector:"#create-specialist",highlightSelector:'[data-highlight-id="create-specialist"]',label:"Settings: Create specialist",route:"/settings?tab=specialists&view=create-specialist#create-specialist",description:"Create-specialist entry point."}),g({id:"providers",tab:"providers",hashAliases:["providers"],scrollSelector:"#providers",highlightSelector:'[data-highlight-id="providers"]',label:"Settings: AI coding CLIs",route:"/settings?tab=providers#providers",description:"Provider/account selector settings."}),g({id:"integrations",tab:"connections",hashAliases:["integrations"],scrollSelector:"#integrations",highlightSelector:'[data-highlight-id="integrations"]',label:"Settings: Connections",route:"/settings?tab=connections#integrations",description:"Connected integrations settings."}),g({id:"devices",tab:"devices",hashAliases:["devices","machines"],scrollSelector:"#devices",highlightSelector:"#devices",label:"Settings: Machines",route:"/settings?tab=devices#devices",description:"Saved remote machine settings."}),g({id:"mobile",tab:"mobile",hashAliases:["mobile"],scrollSelector:"#mobile",highlightSelector:'[data-highlight-id="mobile"]',label:"Settings: Mobile",route:"/settings?tab=mobile#mobile",description:"Remote access and Intent Mobile pairing."}),g({id:"guest-sessions",tab:"collaboration",hashAliases:["collaboration","guest-sessions","sharing"],scrollSelector:"#collaboration",highlightSelector:"#collaboration",label:"Settings: Collaboration",route:"/settings?tab=collaboration#collaboration",description:"Host membership, workspace guests and joined hosts."}),g({id:"websocket-api",tab:"mobile",hashAliases:["websocket-api","remote-access"],scrollSelector:"#websocket-api",highlightSelector:'[data-highlight-id="websocket-api"]',label:"Settings: Remote Access",route:"/settings?tab=mobile#websocket-api",description:"Remote access (WebSocket API) settings."}),...[["voice","Voice Dictation","Voice dictation settings.","input"],["keyboard-shortcuts","Keyboard Shortcuts","Keyboard shortcuts reference.","input"],["mcp-servers","MCP Servers","MCP server configuration.","connections"],["plugins","Plugins","App-wide Agent Plugins.","connections"],["git-workspace","Git & Workspace","Git and workspace defaults.","setup"],["git","Git","Git defaults.","setup"],["shell","Shell","Shell and CLI optimization settings.","setup"],["workspace","Workspace","Workspace defaults.","setup"],["cli-optimization","CLI Optimization","RTK/CLI optimization settings.","setup"],["workspace-api","Tool Output & Retention","Tool output size and retention settings.","advanced"],["notifications","Notifications","Notification preferences.","app-behavior"],["updates","Updates","Application update preferences.","app-behavior"],["open-in","Open In","External editor/app launch preferences.","app-behavior"],["github-link-action","GitHub Links","GitHub issue and pull request link behavior.","app-behavior"],["agent-features","Agent Features","Agent feature settings.","agent-behavior"],["font-style","Font style","Font style settings.","display"],["language","Language","Application language settings.","display"],["labs","Labs","Experimental feature switches.","advanced"],["agent-backend","Agent Backend","Agent backend settings.","advanced"],["connection","Connection","Daemon connection details.","advanced"],["hardware","Hardware","Hardware integration settings.","advanced"],["developer","Developer","Development-only settings.","advanced"]].map(([e,t,r,s])=>g({id:e,tab:s,hashAliases:[e],scrollSelector:`#${e}`,highlightSelector:`[data-highlight-id="${e}"]`,label:`Settings: ${t}`,route:`/settings?tab=${s}#${e}`,description:r})),g({id:"appearance",tab:"display",hashAliases:["appearance","theme"],scrollSelector:"#theme",highlightSelector:'[data-highlight-id="appearance"]',label:"Settings: Appearance",route:"/settings?tab=display#theme",description:"Theme mode controls."}),...[["color-theme","Color theme","Color theme selection."],["note-font","Notes font","Notes/spec font style."],["agent-chat-font","Agent chat font","Agent chat font style."],["code-font","Code font","Code editor and diff font."]].map(([e,t,r])=>g({id:e,tab:"display",hashAliases:[e],scrollSelector:`#${e}`,highlightSelector:`[data-highlight-id="${e}"]`,label:`Settings: ${t}`,route:`/settings?tab=display#${e}`,description:r})),g({id:"general",tab:"advanced",hashAliases:["general","reset"],scrollSelector:"#reset",highlightSelector:'[data-highlight-id="general"]',label:"Settings: Advanced",route:"/settings?tab=advanced#reset",description:"Advanced settings and reset controls."}),{id:"workspace-card",tab:"",hashAliases:["workspace-card"],highlightSelector:'[data-highlight-id^="workspace-"]',label:"Workspace card",category:"workspace",description:"A workspace card on workspace list surfaces.",dynamic:!0,idPattern:"workspace-{workspaceId}"},{id:"specialist-entry",tab:"specialists",highlightSelector:'[data-highlight-id^="specialist-"]',label:"Specialist entry",route:"/settings?tab=specialists&specialist={specialistId}#specialist-{specialistId}",category:"specialist",description:"A specific specialist row in settings.",dynamic:!0,idPattern:"specialist-{specialistId}"}];function Re(e){const t=e.indexOf("#"),r=t>=0?e.slice(t+1):e;return decodeURIComponent(r.replace(/^#/,"")).trim()}function cs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ls(e,t){if(!t.match(/\{[^}]+\}/g)?.length)return e===t;const s=t.split(/\{[^}]+\}/g).map(cs).join("[^/]+");return new RegExp(`^${s}$`).test(e)}function ds(e){const t=Re(e);if(!t)return;const r=x.find(i=>i.id===t||i.hashAliases?.includes(t));if(r)return r;const s=x.find(i=>i.route&&i.dynamic&&i.idPattern&&ls(t,i.idPattern));return s?{...s,id:t}:void 0}function ba(){return x.map(e=>({...e,hashAliases:e.hashAliases?[...e.hashAliases]:void 0}))}function us(e){try{return new URL(e,"app://intent").pathname||"/"}catch{const t=e.indexOf("?"),r=e.indexOf("#");let s=e.length;return t>=0&&(s=Math.min(s,t)),r>=0&&(s=Math.min(s,r)),e.slice(0,s)||"/"}}const ps=new Set(x.flatMap(e=>e.route?[us(e.route)]:[])),fs=[/^\/workspace\/[^/]+$/,/^\/agent\/[^/]+$/];function Sa(e){if(typeof e!="string")return!1;const t=e.trim();if(!t)return!1;if(t.startsWith("intent://"))return!0;let r,s;try{const i=new URL(t,"app://intent");if(i.protocol!=="app:")return!1;r=i.pathname||"/",s=Re(i.hash)}catch{return!1}return ps.has(r)?s?!!ds(s):!0:fs.some(i=>i.test(r))}const _a=["agentFeatures.backgroundHooks","agentFeatures.hostExec","agentFeatures.scripts","agentFeatures.terminalAccess","agentFeatures.browserAutomation","agentFeatures.desktopControl","agentFeatures.richChatBlocks","agentFeatures.structuredQuestions","agentFeatures.secretRequests","agentFeatures.attentionRequests","agentFeatures.stateSnapshot","agentFeatures.prMonitor","agentFeatures.taskGraph","agentFeatures.peerAgents","agentFeatures.mcpTools"],gs=[{path:"agentFeatures.backgroundHooks",label:()=>a.settings_agentFeatures_backgroundHooks_label(),description:()=>a.settings_agentFeatures_backgroundHooks_description(),defaultValue:!0},{path:"agentFeatures.hostExec",label:()=>a.settings_agentFeatures_hostExec_label(),description:()=>a.settings_agentFeatures_hostExec_description(),defaultValue:!0},{path:"agentFeatures.scripts",label:()=>a.settings_agentFeatures_scripts_label(),description:()=>a.settings_agentFeatures_scripts_description(),defaultValue:!0},{path:"agentFeatures.terminalAccess",label:()=>a.settings_agentFeatures_terminalAccess_label(),description:()=>a.settings_agentFeatures_terminalAccess_description(),defaultValue:!0},{path:"agentFeatures.browserAutomation",label:()=>a.settings_agentFeatures_browserAutomation_label(),description:()=>a.settings_agentFeatures_browserAutomation_description(),defaultValue:!0},{path:"agentFeatures.desktopControl",label:()=>a.settings_agentFeatures_desktopControl_label(),description:()=>a.settings_agentFeatures_desktopControl_description(),defaultValue:!0},{path:"agentFeatures.richChatBlocks",label:()=>a.settings_agentFeatures_richChatBlocks_label(),description:()=>a.settings_agentFeatures_richChatBlocks_description(),defaultValue:!0},{path:"agentFeatures.structuredQuestions",label:()=>a.settings_agentFeatures_structuredQuestions_label(),description:()=>a.settings_agentFeatures_structuredQuestions_description(),defaultValue:!0},{path:"agentFeatures.secretRequests",label:()=>a.settings_agentFeatures_secretRequests_label(),description:()=>a.settings_agentFeatures_secretRequests_description(),defaultValue:!1},{path:"agentFeatures.attentionRequests",label:()=>a.settings_agentFeatures_attentionRequests_label(),description:()=>a.settings_agentFeatures_attentionRequests_description(),defaultValue:!0},{path:"agentFeatures.stateSnapshot",label:()=>a.settings_agentFeatures_stateSnapshot_label(),description:()=>a.settings_agentFeatures_stateSnapshot_description(),defaultValue:!0},{path:"agentFeatures.prMonitor",label:()=>a.settings_agentFeatures_prMonitor_label(),description:()=>a.settings_agentFeatures_prMonitor_description(),defaultValue:!0},{path:"agentFeatures.taskGraph",label:()=>a.settings_agentFeatures_taskGraph_label(),description:()=>a.settings_agentFeatures_taskGraph_description(),defaultValue:!0},{path:"agentFeatures.peerAgents",label:()=>a.settings_agentFeatures_peerAgents_label(),description:()=>a.settings_agentFeatures_peerAgents_description(),defaultValue:!0},{path:"agentFeatures.mcpTools",label:()=>a.settings_agentFeatures_mcpTools_label(),description:()=>a.settings_agentFeatures_mcpTools_description(),defaultValue:!0}],va=Object.fromEntries(gs.map(e=>[e.path,e.defaultValue]));export{sr as $,zs as A,wn as B,Rn as C,$s as D,Ot as E,gs as F,pe as G,Oi as H,Mr as I,Jr as J,En as K,xn as L,ne as M,Sa as N,yn as O,Rr as P,ki as Q,Fi as R,E as S,I as T,k as U,Zr as V,pr as W,_i as X,Ar as Y,Ai as Z,Si as _,va as a,Ds as a$,Bn as a0,Nn as a1,wi as a2,wr as a3,ds as a4,ur as a5,Zi as a6,Sn as a7,Vn as a8,Yr as a9,na as aA,On as aB,ci as aC,gi as aD,ni as aE,ji as aF,bn as aG,Vi as aH,ai as aI,oi as aJ,Qs as aK,Ys as aL,Y as aM,Lt as aN,Vt as aO,Ut as aP,fe as aQ,Bt as aR,Dt as aS,Ft as aT,Nt as aU,Wt as aV,Ns as aW,Vs as aX,Us as aY,Hs as aZ,Fs as a_,Un as aa,Ks as ab,Js as ac,hr as ad,jn as ae,Me as af,se as ag,$n as ah,we as ai,Ee as aj,Zn as ak,Yn as al,Xn as am,Jn as an,ea as ao,Kn as ap,Qn as aq,zn as ar,mr as as,Zs as at,Hi as au,ti as av,aa as aw,ia as ax,ra as ay,sa as az,_a as b,cn as b$,Bs as b0,xs as b1,Ws as b2,Ls as b3,Gs as b4,Os as b5,qs as b6,ui as b7,Qr as b8,$i as b9,Ui as bA,Bi as bB,Wi as bC,re as bD,gr as bE,te as bF,Gi as bG,Di as bH,Gn as bI,jt as bJ,mi as bK,bi as bL,fi as bM,hi as bN,ii as bO,pi as bP,A as bQ,ei as bR,zi as bS,qi as bT,Sr as bU,ve as bV,Xs as bW,hn as bX,an as bY,fn as bZ,gn as b_,Kr as ba,Dn as bb,Fn as bc,li as bd,di as be,Ln as bf,Ni as bg,ce as bh,xi as bi,_e as bj,ma as bk,ha as bl,ss as bm,ua as bn,la as bo,as as bp,ga as bq,ca as br,da as bs,rs as bt,fa as bu,is as bv,ns as bw,Tn as bx,si as by,ta as bz,m as c,un as c0,dn as c1,on as c2,nn as c3,sn as c4,mn as c5,rn as c6,ln as c7,pn as c8,b as c9,es as ca,qn as cb,Hn as cc,pa as cd,oa as ce,_n as cf,An as cg,In as ch,Ii as ci,J as cj,N as ck,Ti as cl,Ur as cm,Li as cn,Cn as co,Yi as cp,Xi as cq,Ji as cr,Qi as cs,jr as ct,Ki as cu,Pi as d,Mi as e,Ri as f,Ci as g,yi as h,he as i,Ei as j,be as k,Wn as l,Pn as m,Cr as n,Or as o,vn as p,kn as q,ri as r,$t as s,qt as t,vi as u,Mn as v,ba as w,en as x,tn as y,js as z};
|
|
1
|
+
var Ce=Object.defineProperty;var Pe=(e,t,r)=>t in e?Ce(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var d=(e,t,r)=>Pe(e,typeof t!="symbol"?t+"":t,r);import{k as Ie,N as Te,T as Oe,d as Fe,l as Le,w as De}from"./8KpVpm2n.js";import"./DYhIMPy1.js";import{bm as a,_ as xe}from"./BkULGdgB.js";import"./BkQ2g3_N.js";import"./DdvXzOsp.js";import"./CjRRnXFa.js";import{c as K}from"./ChTqQfQN.js";import"./DEAMVhLT.js";import{IH as n,u2 as Ne,nA as w,nz as v,m3 as We,vr as Be,vp as ie,hb as Ve,hc as Ue,e as Ge,Ik as He,a6 as qe,ym as O,yn as q,yk as $e,yl as je,b$ as ze,b_ as Ke,cd as Qe,cc as Xe,nC as R}from"./DZwGQbE8.js";import{cG as Ze,cv as Ye,bv as Je,cj as Q,cL as et,cK as tt,cP as rt,c7 as st,cn as it,c9 as nt,cE as de,ax as at,bR as ot,cM as ct}from"./D4U_w4GT.js";import{aW as lt,a6 as ue,bX as dt,t as ut,$ as pt,c8 as X,l as ft,a7 as gt,c9 as ht,e as mt,aX as bt,bS as Z,aA as St,ba as _t,ab as vt,aS as At,bZ as kt,aa as yt,a8 as Et,a9 as Mt,bV as wt,I as Rt}from"./BqrO7ljl.js";import{x as Ct}from"./BN5JMxvy.js";import{y as T}from"./BGikh8Vc.js";import{a as Pt,i as It}from"./CJ5wd9GV.js";import{i as V}from"./DhnPdhLH.js";import{n as Tt}from"./_QB9q3ka.js";const Ot=Object.freeze(Object.defineProperty({__proto__:null,NOTIFY_DURATION:Te,TOAST_COUNTDOWN_CLASS:Oe,TOAST_COUNTDOWN_NO_HOVER_PAUSE_CLASS:Fe,notify:Ie,notifyMetadata:Le,withToastCountdown:De},Symbol.toStringTag,{value:"Module"})),Os=n.createSelector(e=>Ze.select(e)?.capabilities.gitlabCheckout===!0),Fs=n.createSelector(e=>e.gitlabAuth.host),Ls=n.createSelector(e=>e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host),Ds=n.createSelector(e=>Ne(e.gitlabAuth.instanceBaseUrl??e.gitlabAuth.host)??""),xs=n.createSelector(e=>e.gitlabAuth.isCancelling),Ns=n.createSelector(e=>e.gitlabAuth.cancelOutcome),Ws=n.createSelector(e=>e.gitlabAuth.isConfigured),Bs=n.createSelector(e=>e.gitlabAuth.isAuthenticating),Vs=n.createSelector(e=>e.gitlabAuth.deviceFlow),Us=n.createSelector(e=>e.gitlabAuth.deviceGrantSupported),Gs=n.createSelector(e=>e.gitlabAuth.user),Hs=n.createSelector(e=>e.gitlabAuth.error);n.createSelector(e=>e.gitlabAuth.method);const qs=n.createSelector(e=>e.gitlabAuth.statusReady===!0),E=[{id:"pr-reviewer",icon:"pr-reviewer",get name(){return a.specialists_builtin_prReviewer_name()},get description(){return a.specialists_builtin_prReviewer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"ui-designer",icon:"ui-designer",get name(){return a.specialists_builtin_uiDesigner_name()},get description(){return a.specialists_builtin_uiDesigner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"vulnerability-scanner",icon:"pr-reviewer",get name(){return a.specialists_builtin_vulnerabilityScanner_name()},get description(){return a.specialists_builtin_vulnerabilityScanner_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"developer",icon:"verifier",get name(){return a.specialists_builtin_developer_name()},get description(){return a.specialists_builtin_developer_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"product-manager",icon:"coordinator",get name(){return a.specialists_builtin_productManager_name()},get description(){return a.specialists_builtin_productManager_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"maintenance-coordinator",icon:"ralph",get name(){return a.specialists_builtin_maintenanceCoordinator_name()},get description(){return a.specialists_builtin_maintenanceCoordinator_description()},defaultBehaviorPrompt:"",promptUnavailable:!0},{id:"chief-of-staff",icon:"chief-of-staff",get name(){return a.specialists_builtin_chiefOfStaff_name()},get description(){return a.specialists_builtin_chiefOfStaff_description()},hidden:!0,defaultBehaviorPrompt:"",promptUnavailable:!0}],pe=new Set(["pr-reviewer"]),$s="developer";function js(e){return E.find(t=>t.id===e)}const Ft=n.createSelector(e=>e.githubAuth.mutationRequestId),Lt=n.createSelector(e=>e.githubAuth.callbacksCancelled),Dt=n.createSelector(e=>e.githubAuth.isDisconnecting),fe=n.createSelector(e=>e.githubAuth.isAuthenticated),xt=n.createSelector(e=>e.githubAuth.statusSettled===!0),Nt=n.createSelector(e=>e.githubAuth.requiresDaemonAuth),Wt=n.createSelector(e=>e.githubAuth.user),Bt=n.createSelector(e=>e.githubAuth.isAuthenticating),Vt=n.createSelector(e=>e.githubAuth.deviceFlow),Ut=n.createSelector(e=>e.githubAuth.error),zs=Object.freeze(Object.defineProperty({__proto__:null,selectGitHubAuthCallbacksCancelled:Lt,selectGitHubAuthDeviceFlow:Vt,selectGitHubAuthError:Ut,selectGitHubAuthIsAuthenticated:fe,selectGitHubAuthIsAuthenticating:Bt,selectGitHubAuthIsDisconnecting:Dt,selectGitHubAuthMutationRequestId:Ft,selectGitHubAuthRequiresDaemonAuth:Nt,selectGitHubAuthStatusSettled:xt,selectGitHubAuthUser:Wt},Symbol.toStringTag,{value:"Module"}));function f(e){return e??""}function Gt(e,t){const r=e??[],s=t??[];return r.length===s.length&&r.every((i,o)=>f(i.provider)===f(s[o].provider)&&i.model===s[o].model&&i.hint===s[o].hint&&f(i.reasoningEffort)===f(s[o].reasoningEffort))}function ne(e,t){if(e.source!=="user"||!t?.ignoreModelPin&&(e.model||e.codingAgent))return!1;const r=e.bundled;return r?f(e.name)===f(r.name)&&f(e.description)===f(r.description)&&f(e.behaviorPrompt)===f(r.behaviorPrompt)&&f(e.roleReminder)===f(r.roleReminder)&&f(e.reasoningEffort)===f(r.reasoningEffort)&&Gt(e.modelOptions,r.modelOptions):!1}const Ks=n.createSelector(e=>e.specialists.bundledSpecialists),Ht=n.createSelector(e=>e.specialists.fileSpecialists),Qs=n.createSelector(e=>w(Ht.select(e))),Xs=n.createSelector(e=>e.specialists.userOverrides);n.createSelector(e=>e.specialists.overridesLoaded);const Zs=n.createSelector(e=>e.specialists.customSpecialistsLoaded),Ys=n.createSelector(e=>e.specialists.fileSpecialistsLoaded),Js=n.createSelector(e=>e.specialists.bundledSpecialistsLoaded),ei=n.createSelector(e=>e.specialists.specialistsFolderPath),ti=n.createSelector((e,t)=>{if(!t)return e.specialists.defaultSpecialistId??"";const r=e.providerCatalog?.byWorkspaceId?.[t]?.settings.find(s=>s.path==="specialists.default")?.value;return typeof r=="string"?r:""});n.createSelector(e=>e.specialists.providerModelOverrides);const U=n.createSelector((e,t)=>!(pe.has(t)&&!fe.select(e)));function qt(e,t){return t?e:e.filter(r=>!pe.has(r.id))}function $t(e,t){return qt(e,t).filter(r=>!r.hidden)}function ri(e,t){return $t(e,t).filter(r=>r.role!=="internal")}const A=n.createSelector((e,t)=>{if(t)return(e.providerCatalog?.byWorkspaceId?.[t]?.specialists??[]).map(l=>({...l,defaultModel:l.model,defaultBehaviorPrompt:l.behaviorPrompt??l.prompt??"",defaultAgentType:l.agentType}));const r=w(e.specialists.fileSpecialists),s=e.specialists.bundledSpecialists,i=new Set,o=[];for(const l of r)!i.has(l.id)&&U.select(e,l.id)&&(i.add(l.id),o.push({id:l.id,name:l.name,description:l.description,codingAgent:l.codingAgent,defaultModel:l.model||void 0,defaultBehaviorPrompt:l.behaviorPrompt,roleReminder:l.roleReminder,source:l.source,importedFrom:l.importedFrom,unsupportedFields:l.unsupportedFields,requiredSkills:l.requiredSkills,missingSkills:l.missingSkills,hidden:l.hidden,resolvedModel:l.resolvedModel,resolvedProvider:l.resolvedProvider,modelOptions:l.modelOptions,reasoningEffort:l.reasoningEffort,role:l.role,teamAgents:l.teamAgents,icon:l.icon}));for(const l of s)!i.has(l.id)&&U.select(e,l.id)&&(i.add(l.id),o.push(l));if(!e.specialists.bundledSpecialistsLoaded&&r.length===0&&s.length===0)for(const l of E)!i.has(l.id)&&U.select(e,l.id)&&(i.add(l.id),o.push(l));const c=new Map;for(const l of E)c.has(l.id)||c.set(l.id,c.size);for(const l of s)c.has(l.id)||c.set(l.id,c.size);return o.sort((l,p)=>{const S=c.has(l.id),B=c.has(p.id);return S&&B?(c.get(l.id)??0)-(c.get(p.id)??0):S&&!B?-1:!S&&B?1:l.name.localeCompare(p.name)}),o}),si=n.createSelector(e=>{const t=A.select(e).filter(s=>s.role==="orchestrator");if(t.length===0)return null;const r=new Set([...E.map(({id:s})=>s),...e.specialists.bundledSpecialists.map(({id:s})=>s)]);return t.sort((s,i)=>+!r.has(s.id)-+!r.has(i.id)||s.id.localeCompare(i.id)),t[0]}),jt=n.createSelector((e,t)=>{const r=v(e.specialists.fileSpecialists,t);if(r)return{id:r.id,name:r.name,description:r.description,source:r.source};const s=e.specialists.bundledSpecialists.find(i=>i.id===t);if(s)return{id:s.id,name:s.name,description:s.description,source:"builtin"};if(!e.specialists.bundledSpecialistsLoaded&&w(e.specialists.fileSpecialists).length===0&&e.specialists.bundledSpecialists.length===0){const i=E.find(o=>o.id===t);if(i)return{id:i.id,name:i.name,description:i.description,source:"builtin"}}return null}),ii=n.createSelector((e,t)=>jt.select(e,t)?.name??null),ni=n.createSelector((e,t,r)=>{const i=A.select(e,r).find(o=>o.id===t);return i?i.defaultModel?i.defaultModel:i.resolvedModel??"":""}),ai=n.createSelector((e,t,r)=>A.select(e,r).find(o=>o.id===t)?.defaultModel||void 0),oi=n.createSelector((e,t,r)=>A.select(e,r).find(o=>o.id===t)?.reasoningEffort||void 0),ci=n.createSelector((e,t,r)=>{const i=A.select(e,r).find(o=>o.id===t);return i?i.defaultBehaviorPrompt:""});function F(e,t){return t.some(r=>r.id===e)||E.some(r=>r.id===e)}const li=n.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(i=>i.id===t);return!s||s.importedFrom?!1:s.source==="bundled"||s.source==="user"&&F(t,e.specialists.bundledSpecialists)}return F(t,e.specialists.bundledSpecialists)}),di=n.createSelector((e,t,r)=>r?!!Y.select(e,t,r):!!v(e.specialists.fileSpecialists,t)),ui=n.createSelector((e,t,r)=>{if(r){const o=Y.select(e,t,r);return!o||o.importedFrom||o.source==="project"?!1:F(t,e.specialists.bundledSpecialists)&&!ne(o)}if(!F(t,e.specialists.bundledSpecialists))return!1;const i=v(e.specialists.fileSpecialists,t);return!i||i.source!=="user"?!1:!ne(i)}),Y=n.createSelector((e,t,r)=>{if(r){const s=e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(i=>i.id===t);return!s||s.source==="bundled"?void 0:{...s,source:s.source,model:s.model??"",behaviorPrompt:s.behaviorPrompt??s.prompt??"",filePath:s.path??""}}return v(e.specialists.fileSpecialists,t)}),pi=n.createSelector((e,t,r)=>{const s=Y.select(e,t,r);return r&&!s?e.providerCatalog?.byWorkspaceId?.[r]?.specialists.some(i=>i.id===t)?"Built-in":null:s?.source==="project"?"Project":s?.source==="user"?"User":e.specialists.bundledSpecialists.some(i=>i.id===t)?"Built-in":null}),fi=n.createSelector((e,t,r)=>{if(r)return e.providerCatalog?.byWorkspaceId?.[r]?.specialists.find(o=>o.id===t)?.path;const s=v(e.specialists.fileSpecialists,t);if(s)return s.filePath;const i=e.specialists.bundledSpecialists.find(o=>o.id===t);if(i&&"filePath"in i)return i.filePath}),gi=n.createSelector((e,t,r)=>{if(r){const i=A.select(e,r).find(l=>l.id===t),o=i?.codingAgent||i?.resolvedProvider;if(o)return Ye.select(e,o,r);const c=Je.select(e,r);return e.providerCatalog?.byWorkspaceId?.[r]?.readiness[c]?.available?c:""}const s=v(e.specialists.fileSpecialists,t);return s?.codingAgent?s.codingAgent:zt.select(e,t)}),zt=n.createSelector((e,t)=>{const s=A.select(e).find(i=>i.id===t);return s?.codingAgent?s.codingAgent:lt.select(e)?ue.select(e):""}),hi=n.createSelector((e,t)=>{if(t)return e.providerCatalog?.byWorkspaceId?.[t]?.importDiagnostics??[];const r=e.specialists.importDiagnostics;return r?w(r):[]}),mi=n.createSelector((e,t)=>e.specialists.creationByContext?.[t]??We),bi=n.createSelector(e=>Object.values(e.specialists.creationByContext??{}).flatMap(t=>t.specialistId?[t.specialistId]:[])),Kt=["connected","disconnected","unreachable","revoked","update-required"],M=e=>e!==null&&typeof e=="object"&&!Array.isArray(e),u=e=>typeof e=="string"&&e.length>0,C=e=>typeof e=="string"&&e.length>0?e:void 0,ge=e=>Number.isSafeInteger(e)&&e>=0?e:0;function Qt(e){if(!M(e))return;const t=Array.isArray(e.providers)?e.providers.flatMap(s=>M(s)&&u(s.id)?[{id:s.id,...s.visible===!1?{visible:!1}:{},status:typeof s.status=="string"?s.status:"unknown",models:Array.isArray(s.models)?s.models.filter(i=>u(i)):[],...s.modelsStale===!0?{modelsStale:!0}:{}}]:[]):[],r=C(e.intentdVersion);return{...r?{intentdVersion:r}:{},providers:t}}function Si(e){if(!M(e)||!u(e.id)||!u(e.name)||!u(e.fingerprint)||!Kt.includes(e.state)||!Number.isInteger(e.port)||!u(e.addedAt))return null;const t=M(e.platform)&&u(e.platform.os)&&u(e.platform.arch)?{os:e.platform.os,arch:e.platform.arch}:void 0,r=Qt(e.capabilities),s=C(e.tcAddress),i=C(e.observedAt),o=C(e.lastConnectedAt),c=Be(e.cloud),l=Number.isInteger(e.nodeProtocol)&&e.nodeProtocol>=0?e.nodeProtocol:void 0;return{id:e.id,name:e.name,...t?{platform:t}:{},hosts:Array.isArray(e.hosts)?e.hosts.filter(p=>u(p)):[],port:e.port,...s?{tcAddress:s}:{},fingerprint:e.fingerprint,state:e.state,runningAgents:ge(e.runningAgents),...r?{capabilities:r}:{},...l!==void 0?{nodeProtocol:l}:{},...i?{observedAt:i}:{},addedAt:e.addedAt,...o?{lastConnectedAt:o}:{},...c?{cloud:c}:{}}}function _i(e){if(!M(e)||!u(e.credentialId)||!u(e.backendId)||!u(e.backendName)||!u(e.createdAt))return null;const t=C(e.lastUsedAt);return{credentialId:e.credentialId,backendId:e.backendId,backendName:e.backendName,createdAt:e.createdAt,...t?{lastUsedAt:t}:{},connected:e.connected===!0,runningAgents:ge(e.runningAgents)}}function vi(e){const t=(typeof e=="string"?e:"").trim().toUpperCase();return t===""?null:t}function Xt(e){if(!M(e)||typeof e.name!="string")return null;const t=e.name;return e.kind==="local"?{kind:"local",name:t}:e.kind==="machine"&&u(e.nodeId)?{kind:"machine",nodeId:e.nodeId,name:t}:e.kind==="cloud"&&u(e.cloudMachineId)?{kind:"cloud",cloudMachineId:e.cloudMachineId,name:t}:null}function Ai(e){if(!Array.isArray(e))return null;const t=[];for(const r of e){const s=Xt(r);if(!s)return null;t.push(s)}return t}function Zt(e){return e.kind==="local"?{kind:"local"}:e.kind==="machine"?{kind:"machine",nodeId:e.nodeId}:{kind:"cloud",cloudMachineId:e.cloudMachineId}}function I(e){return e.kind==="local"?"local":e.kind==="machine"?`machine:${e.nodeId}`:`cloud:${e.cloudMachineId}`}const Yt={macos:"macOS",linux:"Linux",windows:"Windows"},Jt={aarch64:"arm64",arm64:"arm64",x86_64:"x64",x64:"x64"};function k(e,t){const r=[e&&(Yt[e]??e),t&&(Jt[t]??t)].filter(s=>!!s);return r.length?r.join(" "):null}function er(e){return e?.placement?.target==="remote"||T(e?.placement?.target)}const tr=new Set(["running","paused","resuming","pausing","stopping"]);function rr(e,t){if(e.placementError)return null;if(e.cloudStart)return"starting";if(!e.nodeId)return e.effectiveIsolation==="pending"?"starting":null;const r=t?.cloud?.state;return r&&tr.has(r)?r:e.effectiveIsolation==="pending"?"starting":null}function he(e,t){if(!e||!er(e))return null;const r=e.nodeId??e.placement?.nodeId??"",s=t&&t.id===r?t:null;if(T(e.placement?.target))return{nodeId:r,name:e.nodeName?.trim()||Ve(s?.cloud?.provider??Ue(e.placement?.cloudMachineId)),platform:k(s?.platform?.os,s?.platform?.arch),state:"ready",cloud:{state:rr(e,s)}};const i=k(e.placement?.os,e.placement?.arch)??k(s?.platform?.os,s?.platform?.arch),o=s?.state==="revoked"?"revoked":s?.state==="unreachable"||e.nodeState==="offline"?"unreachable":"ready";return{nodeId:r,name:e.nodeName?.trim()||s?.name||a.remoteAgent_location_unknownMachine(),platform:i,state:o}}function ki(e,t){if(!e)return null;const r=t&&t.id===e?t:null;return{nodeId:e,name:r?.name||a.remoteAgent_location_unknownMachine(),platform:k(r?.platform?.os,r?.platform?.arch),state:r?.state==="revoked"?"revoked":r?.state==="unreachable"?"unreachable":"ready"}}function me(e){switch(e){case"starting":return a.cloudMachines_agent_starting();case"running":return a.cloudMachines_agent_running();case"paused":return a.cloudMachines_agent_paused();case"resuming":return a.cloudMachines_agent_resuming();case"pausing":return a.cloudMachines_agent_pausing();case"stopping":return a.cloudMachines_agent_stopping();default:return null}}function yi(e){const t=me(e.cloud?.state);return t?a.cloudMachines_agent_chip({machine:e.name,state:t}):e.name}function Ei(e){if(e.cloud){const r=me(e.cloud.state),s=a.remoteAgent_location_tooltipNoPlatform({machine:e.name});return r?a.remoteAgent_location_tooltipWithState({location:s,state:r}):s}const t=e.platform?a.remoteAgent_location_tooltip({machine:e.name,platform:e.platform}):a.remoteAgent_location_tooltipNoPlatform({machine:e.name});switch(e.state){case"unreachable":return a.remoteAgent_location_tooltipWithState({location:t,state:a.remoteMachines_state_unreachable_label()});case"revoked":return a.remoteAgent_location_tooltipWithState({location:t,state:a.remoteMachines_state_revoked_label()});default:return t}}function be(e,t){return!e||!t?null:e.placementError?"failed":t.state==="revoked"?"revoked":t.state==="unreachable"?"unreachable":e.effectiveIsolation==="pending"||e.cloudStart?"starting":e.setup?.state==="failed"?"setup-failed":null}function Se(e){if(!e.endsWith("}"))return null;for(let t=e.indexOf(" {");t>=0;t=e.indexOf(" {",t+1))try{const r=JSON.parse(e.slice(t+1));if(r&&typeof r=="object"&&typeof r.code=="string")return{message:e.slice(0,t).trim(),data:r}}catch{}return null}function sr(e,t){const r=e.detail??"",s=Se(r),i=e.code==="machine-update-required"||s?.data.code==="machine-update-required";if(i&&s?.data.reason==="prepared-checkout")return{updateRequired:i,message:a.remoteAgent_updateRequired_preparedCheckout({machine:t})};const o=ie(s?.data),c=o??(e.code?ie({code:e.code}):null);return c?{updateRequired:i,message:s?.message||r,cloud:c,cloudDetailKnown:!!o}:{updateRequired:i,message:s?.message||r}}function Mi(e){if(!T(e?.placement?.target)||!e.placementError||e.status!==Ge.Error)return null;const t=sr(e.placementError,"");return t.cloud?t:null}const ir=["attachments-too-large-for-machine:","node-prompt-too-large:"],nr="remote-agent-unsupported:";function ae(e){return new Intl.NumberFormat(void 0,{maximumFractionDigits:1}).format(e/1048576)}function wi(e){const t=Se(e)?.message??e;for(const s of ir){const i=t.indexOf(s);if(i<0)continue;const o=t.slice(i+s.length).trim().replace(/^[a-z][\w]*(?:\.[\w]+)+:\s*/i,""),c=/come to (\d+) bytes\b.*?over its (\d+)-byte limit/.exec(o);return c?a.remoteAgent_attachmentsTooLargeSized_error({size:ae(Number(c[1])),limit:ae(Number(c[2]))}):o?a.remoteAgent_attachmentsTooLarge_error({detail:o}):a.remoteAgent_attachmentsTooLargeNoDetail_error()}const r=t.indexOf(nr);return r>=0&&/attachment/i.test(t.slice(r))?a.remoteAgent_attachmentsUnsupported_error():null}function Ri(e){return T(e?.placement?.target)&&be(e,he(e))==="starting"}function Ci(e,t){if(!T(e?.placement?.target))return!1;const r=he(e,t);return r?.cloud?.state==="resuming"&&be(e,r)===null}const m="",$="cloud:";function J(e){return`${$}${e}`}function N(e){return e?.startsWith($)&&e.slice($.length)||null}const Pi=J("e2b");function ar(e,t){return e?.find(r=>J(r.cloudMachineId)===t&&r.unavailableReason===null)}const or=new Set(["connected","disconnected"]);function cr(e){switch(e){case"unreachable":return a.remoteMachines_state_unreachable_label();case"revoked":return a.remoteMachines_state_revoked_label();case"update-required":return a.remoteMachines_state_updateRequired_label();default:return}}function ee(e){return or.has(e.state)}function lr({backendLabel:e,backendPlatform:t,machines:r,cloud:s,orchestrator:i=!1}){const o=[i?{id:m,label:a.remoteMachines_startOn_firstAvailable_label(),platform:null,disabled:!1,hint:a.remoteMachines_startOn_firstAvailable_hint()}:{id:m,label:e,platform:k(t?.os,t?.arch),disabled:!1},...r.map(c=>{const l=k(c.platform?.os,c.platform?.arch);return ee(c)?{id:c.id,label:c.name,platform:l,disabled:!1}:{id:c.id,label:c.name,platform:l,disabled:!0,reason:cr(c.state)}})];for(const c of s??[])o.push({id:J(c.cloudMachineId),label:c.label,platform:null,kind:"cloud",disabled:c.unavailableReason!==null,...c.unavailableReason?{reason:c.unavailableReason}:c.needsProfile?{hint:a.cloudMachines_startOn_hint()}:{}});return o}function Ii(e){return e.find(t=>t.id===m)?.label??""}function Ti(e,t,r){if(e!==m)return N(e)?void 0:e;if(r)return t.find(s=>s.id!==m&&s.kind!=="cloud"&&!s.disabled)?.id}function dr({remoteMachinesVisible:e,supported:t,machines:r,cloud:s}){return e&&t&&(r.some(ee)||(s??[]).some(i=>i.unavailableReason===null))}function ur(e,t,r){if(!e)return m;if(N(e))return ar(r,e)?e:m;const s=t.find(i=>i.id===e);return s&&ee(s)?s.id:m}function Oi(e,{cloudEntries:t=!1,providerOf:r}={}){const s=N(e);if(s){const i=r?.(s);return t&&i&&i!=="e2b"?{target:"cloud",checkout:"isolated",cloudMachineId:s}:t?{target:"e2b",checkout:"isolated",cloudMachineId:s}:{target:"e2b",checkout:"isolated"}}return e?{target:"remote",checkout:"isolated",nodeId:e}:void 0}function Fi({groups:e,providerRef:t,model:r}){const s=c=>c.options.filter(l=>!l.disabled),i=e.find(c=>c.key===t),o=i?s(i):[];if(r){const c=He(r).modelId;if(o.some(l=>l.value===c))return null}else if(o.length>0)return null;if(i&&o.length>0)return{providerId:i.key,modelId:o[0].value};for(const c of e){if(c.key==="default")continue;const l=s(c);if(l.length>0)return{providerId:c.key,modelId:l[0].value}}return null}function pr(e,t,r,s){const i=e.map(I),o=i.indexOf(t),c=i.indexOf(r);if(o<0||c<0||o===c)return null;let l=c+(s==="after"?1:0);if(o<l&&(l-=1),l===o)return null;const p=[...e],[S]=p.splice(o,1);return p.splice(l,0,S),p.map(Zt)}function Li(e,t,r){const s=e.findIndex(o=>I(o)===t),i=e[s+r];return s<0||!i?null:pr(e,t,I(i),r===-1?"before":"after")}function fr(e,t){if(e===m)return"local";const r=t==="cloud"?N(e):null;return I(r?{kind:"cloud",cloudMachineId:r}:{kind:"machine",nodeId:e})}function oe(e,t){const r=new Map(t.map((i,o)=>[I(i),o])),s=i=>r.get(fr(i.id,i.kind))??t.length;return e.map((i,o)=>({option:i,index:o})).sort((i,o)=>s(i.option)-s(o.option)||i.index-o.index).map(({option:i})=>i)}const gr=n.createSelector(e=>Ct.select(e)||Q.select(e)),te=n.createSelector(e=>gr.select(e)&&e.remoteMachines?.supported===!0),Di=n.createSelector(e=>te.select(e)&&dt.select(e)&&!Q.select(e)),_e=n.createSelector(e=>te.select(e)&&e.remoteMachines.machineOrder===!0&&e.remoteMachines.order!==null),ce=n.createSelector(e=>_e.select(e)?e.remoteMachines.order??[]:[]),xi=n.createSelector(e=>e.remoteMachines.orderSaving!==null),re=n.createSelector(e=>Object.values(e.remoteMachines?.machines??{}).sort((t,r)=>t.name.localeCompare(r.name))),Ni=n.createSelector(e=>e.remoteMachines.localFingerprint),Wi=n.createSelector(e=>e.remoteMachines.pending),Bi=n.createSelector(e=>e.remoteMachines.failures),Vi=n.createSelector(e=>e.remoteMachines.executorBackends??[]),hr=n.createSelector((e,t)=>{if(t===qe)return a.layout_daemonStatus_localConnection_label();const r=v(e.connections.connections,t);return r?ut(r):t}),mr=n.createSelector(e=>hr.select(e,e.connections.windowBackendId)),Ui=n.createSelector((e,t)=>(t?e.remoteMachines.machines[t]??e.cloudMachines?.machines[t]:void 0)??null),Gi=n.createSelector((e,t)=>{const r=e.providerSettings?.profiles;return pt({catalogProfiles:rt.select(e,t),defaultRemoteIncompatibility:tt.select(e,t),defaultRemoteLaunch:et.select(e,t),profileDefaults:Object.values(r?.defaults??{}),profilesLoadStatus:r?.loadStatus??"idle"})}),Hi=n.createSelector(e=>Object.fromEntries(Object.values(e.providerSettings?.profiles?.defaults??{}).map(t=>[t.baseProviderId,t.env.length>0]))),ve=n.createSelector(e=>dr({remoteMachinesVisible:te.select(e),supported:e.remoteMachines?.initialAgentPlacement===!0,machines:re.select(e),cloud:X(e)}));function br(e){const t=v(e.connections.connections,e.connections.windowBackendId);return t?.hostOs?{os:t.hostOs,arch:t.hostArch}:void 0}const Sr=n.createSelector(e=>{const t=Q.select(e),r=lr({backendLabel:mr.select(e),backendPlatform:br(e),machines:re.select(e),cloud:X(e),orchestrator:t});if(!_e.select(e))return r;if(!t)return oe(r,ce.select(e));const[s,...i]=r;return[s,...oe(i,ce.select(e))]}),qi=n.createSelector(e=>ve.select(e)?Sr.select(e):[]),$i=n.createSelector(e=>e.remoteMachines?.initialAgentPlacement===!0),ji=n.createSelector((e,t,r)=>ve.select(e)?ur(t,re.select(e),Ae(e,r)):m);function Ae(e,t){const r=X(e);if(!r||!t)return r;const s=e.cloudMachines?.providers??{};return r.map(i=>{if(i.unavailableReason)return i;const o=ft(e,t,s[i.cloudMachineId]??null);return o?{...i,unavailableReason:o}:i})}const zi=n.createSelector((e,t)=>Ae(e,t)),G=K("Clipboard");async function Ki(e){let t;if(Pt())try{const r=await It("system:write-clipboard",{text:e});if(r?.success===!1)throw new Error(r.error||"Electron clipboard write failed");return}catch(r){t=r,G.warn("Electron clipboard write failed; falling back to browser clipboard",{error:r})}if(typeof navigator<"u"&&navigator.clipboard?.writeText)try{await navigator.clipboard.writeText(e);return}catch(r){throw G.error("Browser clipboard write failed",r,{electronError:t}),r}throw G.error("No clipboard write API is available",void 0,{electronError:t}),t instanceof Error?t:new Error("Clipboard write API unavailable")}const _r=K("WorkspaceValidation");async function Qi(e,t=!1,r=!1){if(!e||e.trim().length===0)return{valid:!1,error:a.workspace_validation_repoPathRequired_error(),suggestion:a.workspace_validation_repoPathRequired_suggestion()};const s=e.trim();return vr(s)?kr(s):yr(s,t,r)}function vr(e){return[/^https?:\/\/github\.com\//i,/^git@github\.com:/i,/^github\.com\//i,/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/].some(r=>r.test(e.trim()))}function Ar(e){const t=e.trim(),r=[/^https?:\/\/github\.com\/([^\/]+)\/([^\/]+)$/i,/^git@github\.com:([^\/]+)\/([^\/]+)$/i,/^github\.com\/([^\/]+)\/([^\/]+)$/i];for(const i of r){const o=t.match(i);if(o){const c=o[2].replace(/\.git$/,"");return c?{owner:o[1],repo:c}:null}}const s=t.match(/^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_\.]+)$/);if(s&&!t.includes("\\")&&!t.includes(":")){const i=s[2].replace(/\.git$/,"");return i?{owner:s[1],repo:i}:null}return null}async function kr(e){return Ar(e)?{valid:!0,warning:a.workspace_validation_githubCloneLocally_warning()}:{valid:!1,error:a.workspace_validation_invalidGithubUrl_error(),suggestion:a.workspace_validation_invalidGithubUrl_suggestion()}}async function yr(e,t=!1,r=!1){if(e.includes("\0"))return{valid:!1,error:a.workspace_validation_nullCharacters_error()};if(!e.startsWith("/")&&!e.startsWith("~")&&!e.startsWith(".")&&!e.includes(":\\")&&!/^[a-zA-Z]:\//.test(e))return{valid:!1,error:a.workspace_validation_pathNotAbsolute_error(),suggestion:a.workspace_validation_pathNotAbsolute_suggestion()};if(typeof window<"u"&&window.electronAPI)try{const s=await V("file:getDirectoryStatus",{path:e});if(s.success&&s.data){const c=s.data;return c.exists?c.isDirectory?c.isGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:c}:c.isSubdirectoryOfGitRepo?{valid:!0,isNewRepo:!1,directoryStatus:c,warning:a.workspace_validation_insideParentRepo_warning({path:c.parentGitRoot??""})}:r?{valid:!0,isNewRepo:!1,directoryStatus:c}:t?c.isEmpty?{valid:!0,isNewRepo:!0,directoryStatus:c,warning:a.workspace_validation_emptyDirInit_warning()}:{valid:!0,isNewRepo:!0,directoryStatus:c,warning:a.workspace_validation_nonGitDirInit_warning()}:{valid:!1,error:a.workspace_repoSelector_notGitRepository_label(),directoryStatus:c}:{valid:!1,error:a.workspace_validation_notDirectory_error(),suggestion:a.workspace_validation_notDirectory_suggestion(),directoryStatus:c}:t?{valid:!0,isNewRepo:!0,directoryStatus:c,warning:a.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:a.workspace_validation_dirNotExist_error(),suggestion:a.workspace_validation_dirNotExist_suggestion(),directoryStatus:c}}if(!(await V("file:exists",{path:e})).exists)return t?{valid:!0,isNewRepo:!0,warning:a.workspace_validation_willCreateRepo_warning()}:{valid:!1,error:a.workspace_validation_dirNotExist_error(),suggestion:a.workspace_validation_dirNotExistLegacy_suggestion()};const o=await V("git:isRepository",{path:e});if(!t&&o?.isRepository!==!0)return{valid:!1,error:o?.isRepository===!1?a.workspace_repoSelector_notGitRepository_label():a.workspace_compactInitializer_gitCheckUnknown_label()};if(!o.isRepository)return{valid:!0,isNewRepo:!0,warning:a.workspace_validation_nonGitInit_warning()}}catch(s){if(_r.warn("Could not validate path existence",s),!t)return{valid:!1,error:a.workspace_compactInitializer_gitCheckUnknown_label()}}return{valid:!0,isNewRepo:!1}}function Xi(e){if(!e||e.trim().length===0)return{valid:!0};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:a.workspace_validation_branchPrefixInvalidChars_error(),suggestion:a.workspace_validation_branchChars_suggestion()}:t==="."||t===".."||t.startsWith(".")?{valid:!1,error:a.workspace_validation_branchPrefixDot_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:a.workspace_validation_branchPrefixConsecutive_error()}:t.startsWith("/")?{valid:!1,error:a.workspace_validation_branchPrefixSlash_error()}:t.endsWith(".lock")?{valid:!1,error:a.workspace_validation_branchPrefixLock_error()}:t.length>50?{valid:!1,error:a.workspace_validation_branchPrefixTooLong_error()}:{valid:!0}}function Zi(e){if(!e||e.trim().length===0)return"";let t=e.trim().replace(/^[./]+/,"").replace(/[\s~^:?*\[\]\\]/g,"-").replace(/\.{2,}/g,"-").replace(/\/{2,}/g,"/").replace(/-{2,}/g,"-").replace(/^-+/,"").replace(/\.lock$/,"").toLowerCase();return t.length>0&&!t.endsWith("/")&&!t.endsWith("-")&&(t=t.includes("/")?`${t}/`:`${t}/`),t}function Yi(e){if(!e||e.trim().length===0)return{valid:!1,error:a.workspace_validation_branchNameRequired_error()};const t=e.trim();return/[\s~^:?*\[\]\\]/.test(t)?{valid:!1,error:a.workspace_validation_branchNameInvalidChars_error(),suggestion:a.workspace_validation_branchChars_suggestion()}:["HEAD",".",".."].includes(t)?{valid:!1,error:a.workspace_validation_branchNameReserved_error()}:t.includes("..")||t.includes("//")?{valid:!1,error:a.workspace_validation_branchNameConsecutive_error()}:t.startsWith("/")||t.endsWith("/")?{valid:!1,error:a.workspace_validation_branchNameSlash_error()}:t.endsWith(".lock")?{valid:!1,error:a.workspace_validation_branchNameLock_error()}:{valid:!0}}function Ji(e){return!e||e.trim().length===0?{valid:!0}:e.trim().length>1e5?{valid:!1,error:a.workspace_validation_promptTooLong_error(),suggestion:a.workspace_validation_promptTooLong_suggestion()}:{valid:!0}}function en(e){const t=e.toLowerCase();return t.includes("maxbuffer")?a.workspace_gitError_maxBuffer():t.includes("clone")&&t.includes("timed out")?a.workspace_gitError_cloneTimeout():t.includes("json-rpc request timed out: workspace.create")?a.workspace_gitError_createTimeout():t.includes("timed out")&&["git","clone","fetch","worktree","pull","push","rebase","merge"].some(r=>t.includes(r))?a.workspace_gitError_gitTimeout():t.includes("git clone failed")?t.includes("could not read from remote")?a.workspace_gitError_cloneRemote():t.includes("authentication")||t.includes("permission denied")||t.includes("access denied")?a.workspace_gitError_cloneAuth():a.workspace_gitError_cloneFailed():t.includes("could not resolve any ref to create worktree")?a.workspace_gitError_worktreeRef():t.includes("failed to write file")?t.includes("eacces")||t.includes("permission denied")?a.workspace_gitError_writePermission():t.includes("enospc")||t.includes("disk space")?a.workspace_gitError_diskSpaceFree():t.includes("enoent")||t.includes("no such file")?a.workspace_gitError_writeNoEnt():e:t.includes("failed to read file")?t.includes("enoent")||t.includes("no such file")?a.workspace_gitError_readNotFound():t.includes("eacces")||t.includes("permission denied")?a.workspace_gitError_readPermission():e:t.includes("permission denied")?a.workspace_gitError_permissionDenied():t.includes("not found")||t.includes("enoent")?a.workspace_gitError_notFound():t.includes("already exists")?a.workspace_gitError_alreadyExists():t.includes("network")||t.includes("etimedout")?a.workspace_gitError_network():t.includes("authentication")||t.includes("401")?t.includes("private repositor")?e:a.workspace_gitError_authFailed():t.includes("rate limit")||t.includes("403")?a.workspace_gitError_rateLimit():t.includes("disk space")||t.includes("enospc")?a.workspace_gitError_diskSpace():e}const Er=["idle","exited"];function Mr(e){return e===void 0||!Er.includes(e)}function tn(e){return e.status==="restarting"?"restarting":Mr(e.status)?"running":e.status==="idle"?"idle":e.exitCode===0?"succeeded":e.exitCode===null||e.exitCode===void 0?"exited":e.exitCode>=128?"stopped":"failed"}function wr(e){return e.engine==="os"?"os":e.isLoading||e.keyConfigured[e.provider]===!0?"daemon":e.osEngineAvailable?"os":"unavailable"}const rn=n.createSelector(e=>e.voiceSettings.isLoading),sn=n.createSelector(e=>e.voiceSettings.available),nn=n.createSelector(e=>e.voiceSettings.provider),an=n.createSelector(e=>e.voiceSettings.engine),on=n.createSelector(e=>e.voiceSettings.osEngineAvailable),cn=n.createSelector(e=>e.voiceSettings.keyConfigured),ln=n.createSelector(e=>e.voiceSettings.vocabulary),dn=n.createSelector(e=>e.voiceSettings.openaiModel),un=n.createSelector(e=>e.voiceSettings.language),pn=n.createSelector(e=>e.voiceSettings.workspaceVocabularyMaxTerms),fn=n.createSelector(e=>e.voiceSettings.inputDeviceId),gn=n.createSelector(e=>e.voiceSettings.inputDevices),hn=n.createSelector(e=>e.voiceSettings.busyProvider),mn=n.createSelector(e=>e.voiceSettings.error),bn=n.createSelector(e=>st.select(e)?"unavailable":wr(e.voiceSettings)),j="intent.voice.inputDevice";let z;function Rr(){if(z!==void 0)return z;try{const e=localStorage.getItem(j);return typeof e=="string"&&e!==""?e:null}catch{return null}}function Sn(e){z=e;try{e===null?localStorage.removeItem(j):localStorage.setItem(j,e)}catch{}}let L=null;function _n(e){L=e}function vn(){const e=L;return L=null,e}function Cr(){L=null}const Pr=300,Ir=300;class Tr{constructor(t){d(this,"holdThresholdMs");d(this,"doublePressWindowMs");d(this,"onRecordStart");d(this,"onRecordStop");d(this,"currentState","idle");d(this,"timer",null);this.holdThresholdMs=t.holdThresholdMs??Pr,this.doublePressWindowMs=t.doublePressWindowMs??Ir,this.onRecordStart=t.onRecordStart,this.onRecordStop=t.onRecordStop}get state(){return this.currentState}keyDown(){switch(this.currentState){case"idle":this.currentState="first-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding"}),this.onRecordStart();break;case"await-second-press":this.clearTimer(),this.currentState="second-press",this.armTimer(this.holdThresholdMs,()=>{this.currentState="holding-send"});break;case"latched":this.currentState="latched-press";break;case"latched-await-second":this.clearTimer(),this.currentState="draining",this.onRecordStop({stopReason:"double-press",autoSend:!0});break}}keyUp(){switch(this.currentState){case"first-press":this.clearTimer(),this.currentState="await-second-press",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="latched"});break;case"holding":this.currentState="idle",this.onRecordStop({stopReason:"hold-release",autoSend:!1});break;case"second-press":this.clearTimer(),this.currentState="idle",this.onRecordStop({stopReason:"double-press",autoSend:!0});break;case"holding-send":this.currentState="idle",this.onRecordStop({stopReason:"double-hold-release",autoSend:!0});break;case"latched-press":this.currentState="latched-await-second",this.armTimer(this.doublePressWindowMs,()=>{this.currentState="idle",this.onRecordStop({stopReason:"latch-stop",autoSend:!1})});break;case"draining":this.currentState="idle";break}}reset(){this.clearTimer(),this.currentState="idle"}armTimer(t,r){this.clearTimer(),this.timer=setTimeout(()=>{this.timer=null,r()},t)}clearTimer(){this.timer!==null&&clearTimeout(this.timer),this.timer=null}}let D=null;function An(e){D=e}function kn(){const e=D;return D=null,e}function Or(){D=null}const Fr=12e4,Lr=["audio/webm;codecs=opus","audio/webm"];function yn(){return typeof navigator<"u"&&typeof navigator.mediaDevices?.getUserMedia=="function"&&typeof MediaRecorder<"u"}function Dr(e){return e?{audio:{deviceId:{ideal:e}}}:{audio:!0}}function xr(){if(!(typeof MediaRecorder>"u"||typeof MediaRecorder.isTypeSupported!="function"))return Lr.find(e=>MediaRecorder.isTypeSupported(e))}class Nr{constructor(t){d(this,"maxDurationMs");d(this,"now");d(this,"callbacks");d(this,"deviceId");d(this,"currentState","idle");d(this,"recorder",null);d(this,"stream",null);d(this,"chunks",[]);d(this,"startedAt",0);d(this,"maxTimer",null);d(this,"discardRequested",!1);d(this,"cancelRequested",!1);this.maxDurationMs=t.maxDurationMs??Fr,this.now=t.now??Date.now,this.callbacks={onFinished:t.onFinished,onError:t.onError},this.deviceId=t.deviceId??null}get state(){return this.currentState}async start(){if(this.currentState!=="idle")return"discarded";this.currentState="starting";let t;try{t=await navigator.mediaDevices.getUserMedia(Dr(this.deviceId))}catch(i){const o=this.discardRequested;return this.currentState="stopped",o||this.callbacks.onError(i),o?"discarded":"error"}if(this.discardRequested){for(const i of t.getTracks())i.stop();return this.currentState="stopped","discarded"}this.stream=t;const r=xr(),s=r?new MediaRecorder(t,{mimeType:r}):new MediaRecorder(t);return this.recorder=s,s.ondataavailable=i=>{i.data&&i.data.size>0&&this.chunks.push(i.data)},s.onstop=()=>this.handleRecorderStop(),s.onerror=i=>this.handleRecorderError(i),s.start(),this.startedAt=this.now(),this.currentState="recording",this.maxTimer=setTimeout(()=>this.stop(),this.maxDurationMs),"recording"}stop(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&this.recorder?.stop()}cancel(){if(this.currentState==="starting"){this.discardRequested=!0;return}this.currentState==="recording"&&(this.cancelRequested=!0,this.recorder?.stop())}handleRecorderStop(){const t=this.now()-this.startedAt,r=this.recorder?.mimeType||"audio/webm",s=this.chunks,i=this.cancelRequested;this.teardown(),!i&&this.callbacks.onFinished({blob:new Blob(s,{type:r}),durationMs:t,mimeType:r})}handleRecorderError(t){const r=t?.error??t;this.teardown(),this.callbacks.onError(r)}teardown(){this.maxTimer!==null&&clearTimeout(this.maxTimer),this.maxTimer=null,this.recorder&&(this.recorder.ondataavailable=null,this.recorder.onstop=null,this.recorder.onerror=null),this.recorder=null;for(const t of this.stream?.getTracks()??[])t.stop();this.stream=null,this.chunks=[],this.currentState="stopped"}}const Wr=300;function Br(e){const t=e?.name;return t==="NotAllowedError"||t==="SecurityError"}const Vr={stopReason:"manual",autoSend:!1};let h=null,_=null,y=0,P=null;const W=new Tr({onRecordStart:()=>{P&&Ur(P)},onRecordStop:e=>{ke(P,e)}});function En(){return h!==null}function Mn(){return h}function wn(e){P=e,y+=1,y===1&&W.keyDown()}function Rn(e){P=e,y!==0&&(y-=1,y===0&&W.keyUp())}function Ur(e){if(h!==null)return;Or(),Cr();const t=new Nr({deviceId:Rr(),onFinished:r=>{h===t&&(h=null);const s=_??{stopReason:"auto-stop",autoSend:!1},i=_!==null;if(_=null,e.dispatch(O()),i||W.reset(),r.durationMs<Wr){s.autoSend&&e.dispatch(q());return}e.dispatch($e({...r,stopReason:s.stopReason,autoSend:s.autoSend}))},onError:r=>{h===t&&(h=null),_=null,e.dispatch(O()),e.showHint(Br(r)?a.hardwareConsole_ptt_micDenied_message():a.hardwareConsole_ptt_recordingFailed_message())}});h=t,e.dispatch(je()),t.start().then(r=>{if(r!=="recording"&&(h===t&&(h=null),r==="discarded")){const s=_?.autoSend===!0;_=null,e.dispatch(O()),s&&e.dispatch(q())}})}function ke(e,t){const r=h;if(r===null){t.autoSend&&e?.dispatch(q());return}_=t,r.stop()}function Cn(){ke(null,Vr)}function Pn(e){W.reset(),y=0,_=null;const t=h;t!==null&&(h=null,t.cancel(),e.dispatch(O()))}const Gr=K("HardwareConsoleVoiceSetupToast"),Hr="hardware-console-voice-setup";let H=null;function qr(){return H||(H=xe(()=>Promise.resolve().then(()=>Ot),void 0,import.meta.url).then(e=>e.notify)),H}function $r(){Tt("/settings?tab=connections#voice").catch(e=>{Gr.error("Failed to open voice settings from setup toast",e)})}function jr(){return{label:a.hardwareConsole_voice_openSettings_label(),onClick:()=>$r()}}function In(){qr().then(e=>{e.error(a.hardwareConsole_voice_noKey_error(),{id:Hr,action:jr()})})}const Tn=n.createSelector(e=>e.externalEditors.selectedAction),zr=n.createSelector(e=>e.externalEditors.editors),Kr=n.createSelector(e=>{const t=w(zr.select(e)),r=e.externalEditors.editorOrder??[];if(!r.length)return t;const s=new Map(t.map(c=>[c.id,c])),i=r.flatMap(c=>{const l=s.get(c);return l?[l]:[]}),o=new Set(r);return[...i,...t.filter(({id:c})=>!o.has(c))]}),On=n.createSelector(e=>e.externalEditors.editorOrder??[]),Fn=n.createSelector(e=>e.externalEditors.loading),Ln=n.createSelector(e=>e.externalEditors.lastFetched),Qr=n.createSelector(e=>e.externalEditors.hiddenEditorIds),Dn=n.createSelector((e,t)=>{if(!(t?it.select(e,t):nt.select(e)))return[];const s=Qr.select(e);return Kr.select(e).filter(i=>i.installed&&!s.includes(i.id))});function xn(e,t){if(!e||!t||t===e.providerId)return!1;const r=e.providerSettings[t];return!!(r&&[r.defaultModel,...Object.values(r.typeOverrides??{})].some(s=>typeof s=="string"&&s.includes(":")))}let Xr=0;function Zr(e,t){const r=++Xr;return n.dispatch(Ke(e,t,r)),r}function Nn(e,t,r){n.dispatch(ze(e,t,r))}async function ye(e,t,r,s){const i=crypto.randomUUID(),o=s?.source??"control";try{return(await n.dispatch(Qe({requestId:i,consumerId:o,agentId:e,workspaceId:t,operation:r,connection:de.select(n.state)},{...s,intent:s?.intent??Zr(e,t)}))).status==="success"}finally{n.dispatch(Xe(i,o))}}async function Wn(e,t,r,s,i){return ye(e,t,{kind:"effort",effort:r,previous:s},i)}async function Bn(e,t,r,s,i){return ye(e,t,{kind:"reconcile",current:r??null,levels:s},i)}const Yr=n.createSelector((e,t)=>w(e.agentModel.mutations).filter(r=>r.consumerId===t)),Vn=n.createSelector((e,t)=>Yr.select(e,t).some(r=>r.status==="pending")),Un=n.createSelector((e,t,r)=>{const s=e.agentSessions.byAgentId[t],i=at.select(e,t),o=gt.select(e,t),c=e.daemonHealth.stats?.protocolVersion,l=ht(c),p=l?mt(s?.model,null,o):s?.model;return{session:s,providerId:i,levels:o,legacy:l,identity:JSON.stringify([p,i]),connection:de.select(e),canWrite:!!s&&s.workspaceId===r&&!ot.select(e,r)}});function Jr(e,t,r=!1){return e!=="auggie"||t===!0||r}const Gn=n.createSelector(e=>bt.select(e)?null:Z.select(e)),es=n.createSelector(e=>e.providerCatalog?.workspaceEpoch??0),b=n.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]:void 0),Hn=n.createSelector(e=>Object.keys(e.providerCatalog?.byWorkspaceId??{})),qn=n.createSelector((e,t)=>!!b.select(e,t)&&e.providerCatalog.workspaceSnapshotEpochs?.[t]===es.select(e)),Ee=n.createSelector((e,t)=>t?b.select(e,t)?.catalog.providers??[]:ct.select(e)),Me=n.createSelector((e,t)=>{if(!t)return ue.select(e);const r=b.select(e,t)?.settings.find(s=>s.path==="model.defaultProvider")?.value;return typeof r=="string"?r:""}),se=n.createSelector((e,t)=>{if(!t)return St.select(e);const r=b.select(e,t)?.settings.find(s=>s.path==="providers.enabled")?.value;return r&&typeof r=="object"?r:{}}),we=n.createSelector((e,t)=>{if(!t)return _t.select(e);const r=se.select(e,t),s=Me.select(e,t),i=b.select(e,t)?.readiness??{};return Ee.select(e,t).filter(o=>o.visible&&(!o.canBeDisabled||r[o.id]||o.id===s)&&i[o.id]?.available).map(o=>o.id)}),$n=n.createSelector((e,t)=>{const r=se.select(e,t),s=t?b.select(e,t)?.readiness??{}:Z.select(e);return Ee.select(e,t).filter(i=>Jr(i.id,s[i.id]?.available,r[i.id]===!0)).map(i=>i.id)}),jn=n.createSelector((e,t)=>t?we.select(e,t):vt.select(e)),zn=n.createSelector((e,t)=>A.select(e,t)),Kn=n.createSelector((e,t)=>t?!!b.select(e,t):At.select(e)),Qn=n.createSelector((e,t)=>{if(!t)return kt.select(e);const r=b.select(e,t)?.settings??[],s=Me.select(e,t),i=r.find(l=>l.path==="model.providerDefaults")?.value,o=i&&typeof i=="object"?i[s]:void 0;if(typeof o=="string")return o;const c=r.find(l=>l.path==="model.default")?.value;return typeof c=="string"?c:""}),Xn=n.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning?[[r,s.warning]]:[])):yt.select(e)),Zn=n.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).map(([r,s])=>[r,s.stale===!0])):Et.select(e)),Yn=n.createSelector((e,t)=>t?Object.fromEntries(Object.entries(e.providerModels?.byWorkspaceId?.[t]??{}).flatMap(([r,s])=>s.warning&&s.warningKind?[[r,s.warningKind]]:[])):Mt.select(e)),Jn=n.createSelector((e,t,r)=>{if(!r)return wt.select(e,t);const s=se.select(e,r),i=b.select(e,r);return we.select(e,r).filter(o=>o!==t&&(s[o]||i?.catalog.providers.find(c=>c.id===o)?.canBeDisabled===!1)&&Rt(o,i?.readiness[o]?.authenticated))}),ea=n.createSelector((e,t)=>t?b.select(e,t)?.readiness??{}:Z.select(e)),ts={},ta=n.createSelector(e=>e.providerSettings?.profiles?.status??ts),ra=n.createSelector(e=>e.directoryPicker.listing),sa=n.createSelector(e=>e.directoryPicker.loading),ia=n.createSelector(e=>e.directoryPicker.error),na=n.createSelector(e=>e.directoryPicker.pathError),aa=n.createSelector(e=>e.directoryPicker.createError),le={},rs=n.createSelector((e,t)=>t?e.providerCatalog?.byWorkspaceId?.[t]?.mcpServers??[]:e.mcpSettings.servers),oa=n.createSelector((e,t,r)=>{const s=e.providerCatalog?.byWorkspaceId?.[t];return s?s.mcpServers?.find(i=>i.id===r)?.name:e.providerCatalog?.mcpServerNamesByWorkspaceId?.[t]?.[r]}),ca=n.createSelector(e=>e.mcpSettings.loading),la=n.createSelector(e=>e.mcpSettings.error),da=n.createSelector(e=>e.mcpSettings.mutationError??null),ua=n.createSelector(e=>e.mcpSettings.enabled),ss=n.createSelector(e=>e.mcpSettings.disabledServers),is=n.createSelector(e=>e.mcpSettings.statusMap),ns=n.createSelector(e=>e.mcpSettings.toolsMap),as=n.createSelector((e,t)=>{if(!t)return e.mcpSettings.errorMessages;const r=e.providerCatalog?.byWorkspaceId?.[t],s=new Map(r?.mcpServers?.map(i=>[i.id,R(i)])??[]);return Object.fromEntries((r?.mcpStatuses??[]).flatMap(i=>{const o=s.get(i.serverId);return o&&i.lastError?[[o,i.lastError]]:[]}))}),os=n.createSelector((e,t)=>t?e.mcpSettings.byWorkspaceId[t]?.disabledServers??le:le),pa=n.createSelector((e,t)=>Object.keys(os.select(e,t))),fa=n.createSelector(e=>{const t=rs.select(e),r=is.select(e),s=ns.select(e),i=ss.select(e),o=as.select(e);return t.map(c=>{const l=R(c)in i,p=s[R(c)]||[];let S=r[R(c)]||"disconnected";return l&&(S="disabled"),{...c,disabled:l,status:S,tools:p,toolCount:p.length,errorMessage:o[R(c)]}})});n.createSelector((e,t)=>e.mcpSettings.errorMessages[t]);const ga=n.createSelector(e=>e.mcpSettings.lastImportedCount),ha=n.createSelector(e=>e.mcpSettings.advancedSaveStatus),ma=n.createSelector(e=>e.mcpSettings.advancedSaveError);function g(e){return{category:"settings",...e}}const x=[{id:"new-workspace",tab:"",label:"New workspace",route:"/workspace/new",category:"navigation",description:"Create-workspace flow."},g({id:"utility-default-model",tab:"providers",hashAliases:["utility-default-model","default-model","quickActions.defaultModel","backgroundAgents.defaultModel"],scrollSelector:"#utility-default-model",highlightSelector:'[data-highlight-id="utility-default-model"]',label:"Settings: Default model",route:"/settings?tab=providers#utility-default-model",description:"Default AI behavior model selection."}),g({id:"global-instructions",tab:"agent-behavior",hashAliases:["global-instructions","agents","specialists","all-agents"],scrollSelector:"#global-instructions",highlightSelector:'[data-highlight-id="global-instructions"]',label:"Settings: Agent Behavior",route:"/settings?tab=agent-behavior#global-instructions",description:"Global agent instructions and defaults."}),g({id:"create-specialist",tab:"specialists",hashAliases:["create-specialist"],scrollSelector:"#create-specialist",highlightSelector:'[data-highlight-id="create-specialist"]',label:"Settings: Create specialist",route:"/settings?tab=specialists&view=create-specialist#create-specialist",description:"Create-specialist entry point."}),g({id:"providers",tab:"providers",hashAliases:["providers"],scrollSelector:"#providers",highlightSelector:'[data-highlight-id="providers"]',label:"Settings: AI coding CLIs",route:"/settings?tab=providers#providers",description:"Provider/account selector settings."}),g({id:"integrations",tab:"connections",hashAliases:["integrations"],scrollSelector:"#integrations",highlightSelector:'[data-highlight-id="integrations"]',label:"Settings: Connections",route:"/settings?tab=connections#integrations",description:"Connected integrations settings."}),g({id:"devices",tab:"devices",hashAliases:["devices","machines"],scrollSelector:"#devices",highlightSelector:"#devices",label:"Settings: Machines",route:"/settings?tab=devices#devices",description:"Saved remote machine settings."}),g({id:"mobile",tab:"mobile",hashAliases:["mobile"],scrollSelector:"#mobile",highlightSelector:'[data-highlight-id="mobile"]',label:"Settings: Mobile",route:"/settings?tab=mobile#mobile",description:"Remote access and Intent Mobile pairing."}),g({id:"guest-sessions",tab:"collaboration",hashAliases:["collaboration","guest-sessions","sharing"],scrollSelector:"#collaboration",highlightSelector:"#collaboration",label:"Settings: Collaboration",route:"/settings?tab=collaboration#collaboration",description:"Host membership, workspace guests and joined hosts."}),g({id:"websocket-api",tab:"mobile",hashAliases:["websocket-api","remote-access"],scrollSelector:"#websocket-api",highlightSelector:'[data-highlight-id="websocket-api"]',label:"Settings: Remote Access",route:"/settings?tab=mobile#websocket-api",description:"Remote access (WebSocket API) settings."}),...[["voice","Voice Dictation","Voice dictation settings.","input"],["keyboard-shortcuts","Keyboard Shortcuts","Keyboard shortcuts reference.","input"],["mcp-servers","MCP Servers","MCP server configuration.","connections"],["plugins","Plugins","App-wide Agent Plugins.","connections"],["git-workspace","Git & Workspace","Git and workspace defaults.","setup"],["git","Git","Git defaults.","setup"],["shell","Shell","Shell and CLI optimization settings.","setup"],["workspace","Workspace","Workspace defaults.","setup"],["cli-optimization","CLI Optimization","RTK/CLI optimization settings.","setup"],["workspace-api","Tool Output & Retention","Tool output size and retention settings.","advanced"],["notifications","Notifications","Notification preferences.","app-behavior"],["updates","Updates","Application update preferences.","app-behavior"],["open-in","Open In","External editor/app launch preferences.","app-behavior"],["github-link-action","GitHub Links","GitHub issue and pull request link behavior.","app-behavior"],["agent-features","Agent Features","Agent feature settings.","agent-behavior"],["font-style","Font style","Font style settings.","display"],["language","Language","Application language settings.","display"],["labs","Labs","Experimental feature switches.","advanced"],["agent-backend","Agent Backend","Agent backend settings.","advanced"],["connection","Connection","Daemon connection details.","advanced"],["hardware","Hardware","Hardware integration settings.","advanced"],["developer","Developer","Development-only settings.","advanced"]].map(([e,t,r,s])=>g({id:e,tab:s,hashAliases:[e],scrollSelector:`#${e}`,highlightSelector:`[data-highlight-id="${e}"]`,label:`Settings: ${t}`,route:`/settings?tab=${s}#${e}`,description:r})),g({id:"appearance",tab:"display",hashAliases:["appearance","theme"],scrollSelector:"#theme",highlightSelector:'[data-highlight-id="appearance"]',label:"Settings: Appearance",route:"/settings?tab=display#theme",description:"Theme mode controls."}),...[["color-theme","Color theme","Color theme selection."],["note-font","Notes font","Notes/spec font style."],["agent-chat-font","Agent chat font","Agent chat font style."],["code-font","Code font","Code editor and diff font."]].map(([e,t,r])=>g({id:e,tab:"display",hashAliases:[e],scrollSelector:`#${e}`,highlightSelector:`[data-highlight-id="${e}"]`,label:`Settings: ${t}`,route:`/settings?tab=display#${e}`,description:r})),g({id:"general",tab:"advanced",hashAliases:["general","reset"],scrollSelector:"#reset",highlightSelector:'[data-highlight-id="general"]',label:"Settings: Advanced",route:"/settings?tab=advanced#reset",description:"Advanced settings and reset controls."}),{id:"workspace-card",tab:"",hashAliases:["workspace-card"],highlightSelector:'[data-highlight-id^="workspace-"]',label:"Workspace card",category:"workspace",description:"A workspace card on workspace list surfaces.",dynamic:!0,idPattern:"workspace-{workspaceId}"},{id:"specialist-entry",tab:"specialists",highlightSelector:'[data-highlight-id^="specialist-"]',label:"Specialist entry",route:"/settings?tab=specialists&specialist={specialistId}#specialist-{specialistId}",category:"specialist",description:"A specific specialist row in settings.",dynamic:!0,idPattern:"specialist-{specialistId}"}];function Re(e){const t=e.indexOf("#"),r=t>=0?e.slice(t+1):e;return decodeURIComponent(r.replace(/^#/,"")).trim()}function cs(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ls(e,t){if(!t.match(/\{[^}]+\}/g)?.length)return e===t;const s=t.split(/\{[^}]+\}/g).map(cs).join("[^/]+");return new RegExp(`^${s}$`).test(e)}function ds(e){const t=Re(e);if(!t)return;const r=x.find(i=>i.id===t||i.hashAliases?.includes(t));if(r)return r;const s=x.find(i=>i.route&&i.dynamic&&i.idPattern&&ls(t,i.idPattern));return s?{...s,id:t}:void 0}function ba(){return x.map(e=>({...e,hashAliases:e.hashAliases?[...e.hashAliases]:void 0}))}function us(e){try{return new URL(e,"app://intent").pathname||"/"}catch{const t=e.indexOf("?"),r=e.indexOf("#");let s=e.length;return t>=0&&(s=Math.min(s,t)),r>=0&&(s=Math.min(s,r)),e.slice(0,s)||"/"}}const ps=new Set(x.flatMap(e=>e.route?[us(e.route)]:[])),fs=[/^\/workspace\/[^/]+$/,/^\/agent\/[^/]+$/];function Sa(e){if(typeof e!="string")return!1;const t=e.trim();if(!t)return!1;if(t.startsWith("intent://"))return!0;let r,s;try{const i=new URL(t,"app://intent");if(i.protocol!=="app:")return!1;r=i.pathname||"/",s=Re(i.hash)}catch{return!1}return ps.has(r)?s?!!ds(s):!0:fs.some(i=>i.test(r))}const _a=["agentFeatures.backgroundHooks","agentFeatures.hostExec","agentFeatures.scripts","agentFeatures.terminalAccess","agentFeatures.browserAutomation","agentFeatures.desktopControl","agentFeatures.richChatBlocks","agentFeatures.structuredQuestions","agentFeatures.secretRequests","agentFeatures.attentionRequests","agentFeatures.stateSnapshot","agentFeatures.prMonitor","agentFeatures.taskGraph","agentFeatures.peerAgents","agentFeatures.mcpTools"],gs=[{path:"agentFeatures.backgroundHooks",label:()=>a.settings_agentFeatures_backgroundHooks_label(),description:()=>a.settings_agentFeatures_backgroundHooks_description(),defaultValue:!0},{path:"agentFeatures.hostExec",label:()=>a.settings_agentFeatures_hostExec_label(),description:()=>a.settings_agentFeatures_hostExec_description(),defaultValue:!0},{path:"agentFeatures.scripts",label:()=>a.settings_agentFeatures_scripts_label(),description:()=>a.settings_agentFeatures_scripts_description(),defaultValue:!0},{path:"agentFeatures.terminalAccess",label:()=>a.settings_agentFeatures_terminalAccess_label(),description:()=>a.settings_agentFeatures_terminalAccess_description(),defaultValue:!0},{path:"agentFeatures.browserAutomation",label:()=>a.settings_agentFeatures_browserAutomation_label(),description:()=>a.settings_agentFeatures_browserAutomation_description(),defaultValue:!0},{path:"agentFeatures.desktopControl",label:()=>a.settings_agentFeatures_desktopControl_label(),description:()=>a.settings_agentFeatures_desktopControl_description(),defaultValue:!0},{path:"agentFeatures.richChatBlocks",label:()=>a.settings_agentFeatures_richChatBlocks_label(),description:()=>a.settings_agentFeatures_richChatBlocks_description(),defaultValue:!0},{path:"agentFeatures.structuredQuestions",label:()=>a.settings_agentFeatures_structuredQuestions_label(),description:()=>a.settings_agentFeatures_structuredQuestions_description(),defaultValue:!0},{path:"agentFeatures.secretRequests",label:()=>a.settings_agentFeatures_secretRequests_label(),description:()=>a.settings_agentFeatures_secretRequests_description(),defaultValue:!1},{path:"agentFeatures.attentionRequests",label:()=>a.settings_agentFeatures_attentionRequests_label(),description:()=>a.settings_agentFeatures_attentionRequests_description(),defaultValue:!0},{path:"agentFeatures.stateSnapshot",label:()=>a.settings_agentFeatures_stateSnapshot_label(),description:()=>a.settings_agentFeatures_stateSnapshot_description(),defaultValue:!0},{path:"agentFeatures.prMonitor",label:()=>a.settings_agentFeatures_prMonitor_label(),description:()=>a.settings_agentFeatures_prMonitor_description(),defaultValue:!0},{path:"agentFeatures.taskGraph",label:()=>a.settings_agentFeatures_taskGraph_label(),description:()=>a.settings_agentFeatures_taskGraph_description(),defaultValue:!0},{path:"agentFeatures.peerAgents",label:()=>a.settings_agentFeatures_peerAgents_label(),description:()=>a.settings_agentFeatures_peerAgents_description(),defaultValue:!0},{path:"agentFeatures.mcpTools",label:()=>a.settings_agentFeatures_mcpTools_label(),description:()=>a.settings_agentFeatures_mcpTools_description(),defaultValue:!0}],va=Object.fromEntries(gs.map(e=>[e.path,e.defaultValue]));export{sr as $,zs as A,wn as B,Rn as C,$s as D,Ot as E,gs as F,pe as G,Oi as H,Mr as I,Jr as J,En as K,xn as L,ne as M,Sa as N,yn as O,Rr as P,ki as Q,Fi as R,E as S,I as T,k as U,Zr as V,pr as W,_i as X,Ar as Y,Ai as Z,Si as _,va as a,Ds as a$,Bn as a0,Nn as a1,wi as a2,wr as a3,ds as a4,ur as a5,Zi as a6,Sn as a7,Vn as a8,Yr as a9,na as aA,On as aB,ci as aC,gi as aD,ni as aE,ji as aF,bn as aG,Vi as aH,ai as aI,oi as aJ,Qs as aK,Ys as aL,Y as aM,Lt as aN,Vt as aO,Ut as aP,fe as aQ,Bt as aR,Dt as aS,Ft as aT,Nt as aU,Wt as aV,Ns as aW,Vs as aX,Us as aY,Hs as aZ,Fs as a_,Un as aa,Ks as ab,Js as ac,hr as ad,jn as ae,Me as af,se as ag,$n as ah,we as ai,Ee as aj,Zn as ak,Yn as al,Xn as am,Jn as an,ea as ao,Kn as ap,Qn as aq,zn as ar,mr as as,Zs as at,Hi as au,ti as av,aa as aw,ia as ax,ra as ay,sa as az,_a as b,cn as b$,Bs as b0,xs as b1,Ws as b2,Ls as b3,Gs as b4,Os as b5,qs as b6,ui as b7,Qr as b8,$i as b9,Ui as bA,Bi as bB,Wi as bC,re as bD,gr as bE,te as bF,Gi as bG,Di as bH,Gn as bI,jt as bJ,mi as bK,bi as bL,fi as bM,hi as bN,ii as bO,pi as bP,A as bQ,ei as bR,zi as bS,qi as bT,Sr as bU,ve as bV,Xs as bW,hn as bX,an as bY,fn as bZ,gn as b_,Kr as ba,Dn as bb,Fn as bc,li as bd,di as be,Ln as bf,Ni as bg,ce as bh,xi as bi,_e as bj,ma as bk,ha as bl,ss as bm,ua as bn,la as bo,as as bp,ga as bq,ca as br,da as bs,rs as bt,fa as bu,is as bv,ns as bw,Tn as bx,si as by,ta as bz,m as c,un as c0,dn as c1,on as c2,nn as c3,sn as c4,mn as c5,rn as c6,ln as c7,pn as c8,b as c9,es as ca,qn as cb,Hn as cc,pa as cd,oa as ce,_n as cf,An as cg,In as ch,Ii as ci,J as cj,N as ck,Ti as cl,Ur as cm,Li as cn,Cn as co,Yi as cp,Xi as cq,Ji as cr,Qi as cs,jr as ct,Ki as cu,Pi as d,Mi as e,Ri as f,Ci as g,yi as h,he as i,Ei as j,be as k,Wn as l,Pn as m,Cr as n,Or as o,vn as p,kn as q,ri as r,$t as s,qt as t,vi as u,Mn as v,ba as w,en as x,tn as y,js as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as a,aW as o}from"./
|
|
1
|
+
import{b as a,aW as o}from"./D2P0fD42.js";var g=a((t,e)=>{let n;return e==="sandbox"&&(n=o("#i"+t)),(e==="sandbox"?o(n.nodes()[0].contentDocument.body):o("body")).select(`[id="${t}"]`)},"getDiagramElement");export{g};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as He,bo as v,bm as d,bw as je,b as Ze,br as or,bs as _t,bq as Ur}from"./BkULGdgB.js";import{bs as Xe,ay as X,be as ut,b$ as nt,b_ as q,bO as J,W as y,bS as m,aD as e,a7 as ht,bl as xe,bn as Je,c9 as c,aA as p,aB as re,ca as Le,c0 as pt,bH as s,a5 as oe,bA as ne,bV as W,br as Ct,bk as Ar,bj as Br,bf as Lo,bo as Nr,c5 as kt,aw as Jt,bz as Fo,cd as qt}from"./DYhIMPy1.js";import{i as be}from"./CVqc5kFv.js";import{c as Q}from"./dqNuna_B.js";import{g as yr,i as Ro,I as So,e as It}from"./jKsiRjTE.js";import{f as Lt,s as Me,g as To}from"./BkQ2g3_N.js";import{b as wt}from"./BaIAhI85.js";import{d as xr}from"./
|
|
1
|
+
import{t as He,bo as v,bm as d,bw as je,b as Ze,br as or,bs as _t,bq as Ur}from"./BkULGdgB.js";import{bs as Xe,ay as X,be as ut,b$ as nt,b_ as q,bO as J,W as y,bS as m,aD as e,a7 as ht,bl as xe,bn as Je,c9 as c,aA as p,aB as re,ca as Le,c0 as pt,bH as s,a5 as oe,bA as ne,bV as W,br as Ct,bk as Ar,bj as Br,bf as Lo,bo as Nr,c5 as kt,aw as Jt,bz as Fo,cd as qt}from"./DYhIMPy1.js";import{i as be}from"./CVqc5kFv.js";import{c as Q}from"./dqNuna_B.js";import{g as yr,i as Ro,I as So,e as It}from"./jKsiRjTE.js";import{f as Lt,s as Me,g as To}from"./BkQ2g3_N.js";import{b as wt}from"./BaIAhI85.js";import{d as xr}from"./CV16Bucz.js";import{k as $o}from"./Cx2QERlx.js";import{c as nr}from"./ChTqQfQN.js";import{a as Uo}from"./CC7to1B5.js";import{f as Be}from"./DbyXkQ-A.js";import{F as Ao}from"./CjRRnXFa.js";import{k as st}from"./8KpVpm2n.js";import{s as Bo}from"./DdvXzOsp.js";import{cl as Or,F as _e,a5 as No,aW as Oo,ao as Mo,cG as Do,aJ as Ko,aX as Yt,Z as ar,$ as ir,a_ as Mr,at as Wo,az as Dr,cP as Vo,ce as Kr,bP as Wr,cj as zo}from"./DcwBt__E.js";import"./DEAMVhLT.js";import{IH as Pe,fO as Go,bu as qo,zr as Ho,yK as jo,KG as Cr,dL as Zo,bO as Xo,KF as Jo,us as Yo,KD as kr,gu as Qo,tP as en,KE as tn,Kj as Ir,KC as Er}from"./DZwGQbE8.js";import"./zqSn-6Mx.js";import{R as rn,k as Ht,l as dt,j as on,i as qe,p as Vr,h as zr,K as nn,m as an,o as sn,n as ln,M as Gr,d as dn}from"./ByONXdFP.js";import{a as qr,B as Et}from"./BvFAWM27.js";import{cu as un}from"./DnD4hxy7.js";import{ae as cn,G as fn}from"./BnnkDYnu.js";import{w as gn,K as vn}from"./qUWUBPqP.js";import{I as $t}from"./ClwnVDeP.js";import{d as pn}from"./DdafiALh.js";import{G as wn,I as bn}from"./BGikh8Vc.js";import{ac as mn}from"./BMyQIDAo.js";import{i as Qt}from"./CJ5wd9GV.js";import{i as _n,a as hn}from"./B8bo_smg.js";import{B as yn,s as xn,l as Cn,m as kn}from"./Dcvn1tie.js";import"./B491IXH3.js";import{t as Ke}from"./B7H9m8-p.js";import{M as Hr}from"./C9gg-9EN.js";import"./BhaFA6n_.js";import"./BTOuGvfD.js";import{b as In}from"./DyRs4I5x.js";import"./Dewa-xFN.js";import{o as Pr,s as lt,n as St}from"./CIyUrgF0.js";import{g as En}from"./DfN8_dcw.js";import{f as Pn}from"./DPirTM_u.js";import{ay as Ln,$ as Fn}from"./DQMWee-l.js";import{aO as Rn}from"./D4U_w4GT.js";function Sn(o,r){return o.loadURL(r)}function Tn(o){return{previousUrlProp:o||null}}function Lr(o,r){o.previousUrlProp=r}function $n(o,r,i){const b=i||r;return o.previousUrlProp===b?null:(o.previousUrlProp=b,b)}function Un(o,r,i){return r?o.previousUrlProp===null?(o.previousUrlProp=r,{shouldLoad:!1,targetUrl:null}):r===o.previousUrlProp?{shouldLoad:!1,targetUrl:null}:i.webviewReady?(o.previousUrlProp=r,i.isValidBrowserUrl(r)?{shouldLoad:!0,targetUrl:r}:{shouldLoad:!1,targetUrl:null}):{shouldLoad:!1,targetUrl:null}:{shouldLoad:!1,targetUrl:null}}const jr=nr("TabBoundsReporter"),An=150;function jt(o,r,i){!(r>0)||!(i>0)||window.electronAPI?.invoke("browser:report-tab-bounds",{tabId:o,width:r,height:i}).catch(b=>{jr.debug("Failed to report tab bounds",{tabId:o,error:b})})}function Fr(o){window.electronAPI?.invoke("browser:report-tab-bounds",{tabId:o}).catch(r=>{jr.debug("Failed to clear tab bounds",{tabId:o,error:r})})}function Bn(o,r){let i=r,b;const x=typeof ResizeObserver>"u"?void 0:new ResizeObserver(C=>{if(!i)return;const h=C[C.length-1]?.contentRect;if(!h)return;const N=i;clearTimeout(b),b=setTimeout(()=>{jt(N,h.width,h.height)},An)});if(x?.observe(o),i){const C=o.getBoundingClientRect();jt(i,C.width,C.height)}return{update(C){if(C!==i&&(clearTimeout(b),i&&Fr(i),i=C,i)){const h=o.getBoundingClientRect();jt(i,h.width,h.height)}},destroy(){clearTimeout(b),x?.disconnect(),i&&Fr(i)}}}function Zr(o){let r=o.trim();if(!r)return null;/^[a-z][a-z0-9+.-]*:\/\//i.test(r)||(r=(r.includes("localhost")||r.includes("127.0.0.1")||r.includes("0.0.0.0")?"http://":"https://")+r);try{return new URL(r),r}catch{return null}}function ot(o,r=typeof window<"u"?window.location.origin:""){return o==="about:blank"||Xr(o,r)}function Xr(o,r=typeof window<"u"?window.location.origin:""){if(!o)return!1;try{const i=new URL(o);return qr.NAVIGATION_ALLOWED.includes(i.protocol)&&i.origin!==r}catch{return!1}}const er="__INTENT_PANEL_BRACKET__:",Nn=`
|
|
2
2
|
(function() {
|
|
3
3
|
if (window.__augmentKeyboardInterceptorInstalled) return;
|
|
4
4
|
window.__augmentKeyboardInterceptorInstalled = true;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{b as e,ay as s,aX as o,B as i}from"./
|
|
1
|
+
import{b as e,ay as s,aX as o,B as i}from"./D2P0fD42.js";import{p as g}from"./BGC1OvbZ.js";var p={parse:e(async r=>{const a=await g("info",r);s.debug(a)},"parse")},v={version:"12.3.0"},d=e(()=>v.version,"getVersion"),m={getVersion:d},c=e((r,a,n)=>{s.debug(`rendering info diagram
|
|
2
2
|
`+r);const t=o(a);i(t,100,400,!0),t.append("g").append("text").attr("x",100).attr("y",40).attr("class","version").attr("font-size",32).style("text-anchor","middle").text(`v${n}`)},"draw"),f={draw:c},b={parser:p,db:m,renderer:f};export{b as diagram};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
var vo=Object.defineProperty;var bo=(e,t,i)=>t in e?vo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var v=(e,t,i)=>bo(e,typeof t!="symbol"?t+"":t,i);import{t as ir,bo as M,bw as nr,b as rr,bs as dn,bq as So,bm as $e}from"./BkULGdgB.js";import{bs as or,a5 as De,ay as hn,bS as Xe,aD as C,bA as ke,b_ as Me,bO as rt,W as le,bl as Xt,be as Hi,bn as sr,c9 as ne,aA as I,b$ as ar,aB as ge,ai as yo,bV as Te,br as Co,ca as je,bH as Y,c5 as dt,bk as xo,bj as Lo,aj as wo,c0 as fn}from"./DYhIMPy1.js";import{i as we}from"./CVqc5kFv.js";import{f as un,g as pi,s as cn}from"./BkQ2g3_N.js";import{b as ko}from"./p7znhYIU.js";import{b as pn}from"./BaIAhI85.js";import{h as Eo,c as Ye,w as lr,N as O,O as Jt,b2 as Qe,a as dr,j as hr,P as Je,H as fr,i as ur,ab as cr,U as Ro,f as Ao,e as pr,T as Ho,g as To,S as Do,a4 as Ze,a3 as Ve,C as Mo,G as gr,F as Io,I as Fo,A as At,ah as No,$ as Ht,ad as Tt,v as St,a1 as Ti,s as J,r as Ue,an as wt,D as Po,d as zo,aa as mr,b as gn,u as mn,aI as Uo,ap as ct,ac as _o,K as Le,M as Ut,L as Oo,a0 as Dt,E as Bo,al as vr,a6 as Vo,a2 as vn,t as br,af as ft,a5 as kt,ae as ot,ag as Sr,B as gi,a9 as mi,k as Wo,aH as bn}from"./
|
|
1
|
+
var vo=Object.defineProperty;var bo=(e,t,i)=>t in e?vo(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var v=(e,t,i)=>bo(e,typeof t!="symbol"?t+"":t,i);import{t as ir,bo as M,bw as nr,b as rr,bs as dn,bq as So,bm as $e}from"./BkULGdgB.js";import{bs as or,a5 as De,ay as hn,bS as Xe,aD as C,bA as ke,b_ as Me,bO as rt,W as le,bl as Xt,be as Hi,bn as sr,c9 as ne,aA as I,b$ as ar,aB as ge,ai as yo,bV as Te,br as Co,ca as je,bH as Y,c5 as dt,bk as xo,bj as Lo,aj as wo,c0 as fn}from"./DYhIMPy1.js";import{i as we}from"./CVqc5kFv.js";import{f as un,g as pi,s as cn}from"./BkQ2g3_N.js";import{b as ko}from"./p7znhYIU.js";import{b as pn}from"./BaIAhI85.js";import{h as Eo,c as Ye,w as lr,N as O,O as Jt,b2 as Qe,a as dr,j as hr,P as Je,H as fr,i as ur,ab as cr,U as Ro,f as Ao,e as pr,T as Ho,g as To,S as Do,a4 as Ze,a3 as Ve,C as Mo,G as gr,F as Io,I as Fo,A as At,ah as No,$ as Ht,ad as Tt,v as St,a1 as Ti,s as J,r as Ue,an as wt,D as Po,d as zo,aa as mr,b as gn,u as mn,aI as Uo,ap as ct,ac as _o,K as Le,M as Ut,L as Oo,a0 as Dt,E as Bo,al as vr,a6 as Vo,a2 as vn,t as br,af as ft,a5 as kt,ae as ot,ag as Sr,B as gi,a9 as mi,k as Wo,aH as bn}from"./C5zadSpA.js";import{g as Go,i as $o}from"./jKsiRjTE.js";import{F as vi,c5 as jo,bf as qo,au as Ko,at as Xo}from"./DcwBt__E.js";import{f as Di}from"./DbyXkQ-A.js";import"./CjRRnXFa.js";import{g as Yo}from"./BN5JMxvy.js";import{c as Qo}from"./DEAMVhLT.js";import{P as Jo}from"./BMyQIDAo.js";import{t as Sn}from"./B7H9m8-p.js";class Zo extends Eo{constructor(){super(...arguments),this.tokenize=ts}equals(t,i,n){return n.ignoreWhitespace?((!n.newlineIsToken||!t.includes(`
|
|
2
2
|
`))&&(t=t.trim()),(!n.newlineIsToken||!i.includes(`
|
|
3
3
|
`))&&(i=i.trim())):n.ignoreNewlineAtEof&&!n.newlineIsToken&&(t.endsWith(`
|
|
4
4
|
`)&&(t=t.slice(0,-1)),i.endsWith(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as O,bo as m,bw as R,b as T,bm as y}from"./BkULGdgB.js";import{bs as U,a7 as Y,ay as q,W as s,bn as J,aA as v,be as p,b$ as f,b_ as u,bO as d,a5 as P,bA as S,bS as Q,aD as V,aB as L,c9 as X,aG as Z,bI as tt}from"./DYhIMPy1.js";import{i as C}from"./CVqc5kFv.js";import{E as z}from"./ByONXdFP.js";import"./BkQ2g3_N.js";import"./zqSn-6Mx.js";import"./CjRRnXFa.js";import{f as A}from"./DbyXkQ-A.js";import{F as et,a0 as at,bM as ot}from"./DcwBt__E.js";import"./DdvXzOsp.js";import{I as st}from"./jKsiRjTE.js";import{i as nt,b as rt}from"./
|
|
1
|
+
import{t as O,bo as m,bw as R,b as T,bm as y}from"./BkULGdgB.js";import{bs as U,a7 as Y,ay as q,W as s,bn as J,aA as v,be as p,b$ as f,b_ as u,bO as d,a5 as P,bA as S,bS as Q,aD as V,aB as L,c9 as X,aG as Z,bI as tt}from"./DYhIMPy1.js";import{i as C}from"./CVqc5kFv.js";import{E as z}from"./ByONXdFP.js";import"./BkQ2g3_N.js";import"./zqSn-6Mx.js";import"./CjRRnXFa.js";import{f as A}from"./DbyXkQ-A.js";import{F as et,a0 as at,bM as ot}from"./DcwBt__E.js";import"./DdvXzOsp.js";import{I as st}from"./jKsiRjTE.js";import{i as nt,b as rt}from"./DcGNquRL.js";var it=L('<span aria-hidden="true"><!></span>'),lt=L('<div class="flex flex-wrap justify-center gap-2"><!> <!></div>');function ct(g,n){if(new.target)return O({component:ct,...g});U(n,!0);let o=m(n,"view",7),b=m(n,"canMove",7,!1),w=m(n,"waiting",7,!1),h=m(n,"onWait",7),x=m(n,"onMove",7);var I={get view(){return o()},set view(t){o(t),v()},get canMove(){return b()},set canMove(t=!1){b(t),v()},get waiting(){return w()},set waiting(t=!1){w(t),v()},get onWait(){return h()},set onWait(t){h(t),v()},get onMove(){return x()},set onMove(t){x(t),v()},$set:R,$on:(t,k)=>T(n,t,k)},H=Y(),$=q(H);{var B=t=>{z(t,{class:"h-full min-h-0",density:"compact","data-workspace-home-panel-notice":"starting",icon:_=>{var r=it(),e=P(r);st(e,{size:16}),S(r),s(_,r)},title:_=>{p();var r=f();u(e=>d(r,e),[()=>y.workspaceHome_starting_label()]),s(_,r)},$$slots:{icon:!0,title:!0}})},F=t=>{z(t,{class:"h-full",get"data-workspace-home-panel-notice"(){return o().state},icon:e=>{{let a=X(()=>o().state==="moving"?at:ot);et(e,{get icon(){return V(a)},class:"size-5"})}},title:e=>{p();var a=f();u(l=>d(a,l),[()=>rt(o().state==="moving"?"moving":"detached")]),s(e,a)},description:e=>{p();var a=f();u(l=>d(a,l),[()=>nt(o())]),s(e,a)},actions:e=>{var a=lt(),l=P(a);{var D=i=>{A(i,{variant:"outline",size:"sm",get disabled(){return w()},onclick:()=>h()?.(),children:(M,N)=>{p();var c=f();u(W=>d(c,W),[()=>y.workspaceHome_wait_label()]),s(M,c)},$$slots:{default:!0}})};C(l,i=>{o().canWait&&i(D)})}var G=Q(l,2);{var K=i=>{A(i,{variant:"outline",size:"sm",onclick:()=>x()?.(),children:(M,N)=>{p();var c=f();u(W=>d(c,W),[()=>y.workspaceHome_move_label()]),s(M,c)},$$slots:{default:!0}})};C(G,i=>{b()&&i(K)})}S(a),s(e,a)},$$slots:{icon:!0,title:!0,description:!0,actions:!0}})};C($,t=>{o().starting?t(B):t(F,-1)})}return s(g,H),J(I)}const E=Symbol("workspace-home-panel");function kt(g){tt(E,g)}function Mt(){return Z(E)}export{ct as W,Mt as g,kt as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as o,X as ot,aH as ut,aX as dt,i as yt,r as ft,z as pt,b0 as it,V as gt,a_ as kt,U as mt,aZ as wt,Y as _t,B as bt}from"./
|
|
1
|
+
import{b as o,X as ot,aH as ut,aX as dt,i as yt,r as ft,z as pt,b0 as it,V as gt,a_ as kt,U as mt,aZ as wt,Y as _t,B as bt}from"./D2P0fD42.js";var J=(function(){var e=o(function(T,t,s,i){for(s=s||{},i=T.length;i--;s[T[i]]=t);return s},"o"),h=[1,4],r=[1,14],a=[1,12],l=[1,13],y=[6,7,8],f=[1,20],d=[1,18],m=[1,19],u=[6,7,11],k=[1,6,13,14],g=[1,23],_=[1,24],x=[1,6,7,11,13,14],D={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ishikawa:4,spaceLines:5,SPACELINE:6,NL:7,ISHIKAWA:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,TEXT:14,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"ISHIKAWA",11:"EOF",13:"SPACELIST",14:"TEXT"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,1],[12,1],[12,1]],performAction:o(function(t,s,i,c,p,n,v){var w=n.length-1;switch(p){case 6:case 7:return c;case 15:c.addNode(n[w-1].length,n[w].trim());break;case 16:c.addNode(0,n[w].trim());break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:r,7:[1,10],9:9,12:11,13:a,14:l},e(y,[2,3]),{1:[2,2]},e(y,[2,4]),e(y,[2,5]),{1:[2,6],6:r,12:15,13:a,14:l},{6:r,9:16,12:11,13:a,14:l},{6:f,7:d,10:17,11:m},e(u,[2,18],{14:[1,21]}),e(u,[2,16]),e(u,[2,17]),{6:f,7:d,10:22,11:m},{1:[2,7],6:r,12:15,13:a,14:l},e(k,[2,14],{7:g,11:_}),e(x,[2,8]),e(x,[2,9]),e(x,[2,10]),e(u,[2,15]),e(k,[2,13],{7:g,11:_}),e(x,[2,11]),e(x,[2,12])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(t,s){if(s.recoverable)this.trace(t);else{var i=new Error(t);throw i.hash=s,i}},"parseError"),parse:o(function(t){var s=this,i=[0],c=[],p=[null],n=[],v=this.table,w="",I=0,$=0,L=2,A=1,V=n.slice.call(arguments,1),b=Object.create(this.lexer),S={yy:{}};for(var B in this.yy)Object.prototype.hasOwnProperty.call(this.yy,B)&&(S.yy[B]=this.yy[B]);b.setInput(t,S.yy),S.yy.lexer=b,S.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var R=b.yylloc;n.push(R);var U=b.options&&b.options.ranges;typeof S.yy.parseError=="function"?this.parseError=S.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Y(P){i.length=i.length-2*P,p.length=p.length-P,n.length=n.length-P}o(Y,"popStack");function tt(){var P;return P=c.pop()||b.lex()||A,typeof P!="number"&&(P instanceof Array&&(c=P,P=c.pop()),P=s.symbols_[P]||P),P}o(tt,"lex");for(var M,W,N,K,z={},G,C,et,X;;){if(W=i[i.length-1],this.defaultActions[W]?N=this.defaultActions[W]:((M===null||typeof M>"u")&&(M=tt()),N=v[W]&&v[W][M]),typeof N>"u"||!N.length||!N[0]){var q="";X=[];for(G in v[W])this.terminals_[G]&&G>L&&X.push("'"+this.terminals_[G]+"'");b.showPosition?q="Parse error on line "+(I+1)+`:
|
|
2
2
|
`+b.showPosition()+`
|
|
3
3
|
Expecting `+X.join(", ")+", got '"+(this.terminals_[M]||M)+"'":q="Parse error on line "+(I+1)+": Unexpected "+(M==A?"end of input":"'"+(this.terminals_[M]||M)+"'"),this.parseError(q,{text:b.match,token:this.terminals_[M]||M,line:b.yylineno,loc:R,expected:X})}if(N[0]instanceof Array&&N.length>1)throw new Error("Parse Error: multiple actions possible at state: "+W+", token: "+M);switch(N[0]){case 1:i.push(M),p.push(b.yytext),n.push(b.yylloc),i.push(N[1]),M=null,$=b.yyleng,w=b.yytext,I=b.yylineno,R=b.yylloc;break;case 2:if(C=this.productions_[N[1]][1],z.$=p[p.length-C],z._$={first_line:n[n.length-(C||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(C||1)].first_column,last_column:n[n.length-1].last_column},U&&(z._$.range=[n[n.length-(C||1)].range[0],n[n.length-1].range[1]]),K=this.performAction.apply(z,[w,$,I,S.yy,N[1],p,n].concat(V)),typeof K<"u")return K;C&&(i=i.slice(0,-1*C*2),p=p.slice(0,-1*C),n=n.slice(0,-1*C)),i.push(this.productions_[N[1]][0]),p.push(z.$),n.push(z._$),et=v[i[i.length-2]][i[i.length-1]],i.push(et);break;case 3:return!0}}return!0},"parse")},O=(function(){var T={EOF:1,parseError:o(function(s,i){if(this.yy.parser)this.yy.parser.parseError(s,i);else throw new Error(s)},"parseError"),setInput:o(function(t,s){return this.yy=s||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var s=t.match(/(?:\r\n?|\n).*/g);return s?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},"input"),unput:o(function(t){var s=t.length,i=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-s),this.offset-=s;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),i.length-1&&(this.yylineno-=i.length-1);var p=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:i?(i.length===c.length?this.yylloc.first_column:0)+c[c.length-i.length].length-i[0].length:this.yylloc.first_column-s},this.options.ranges&&(this.yylloc.range=[p[0],p[0]+this.yyleng-s]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(t){this.unput(this.match.slice(t))},"less"),pastInput:o(function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var t=this.pastInput(),s=new Array(t.length+1).join("-");return t+this.upcomingInput()+`
|