@intent-hq/web 2.342.1 → 2.342.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/web/app/immutable/chunks/{DEyE92PJ.js → -ccfrtH7.js} +2 -2
- package/web/app/immutable/chunks/{CJDdIkUD.js → 13n0hWYJ.js} +1 -1
- package/web/app/immutable/chunks/{BE2e7JDe.js → 16ZnmKwk.js} +4 -4
- package/web/app/immutable/chunks/{DoBxwPW8.js → 1qEFdFvy.js} +12 -12
- package/web/app/immutable/chunks/{IUYHwj-Q.js → 8JbYrP_-.js} +1 -1
- package/web/app/immutable/chunks/{Cc3t1-St.js → A3j68Jpj.js} +1 -1
- package/web/app/immutable/chunks/{BAeRDdCp.js → B-YLcmrj.js} +1 -1
- package/web/app/immutable/chunks/{wkk-WhNm.js → B0LTdoMZ.js} +1 -1
- package/web/app/immutable/chunks/{B2YL0V12.js → B2_9lYPy.js} +2 -2
- package/web/app/immutable/chunks/{D2MxkB-j.js → B3Vpc0UD.js} +1 -1
- package/web/app/immutable/chunks/{DiJfTLSL.js → B469zf_w.js} +1 -1
- package/web/app/immutable/chunks/{DryTclNg.js → B4qrSEpy.js} +1 -1
- package/web/app/immutable/chunks/{DzM_rrom.js → B8qGzL8i.js} +1 -1
- package/web/app/immutable/chunks/{BIKajrVX.js → B984L3ei.js} +1 -1
- package/web/app/immutable/chunks/{C3Gh2blV.js → BADTNT-R.js} +1 -1
- package/web/app/immutable/chunks/{DqpwsXVv.js → BBLI7gZr.js} +1 -1
- package/web/app/immutable/chunks/{EUuCRgBG.js → BFkh8x47.js} +2 -2
- package/web/app/immutable/chunks/{BT9dxP4b.js → BFu7QfPc.js} +1 -1
- package/web/app/immutable/chunks/{sxD3pQ34.js → BNReA8Eg.js} +1 -1
- package/web/app/immutable/chunks/{SB0oeZZm.js → BPHUIiiV.js} +1 -1
- package/web/app/immutable/chunks/{CWkugLNW.js → BR_savCB.js} +1 -1
- package/web/app/immutable/chunks/{D4zAmJHw.js → Bbozl6mM.js} +3 -3
- package/web/app/immutable/chunks/{Cy6EJnAj.js → BdvKyyQ7.js} +1 -1
- package/web/app/immutable/chunks/{DiCe745f.js → BeYtcsu8.js} +1 -1
- package/web/app/immutable/chunks/{D0JTb-x1.js → BehoboVr.js} +1 -1
- package/web/app/immutable/chunks/{BMcTRN7B.js → BgDzDopc.js} +1 -1
- package/web/app/immutable/chunks/{ClkoN0_7.js → BkLgWHWF.js} +1 -1
- package/web/app/immutable/chunks/{z4kq6KWc.js → Bm4gN2Zb.js} +1 -1
- package/web/app/immutable/chunks/{DZGJMqUt.js → BmjPIH38.js} +1 -1
- package/web/app/immutable/chunks/{MdBXkHgJ.js → BmpDuIkF.js} +1 -1
- package/web/app/immutable/chunks/{DzKmanpI.js → BoHY5gYD.js} +2 -2
- package/web/app/immutable/chunks/{sLhSSNGJ.js → Bq6eGKPr.js} +1 -1
- package/web/app/immutable/chunks/{ChGUMi8s.js → Bsu5oWdj.js} +4 -4
- package/web/app/immutable/chunks/{nwJTcqVj.js → BuRfMW9U.js} +1 -1
- package/web/app/immutable/chunks/{CdFUlmVm.js → BugMDWpY.js} +1 -1
- package/web/app/immutable/chunks/{DVtimWsJ.js → C0U5HDdc.js} +1 -1
- package/web/app/immutable/chunks/{Ceet7yGK.js → C0g7Eqbd.js} +1 -1
- package/web/app/immutable/chunks/{Cmktqw1t.js → C2vLXngQ.js} +1 -1
- package/web/app/immutable/chunks/{Bxc9qqDR.js → C451wdH8.js} +1 -1
- package/web/app/immutable/chunks/{D4JPXZyy.js → C9Tn2aWq.js} +1 -1
- package/web/app/immutable/chunks/{BSjdkOXN.js → CCA-a5JP.js} +1 -1
- package/web/app/immutable/chunks/{DN4HOaG2.js → CCeWyMrz.js} +1 -1
- package/web/app/immutable/chunks/{pd6ci8R7.js → CCyHGsx1.js} +1 -1
- package/web/app/immutable/chunks/{q04RkU5w.js → CI524qsg.js} +1 -1
- package/web/app/immutable/chunks/{DBNIVHC3.js → CJODFnM7.js} +1 -1
- package/web/app/immutable/chunks/{DlOELRPg.js → CJgNYK9V.js} +1 -1
- package/web/app/immutable/chunks/{B0P-JC2_.js → CKqX6wgb.js} +1 -1
- package/web/app/immutable/chunks/{CS4gjpMT.js → CM6ofsmm.js} +1 -1
- package/web/app/immutable/chunks/{Cc-3_ZEX.js → CNmewsOv.js} +1 -1
- package/web/app/immutable/chunks/{CuuefJC4.js → CSmqi2h5.js} +1 -1
- package/web/app/immutable/chunks/{BUBp-Ovl.js → CVNMYGFF.js} +1 -1
- package/web/app/immutable/chunks/{DzBwn-Yt.js → CVZTt6Li.js} +1 -1
- package/web/app/immutable/chunks/{CpSj3JZp.js → CXL6aPFd.js} +3 -3
- package/web/app/immutable/chunks/{CLjY0iIn.js → CXryJZjo.js} +1 -1
- package/web/app/immutable/chunks/{wYgRppwI.js → CZI58O7j.js} +1 -1
- package/web/app/immutable/chunks/{BuYqXi0L.js → CfzS8Gfm.js} +3 -3
- package/web/app/immutable/chunks/{CYgBZucw.js → Cg2YKAtv.js} +3 -3
- package/web/app/immutable/chunks/{DU2uhw3t.js → ChM8LZU3.js} +1 -1
- package/web/app/immutable/chunks/{CeRfV5NA.js → Ciy5ndAt.js} +2 -2
- package/web/app/immutable/chunks/{zBPK5s1-.js → Ck-MVCeg.js} +1 -1
- package/web/app/immutable/chunks/{DOFEO5SQ.js → Cn042LtA.js} +2 -2
- package/web/app/immutable/chunks/{CdceEfVS.js → CnyHVjhu.js} +1 -1
- package/web/app/immutable/chunks/{B1eUs-GT.js → CqfhsexB.js} +1 -1
- package/web/app/immutable/chunks/{DUiZSnMh.js → CtLD2qbA.js} +1 -1
- package/web/app/immutable/chunks/{7sX0Tp9W.js → CxHAlRVQ.js} +1 -1
- package/web/app/immutable/chunks/{CWY8k4gh.js → CxtY9PAo.js} +1 -1
- package/web/app/immutable/chunks/{NSeFolqL.js → CypdcPp3.js} +5 -5
- package/web/app/immutable/chunks/{BLBVN-SC.js → D7KFkzTo.js} +1 -1
- package/web/app/immutable/chunks/{Cy1w4EdG.js → D7Li4Mli.js} +4 -4
- package/web/app/immutable/chunks/{DjQNgs4p.js → D8Y4PJzg.js} +4 -4
- package/web/app/immutable/chunks/{CdG4iBQs.js → D8dEtl5c.js} +1 -1
- package/web/app/immutable/chunks/{D_sSf0vv.js → DDe9tE4g.js} +1 -1
- package/web/app/immutable/chunks/{BFQ4zSOP.js → DEAJosBQ.js} +1 -1
- package/web/app/immutable/chunks/{B-TrLhSP.js → DJtPzYvk.js} +1 -1
- package/web/app/immutable/chunks/{vuPofDJd.js → DKDl5IPw.js} +1 -1
- package/web/app/immutable/chunks/{Cc2PZs8y.js → DKpqZZ5J.js} +1 -1
- package/web/app/immutable/chunks/{Dlqod_D5.js → DL6GFQWd.js} +1 -1
- package/web/app/immutable/chunks/{Cx3mm-QI.js → DO6bRkht.js} +1 -1
- package/web/app/immutable/chunks/{YUTOcxSv.js → DRAHBqQm.js} +1 -1
- package/web/app/immutable/chunks/{Dmx6eQHl.js → DSNzRZ8C.js} +1 -1
- package/web/app/immutable/chunks/{B1qL2mIF.js → DSaN60B-.js} +1 -1
- package/web/app/immutable/chunks/{CeFwx3XL.js → DXFhywqj.js} +1 -1
- package/web/app/immutable/chunks/{Cr6nDIxG.js → DXtdosGC.js} +1 -1
- package/web/app/immutable/chunks/{xB4HOmid.js → DYQYcTNY.js} +1 -1
- package/web/app/immutable/chunks/{D6uMWlr5.js → DZBAmic_.js} +1 -1
- package/web/app/immutable/chunks/{vOds2UO6.js → DZx5PyYP.js} +1 -1
- package/web/app/immutable/chunks/{D7YcNS-l.js → D_Pty9qy.js} +1 -1
- package/web/app/immutable/chunks/{-mR18H9M.js → D_yjck8l.js} +1 -1
- package/web/app/immutable/chunks/{BKh5-nTu.js → DdzkwSDy.js} +1 -1
- package/web/app/immutable/chunks/{C9gmZxfY.js → DeKwn_F7.js} +1 -1
- package/web/app/immutable/chunks/{DcRC-D9-.js → Df-fNNqU.js} +1 -1
- package/web/app/immutable/chunks/{ChCpmZvV.js → DfSU1zsS.js} +1 -1
- package/web/app/immutable/chunks/{LiN3qoUD.js → DgYqkFYk.js} +1 -1
- package/web/app/immutable/chunks/{BI6d_Sls.js → Dgc550NC.js} +1 -1
- package/web/app/immutable/chunks/{BRqXLjM4.js → DkITK-2z.js} +1 -1
- package/web/app/immutable/chunks/{DNhsoFiW.js → DmExokFD.js} +3 -3
- package/web/app/immutable/chunks/{99pf2UTc.js → Dn6TxX1b.js} +1 -1
- package/web/app/immutable/chunks/{B4aLuSlK.js → Du2Gj6UM.js} +1 -1
- package/web/app/immutable/chunks/{DIAwHvqh.js → DuXQgVrN.js} +1 -1
- package/web/app/immutable/chunks/{ao08AFko.js → DvDeEn1B.js} +1 -1
- package/web/app/immutable/chunks/{CBPH6RMz.js → DxpMmzym.js} +1 -1
- package/web/app/immutable/chunks/{C2UoIc_W.js → DyYoVm9l.js} +1 -1
- package/web/app/immutable/chunks/{CkzLAxTX.js → L_xQfaig.js} +1 -1
- package/web/app/immutable/chunks/{CHM8aaKI.js → QyIGonlC.js} +1 -1
- package/web/app/immutable/chunks/{Dy-xIfFO.js → SgKRyWMJ.js} +1 -1
- package/web/app/immutable/chunks/{BlnajRfF.js → UVG37ujP.js} +1 -1
- package/web/app/immutable/chunks/{B-Eh_eo4.js → UYZesgqg.js} +1 -1
- package/web/app/immutable/chunks/{DnLdM-QZ.js → UgJ8KjVC.js} +1 -1
- package/web/app/immutable/chunks/{DB0FiVwX.js → Uyyxw4bl.js} +1 -1
- package/web/app/immutable/chunks/{ISabpJyz.js → VaiKGhlm.js} +1 -1
- package/web/app/immutable/chunks/{CJ00qudQ.js → _tCsFuOP.js} +1 -1
- package/web/app/immutable/chunks/{GP5gU8GB.js → ag0-9R2l.js} +2 -2
- package/web/app/immutable/chunks/{B1ZQMY3n.js → aokpM5AB.js} +1 -1
- package/web/app/immutable/chunks/{uDKsIseI.js → iB_Ug3Tj.js} +1 -1
- package/web/app/immutable/chunks/{C7sevXRg.js → lk5ctrEi.js} +2 -2
- package/web/app/immutable/chunks/{CI3AMzpC.js → ly44q7lS.js} +1 -1
- package/web/app/immutable/chunks/{-Dxv6K1p.js → mqDhqc1z.js} +1 -1
- package/web/app/immutable/chunks/{bTTOLC6Y.js → ppFDuElZ.js} +1 -1
- package/web/app/immutable/chunks/{Cg13XVA6.js → pqyPptbZ.js} +1 -1
- package/web/app/immutable/chunks/{BO7tTahy.js → qHzkHUJa.js} +1 -1
- package/web/app/immutable/chunks/{bqt2f6_K.js → qTbFtTyZ.js} +1 -1
- package/web/app/immutable/chunks/{Bd_hasKp.js → tZn51uqd.js} +1 -1
- package/web/app/immutable/chunks/{_DgrG-uz.js → uyuKNxsR.js} +1 -1
- package/web/app/immutable/chunks/{CgpO_ER6.js → z1z8GC2-.js} +1 -1
- package/web/app/immutable/entry/{app.DxHiQ2oX.js → app.CfkKS3_B.js} +2 -2
- package/web/app/immutable/entry/start.D8twmA7m.js +1 -0
- package/web/app/immutable/nodes/{0.CN8CENFf.js → 0.lcvHyY-0.js} +1 -1
- package/web/app/immutable/nodes/{1.BA-nuCLe.js → 1.BhBvaoaE.js} +1 -1
- package/web/app/immutable/nodes/{10.CZGA3bGf.js → 10.Dl3iInnZ.js} +1 -1
- package/web/app/immutable/nodes/{14.BhhKV3d_.js → 14.CWZgoDsu.js} +1 -1
- package/web/app/immutable/nodes/{17.KM-T33gb.js → 17.DNzsiTvY.js} +2 -2
- package/web/app/immutable/nodes/{2.DPjewEhy.js → 2.DTYQ5-L1.js} +4 -4
- package/web/app/immutable/nodes/{3.CFq56H2j.js → 3.Bw9eze1v.js} +1 -1
- package/web/app/immutable/nodes/{4.r9Tkg-el.js → 4.QtvgFa_a.js} +1 -1
- package/web/app/immutable/nodes/{5.DyN42GGq.js → 5.TW71fA8G.js} +1 -1
- package/web/app/immutable/nodes/{6.CcFwXeH9.js → 6.u50ySvFG.js} +1 -1
- package/web/app/immutable/nodes/{7.utZT-aFD.js → 7.CRu43av9.js} +1 -1
- package/web/app/immutable/nodes/{8.Cj-VG2gq.js → 8.B52SAcoZ.js} +4 -4
- package/web/app/immutable/nodes/{9.DAntSadP.js → 9.Ci2jUFUn.js} +4 -4
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/entry/start.BiwGykY4.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
var Me=Object.defineProperty;var De=(i,s,e)=>s in i?Me(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var m=(i,s,e)=>De(i,typeof s!="symbol"?s+"":s,e);import{x as Ne,J as oe,Z as ce,ai as q,ar as Ce}from"./CpSj3JZp.js";import{bY as Le,cX as le,co as ue,cn as ve}from"./CgpO_ER6.js";import{Iy as p,Bd as we,bw as be,c as Fe,KC as de,i8 as me,bI as ke,D8 as z,BC as Ge,f5 as Pe,zH as xe,dS as Ee,f1 as fe,dR as _e,Aa as Ve,Kg as Ue,vR as Be}from"./D5ej8a-y.js";import{aC as Ae,dG as he,A as H,P as Re,ay as K}from"./Cg2SHWhQ.js";import{ax as $e}from"./Bfr1QjPr.js";import{c as W}from"./ChTqQfQN.js";import{a as Xe}from"./BdWqymET.js";import{k as Q}from"./DT4bpJWb.js";import"./DYhIMPy1.js";import{bp as n}from"./DXyyWeag.js";import"./CjaOLL1c.js";import"./Cuqq8bL5.js";import"./DJkHth-B.js";import{R as ge}from"./BvFAWM27.js";import{L as Ye}from"./CSiaiLHL.js";function We(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new Xe("PerformanceOptimizer"),w=class w{constructor(){m(this,"metricsBuffer");m(this,"metricsIndex",0);m(this,"metricsCount",0);m(this,"MAX_METRICS",500);m(this,"TARGET_RESPONSE_TIME",100);m(this,"memoCache",new Map);m(this,"MEMO_TTL",6e4);m(this,"MAX_CACHE_SIZE",100);m(this,"cacheHits",0);m(this,"cacheMisses",0);m(this,"pendingRequests",new Map);m(this,"requestQueue",[]);m(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let c=0;c<s.length;c+=r){const f=s.slice(c,c+r).map((o,g)=>{const R=Math.floor(g/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(o);d(k)},R)})}),u=await Promise.all(f);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=Z.now();try{const a=t.cacheKey||s;if(t.memoize){const f=this.getMemoized(a);if(f!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),f;this.cacheMisses++}if(t.coalesce){const f=this.pendingRequests.get(s);if(f)return V.debug("Request coalesced",{operation:s}),f}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const c=await l;t.memoize&&this.memoize(a,c);const E=Z.now()-r;return this.recordMetric(s,E,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),E>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(E),target:this.TARGET_RESPONSE_TIME}),c}catch(a){const l=Z.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const o=this.metricsBuffer[(e+u)%this.MAX_METRICS];o&&s.push(o)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,o)=>u.duration-o.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const c=a/s.length,E=Math.floor(t.length*.95),f=Math.floor(t.length*.99);return{avgResponseTime:Math.round(c),p95ResponseTime:Math.round(t[E]?.duration||0),p99ResponseTime:Math.round(t[f]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};m(w,"instance");let ee=w;const qe=ee.getInstance(),pe={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},j={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},ze={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function He(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Ke(i,s){return He(i).every(t=>t in s)}function Ie(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function J(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function Qe(i,s){return s&&j[i]&&Ke(j[i],s)?Ie(j[i],s):ze[i]||n.errors_userFriendly_fallback_error()}function Ze(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?pe[e]:pe.GENERAL}const je={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function Je(i){return je[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var D=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(D||{});class Y extends Error{constructor(e,t,r={},a){super(e);m(this,"code");m(this,"context");m(this,"recoverySuggestions");m(this,"userMessage");m(this,"isRecoverable");m(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return Qe(e,this.context)}getDefaultRecoverySuggestions(e){return Je(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return Ze(this.code)}formatMessage(e){return Ie(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const et={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function ie(i){const s=i.toLowerCase();for(const e of et.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const tt="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=ge.DEFAULT_ATTEMPTS,retryDelay:a=ge.BASE_DELAY,exponentialBackoff:l=!0,notify:c=!1,notifyOnRetry:E=!1,context:f={},onError:u,onRetry:o,shouldRetry:g=this.defaultShouldRetry}=t;let R=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const h=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),h}catch(h){if(R=h,v.error(`[${e}] Attempt ${d} failed`,{error:R.message,attempt:d,maxAttempts:r+1,context:f}),u?.(R,d),d<=r&&g(R)){const C=l?a*Math.pow(2,d-1):a;E&&Q.warning(n.agent_errorBoundary_retrying_message({seconds:C/1e3})),o?.(d),v.info(`[${e}] Retrying in ${C}ms`),await this.sleep(C)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${R?.message}`,P=J(R?.message||n.agent_errorBoundary_generic_error()),N=R?.message?.toLowerCase()||"",$=N.includes("no available models")||N.includes("all models exhausted")||N.includes("all models unavailable");throw c&&!$&&Q.error(P),new Y(P,D.OPERATION_FAILED,{originalError:R?.message,detailedMessage:k,attempts:d,context:f})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&Q.error(J(a.message)),new Y(J(a.message),D.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return ie(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof Y?[D.NETWORK_ERROR,D.STREAM_TIMEOUT,D.STREAM_CONNECTION_FAILED,D.PROVIDER_CONNECTION_FAILED,D.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new Y(`${t} timed out after ${e}ms`,D.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,c=[],E=[];for(let f=0;f<s.length;f+=r){const u=s.slice(f,f+r);(await Promise.allSettled(u.map(g=>e(g)))).forEach((g,R)=>{if(g.status==="fulfilled")c.push(g.value);else{const d=g.reason;if(E.push({item:u[R],error:d}),v.error(`[${l}] Batch item failed`,{item:u[R],error:d.message}),!a)throw d}})}return E.length>0&&v.warn(`[${l}] Completed with ${E.length} errors`),{results:c,errors:E}}};m(b,"instance");let te=b;const st=te.getInstance(),se=W("browser/index"),F=new Map,B=new Map;let U;function it(i,s,e){for(const t of s)try{t(e)}catch(r){se.error("Error in agent subscriber callback",{agentId:i,error:r})}}function rt(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Ae.select(e,t);B.get(t)!==a&&(B.set(t,a),it(t,r,a))}})}function at(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ct(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),rt();const a=p.state,l=Ae.select(a,i);return r&&B.set(i,l),l?se.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):se.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const c=F.get(i);c&&(c.delete(s),c.size===0&&(F.delete(i),B.delete(i))),at()}}const y=W("ErrorRecovery"),Se={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||ie(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class nt{constructor(){m(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class ot extends nt{constructor(){super(...arguments);m(this,"activeRecoveries",new Map);m(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=Se.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let c,E=t.initialBackoffMs,f=0;for(let u=1;u<=t.maxRetries;u++){if(f=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const o=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:o,attempts:u,totalTime:Date.now()-a}}catch(o){c=o,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:c.message});const g=c.message.toLowerCase();if(g.includes("interrupted")||g.includes("cancelled")||g.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:c.message});break}if(g.includes("no available models")||g.includes("all models exhausted")||g.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:c.message});break}if(ie(c.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:c.message});break}if(!t.shouldRetry(c,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:c.message});break}if(u<t.maxRetries){const R=Math.random()*.2*E,d=Math.min(E+R,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:c.message}),await this.delay(d,l.signal),E=Math.min(E*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(c,f),this.emit("recovery:failure",{operationId:r,attempts:f,duration:Date.now()-a,error:c?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:c,attempts:f,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const c=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",c);const E=r;r=()=>{t.removeEventListener("abort",c),E()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const ct=new ot,O=new Ye({category:"WorkspaceMetrics"}),lt=100;class ut{constructor(){m(this,"metrics",new Map);m(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>lt;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const dt=new ut,M=W("AgentSend");function A(i){p.dispatch(i)}function Te(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function mt(i){const s=Te(i)&&i.success===!0&&"data"in i?i.data:i;return!Te(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(tt)}async function Lt(i,s,e,t={}){const r=he.select(p.state,e.id);if(!r)return;const a=Ne(i,e.id),l=t.submission,c=!!l&&Le.select(p.state,l.scope)?.supported===!0,E=(o,g,R=!1)=>{l&&A(Be(l.scope,l.id,o,Date.now(),g,R))};let f=!1;const u=()=>(!l||f||ve.select(p.state,l))&&r===he.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let o=await p.dispatch(we(e.id,i));if(u()){if(!o)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));o={...o,isStreaming:o.isStreaming??!1};{if(o&&(o.status==="pending"||!o.id)&&!o.backendSessionId&&o.activationState!==H.ACTIVE&&o.activationState!==H.ACTIVATING){const h=e.id.startsWith("optimistic-"),C=e.worktreePath||e.repositoryPath||e.path;if(!h&&C){M.info("Activating pending session in sendMessage",{agentId:i,status:o.status,activationState:o.activationState,hasBackendSessionId:!!o.backendSessionId});const x=await p.dispatch(be(e.id,i));if(!u())return;x&&(o=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else o&&o.status==="pending"&&o.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:o.backendSessionId,activationState:o.activationState}),o={...o,status:Fe.Active,activationState:H.ACTIVE},A(de({...o,workspaceId:e.id})));if(!o)throw new Error(`Failed to get or create session for agent ${i}`);A(de({...o,workspaceId:e.id}));const R=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)R.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)R.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??oe(),k=t.messageMetadata?.[Re],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[Re]:k}:{}},N={id:me(le()),appMessageId:d,role:"user",contentBlocks:R,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};c||(l&&(E("rejected"),f=!0),A(ke(o.id,N))),A(z(o.id,!0));let $=!1;try{c||await p.dispatch(Ge(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=me(`msg_${le()}`),C=oe(),x=async()=>st.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:o.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(_=>({type:_.type,mimeType:_.mimeType,dataLength:_.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(_=>({type:_.type,fileName:_.fileName,mimeType:_.mimeType,attachmentId:_.attachmentId,size:_.size}))||[]});const Oe=t.model??t.modelId??o.model??void 0;A(Pe(i));const ye=ce(i,e.id),ae=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await $e("agent.sendMessage",{agentId:i,...c&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Oe,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:C,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(_=>{if(u())throw _});if(u()){if(mt(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:o.id}),E("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const _=T.error,I=typeof _=="string"?_:_?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:o.id,queuedMessageId:T.queuedMessage?.id}),(!c||!l||!ue.select(p.state,l))&&A(z(o.id,!1)),c||A(xe(o.id,N.id)),c){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=Ee(s,t),X=K.select(p.state,i,e.id).find(ne=>ne.id===I.id||ne.turnId===L);A(fe(i,I.id,S,L,_e(X??I,S),!X&&!!l&&ue.select(p.state,l),ae))}E("accepted",I,!0),q(i,e.id);return}const _=T.queuedMessage;if(_){const I=T.turnId,G=typeof I=="string"?I:_.turnId;let L=_;if(u()&&ce(i,e.id)===ye){const S=K.select(p.state,i,e.id),X=We(S,_);A(Ve(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:_.id}),await q(i,e.id).catch(()=>{}),L=K.select(p.state,i,e.id).find(S=>S.id===_.id||S.turnId===G));if(u()&&typeof G=="string"){const S=Ee(s,t);A(fe(i,_.id,S,G,_e(L??_,S),!L,ae))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:_.id})}return}}c&&(E("accepted"),q(i,e.id),Ce(i,e.id)),dt.incrementMessageSent(e.id)}},"send message",{retries:c?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),re=c?await x().then(()=>({success:!0,error:void 0})):await ct.executeWithRecovery(x,Se.streaming,`send-message-${i}`);if(!re.success)throw re.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(z(o.id,!1)),!c&&t.messageMetadata&&A(Ue(o.id,N.id,{metadata:P})),c&&E($?"rejected":"uncertain"),h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Ct as a,J as c,We as r,Lt as s};
|
|
1
|
+
var Me=Object.defineProperty;var De=(i,s,e)=>s in i?Me(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var m=(i,s,e)=>De(i,typeof s!="symbol"?s+"":s,e);import{x as Ne,J as oe,Z as ce,ai as q,ar as Ce}from"./CXL6aPFd.js";import{bY as Le,cX as le,co as ue,cn as ve}from"./z1z8GC2-.js";import{Iy as p,Bd as we,bw as be,c as Fe,KC as de,i8 as me,bI as ke,D8 as z,BC as Ge,f5 as Pe,zH as xe,dS as Ee,f1 as fe,dR as _e,Aa as Ve,Kg as Ue,vR as Be}from"./D5ej8a-y.js";import{aC as Ae,dG as he,A as H,P as Re,ay as K}from"./Cg2SHWhQ.js";import{ax as $e}from"./Bfr1QjPr.js";import{c as W}from"./ChTqQfQN.js";import{a as Xe}from"./BdWqymET.js";import{k as Q}from"./DT4bpJWb.js";import"./DYhIMPy1.js";import{bp as n}from"./DXyyWeag.js";import"./CjaOLL1c.js";import"./Cuqq8bL5.js";import"./DJkHth-B.js";import{R as ge}from"./BvFAWM27.js";import{L as Ye}from"./CSiaiLHL.js";function We(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new Xe("PerformanceOptimizer"),w=class w{constructor(){m(this,"metricsBuffer");m(this,"metricsIndex",0);m(this,"metricsCount",0);m(this,"MAX_METRICS",500);m(this,"TARGET_RESPONSE_TIME",100);m(this,"memoCache",new Map);m(this,"MEMO_TTL",6e4);m(this,"MAX_CACHE_SIZE",100);m(this,"cacheHits",0);m(this,"cacheMisses",0);m(this,"pendingRequests",new Map);m(this,"requestQueue",[]);m(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let c=0;c<s.length;c+=r){const f=s.slice(c,c+r).map((o,g)=>{const R=Math.floor(g/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(o);d(k)},R)})}),u=await Promise.all(f);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=Z.now();try{const a=t.cacheKey||s;if(t.memoize){const f=this.getMemoized(a);if(f!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),f;this.cacheMisses++}if(t.coalesce){const f=this.pendingRequests.get(s);if(f)return V.debug("Request coalesced",{operation:s}),f}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const c=await l;t.memoize&&this.memoize(a,c);const E=Z.now()-r;return this.recordMetric(s,E,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),E>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(E),target:this.TARGET_RESPONSE_TIME}),c}catch(a){const l=Z.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const o=this.metricsBuffer[(e+u)%this.MAX_METRICS];o&&s.push(o)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,o)=>u.duration-o.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const c=a/s.length,E=Math.floor(t.length*.95),f=Math.floor(t.length*.99);return{avgResponseTime:Math.round(c),p95ResponseTime:Math.round(t[E]?.duration||0),p99ResponseTime:Math.round(t[f]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};m(w,"instance");let ee=w;const qe=ee.getInstance(),pe={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},j={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},ze={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function He(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Ke(i,s){return He(i).every(t=>t in s)}function Ie(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function J(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function Qe(i,s){return s&&j[i]&&Ke(j[i],s)?Ie(j[i],s):ze[i]||n.errors_userFriendly_fallback_error()}function Ze(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?pe[e]:pe.GENERAL}const je={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function Je(i){return je[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var D=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(D||{});class Y extends Error{constructor(e,t,r={},a){super(e);m(this,"code");m(this,"context");m(this,"recoverySuggestions");m(this,"userMessage");m(this,"isRecoverable");m(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return Qe(e,this.context)}getDefaultRecoverySuggestions(e){return Je(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return Ze(this.code)}formatMessage(e){return Ie(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const et={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function ie(i){const s=i.toLowerCase();for(const e of et.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const tt="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=ge.DEFAULT_ATTEMPTS,retryDelay:a=ge.BASE_DELAY,exponentialBackoff:l=!0,notify:c=!1,notifyOnRetry:E=!1,context:f={},onError:u,onRetry:o,shouldRetry:g=this.defaultShouldRetry}=t;let R=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const h=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),h}catch(h){if(R=h,v.error(`[${e}] Attempt ${d} failed`,{error:R.message,attempt:d,maxAttempts:r+1,context:f}),u?.(R,d),d<=r&&g(R)){const C=l?a*Math.pow(2,d-1):a;E&&Q.warning(n.agent_errorBoundary_retrying_message({seconds:C/1e3})),o?.(d),v.info(`[${e}] Retrying in ${C}ms`),await this.sleep(C)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${R?.message}`,P=J(R?.message||n.agent_errorBoundary_generic_error()),N=R?.message?.toLowerCase()||"",$=N.includes("no available models")||N.includes("all models exhausted")||N.includes("all models unavailable");throw c&&!$&&Q.error(P),new Y(P,D.OPERATION_FAILED,{originalError:R?.message,detailedMessage:k,attempts:d,context:f})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&Q.error(J(a.message)),new Y(J(a.message),D.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return ie(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof Y?[D.NETWORK_ERROR,D.STREAM_TIMEOUT,D.STREAM_CONNECTION_FAILED,D.PROVIDER_CONNECTION_FAILED,D.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new Y(`${t} timed out after ${e}ms`,D.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,c=[],E=[];for(let f=0;f<s.length;f+=r){const u=s.slice(f,f+r);(await Promise.allSettled(u.map(g=>e(g)))).forEach((g,R)=>{if(g.status==="fulfilled")c.push(g.value);else{const d=g.reason;if(E.push({item:u[R],error:d}),v.error(`[${l}] Batch item failed`,{item:u[R],error:d.message}),!a)throw d}})}return E.length>0&&v.warn(`[${l}] Completed with ${E.length} errors`),{results:c,errors:E}}};m(b,"instance");let te=b;const st=te.getInstance(),se=W("browser/index"),F=new Map,B=new Map;let U;function it(i,s,e){for(const t of s)try{t(e)}catch(r){se.error("Error in agent subscriber callback",{agentId:i,error:r})}}function rt(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Ae.select(e,t);B.get(t)!==a&&(B.set(t,a),it(t,r,a))}})}function at(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ct(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),rt();const a=p.state,l=Ae.select(a,i);return r&&B.set(i,l),l?se.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):se.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const c=F.get(i);c&&(c.delete(s),c.size===0&&(F.delete(i),B.delete(i))),at()}}const y=W("ErrorRecovery"),Se={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||ie(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class nt{constructor(){m(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class ot extends nt{constructor(){super(...arguments);m(this,"activeRecoveries",new Map);m(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=Se.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let c,E=t.initialBackoffMs,f=0;for(let u=1;u<=t.maxRetries;u++){if(f=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const o=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:o,attempts:u,totalTime:Date.now()-a}}catch(o){c=o,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:c.message});const g=c.message.toLowerCase();if(g.includes("interrupted")||g.includes("cancelled")||g.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:c.message});break}if(g.includes("no available models")||g.includes("all models exhausted")||g.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:c.message});break}if(ie(c.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:c.message});break}if(!t.shouldRetry(c,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:c.message});break}if(u<t.maxRetries){const R=Math.random()*.2*E,d=Math.min(E+R,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:c.message}),await this.delay(d,l.signal),E=Math.min(E*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(c,f),this.emit("recovery:failure",{operationId:r,attempts:f,duration:Date.now()-a,error:c?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:c,attempts:f,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const c=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",c);const E=r;r=()=>{t.removeEventListener("abort",c),E()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const ct=new ot,O=new Ye({category:"WorkspaceMetrics"}),lt=100;class ut{constructor(){m(this,"metrics",new Map);m(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>lt;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const dt=new ut,M=W("AgentSend");function A(i){p.dispatch(i)}function Te(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function mt(i){const s=Te(i)&&i.success===!0&&"data"in i?i.data:i;return!Te(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(tt)}async function Lt(i,s,e,t={}){const r=he.select(p.state,e.id);if(!r)return;const a=Ne(i,e.id),l=t.submission,c=!!l&&Le.select(p.state,l.scope)?.supported===!0,E=(o,g,R=!1)=>{l&&A(Be(l.scope,l.id,o,Date.now(),g,R))};let f=!1;const u=()=>(!l||f||ve.select(p.state,l))&&r===he.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let o=await p.dispatch(we(e.id,i));if(u()){if(!o)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));o={...o,isStreaming:o.isStreaming??!1};{if(o&&(o.status==="pending"||!o.id)&&!o.backendSessionId&&o.activationState!==H.ACTIVE&&o.activationState!==H.ACTIVATING){const h=e.id.startsWith("optimistic-"),C=e.worktreePath||e.repositoryPath||e.path;if(!h&&C){M.info("Activating pending session in sendMessage",{agentId:i,status:o.status,activationState:o.activationState,hasBackendSessionId:!!o.backendSessionId});const x=await p.dispatch(be(e.id,i));if(!u())return;x&&(o=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else o&&o.status==="pending"&&o.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:o.backendSessionId,activationState:o.activationState}),o={...o,status:Fe.Active,activationState:H.ACTIVE},A(de({...o,workspaceId:e.id})));if(!o)throw new Error(`Failed to get or create session for agent ${i}`);A(de({...o,workspaceId:e.id}));const R=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)R.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)R.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??oe(),k=t.messageMetadata?.[Re],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[Re]:k}:{}},N={id:me(le()),appMessageId:d,role:"user",contentBlocks:R,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};c||(l&&(E("rejected"),f=!0),A(ke(o.id,N))),A(z(o.id,!0));let $=!1;try{c||await p.dispatch(Ge(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=me(`msg_${le()}`),C=oe(),x=async()=>st.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:o.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(_=>({type:_.type,mimeType:_.mimeType,dataLength:_.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(_=>({type:_.type,fileName:_.fileName,mimeType:_.mimeType,attachmentId:_.attachmentId,size:_.size}))||[]});const Oe=t.model??t.modelId??o.model??void 0;A(Pe(i));const ye=ce(i,e.id),ae=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await $e("agent.sendMessage",{agentId:i,...c&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Oe,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:C,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(_=>{if(u())throw _});if(u()){if(mt(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:o.id}),E("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const _=T.error,I=typeof _=="string"?_:_?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:o.id,queuedMessageId:T.queuedMessage?.id}),(!c||!l||!ue.select(p.state,l))&&A(z(o.id,!1)),c||A(xe(o.id,N.id)),c){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=Ee(s,t),X=K.select(p.state,i,e.id).find(ne=>ne.id===I.id||ne.turnId===L);A(fe(i,I.id,S,L,_e(X??I,S),!X&&!!l&&ue.select(p.state,l),ae))}E("accepted",I,!0),q(i,e.id);return}const _=T.queuedMessage;if(_){const I=T.turnId,G=typeof I=="string"?I:_.turnId;let L=_;if(u()&&ce(i,e.id)===ye){const S=K.select(p.state,i,e.id),X=We(S,_);A(Ve(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:_.id}),await q(i,e.id).catch(()=>{}),L=K.select(p.state,i,e.id).find(S=>S.id===_.id||S.turnId===G));if(u()&&typeof G=="string"){const S=Ee(s,t);A(fe(i,_.id,S,G,_e(L??_,S),!L,ae))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:_.id})}return}}c&&(E("accepted"),q(i,e.id),Ce(i,e.id)),dt.incrementMessageSent(e.id)}},"send message",{retries:c?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),re=c?await x().then(()=>({success:!0,error:void 0})):await ct.executeWithRecovery(x,Se.streaming,`send-message-${i}`);if(!re.success)throw re.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(z(o.id,!1)),!c&&t.messageMetadata&&A(Ue(o.id,N.id,{metadata:P})),c&&E($?"rejected":"uncertain"),h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Ct as a,J as c,We as r,Lt as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{I as W}from"./
|
|
1
|
+
import{I as W}from"./BgDzDopc.js";import{p as X}from"./DKpqZZ5J.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"./Bsu5oWdj.js";import{p as te}from"./2gme4FSl.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,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/BJneMVAK.js","/app/immutable/chunks/DT4bpJWb.js","/app/immutable/chunks/DyvrH0mm.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/DXyyWeag.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CjaOLL1c.js","/app/immutable/chunks/Cuqq8bL5.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/Bfr1QjPr.js","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/CnVt0JNG.js","/app/immutable/chunks/BybfkKTj.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BboIV5H5.js","/app/immutable/chunks/DJkHth-B.js","/app/immutable/chunks/D5ej8a-y.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/ppRpwazH.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/BTdkHPOB.js","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/
|
|
2
|
-
import{bp as b,_ as C}from"./DXyyWeag.js";import{g as f,Iy as a,db as P,GW as S,yy as N,F6 as q,vd as R,qy as W,uN as H,KC as U}from"./D5ej8a-y.js";import{d as y}from"./ChkzKl5W.js";import{bb as V}from"./Bfr1QjPr.js";import{parseIntentLink as j}from"./
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/BJneMVAK.js","/app/immutable/chunks/DT4bpJWb.js","/app/immutable/chunks/DyvrH0mm.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/DXyyWeag.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/CjaOLL1c.js","/app/immutable/chunks/Cuqq8bL5.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/Bfr1QjPr.js","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/CnVt0JNG.js","/app/immutable/chunks/BybfkKTj.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BboIV5H5.js","/app/immutable/chunks/DJkHth-B.js","/app/immutable/chunks/D5ej8a-y.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/ppRpwazH.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/BTdkHPOB.js","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/CnyHVjhu.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/ChkzKl5W.js","/app/immutable/chunks/DogedYC1.js","/app/immutable/chunks/pKvpKpo4.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/DNBv5HWD.js","/app/immutable/chunks/Cg2SHWhQ.js","/app/immutable/chunks/DEYvT_CO.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/-ccfrtH7.js","/app/immutable/chunks/DdzkwSDy.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{bp as b,_ as C}from"./DXyyWeag.js";import{g as f,Iy as a,db as P,GW as S,yy as N,F6 as q,vd as R,qy as W,uN as H,KC as U}from"./D5ej8a-y.js";import{d as y}from"./ChkzKl5W.js";import{bb as V}from"./Bfr1QjPr.js";import{parseIntentLink as j}from"./lk5ctrEi.js";import{k as I}from"./DT4bpJWb.js";import"./DYhIMPy1.js";import"./CjaOLL1c.js";import"./Cuqq8bL5.js";import"./ChTqQfQN.js";import"./DJkHth-B.js";import{I as B,q as x,H as L}from"./DHQOuksI.js";import{dr as D}from"./Cg2SHWhQ.js";import{p as F,o as K,h as $}from"./LUvhmWrd.js";const p="assistant-content",z=a.createSelector(t=>{const r=F.select(t),s=K.select(t),e=$.select(t).find(i=>i.agentId===s)??r.find(i=>i.isActive)??r.find(i=>i.messageCount>0)??r[0];return P(e?.agentId??null)}),O=new Map;function G(t,r=!1){const s=O.get(t)??{explicit:0,background:0},e={explicit:s.explicit+(r?0:1),background:s.background+(r?1:0)};return O.set(t,e),r?e:{explicit:e.explicit}}function m(t,r){const s=O.get(t);return s!==void 0&&r.explicit===s.explicit&&(r.background===void 0||r.background===s.background)}async function J(t){a.dispatch(R(t)),L.select(a.state,t).restoreStatus==="pending"&&await new Promise(r=>{const s=L.withStore(a)(t).subscribe(e=>{e.restoreStatus!=="pending"&&(r(),queueMicrotask(()=>s()))})})}function _(t,r,s){const e=L.select(a.state,s);if(!e.panels[p]||Object.keys(e.panels).some(i=>i!==p)){const i=e.panels[p],d=Object.values(e.panels).flatMap(n=>n.tabs.filter(o=>o.type!=="agent"||o.workspaceId!==f)),c=d.some(n=>n.id===i?.activeTabId)?i?.activeTabId??null:d.at(-1)?.id??null;a.dispatch(W(s,{root:{type:"panel",panelId:p},panels:{[p]:{id:p,tabs:d,activeTabId:c}},focusedPanelId:e.focusedPanelId===p?p:null,hiddenTabs:x.select(a.state,s)}))}a.dispatch(H(s,t,p,void 0,!0,void 0,!1,r.background||r.preserveFocus,void 0,r.background))}async function de(t,r={}){try{return await Q(t,r)}catch(s){return I.error(b.ui_linkHandler_notFound_title(),{description:s instanceof Error?s.message:String(s)}),!0}}async function Q(t,r){const s=/^intent:\/\/local\/([^/?#]+)\/agent\/([^/?#]+)$/.exec(t),e=t.startsWith("intent://")?j(t):null,i=e?.valid&&e.type==="workspace"?[t,e.resourceId]:/^\/workspace\/([^/?#]+)\/?$/.exec(t),d=/^https?:\/\//.test(t)&&!V(t);if(!i&&!s&&!d&&!(e?.valid&&["file","message","note","task"].includes(e.type))||i&&[f,"new"].includes(i[1]))return!1;const c=F.select(a.state),n=r.agentId?P(r.agentId):r.background?c.length===1?P(c[0].agentId):null:r.layoutId??z.select(a.state);if(!n)return!0;const o=G(n,r.background);if(await J(n),!m(n,o))return!0;if(i){const u=i[1],g=await y.workspaces.get(u);return m(n,o)?g?(a.dispatch(S(g)),_({type:"workspace",title:g.title,workspaceId:u,closable:!0},r,n),!0):(I.error(b.workspace_loader_notFound_title()),!0):!0}if(s)return T(s[1],s[2],r,n,o);if(d){const{resolveBrowserLinkForOpen:u}=await C(async()=>{const{resolveBrowserLinkForOpen:v}=await import("./BJneMVAK.js").then(w=>w.b);return{resolveBrowserLinkForOpen:v}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26]),import.meta.url),g=await u(t);return m(n,o)&&_({type:"browser",title:new URL(t).hostname,browserUrl:g.url,browserRequestedUrl:g.requestedUrl,workspaceId:f,closable:!0},r,n),!0}if(!e?.valid)return!1;const h=e.workspaceId??f;if(e.type==="file"){const u=await y.workspaces.get(h);return m(n,o)?u?(a.dispatch(S(u)),_({type:"file",title:e.resourceId.split("/").at(-1)??e.resourceId,filePath:e.resourceId,workspaceId:h,closable:!0,data:{line:e.line,filePathIsLiteral:!0}},r,n),!0):(I.error(b.workspace_loader_notFound_title()),!0):!0}if(e.type==="message"&&e.agentId)return T(h,e.agentId,r,n,o,e.resourceId);if(e.type!=="note"&&e.type!=="task")return!1;const l=e.workspaceId??f,[k,A]=await Promise.all([a.dispatch(N(l,e.resourceId)),Promise.resolve(D.select(a.state,l)??y.workspaces.get(l)).catch(()=>null)]);if(!m(n,o))return!0;if(!k||String(k.workspaceId)!==l)return I.error(b.ui_linkHandler_notFound_title(),{description:b.ui_linkHandler_noteNotFound_error({noteId:e.resourceId,workspaceId:l})}),!0;A&&String(A.id)===l&&a.dispatch(S(A));const M=Object.entries(B.select(a.state)).some(([u,g])=>{const v=w=>w.type==="note"&&w.noteId===String(k.id)&&(w.workspaceId??u)===l;return Object.values(g.panels).some(w=>w.tabs.some(v))||x.select(a.state,u).some(v)}),E=a.state.transientUi.byWorkspaceId[l]?.noteViewModeByNoteId[String(k.id)];return!M&&(!r.background||E===void 0)&&a.dispatch(q(l,String(k.id),"editor")),_({type:"note",title:k.title,noteId:String(k.id),workspaceId:l,closable:!0},r,n),!0}async function T(t,r,s,e,i,d){const c=await y.agents.get(r,t===f?void 0:t);t===f&&c&&(t=String(c.workspaceId));const n=t===f?null:await y.workspaces.get(t);if(!m(e,i))return!0;if(!n&&t!==f||!c||String(c.workspaceId)!==t)return I.error(b.ui_linkHandler_notFound_title()),!0;if(n&&a.dispatch(S(n)),a.dispatch(U(c)),_({type:"agent",title:c.name??r,agentId:r,workspaceId:t,closable:!0},s,e),d&&!s.background){const{openMessage:o}=await C(async()=>{const{openMessage:h}=await import("./CnyHVjhu.js");return{openMessage:h}},__vite__mapDeps([27,28,29,30,4,3,17,18,19,20,5,7,21,13,2,9,6,8,10,11,12,14,31,32,33,34,35,23,36,15,37,38,39]),import.meta.url);o({workspaceId:t,agentId:r,messageId:d,contentAlreadyOpen:!0})}return!0}export{p as ASSISTANT_CONTENT_PANEL_ID,z as selectAssistantPanelLayoutId,de as showAssistantContent};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as Fe}from"./Dy-xIfFO.js";import{ap as Me,a5 as xe,ar as Ke,bc as We,bb as Ye,be as Ve,bd as Ue,b9 as He,b7 as Xe,b2 as je,aN as Ge,aF as qe,aE as Je,az as Ze,aj as Qe,ai as $e,ak as et,S as tt,R as st,K as rt,k as it,I as at,f as nt,g as ot,e as ct,b as u,W as P,aW as X,ag as lt,aD as ut,B as ht,ay as y,r as gt,am as dt,aU as pt,ab as ft,x as bt,aT as St,p as xt,X as Le,ae as Lt,af as mt,aK as yt,z as wt,a3 as Et,ah as me,b6 as kt,aL as _t}from"./ChGUMi8s.js";import{G as Dt}from"./-xK_vQQs.js";function Tt(e){return Array.isArray(e)}function Nt(e){if(Me(e))return e;const a=xe(e);if(!It(e))return{};if(Tt(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(Ke(e)){const s=e,c=s.constructor;return new c(s.buffer,s.byteOffset,s.length)}if(a==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(a==="[object DataView]"){const s=e,c=s.buffer,g=s.byteOffset,t=s.byteLength,h=new ArrayBuffer(t),x=new Uint8Array(c,g,t);return new Uint8Array(h).set(x),new DataView(h)}if(a==="[object Boolean]"||a==="[object Number]"||a==="[object String]"){const s=e.constructor,c=new s(e.valueOf());return a==="[object String]"?Ct(c,e):se(c,e),c}if(a==="[object Date]")return new Date(Number(e));if(a==="[object RegExp]"){const s=e,c=new RegExp(s.source,s.flags);return c.lastIndex=s.lastIndex,c}if(a==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(a==="[object Map]"){const s=e,c=new Map;return s.forEach((g,t)=>{c.set(t,g)}),c}if(a==="[object Set]"){const s=e,c=new Set;return s.forEach(g=>{c.add(g)}),c}if(a==="[object Arguments]"){const s=e,c={};return se(c,s),c.length=s.length,c[Symbol.iterator]=s[Symbol.iterator],c}const o={};return vt(o,e),se(o,e),Ot(o,e),o}function It(e){switch(xe(e)){case ct:case ot:case nt:case at:case it:case rt:case st:case tt:case et:case $e:case Qe:case Ze:case Je:case qe:case Ge:case je:case Xe:case He:case Ue:case Ve:case Ye:case We:return!0;default:return!1}}function se(e,a){for(const o in a)Object.hasOwn(a,o)&&(e[o]=a[o])}function Ot(e,a){const o=Object.getOwnPropertySymbols(a);for(let s=0;s<o.length;s++){const c=o[s];Object.prototype.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}}function Ct(e,a){const o=a.valueOf().length;for(const s in a)Object.hasOwn(a,s)&&(Number.isNaN(Number(s))||Number(s)>=o)&&(e[s]=a[s])}function vt(e,a){const o=Object.getPrototypeOf(a);o!==null&&typeof a.constructor=="function"&&Object.setPrototypeOf(e,o)}var ie=(function(){var e=u(function(C,d,i,l){for(i=i||{},l=C.length;l--;i[C[l]]=d);return i},"o"),a=[1,15],o=[1,7],s=[1,13],c=[1,14],g=[1,19],t=[1,16],h=[1,17],x=[1,18],L=[8,30],b=[8,10,21,28,29,30,31,39,43,46],f=[1,23],m=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],S=[8,10,15,16,21,27,28,29,30,31,39,43,46],_=[1,49],k={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:u(function(d,i,l,p,E,r,K){var n=r.length-1;switch(E){case 4:p.getLogger().debug("Rule: separator (NL) ");break;case 5:p.getLogger().debug("Rule: separator (Space) ");break;case 6:p.getLogger().debug("Rule: separator (EOF) ");break;case 7:p.getLogger().debug("Rule: hierarchy: ",r[n-1]),p.setHierarchy(r[n-1]);break;case 8:p.getLogger().debug("Stop NL ");break;case 9:p.getLogger().debug("Stop EOF ");break;case 10:p.getLogger().debug("Stop NL2 ");break;case 11:p.getLogger().debug("Stop EOF2 ");break;case 12:p.getLogger().debug("Rule: statement: ",r[n]),typeof r[n].length=="number"?this.$=r[n]:this.$=[r[n]];break;case 13:p.getLogger().debug("Rule: statement #2: ",r[n-1]),this.$=[r[n-1]].concat(r[n]);break;case 14:p.getLogger().debug("Rule: link: ",r[n],d),this.$={edgeTypeStr:r[n],label:""};break;case 15:p.getLogger().debug("Rule: LABEL link: ",r[n-3],r[n-1],r[n]),this.$={edgeTypeStr:r[n],label:r[n-1]};break;case 18:const F=parseInt(r[n]),Y=p.generateId();this.$={id:Y,type:"space",label:"",width:F,children:[]};break;case 23:p.getLogger().debug("Rule: (nodeStatement link node) ",r[n-2],r[n-1],r[n]," typestr: ",r[n-1].edgeTypeStr);const J=p.edgeStrToEdgeData(r[n-1].edgeTypeStr),V=p.edgeStrToEdgeStartData(r[n-1].edgeTypeStr),Z=p.edgeStrToThickness(r[n-1].edgeTypeStr),D=p.edgeStrToPattern(r[n-1].edgeTypeStr);this.$=[{id:r[n-2].id,label:r[n-2].label,type:r[n-2].type,directions:r[n-2].directions},{id:r[n-2].id+"-"+r[n].id,start:r[n-2].id,end:r[n].id,label:r[n-1].label,type:"edge",thickness:Z,pattern:D,directions:r[n].directions,arrowTypeEnd:J,arrowTypeStart:V},{id:r[n].id,label:r[n].label,type:p.typeStr2Type(r[n].typeStr),directions:r[n].directions}];break;case 24:p.getLogger().debug("Rule: nodeStatement (abc88 node size) ",r[n-1],r[n]),this.$={id:r[n-1].id,label:r[n-1].label,type:p.typeStr2Type(r[n-1].typeStr),directions:r[n-1].directions,widthInColumns:parseInt(r[n],10)};break;case 25:p.getLogger().debug("Rule: nodeStatement (node) ",r[n]),this.$={id:r[n].id,label:r[n].label,type:p.typeStr2Type(r[n].typeStr),directions:r[n].directions,widthInColumns:1};break;case 26:p.getLogger().debug("APA123",this?this:"na"),p.getLogger().debug("COLUMNS: ",r[n]),this.$={type:"column-setting",columns:r[n]==="auto"?-1:parseInt(r[n])};break;case 27:p.getLogger().debug("Rule: id-block statement : ",r[n-2],r[n-1]),p.generateId(),this.$={...r[n-2],type:"composite",children:r[n-1]};break;case 28:p.getLogger().debug("Rule: blockStatement : ",r[n-2],r[n-1],r[n]);const z=p.generateId();this.$={id:z,type:"composite",label:"",children:r[n-1]};break;case 29:p.getLogger().debug("Rule: node (NODE_ID separator): ",r[n]),this.$={id:r[n]};break;case 30:p.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",r[n-1],r[n]),this.$={id:r[n-1],label:r[n].label,typeStr:r[n].typeStr,directions:r[n].directions};break;case 31:p.getLogger().debug("Rule: dirList: ",r[n]),this.$=[r[n]];break;case 32:p.getLogger().debug("Rule: dirList: ",r[n-1],r[n]),this.$=[r[n-1]].concat(r[n]);break;case 33:p.getLogger().debug("Rule: nodeShapeNLabel: ",r[n-2],r[n-1],r[n]),this.$={typeStr:r[n-2]+r[n],label:r[n-1]};break;case 34:p.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",r[n-3],r[n-2]," #3:",r[n-1],r[n]),this.$={typeStr:r[n-3]+r[n],label:r[n-2],directions:r[n-1]};break;case 35:case 36:this.$={type:"classDef",id:r[n-1].trim(),css:r[n].trim()};break;case 37:this.$={type:"applyClass",id:r[n-1].trim(),styleClass:r[n].trim()};break;case 38:this.$={type:"applyStyles",id:r[n-1].trim(),stylesStr:r[n].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:a,11:3,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:s,29:c,31:g,39:t,43:h,46:x},{8:[1,20]},e(L,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:a,21:o,28:s,29:c,31:g,39:t,43:h,46:x}),e(b,[2,16],{14:22,15:f,16:m}),e(b,[2,17]),e(b,[2,18]),e(b,[2,19]),e(b,[2,20]),e(b,[2,21]),e(b,[2,22]),e(w,[2,25],{27:[1,25]}),e(b,[2,26]),{19:26,26:12,31:g},{10:a,11:27,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:s,29:c,31:g,39:t,43:h,46:x},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(S,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(L,[2,13]),{26:35,31:g},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:a,11:37,13:4,14:22,15:f,16:m,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:s,29:c,31:g,39:t,43:h,46:x},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(S,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(b,[2,28]),e(b,[2,35]),e(b,[2,36]),e(b,[2,37]),e(b,[2,38]),{36:[1,47]},{33:48,34:_},{15:[1,50]},e(b,[2,27]),e(S,[2,33]),{38:[1,51]},{33:52,34:_,38:[2,31]},{31:[2,15]},e(S,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:u(function(d,i){if(i.recoverable)this.trace(d);else{var l=new Error(d);throw l.hash=i,l}},"parseError"),parse:u(function(d){var i=this,l=[0],p=[],E=[null],r=[],K=this.table,n="",F=0,Y=0,J=2,V=1,Z=r.slice.call(arguments,1),D=Object.create(this.lexer),z={yy:{}};for(var Q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Q)&&(z.yy[Q]=this.yy[Q]);D.setInput(d,z.yy),z.yy.lexer=D,z.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var $=D.yylloc;r.push($);var Re=D.options&&D.options.ranges;typeof z.yy.parseError=="function"?this.parseError=z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Pe(I){l.length=l.length-2*I,E.length=E.length-I,r.length=r.length-I}u(Pe,"popStack");function de(){var I;return I=p.pop()||D.lex()||V,typeof I!="number"&&(I instanceof Array&&(p=I,I=p.pop()),I=i.symbols_[I]||I),I}u(de,"lex");for(var N,R,v,ee,M={},U,B,pe,H;;){if(R=l[l.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((N===null||typeof N>"u")&&(N=de()),v=K[R]&&K[R][N]),typeof v>"u"||!v.length||!v[0]){var te="";H=[];for(U in K[R])this.terminals_[U]&&U>J&&H.push("'"+this.terminals_[U]+"'");D.showPosition?te="Parse error on line "+(F+1)+`:
|
|
1
|
+
import{g as Fe}from"./SgKRyWMJ.js";import{ap as Me,a5 as xe,ar as Ke,bc as We,bb as Ye,be as Ve,bd as Ue,b9 as He,b7 as Xe,b2 as je,aN as Ge,aF as qe,aE as Je,az as Ze,aj as Qe,ai as $e,ak as et,S as tt,R as st,K as rt,k as it,I as at,f as nt,g as ot,e as ct,b as u,W as P,aW as X,ag as lt,aD as ut,B as ht,ay as y,r as gt,am as dt,aU as pt,ab as ft,x as bt,aT as St,p as xt,X as Le,ae as Lt,af as mt,aK as yt,z as wt,a3 as Et,ah as me,b6 as kt,aL as _t}from"./Bsu5oWdj.js";import{G as Dt}from"./-xK_vQQs.js";function Tt(e){return Array.isArray(e)}function Nt(e){if(Me(e))return e;const a=xe(e);if(!It(e))return{};if(Tt(e)){const s=Array.from(e);return e.length>0&&typeof e[0]=="string"&&Object.hasOwn(e,"index")&&(s.index=e.index,s.input=e.input),s}if(Ke(e)){const s=e,c=s.constructor;return new c(s.buffer,s.byteOffset,s.length)}if(a==="[object ArrayBuffer]")return new ArrayBuffer(e.byteLength);if(a==="[object DataView]"){const s=e,c=s.buffer,g=s.byteOffset,t=s.byteLength,h=new ArrayBuffer(t),x=new Uint8Array(c,g,t);return new Uint8Array(h).set(x),new DataView(h)}if(a==="[object Boolean]"||a==="[object Number]"||a==="[object String]"){const s=e.constructor,c=new s(e.valueOf());return a==="[object String]"?Ct(c,e):se(c,e),c}if(a==="[object Date]")return new Date(Number(e));if(a==="[object RegExp]"){const s=e,c=new RegExp(s.source,s.flags);return c.lastIndex=s.lastIndex,c}if(a==="[object Symbol]")return Object(Symbol.prototype.valueOf.call(e));if(a==="[object Map]"){const s=e,c=new Map;return s.forEach((g,t)=>{c.set(t,g)}),c}if(a==="[object Set]"){const s=e,c=new Set;return s.forEach(g=>{c.add(g)}),c}if(a==="[object Arguments]"){const s=e,c={};return se(c,s),c.length=s.length,c[Symbol.iterator]=s[Symbol.iterator],c}const o={};return vt(o,e),se(o,e),Ot(o,e),o}function It(e){switch(xe(e)){case ct:case ot:case nt:case at:case it:case rt:case st:case tt:case et:case $e:case Qe:case Ze:case Je:case qe:case Ge:case je:case Xe:case He:case Ue:case Ve:case Ye:case We:return!0;default:return!1}}function se(e,a){for(const o in a)Object.hasOwn(a,o)&&(e[o]=a[o])}function Ot(e,a){const o=Object.getOwnPropertySymbols(a);for(let s=0;s<o.length;s++){const c=o[s];Object.prototype.propertyIsEnumerable.call(a,c)&&(e[c]=a[c])}}function Ct(e,a){const o=a.valueOf().length;for(const s in a)Object.hasOwn(a,s)&&(Number.isNaN(Number(s))||Number(s)>=o)&&(e[s]=a[s])}function vt(e,a){const o=Object.getPrototypeOf(a);o!==null&&typeof a.constructor=="function"&&Object.setPrototypeOf(e,o)}var ie=(function(){var e=u(function(C,d,i,l){for(i=i||{},l=C.length;l--;i[C[l]]=d);return i},"o"),a=[1,15],o=[1,7],s=[1,13],c=[1,14],g=[1,19],t=[1,16],h=[1,17],x=[1,18],L=[8,30],b=[8,10,21,28,29,30,31,39,43,46],f=[1,23],m=[1,24],w=[8,10,15,16,21,28,29,30,31,39,43,46],S=[8,10,15,16,21,27,28,29,30,31,39,43,46],_=[1,49],k={trace:u(function(){},"trace"),yy:{},symbols_:{error:2,spaceLines:3,SPACELINE:4,NL:5,separator:6,SPACE:7,EOF:8,start:9,BLOCK_DIAGRAM_KEY:10,document:11,stop:12,statement:13,link:14,LINK:15,START_LINK:16,LINK_LABEL:17,STR:18,nodeStatement:19,columnsStatement:20,SPACE_BLOCK:21,blockStatement:22,classDefStatement:23,cssClassStatement:24,styleStatement:25,node:26,SIZE:27,COLUMNS:28,"id-block":29,end:30,NODE_ID:31,nodeShapeNLabel:32,dirList:33,DIR:34,NODE_DSTART:35,NODE_DEND:36,BLOCK_ARROW_START:37,BLOCK_ARROW_END:38,classDef:39,CLASSDEF_ID:40,CLASSDEF_STYLEOPTS:41,DEFAULT:42,class:43,CLASSENTITY_IDS:44,STYLECLASS:45,style:46,STYLE_ENTITY_IDS:47,STYLE_DEFINITION_DATA:48,$accept:0,$end:1},terminals_:{2:"error",4:"SPACELINE",5:"NL",7:"SPACE",8:"EOF",10:"BLOCK_DIAGRAM_KEY",15:"LINK",16:"START_LINK",17:"LINK_LABEL",18:"STR",21:"SPACE_BLOCK",27:"SIZE",28:"COLUMNS",29:"id-block",30:"end",31:"NODE_ID",34:"DIR",35:"NODE_DSTART",36:"NODE_DEND",37:"BLOCK_ARROW_START",38:"BLOCK_ARROW_END",39:"classDef",40:"CLASSDEF_ID",41:"CLASSDEF_STYLEOPTS",42:"DEFAULT",43:"class",44:"CLASSENTITY_IDS",45:"STYLECLASS",46:"style",47:"STYLE_ENTITY_IDS",48:"STYLE_DEFINITION_DATA"},productions_:[0,[3,1],[3,2],[3,2],[6,1],[6,1],[6,1],[9,3],[12,1],[12,1],[12,2],[12,2],[11,1],[11,2],[14,1],[14,4],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[19,3],[19,2],[19,1],[20,1],[22,4],[22,3],[26,1],[26,2],[33,1],[33,2],[32,3],[32,4],[23,3],[23,3],[24,3],[25,3]],performAction:u(function(d,i,l,p,E,r,K){var n=r.length-1;switch(E){case 4:p.getLogger().debug("Rule: separator (NL) ");break;case 5:p.getLogger().debug("Rule: separator (Space) ");break;case 6:p.getLogger().debug("Rule: separator (EOF) ");break;case 7:p.getLogger().debug("Rule: hierarchy: ",r[n-1]),p.setHierarchy(r[n-1]);break;case 8:p.getLogger().debug("Stop NL ");break;case 9:p.getLogger().debug("Stop EOF ");break;case 10:p.getLogger().debug("Stop NL2 ");break;case 11:p.getLogger().debug("Stop EOF2 ");break;case 12:p.getLogger().debug("Rule: statement: ",r[n]),typeof r[n].length=="number"?this.$=r[n]:this.$=[r[n]];break;case 13:p.getLogger().debug("Rule: statement #2: ",r[n-1]),this.$=[r[n-1]].concat(r[n]);break;case 14:p.getLogger().debug("Rule: link: ",r[n],d),this.$={edgeTypeStr:r[n],label:""};break;case 15:p.getLogger().debug("Rule: LABEL link: ",r[n-3],r[n-1],r[n]),this.$={edgeTypeStr:r[n],label:r[n-1]};break;case 18:const F=parseInt(r[n]),Y=p.generateId();this.$={id:Y,type:"space",label:"",width:F,children:[]};break;case 23:p.getLogger().debug("Rule: (nodeStatement link node) ",r[n-2],r[n-1],r[n]," typestr: ",r[n-1].edgeTypeStr);const J=p.edgeStrToEdgeData(r[n-1].edgeTypeStr),V=p.edgeStrToEdgeStartData(r[n-1].edgeTypeStr),Z=p.edgeStrToThickness(r[n-1].edgeTypeStr),D=p.edgeStrToPattern(r[n-1].edgeTypeStr);this.$=[{id:r[n-2].id,label:r[n-2].label,type:r[n-2].type,directions:r[n-2].directions},{id:r[n-2].id+"-"+r[n].id,start:r[n-2].id,end:r[n].id,label:r[n-1].label,type:"edge",thickness:Z,pattern:D,directions:r[n].directions,arrowTypeEnd:J,arrowTypeStart:V},{id:r[n].id,label:r[n].label,type:p.typeStr2Type(r[n].typeStr),directions:r[n].directions}];break;case 24:p.getLogger().debug("Rule: nodeStatement (abc88 node size) ",r[n-1],r[n]),this.$={id:r[n-1].id,label:r[n-1].label,type:p.typeStr2Type(r[n-1].typeStr),directions:r[n-1].directions,widthInColumns:parseInt(r[n],10)};break;case 25:p.getLogger().debug("Rule: nodeStatement (node) ",r[n]),this.$={id:r[n].id,label:r[n].label,type:p.typeStr2Type(r[n].typeStr),directions:r[n].directions,widthInColumns:1};break;case 26:p.getLogger().debug("APA123",this?this:"na"),p.getLogger().debug("COLUMNS: ",r[n]),this.$={type:"column-setting",columns:r[n]==="auto"?-1:parseInt(r[n])};break;case 27:p.getLogger().debug("Rule: id-block statement : ",r[n-2],r[n-1]),p.generateId(),this.$={...r[n-2],type:"composite",children:r[n-1]};break;case 28:p.getLogger().debug("Rule: blockStatement : ",r[n-2],r[n-1],r[n]);const z=p.generateId();this.$={id:z,type:"composite",label:"",children:r[n-1]};break;case 29:p.getLogger().debug("Rule: node (NODE_ID separator): ",r[n]),this.$={id:r[n]};break;case 30:p.getLogger().debug("Rule: node (NODE_ID nodeShapeNLabel separator): ",r[n-1],r[n]),this.$={id:r[n-1],label:r[n].label,typeStr:r[n].typeStr,directions:r[n].directions};break;case 31:p.getLogger().debug("Rule: dirList: ",r[n]),this.$=[r[n]];break;case 32:p.getLogger().debug("Rule: dirList: ",r[n-1],r[n]),this.$=[r[n-1]].concat(r[n]);break;case 33:p.getLogger().debug("Rule: nodeShapeNLabel: ",r[n-2],r[n-1],r[n]),this.$={typeStr:r[n-2]+r[n],label:r[n-1]};break;case 34:p.getLogger().debug("Rule: BLOCK_ARROW nodeShapeNLabel: ",r[n-3],r[n-2]," #3:",r[n-1],r[n]),this.$={typeStr:r[n-3]+r[n],label:r[n-2],directions:r[n-1]};break;case 35:case 36:this.$={type:"classDef",id:r[n-1].trim(),css:r[n].trim()};break;case 37:this.$={type:"applyClass",id:r[n-1].trim(),styleClass:r[n].trim()};break;case 38:this.$={type:"applyStyles",id:r[n-1].trim(),stylesStr:r[n].trim()};break}},"anonymous"),table:[{9:1,10:[1,2]},{1:[3]},{10:a,11:3,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:s,29:c,31:g,39:t,43:h,46:x},{8:[1,20]},e(L,[2,12],{13:4,19:5,20:6,22:8,23:9,24:10,25:11,26:12,11:21,10:a,21:o,28:s,29:c,31:g,39:t,43:h,46:x}),e(b,[2,16],{14:22,15:f,16:m}),e(b,[2,17]),e(b,[2,18]),e(b,[2,19]),e(b,[2,20]),e(b,[2,21]),e(b,[2,22]),e(w,[2,25],{27:[1,25]}),e(b,[2,26]),{19:26,26:12,31:g},{10:a,11:27,13:4,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:s,29:c,31:g,39:t,43:h,46:x},{40:[1,28],42:[1,29]},{44:[1,30]},{47:[1,31]},e(S,[2,29],{32:32,35:[1,33],37:[1,34]}),{1:[2,7]},e(L,[2,13]),{26:35,31:g},{31:[2,14]},{17:[1,36]},e(w,[2,24]),{10:a,11:37,13:4,14:22,15:f,16:m,19:5,20:6,21:o,22:8,23:9,24:10,25:11,26:12,28:s,29:c,31:g,39:t,43:h,46:x},{30:[1,38]},{41:[1,39]},{41:[1,40]},{45:[1,41]},{48:[1,42]},e(S,[2,30]),{18:[1,43]},{18:[1,44]},e(w,[2,23]),{18:[1,45]},{30:[1,46]},e(b,[2,28]),e(b,[2,35]),e(b,[2,36]),e(b,[2,37]),e(b,[2,38]),{36:[1,47]},{33:48,34:_},{15:[1,50]},e(b,[2,27]),e(S,[2,33]),{38:[1,51]},{33:52,34:_,38:[2,31]},{31:[2,15]},e(S,[2,34]),{38:[2,32]}],defaultActions:{20:[2,7],23:[2,14],50:[2,15],52:[2,32]},parseError:u(function(d,i){if(i.recoverable)this.trace(d);else{var l=new Error(d);throw l.hash=i,l}},"parseError"),parse:u(function(d){var i=this,l=[0],p=[],E=[null],r=[],K=this.table,n="",F=0,Y=0,J=2,V=1,Z=r.slice.call(arguments,1),D=Object.create(this.lexer),z={yy:{}};for(var Q in this.yy)Object.prototype.hasOwnProperty.call(this.yy,Q)&&(z.yy[Q]=this.yy[Q]);D.setInput(d,z.yy),z.yy.lexer=D,z.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var $=D.yylloc;r.push($);var Re=D.options&&D.options.ranges;typeof z.yy.parseError=="function"?this.parseError=z.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function Pe(I){l.length=l.length-2*I,E.length=E.length-I,r.length=r.length-I}u(Pe,"popStack");function de(){var I;return I=p.pop()||D.lex()||V,typeof I!="number"&&(I instanceof Array&&(p=I,I=p.pop()),I=i.symbols_[I]||I),I}u(de,"lex");for(var N,R,v,ee,M={},U,B,pe,H;;){if(R=l[l.length-1],this.defaultActions[R]?v=this.defaultActions[R]:((N===null||typeof N>"u")&&(N=de()),v=K[R]&&K[R][N]),typeof v>"u"||!v.length||!v[0]){var te="";H=[];for(U in K[R])this.terminals_[U]&&U>J&&H.push("'"+this.terminals_[U]+"'");D.showPosition?te="Parse error on line "+(F+1)+`:
|
|
2
2
|
`+D.showPosition()+`
|
|
3
3
|
Expecting `+H.join(", ")+", got '"+(this.terminals_[N]||N)+"'":te="Parse error on line "+(F+1)+": Unexpected "+(N==V?"end of input":"'"+(this.terminals_[N]||N)+"'"),this.parseError(te,{text:D.match,token:this.terminals_[N]||N,line:D.yylineno,loc:$,expected:H})}if(v[0]instanceof Array&&v.length>1)throw new Error("Parse Error: multiple actions possible at state: "+R+", token: "+N);switch(v[0]){case 1:l.push(N),E.push(D.yytext),r.push(D.yylloc),l.push(v[1]),N=null,Y=D.yyleng,n=D.yytext,F=D.yylineno,$=D.yylloc;break;case 2:if(B=this.productions_[v[1]][1],M.$=E[E.length-B],M._$={first_line:r[r.length-(B||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(B||1)].first_column,last_column:r[r.length-1].last_column},Re&&(M._$.range=[r[r.length-(B||1)].range[0],r[r.length-1].range[1]]),ee=this.performAction.apply(M,[n,Y,F,z.yy,v[1],E,r].concat(Z)),typeof ee<"u")return ee;B&&(l=l.slice(0,-1*B*2),E=E.slice(0,-1*B),r=r.slice(0,-1*B)),l.push(this.productions_[v[1]][0]),E.push(M.$),r.push(M._$),pe=K[l[l.length-2]][l[l.length-1]],l.push(pe);break;case 3:return!0}}return!0},"parse")},T=(function(){var C={EOF:1,parseError:u(function(i,l){if(this.yy.parser)this.yy.parser.parseError(i,l);else throw new Error(i)},"parseError"),setInput:u(function(d,i){return this.yy=i||this.yy||{},this._input=d,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:u(function(){var d=this._input[0];this.yytext+=d,this.yyleng++,this.offset++,this.match+=d,this.matched+=d;var i=d.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),d},"input"),unput:u(function(d){var i=d.length,l=d.split(/(?:\r\n?|\n)/g);this._input=d+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var p=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),l.length-1&&(this.yylineno-=l.length-1);var E=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:l?(l.length===p.length?this.yylloc.first_column:0)+p[p.length-l.length].length-l[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[E[0],E[0]+this.yyleng-i]),this.yyleng=this.yytext.length,this},"unput"),more:u(function(){return this._more=!0,this},"more"),reject:u(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:u(function(d){this.unput(this.match.slice(d))},"less"),pastInput:u(function(){var d=this.matched.substr(0,this.matched.length-this.match.length);return(d.length>20?"...":"")+d.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:u(function(){var d=this.match;return d.length<20&&(d+=this._input.substr(0,20-d.length)),(d.substr(0,20)+(d.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:u(function(){var d=this.pastInput(),i=new Array(d.length+1).join("-");return d+this.upcomingInput()+`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/
|
|
2
|
-
var W1=Object.defineProperty;var z1=(e,t,r)=>t in e?W1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var gr=(e,t,r)=>z1(e,typeof t!="symbol"?t+"":t,r);import{_ as Ge,t as _a,br as ze,bp as Ye,bz as La,b as Aa,a_ as ur,bs as H1}from"./DXyyWeag.js";import{g as Y1}from"./BdWqymET.js";import{aP as cs}from"./
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/DkITK-2z.js","/app/immutable/chunks/BugMDWpY.js","/app/immutable/chunks/BFkh8x47.js","/app/immutable/chunks/DXyyWeag.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/-xK_vQQs.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/DEAJosBQ.js","/app/immutable/chunks/pqyPptbZ.js","/app/immutable/chunks/A3j68Jpj.js","/app/immutable/chunks/lAmQKSWr.js","/app/immutable/chunks/B0LTdoMZ.js","/app/immutable/chunks/C451wdH8.js","/app/immutable/chunks/B984L3ei.js","/app/immutable/chunks/SgKRyWMJ.js","/app/immutable/chunks/DXtdosGC.js","/app/immutable/chunks/DZx5PyYP.js","/app/immutable/chunks/z1z8GC2-.js","/app/immutable/chunks/Cg2SHWhQ.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/D5ej8a-y.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/ppRpwazH.js","/app/immutable/chunks/Cuqq8bL5.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/DyvrH0mm.js","/app/immutable/chunks/BTdkHPOB.js","/app/immutable/chunks/CnVt0JNG.js","/app/immutable/chunks/CjaOLL1c.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/Bfr1QjPr.js","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/BybfkKTj.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/DEYvT_CO.js","/app/immutable/chunks/BboIV5H5.js","/app/immutable/chunks/DYQYcTNY.js","/app/immutable/chunks/DT4bpJWb.js","/app/immutable/chunks/DJkHth-B.js","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/RD9QY1Yc.js","/app/immutable/chunks/DogedYC1.js","/app/immutable/chunks/BAKm0uzb.js","/app/immutable/chunks/DHQOuksI.js","/app/immutable/chunks/DNBv5HWD.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/-ccfrtH7.js","/app/immutable/chunks/ChkzKl5W.js","/app/immutable/chunks/pKvpKpo4.js","/app/immutable/chunks/C2vLXngQ.js","/app/immutable/chunks/CxHAlRVQ.js","/app/immutable/chunks/C0U5HDdc.js","/app/immutable/chunks/Dn6TxX1b.js","/app/immutable/chunks/BgDzDopc.js","/app/immutable/chunks/DKpqZZ5J.js","/app/immutable/chunks/2gme4FSl.js","/app/immutable/chunks/ppFDuElZ.js","/app/immutable/chunks/uyuKNxsR.js","/app/immutable/chunks/B3Vpc0UD.js","/app/immutable/chunks/CM6ofsmm.js","/app/immutable/chunks/CXryJZjo.js","/app/immutable/chunks/D7KFkzTo.js","/app/immutable/chunks/qTbFtTyZ.js","/app/immutable/chunks/CNmewsOv.js","/app/immutable/chunks/qHzkHUJa.js","/app/immutable/chunks/CJgNYK9V.js","/app/immutable/chunks/DDe9tE4g.js","/app/immutable/chunks/DfSU1zsS.js","/app/immutable/chunks/DSaN60B-.js","/app/immutable/chunks/VaiKGhlm.js","/app/immutable/chunks/CVNMYGFF.js","/app/immutable/chunks/ChM8LZU3.js","/app/immutable/chunks/Bq6eGKPr.js","/app/immutable/chunks/BmpDuIkF.js","/app/immutable/chunks/D_Pty9qy.js","/app/immutable/chunks/CCeWyMrz.js","/app/immutable/chunks/C9Tn2aWq.js","/app/immutable/chunks/DXFhywqj.js","/app/immutable/chunks/Dgc550NC.js","/app/immutable/chunks/UgJ8KjVC.js","/app/immutable/chunks/BehoboVr.js","/app/immutable/chunks/BNReA8Eg.js","/app/immutable/chunks/CtLD2qbA.js","/app/immutable/chunks/DvDeEn1B.js","/app/immutable/chunks/B-YLcmrj.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var W1=Object.defineProperty;var z1=(e,t,r)=>t in e?W1(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var gr=(e,t,r)=>z1(e,typeof t!="symbol"?t+"":t,r);import{_ as Ge,t as _a,br as ze,bp as Ye,bz as La,b as Aa,a_ as ur,bs as H1}from"./DXyyWeag.js";import{g as Y1}from"./BdWqymET.js";import{aP as cs}from"./z1z8GC2-.js";import{b7 as X1,cc as j1,bs as Fa,a7 as za,ay as ri,aD as S,bS as qe,be as Hs,b$ as zn,b_ as or,bO as pr,W as ge,c9 as Et,bn as $a,aA as Te,aB as er,bk as Gh,bH as ft,ca as ba,c5 as el,a5 as Ne,bA as Fe,bV as ce,bl as kr,c0 as ch,aC as oi,aw as rl,a as vu,bj as Cp,br as fi,cb as G1,bf as U1}from"./DYhIMPy1.js";import{z as Mu}from"./ag0-9R2l.js";import{v as ra,u as fe,s as Ys,o as V1,i as wp,e as Z1,f as K1,g as Q1,n as no,p as Tu,j as kp,w as Oo}from"./CjaOLL1c.js";import{b as ta}from"./BaIAhI85.js";import{c as J1}from"./ChTqQfQN.js";import{c$ as tC,cR as eC,F as Qs,aI as rC,b7 as Sp,l as iC,m as aC,f as oC,i as sC,v as Bu,s as _u,g as nC,G as lC,P as cC,q as hC,y as dC,p as uC,j as fC,D as Lu,H as gC,U as pC,at as mC,au as yC,aU as xC}from"./BTdkHPOB.js";import{f as Ho,am as bC}from"./Bfr1QjPr.js";import{r as CC,a6 as wC}from"./D8Y4PJzg.js";import{e as kC,H as SC}from"./D7Li4Mli.js";import{G as vp}from"./DyvrH0mm.js";import{I as xa,h as Au,H as Ms,d as Fu}from"./BboIV5H5.js";import{c as io}from"./CnVt0JNG.js";import{e as vC}from"./B5m4HK_m.js";import{t as MC}from"./4NMrKcis.js";import{s as Hn}from"./Cuqq8bL5.js";import{s as $u,a as TC}from"./BsieX9dN.js";import{p as BC,K as _C,h as LC,i as sc,M as AC}from"./CX_KiszT.js";import"./D6bHtnlF.js";import{t as ga}from"./DT4bpJWb.js";import"./DJkHth-B.js";import"./D5ej8a-y.js";import{cq as FC}from"./DYQYcTNY.js";function $C(e,t){X1(window,["resize"],()=>j1(()=>t(window[e])))}var Mp=Object.defineProperty,b=(e,t)=>Mp(e,"name",{value:t,configurable:!0}),EC=(e,t)=>{for(var r in t)Mp(e,r,{get:t[r],enumerable:!0})};function Tp(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}b(Tp,"getDefaultExportFromCjs");var jr={},kn={},Ra={},Eu;function ms(){if(Eu)return Ra;Eu=1;function e(s){return typeof s>"u"||s===null}b(e,"isNothing");function t(s){return typeof s=="object"&&s!==null}b(t,"isObject");function r(s){return Array.isArray(s)?s:e(s)?[]:[s]}b(r,"toArray");function i(s,n){if(n){const l=Object.keys(n);for(let c=0,h=l.length;c<h;c+=1){const d=l[c];s[d]=n[d]}}return s}b(i,"extend");function a(s,n){let l="";for(let c=0;c<n;c+=1)l+=s;return l}b(a,"repeat");function o(s){return s===0&&Number.NEGATIVE_INFINITY===1/s}return b(o,"isNegativeZero"),Ra.isNothing=e,Ra.isObject=t,Ra.toArray=r,Ra.repeat=a,Ra.isNegativeZero=o,Ra.extend=i,Ra}b(ms,"requireCommon");var nc,Pu;function ys(){if(Pu)return nc;Pu=1;function e(r,i){let a="";const o=r.reason||"(unknown reason)";return r.mark?(r.mark.name&&(a+='in "'+r.mark.name+'" '),a+="("+(r.mark.line+1)+":"+(r.mark.column+1)+")",!i&&r.mark.snippet&&(a+=`
|
|
3
3
|
|
|
4
4
|
`+r.mark.snippet),o+" "+a):o}b(e,"formatError");function t(r,i){Error.call(this),this.name="YAMLException",this.reason=r,this.mark=i,this.message=e(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}return b(t,"YAMLException2"),t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t.prototype.toString=b(function(i){return this.name+": "+e(this,i)},"toString"),nc=t,nc}b(ys,"requireException");var lc,Iu;function Bp(){if(Iu)return lc;Iu=1;const e=ms();function t(a,o,s,n,l){let c="",h="";const d=Math.floor(l/2)-1;return n-o>d&&(c=" ... ",o=n-d+c.length),s-n>d&&(h=" ...",s=n+d-h.length),{str:c+a.slice(o,s).replace(/\t/g,"→")+h,pos:n-o+c.length}}b(t,"getLine");function r(a,o){return e.repeat(" ",o-a.length)+a}b(r,"padStart");function i(a,o){if(o=Object.create(o||null),!a.buffer)return null;o.maxLength||(o.maxLength=79),typeof o.indent!="number"&&(o.indent=1),typeof o.linesBefore!="number"&&(o.linesBefore=3),typeof o.linesAfter!="number"&&(o.linesAfter=2);const s=/\r?\n|\r|\0/g,n=[0],l=[];let c,h=-1;for(;c=s.exec(a.buffer);)l.push(c.index),n.push(c.index+c[0].length),a.position<=c.index&&h<0&&(h=n.length-2);h<0&&(h=n.length-1);let d="";const u=Math.min(a.line+o.linesAfter,l.length).toString().length,f=o.maxLength-(o.indent+u+3);for(let g=1;g<=o.linesBefore&&!(h-g<0);g++){const m=t(a.buffer,n[h-g],l[h-g],a.position-(n[h]-n[h-g]),f);d=e.repeat(" ",o.indent)+r((a.line-g+1).toString(),u)+" | "+m.str+`
|
|
5
5
|
`+d}const p=t(a.buffer,n[h],l[h],a.position,f);d+=e.repeat(" ",o.indent)+r((a.line+1).toString(),u)+" | "+p.str+`
|
|
@@ -298,8 +298,8 @@ ${o.join(`
|
|
|
298
298
|
L0,20`)},"requirement_arrow"),W_=b((e,t,r)=>{const i=Tr(),{themeVariables:a}=i,{strokeWidth:o}=a;e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_arrowEnd").attr("refX",20).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").attr("stroke-width",`${o}`).attr("viewBox","0 0 25 20").append("path").attr("d",`M0,0
|
|
299
299
|
L20,10
|
|
300
300
|
M20,10
|
|
301
|
-
L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),z_=b((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),H_=b((e,t,r)=>{const i=Tr(),{themeVariables:a}=i,{strokeWidth:o}=a,s=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${o}`)},"requirement_contains_neo"),Y_=b((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-hierarchyEnd").attr("class","marker hierarchy "+t).attr("viewBox","0 0 12 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 0 0 L 6 5 L 0 10 M 4 0 L 10 5 L 4 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none"),e.append("marker").attr("id",r+"_"+t+"-hierarchyStart").attr("class","marker hierarchy "+t).attr("viewBox","0 0 12 10").attr("refX",2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 12 0 L 6 5 L 12 10 M 8 0 L 2 5 L 8 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none")},"hierarchy"),X_=b((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-openArrowEnd").attr("class","marker openArrow "+t).attr("viewBox","0 0 12 12").attr("refX",11).attr("refY",6).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1 1 L 11 6 L 1 11").attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-linecap","round").style("stroke-linejoin","round").style("stroke-dasharray","1,0").style("fill","none"),e.append("marker").attr("id",r+"_"+t+"-openArrowStart").attr("class","marker openArrow "+t).attr("viewBox","0 0 12 12").attr("refX",1).attr("refY",6).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 11 1 L 1 6 L 11 11").attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-linecap","round").style("stroke-linejoin","round").style("stroke-dasharray","1,0").style("fill","none")},"openArrow"),j_=b((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-hollowCircleStart").attr("class","marker hollowCircle "+t).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("circle").attr("cx",5).attr("cy",5).attr("r",3.6).attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-dasharray","1,0").style("fill","none"),e.append("marker").attr("id",r+"_"+t+"-hollowCircleEnd").attr("class","marker hollowCircle "+t).attr("viewBox","0 0 10 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("circle").attr("cx",5).attr("cy",5).attr("r",3.6).attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-dasharray","1,0").style("fill","none")},"hollowCircle"),G_={extension:k_,composition:S_,aggregation:v_,dependency:M_,lollipop:T_,point:B_,circle:__,cross:L_,barb:A_,barbNeo:F_,hierarchy:Y_,only_one:$_,zero_or_one:E_,one_or_more:P_,zero_or_more:I_,only_one_neo:O_,zero_or_one_neo:R_,one_or_more_neo:D_,zero_or_more_neo:N_,requirement_arrow:q_,requirement_contains:z_,requirement_arrow_neo:W_,requirement_contains_neo:H_,openArrow:X_,hollowCircle:j_},U_=w_,V_={common:hn,getConfig:Tr,insertCluster:BB,insertEdge:C_,insertEdgeLabel:u_,insertMarkers:U_,insertNode:O0,interpolateToCurve:$d,labelHelper:he,log:Tt,positionEdgeLabel:g_},Z_=["elk.stress","elk.force","elk.mrtree","elk.sporeOverlap","elk.box","elk.rectpacking"],an=Object.create(null),eb=b(e=>{for(const t of e)an[t.name]=t},"registerLayoutLoaders"),K_=b(()=>{const e=b(async()=>await Ge(()=>import("./BRqXLjM4.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),"loader");return[{name:"elk",loader:e,algorithm:"elk.layered"},...Z_.map(t=>({name:t,loader:e,algorithm:t}))]},"elkLayoutLoaders"),Q_=b(()=>{eb([{name:"dagre",loader:b(async()=>await Ge(()=>import("./BFQ4zSOP.js"),__vite__mapDeps([7,2,3,4,5]),import.meta.url),"loader")},{name:"swimlane",loader:b(async()=>await Ge(()=>import("./Cg13XVA6.js"),__vite__mapDeps([8,1,2,3,4,5]),import.meta.url),"loader")},{name:"cose-bilkent",loader:b(async()=>await Ge(()=>import("./Cc3t1-St.js"),__vite__mapDeps([9,10,6]),import.meta.url),"loader")},...K_()])},"registerDefaultLayoutLoaders");Q_();var eP=b(async(e,t)=>{if(!Object.hasOwn(an,e.layoutAlgorithm))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const o of e.nodes){const s=o.domId||o.id;o.domId=`${e.diagramId}-${s}`}const r=an[e.layoutAlgorithm],i=await r.loader();DC(t,e.config);const a=await i.render(e,t,V_,{algorithm:r.algorithm});return s_(t.node()),a},"render"),Vc="dagre",rP=b((e="",{fallback:t=Vc}={})=>{if(Object.hasOwn(an,e))return e;for(const r of[t,Vc])if(Object.hasOwn(an,r))return Tt.warn(`Layout algorithm ${e} is not registered. Using ${r} as fallback.`),r;throw new Error(`Neither layout algorithm ${e}, ${t}, nor ${Vc} is registered.`)},"getRegisteredLayoutAlgorithm"),J_=b(e=>{const{securityLevel:t}=Xe();let r=He("body");if(t==="sandbox"){const o=He(`#i${e}`).node()?.contentDocument??document;r=He(o.body)}return r.select(`#${e}`)},"selectSvgElement"),ou="comm",rb="rule",ib="decl",tL="@media",eL="@import",rL="@supports",iL="@namespace",Rh="@keyframes",ab="@layer",aL="@scope",oL=Math.abs,Ks=String.fromCharCode;function ob(e){return e.trim()}function Dh(e,t,r){return e.replace(t,r)}function Go(e,t){return e.charCodeAt(t)|0}function us(e,t,r){return e.slice(t,r)}function Ki(e){return e.length}function sb(e){return e.length}function Pn(e,t){return t.push(e),e}var Vl=1,fs=1,nb=0,_i=0,Pr=0,ws="";function su(e,t,r,i,a,o,s,n){return{value:e,root:t,parent:r,type:i,props:a,children:o,line:Vl,column:fs,length:s,return:"",siblings:n}}function sL(){return Pr}function nL(){return Pr=_i>0?Go(ws,--_i):0,fs--,Pr===10&&(fs=1,Vl--),Pr}function Di(){return Pr=_i<nb?Go(ws,_i++):0,fs++,Pr===10&&(fs=1,Vl++),Pr}function qa(){return Go(ws,_i)}function Jn(){return _i}function Zl(e,t){return us(ws,e,t)}function on(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function lL(e){return Vl=fs=1,nb=Ki(ws=e),_i=0,[]}function cL(e){return ws="",e}function Zc(e){return ob(Zl(_i-1,Nh(e===91?e+2:e===40?e+1:e)))}function hL(e){for(;(Pr=qa())&&Pr<33;)Di();return on(e)>2||on(Pr)>3?"":" "}function dL(e,t){for(;--t&&Di()&&!(Pr<48||Pr>102||Pr>57&&Pr<65||Pr>70&&Pr<97););return Zl(e,Jn()+(t<6&&qa()==32&&Di()==32))}function Nh(e){for(;Di();)switch(Pr){case e:return _i;case 34:case 39:e!==34&&e!==39&&Nh(Pr);break;case 40:e===41&&Nh(e);break;case 92:Di();break}return _i}function uL(e,t){for(;Di()&&e+Pr!==57;)if(e+Pr===84&&qa()===47)break;return"/*"+Zl(t,_i-1)+"*"+Ks(e===47?e:Di())}function fL(e){for(;!on(qa());)Di();return Zl(e,_i)}function gL(e){return cL(tl("",null,null,null,[""],e=lL(e),0,[0],e))}function tl(e,t,r,i,a,o,s,n,l){for(var c=0,h=0,d=s,u=0,f=0,p=0,g=1,m=1,y=1,x=0,C=0,k="",v=a,T=o,F=i,A=k;m;)switch(p=C,C=Di()){case 40:p!=108&&Go(A,d-1)==58?(x++,A+="("):A+=Zc(C);break;case 41:x--,A+=")";break;case 34:case 39:case 91:A+=Zc(C);break;case 9:case 10:case 13:case 32:if(x>0){A+=Ks(C);break}A+=hL(p);break;case 92:A+=dL(Jn()-1,7);continue;case 47:switch(qa()){case 42:case 47:Pn(pL(uL(Di(),Jn()),t,r,l),l),(on(p||1)==5||on(qa()||1)==5)&&Ki(A)&&us(A,-1,void 0)!==" "&&(A+=" ");break;default:A+="/"}break;case 123*g:n[c++]=Ki(A)*y;case 125*g:case 59:case 0:if(x>0&&C){A+=Ks(C);break}switch(C){case 0:case 125:m=0;case 59+h:y==-1&&(A=Dh(A,/\f/g,"")),f>0&&(Ki(A)-d||g===0)&&Pn(f>32?Hg(A+";",i,r,d-1,l):Hg(Dh(A," ","")+";",i,r,d-2,l),l);break;case 59:A+=";";default:if(Pn(F=zg(A,t,r,c,h,a,n,k,v=[],T=[],d,o),o),C===123)if(h===0)tl(A,t,F,F,v,o,d,n,T);else{switch(u){case 99:if(Go(A,3)===110)break;case 108:if(Go(A,2)===97)break;default:h=0;case 100:case 109:case 115:}h?tl(e,F,F,i&&Pn(zg(e,F,F,0,0,a,n,k,a,v=[],d,T),T),a,T,d,n,i?v:T):tl(A,F,F,F,[""],T,0,n,T)}}c=h=f=0,g=y=1,k=A="",d=s;break;case 58:d=1+Ki(A),f=p;default:if(g<1){if(C==123)--g;else if(C==125&&g++==0&&nL()==125)continue}switch(A+=Ks(C),C*g){case 38:y=h>0?1:(A+="\f",-1);break;case 44:if(x>0)break;n[c++]=(Ki(A)-1)*y,y=1;break;case 64:qa()===45&&(A+=Zc(Di())),u=qa(),h=d=Ki(k=A+=fL(Jn())),C++;break;case 45:p===45&&Ki(A)==2&&(g=0)}}return o}function zg(e,t,r,i,a,o,s,n,l,c,h,d){for(var u=a-1,f=a===0?o:[""],p=sb(f),g=0,m=0,y=0;g<i;++g)for(var x=0,C=us(e,u+1,u=oL(m=s[g])),k=e;x<p;++x)(k=ob(m>0?f[x]+" "+C:Dh(C,/&\f/g,f[x])))&&(l[y++]=k);return su(e,t,r,a===0?rb:n,l,c,h,d)}function pL(e,t,r,i){return su(e,t,r,ou,Ks(sL()),us(e,2,-2),0,i)}function Hg(e,t,r,i,a){return su(e,t,r,ib,us(e,0,i),us(e,i+1,-1),i,a)}function qh(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function mL(e,t,r,i){switch(e.type){case ab:if(e.children.length)break;case eL:case iL:case ib:return e.return=e.return||e.value;case ou:return"";case Rh:return e.return=e.value+"{"+qh(e.children,i)+"}";case rb:if(!Ki(e.value=e.props.join(",")))return""}return Ki(r=qh(e.children,i))?e.return=e.value+"{"+r+"}":""}function yL(e){var t=sb(e);return function(r,i,a,o){for(var s="",n=0;n<t;n++)s+=e[n](r,i,a,o)||"";return s}}var lb="c4",xL=b(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),bL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./wkk-WhNm.js");return{diagram:t}},__vite__mapDeps([11,12]),import.meta.url);return{id:lb,diagram:e}},"loader"),CL={id:lb,detector:xL,loader:bL},wL=CL,cb="flowchart-v2",kL=b(e=>/^\s*(graph|flowchart)/.test(e),"detector"),SL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./BIKajrVX.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:cb,diagram:e}},"loader"),vL={id:cb,detector:kL,loader:SL},ML=vL,hb="agentflow",TL=b(e=>/^\s*agentflow-beta\b/.test(e),"detector"),BL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./Cmktqw1t.js");return{diagram:t}},__vite__mapDeps([55,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:hb,diagram:e}},"loader"),_L={id:hb,detector:TL,loader:BL},LL=_L,db="swimlane",AL=b(e=>/^\s*swimlane-beta\b/.test(e),"detector"),FL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./7sX0Tp9W.js");return{diagram:t}},__vite__mapDeps([56,13,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:db,diagram:e}},"loader"),$L={id:db,detector:AL,loader:FL},EL=$L,ub="er",PL=b(e=>/^\s*erDiagram/.test(e),"detector"),IL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./DVtimWsJ.js");return{diagram:t}},__vite__mapDeps([57,15,16]),import.meta.url);return{id:ub,diagram:e}},"loader"),OL={id:ub,detector:PL,loader:IL},RL=OL,fb="gitGraph",DL=b(e=>/^\s*gitGraph/.test(e),"detector"),NL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./99pf2UTc.js");return{diagram:t}},__vite__mapDeps([58,59,60,61,3,4]),import.meta.url);return{id:fb,diagram:e}},"loader"),qL={id:fb,detector:DL,loader:NL},WL=qL,gb="gantt",zL=b(e=>/^\s*gantt/.test(e),"detector"),HL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./bTTOLC6Y.js");return{diagram:t}},__vite__mapDeps([62,6,63]),import.meta.url);return{id:gb,diagram:e}},"loader"),YL={id:gb,detector:zL,loader:HL},XL=YL,pb="info",jL=b(e=>/^\s*info/.test(e),"detector"),GL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./D2MxkB-j.js");return{diagram:t}},__vite__mapDeps([64,61,3,4]),import.meta.url);return{id:pb,diagram:e}},"loader"),UL={id:pb,detector:jL,loader:GL},mb="pie",VL=b(e=>/^\s*pie/.test(e),"detector"),ZL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./CS4gjpMT.js");return{diagram:t}},__vite__mapDeps([65,60,61,3,4,63]),import.meta.url);return{id:mb,diagram:e}},"loader"),KL={id:mb,detector:VL,loader:ZL},yb="quadrantChart",QL=b(e=>/^\s*quadrantChart/.test(e),"detector"),JL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./CLjY0iIn.js");return{diagram:t}},__vite__mapDeps([66,63]),import.meta.url);return{id:yb,diagram:e}},"loader"),tA={id:yb,detector:QL,loader:JL},eA=tA,xb="xychart",rA=b(e=>/^\s*xychart(-beta)?/.test(e),"detector"),iA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./BLBVN-SC.js");return{diagram:t}},__vite__mapDeps([67,63]),import.meta.url);return{id:xb,diagram:e}},"loader"),aA={id:xb,detector:rA,loader:iA},oA=aA,bb="requirement",sA=b(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),nA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./bqt2f6_K.js");return{diagram:t}},__vite__mapDeps([68,15,16]),import.meta.url);return{id:bb,diagram:e}},"loader"),lA={id:bb,detector:sA,loader:nA},cA=lA,Cb="sequence",hA=b(e=>/^\s*sequenceDiagram/.test(e),"detector"),dA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./Cc-3_ZEX.js");return{diagram:t}},__vite__mapDeps([69,59,12]),import.meta.url);return{id:Cb,diagram:e}},"loader"),uA={id:Cb,detector:hA,loader:dA},fA=uA,wb="classDiagram",gA=b(e=>/^\s*classDiagram/.test(e),"detector"),pA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./BO7tTahy.js");return{diagram:t}},__vite__mapDeps([70,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:wb,diagram:e}},"loader"),mA={id:wb,detector:gA,loader:pA},yA=mA,kb="stateDiagram",xA=b(e=>/^\s*stateDiagram/.test(e),"detector"),bA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./DlOELRPg.js");return{diagram:t}},__vite__mapDeps([71,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:kb,diagram:e}},"loader"),CA={id:kb,detector:xA,loader:bA},wA=CA,Sb="journey",kA=b(e=>/^\s*journey/.test(e),"detector"),SA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./D_sSf0vv.js");return{diagram:t}},__vite__mapDeps([72,14,12]),import.meta.url);return{id:Sb,diagram:e}},"loader"),vA={id:Sb,detector:kA,loader:SA},MA=vA,In=4,Es=75,TA=b(e=>{const t=[];for(const a of e.split(/\s+/)){let o=[...a];for(;o.length>Es;)t.push(o.slice(0,Es).join("")),o=o.slice(Es);o.length>0&&t.push(o.join(""))}const r=[];let i="";for(const a of t){const o=i?`${i} ${a}`:a;[...o].length>Es?(r.push(i),i=a):i=o}if(i&&r.push(i),r.length>In){r.length=In;const a=r[In-1]??"";r[In-1]=`${[...a].slice(0,Es-3).join("")}...`}return r},"wrapErrorMessage"),BA=b((e,t,r,i)=>{Tt.debug(`rendering svg for syntax error
|
|
302
|
-
`);const a=J_(t),o=a.append("g"),s=TA(i?.db.getErrorMessage?.()??""),n=s.length>0?500+s.length*56:512;a.attr("viewBox",`0 0 2412 ${n}`),Gp(a,100,n,!0),o.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),o.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),o.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),o.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),o.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),o.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),o.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),o.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`),s.forEach((l,c)=>{o.append("text").attr("class","error-text").attr("x",1440).attr("y",510+c*56).attr("font-size","42px").style("text-anchor","middle").text(l)})},"draw"),vb={draw:BA},_A=vb,Kc,LA={clear(){Kc=void 0},setErrorMessage(e){Kc=e},getErrorMessage(){return Kc}},AA={db:LA,renderer:vb,parser:{parse:b(()=>{},"parse")}},FA=AA,Mb="flowchart-elk",$A=b((e,t={})=>/^\s*flowchart-elk/.test(e)?(t.layout="elk",!0):!1,"detector"),EA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./BIKajrVX.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:Mb,diagram:e}},"loader"),PA={id:Mb,detector:$A,loader:EA},IA=PA,Tb="timeline",OA=b(e=>/^\s*timeline/.test(e),"detector"),RA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./Cx3mm-QI.js");return{diagram:t}},[],import.meta.url);return{id:Tb,diagram:e}},"loader"),DA={id:Tb,detector:OA,loader:RA},NA=DA,Bb="mindmap",qA=b(e=>/^\s*mindmap/.test(e),"detector"),WA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./ChCpmZvV.js");return{diagram:t}},__vite__mapDeps([73,15,16]),import.meta.url);return{id:Bb,diagram:e}},"loader"),zA={id:Bb,detector:qA,loader:WA},HA=zA,_b="kanban",YA=b(e=>/^\s*kanban/.test(e),"detector"),XA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./B1qL2mIF.js");return{diagram:t}},__vite__mapDeps([74,14]),import.meta.url);return{id:_b,diagram:e}},"loader"),jA={id:_b,detector:YA,loader:XA},GA=jA,Lb="sankey",UA=b(e=>/^\s*sankey(-beta)?/.test(e),"detector"),VA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./ISabpJyz.js");return{diagram:t}},__vite__mapDeps([75,63]),import.meta.url);return{id:Lb,diagram:e}},"loader"),ZA={id:Lb,detector:UA,loader:VA},KA=ZA,Ab="packet",QA=b(e=>/^\s*packet(-beta)?/.test(e),"detector"),JA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./BUBp-Ovl.js");return{diagram:t}},__vite__mapDeps([76,60,61,3,4]),import.meta.url);return{id:Ab,diagram:e}},"loader"),t5={id:Ab,detector:QA,loader:JA},Fb="radar",e5=b(e=>/^\s*radar-beta/.test(e),"detector"),r5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./DU2uhw3t.js");return{diagram:t}},__vite__mapDeps([77,60,61,3,4]),import.meta.url);return{id:Fb,diagram:e}},"loader"),i5={id:Fb,detector:e5,loader:r5},$b="block",a5=b(e=>/^\s*block(-beta)?/.test(e),"detector"),o5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./sLhSSNGJ.js");return{diagram:t}},__vite__mapDeps([78,14,5]),import.meta.url);return{id:$b,diagram:e}},"loader"),s5={id:$b,detector:a5,loader:o5},n5=s5,Eb="treeView",l5=b(e=>/^\s*treeView-beta/.test(e),"detector"),c5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./MdBXkHgJ.js");return{diagram:t}},__vite__mapDeps([79,59,60,61,3,4]),import.meta.url);return{id:Eb,diagram:e}},"loader"),h5={id:Eb,detector:l5,loader:c5},d5=h5,Pb="architecture",u5=b(e=>/^\s*architecture/.test(e),"detector"),f5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./D7YcNS-l.js");return{diagram:t}},__vite__mapDeps([80,60,61,3,4,10,6]),import.meta.url);return{id:Pb,diagram:e}},"loader"),g5={id:Pb,detector:u5,loader:f5},p5=g5,Ib="eventmodeling",m5=b(e=>/^\s*eventmodeling/.test(e),"detector"),y5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./DN4HOaG2.js");return{diagram:t}},__vite__mapDeps([81,60,61,3,4]),import.meta.url);return{id:Ib,diagram:e}},"loader"),x5={id:Ib,detector:m5,loader:y5},b5=x5,Ob="ishikawa",C5=b(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),w5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./CI3AMzpC.js");return{diagram:t}},[],import.meta.url);return{id:Ob,diagram:e}},"loader"),k5={id:Ob,detector:C5,loader:w5},Rb="venn",S5=b(e=>/^\s*venn-beta/.test(e),"detector"),v5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./pd6ci8R7.js");return{diagram:t}},[],import.meta.url);return{id:Rb,diagram:e}},"loader"),M5={id:Rb,detector:S5,loader:v5},T5=M5,Db="treemap",B5=b(e=>/^\s*treemap/.test(e),"detector"),_5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./D4JPXZyy.js");return{diagram:t}},__vite__mapDeps([82,16,60,61,3,4,63]),import.meta.url);return{id:Db,diagram:e}},"loader"),L5={id:Db,detector:B5,loader:_5},Nb="usecase",A5=b(e=>/^\s*usecase-beta(?:\s|$)/.test(e),"detector"),F5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./CeFwx3XL.js");return{diagram:t}},__vite__mapDeps([83,15,16]),import.meta.url);return{id:Nb,diagram:e}},"loader"),$5={id:Nb,detector:A5,loader:F5},qb="wardley",E5=b(e=>/^\s*wardley-beta/i.test(e),"detector"),P5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./BI6d_Sls.js");return{diagram:t}},__vite__mapDeps([84,60,61,3,4]),import.meta.url);return{id:qb,diagram:e}},"loader"),I5={id:qb,detector:E5,loader:P5},O5=I5,Wb="cynefin",R5=b(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),D5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./DnLdM-QZ.js");return{diagram:t}},__vite__mapDeps([85,60,61,3,4]),import.meta.url);return{id:Wb,diagram:e}},"loader"),N5={id:Wb,detector:R5,loader:D5},zb="railroad",q5=b(e=>/^\s*railroad-beta/i.test(e),"detector"),W5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./D0JTb-x1.js");return{diagram:t}},__vite__mapDeps([86,87,60,61,3,4]),import.meta.url);return{id:zb,diagram:e}},"loader"),z5={id:zb,detector:q5,loader:W5},Hb="railroadEbnf",H5=b(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),Y5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./DUiZSnMh.js");return{diagram:t}},__vite__mapDeps([88,87,60,61,3,4]),import.meta.url);return{id:Hb,diagram:e}},"loader"),X5={id:Hb,detector:H5,loader:Y5},Yb="railroadAbnf",j5=b(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),G5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./ao08AFko.js");return{diagram:t}},__vite__mapDeps([89,87,60,61,3,4]),import.meta.url);return{id:Yb,diagram:e}},"loader"),U5={id:Yb,detector:j5,loader:G5},Xb="railroadPeg",V5=b(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),Z5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./BAeRDdCp.js");return{diagram:t}},__vite__mapDeps([90,87,60,61,3,4]),import.meta.url);return{id:Xb,diagram:e}},"loader"),K5={id:Xb,detector:V5,loader:Z5},Yg=!1,Kl=b(()=>{Yg||(Yg=!0,cl("error",FA,e=>e.toLowerCase().trim()==="error"),cl("---",{db:{clear:b(()=>{},"clear")},styles:{},renderer:{draw:b(()=>{},"draw")},parser:{parse:b(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:b(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),hh(IA,HA,p5),hh(LL,wL,GA,yA,RL,XL,UL,KL,cA,fA,EL,ML,NA,WL,wA,MA,eA,KA,t5,oA,n5,b5,d5,i5,k5,L5,z5,X5,U5,K5,T5,O5,N5,$5))},"addDiagrams"),Q5=b(async()=>{Tt.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(yo).map(async([r,{detector:i,loader:a}])=>{if(a)try{ph(r)}catch{try{const{diagram:o,id:s}=await a();cl(s,o,i)}catch(o){throw Tt.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete yo[r],o}}}))).filter(r=>r.status==="rejected");if(t.length>0){Tt.error(`Failed to load ${t.length} external diagrams`);for(const r of t)Tt.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),J5="graphics-document document";function jb(e,t){e.attr("role",J5),t!==""&&e.attr("aria-roledescription",t)}b(jb,"setA11yDiagramInfo");function Gb(e,t,r,i){if(e.insert!==void 0){if(r){const a=`chart-desc-${i}`;e.attr("aria-describedby",a),e.insert("desc",":first-child").attr("id",a).text(r)}if(t){const a=`chart-title-${i}`;e.attr("aria-labelledby",a),e.insert("title",":first-child").attr("id",a).text(t)}}}b(Gb,"addSVGa11yTitleDescription");var mo,Fl=(mo=class{constructor(t,r,i,a,o){this.type=t,this.text=r,this.db=i,this.parser=a,this.renderer=o}static async fromText(t,r={}){const i=typeof t=="string"?{cleaned:t}:t,a=Tr(),o=Ol(i.cleaned,a);try{ph(o)}catch{const u=JC(o);if(!u)throw new Pp(`Diagram ${o} not found.`);const{id:f,diagram:p}=await u();cl(f,p)}const{db:s,parser:n,renderer:l,init:c}=ph(o);n.parser&&(n.parser.yy=s),s.clear?.(),c?.(a),r.title&&s.setDiagramTitle?.(r.title);let h=i.cleaned;if(s.preserveCommentsWhenParsing&&i.withComments){const u=a.maxTextSize??ud.maxTextSize;i.withComments.length>u?Tt.warn(`Comment-preserving source exceeds maxTextSize (${i.withComments.length} > ${u}); parsing the comment-stripped text instead. Reported source positions will not account for comment lines.`):h=i.withComments}const d=oM(h)+`
|
|
301
|
+
L0,20`).attr("stroke-linejoin","miter")},"requirement_arrow_neo"),z_=b((e,t,r)=>{const i=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").append("g");i.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),i.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),i.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10)},"requirement_contains"),H_=b((e,t,r)=>{const i=Tr(),{themeVariables:a}=i,{strokeWidth:o}=a,s=e.append("defs").append("marker").attr("id",r+"_"+t+"-requirement_containsStart").attr("refX",0).attr("refY",10).attr("markerWidth",20).attr("markerHeight",20).attr("orient","auto").attr("markerUnits","userSpaceOnUse").append("g");s.append("circle").attr("cx",10).attr("cy",10).attr("r",9).attr("fill","none"),s.append("line").attr("x1",1).attr("x2",19).attr("y1",10).attr("y2",10),s.append("line").attr("y1",1).attr("y2",19).attr("x1",10).attr("x2",10),s.selectAll("*").attr("stroke-width",`${o}`)},"requirement_contains_neo"),Y_=b((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-hierarchyEnd").attr("class","marker hierarchy "+t).attr("viewBox","0 0 12 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 0 0 L 6 5 L 0 10 M 4 0 L 10 5 L 4 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none"),e.append("marker").attr("id",r+"_"+t+"-hierarchyStart").attr("class","marker hierarchy "+t).attr("viewBox","0 0 12 10").attr("refX",2).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",10).attr("orient","auto").append("path").attr("d","M 12 0 L 6 5 L 12 10 M 8 0 L 2 5 L 8 10").attr("class","arrowMarkerPath").style("stroke-width",1).style("stroke-dasharray","1,0").style("fill","none")},"hierarchy"),X_=b((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-openArrowEnd").attr("class","marker openArrow "+t).attr("viewBox","0 0 12 12").attr("refX",11).attr("refY",6).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 1 1 L 11 6 L 1 11").attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-linecap","round").style("stroke-linejoin","round").style("stroke-dasharray","1,0").style("fill","none"),e.append("marker").attr("id",r+"_"+t+"-openArrowStart").attr("class","marker openArrow "+t).attr("viewBox","0 0 12 12").attr("refX",1).attr("refY",6).attr("markerUnits","userSpaceOnUse").attr("markerWidth",12).attr("markerHeight",12).attr("orient","auto").append("path").attr("d","M 11 1 L 1 6 L 11 11").attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-linecap","round").style("stroke-linejoin","round").style("stroke-dasharray","1,0").style("fill","none")},"openArrow"),j_=b((e,t,r)=>{e.append("marker").attr("id",r+"_"+t+"-hollowCircleStart").attr("class","marker hollowCircle "+t).attr("viewBox","0 0 10 10").attr("refX",0).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("circle").attr("cx",5).attr("cy",5).attr("r",3.6).attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-dasharray","1,0").style("fill","none"),e.append("marker").attr("id",r+"_"+t+"-hollowCircleEnd").attr("class","marker hollowCircle "+t).attr("viewBox","0 0 10 10").attr("refX",10).attr("refY",5).attr("markerUnits","userSpaceOnUse").attr("markerWidth",10).attr("markerHeight",10).attr("orient","auto").append("circle").attr("cx",5).attr("cy",5).attr("r",3.6).attr("class","arrowMarkerPath").style("stroke-width",1.4).style("stroke-dasharray","1,0").style("fill","none")},"hollowCircle"),G_={extension:k_,composition:S_,aggregation:v_,dependency:M_,lollipop:T_,point:B_,circle:__,cross:L_,barb:A_,barbNeo:F_,hierarchy:Y_,only_one:$_,zero_or_one:E_,one_or_more:P_,zero_or_more:I_,only_one_neo:O_,zero_or_one_neo:R_,one_or_more_neo:D_,zero_or_more_neo:N_,requirement_arrow:q_,requirement_contains:z_,requirement_arrow_neo:W_,requirement_contains_neo:H_,openArrow:X_,hollowCircle:j_},U_=w_,V_={common:hn,getConfig:Tr,insertCluster:BB,insertEdge:C_,insertEdgeLabel:u_,insertMarkers:U_,insertNode:O0,interpolateToCurve:$d,labelHelper:he,log:Tt,positionEdgeLabel:g_},Z_=["elk.stress","elk.force","elk.mrtree","elk.sporeOverlap","elk.box","elk.rectpacking"],an=Object.create(null),eb=b(e=>{for(const t of e)an[t.name]=t},"registerLayoutLoaders"),K_=b(()=>{const e=b(async()=>await Ge(()=>import("./DkITK-2z.js"),__vite__mapDeps([0,1,2,3,4,5,6]),import.meta.url),"loader");return[{name:"elk",loader:e,algorithm:"elk.layered"},...Z_.map(t=>({name:t,loader:e,algorithm:t}))]},"elkLayoutLoaders"),Q_=b(()=>{eb([{name:"dagre",loader:b(async()=>await Ge(()=>import("./DEAJosBQ.js"),__vite__mapDeps([7,2,3,4,5]),import.meta.url),"loader")},{name:"swimlane",loader:b(async()=>await Ge(()=>import("./pqyPptbZ.js"),__vite__mapDeps([8,1,2,3,4,5]),import.meta.url),"loader")},{name:"cose-bilkent",loader:b(async()=>await Ge(()=>import("./A3j68Jpj.js"),__vite__mapDeps([9,10,6]),import.meta.url),"loader")},...K_()])},"registerDefaultLayoutLoaders");Q_();var eP=b(async(e,t)=>{if(!Object.hasOwn(an,e.layoutAlgorithm))throw new Error(`Unknown layout algorithm: ${e.layoutAlgorithm}`);if(e.diagramId)for(const o of e.nodes){const s=o.domId||o.id;o.domId=`${e.diagramId}-${s}`}const r=an[e.layoutAlgorithm],i=await r.loader();DC(t,e.config);const a=await i.render(e,t,V_,{algorithm:r.algorithm});return s_(t.node()),a},"render"),Vc="dagre",rP=b((e="",{fallback:t=Vc}={})=>{if(Object.hasOwn(an,e))return e;for(const r of[t,Vc])if(Object.hasOwn(an,r))return Tt.warn(`Layout algorithm ${e} is not registered. Using ${r} as fallback.`),r;throw new Error(`Neither layout algorithm ${e}, ${t}, nor ${Vc} is registered.`)},"getRegisteredLayoutAlgorithm"),J_=b(e=>{const{securityLevel:t}=Xe();let r=He("body");if(t==="sandbox"){const o=He(`#i${e}`).node()?.contentDocument??document;r=He(o.body)}return r.select(`#${e}`)},"selectSvgElement"),ou="comm",rb="rule",ib="decl",tL="@media",eL="@import",rL="@supports",iL="@namespace",Rh="@keyframes",ab="@layer",aL="@scope",oL=Math.abs,Ks=String.fromCharCode;function ob(e){return e.trim()}function Dh(e,t,r){return e.replace(t,r)}function Go(e,t){return e.charCodeAt(t)|0}function us(e,t,r){return e.slice(t,r)}function Ki(e){return e.length}function sb(e){return e.length}function Pn(e,t){return t.push(e),e}var Vl=1,fs=1,nb=0,_i=0,Pr=0,ws="";function su(e,t,r,i,a,o,s,n){return{value:e,root:t,parent:r,type:i,props:a,children:o,line:Vl,column:fs,length:s,return:"",siblings:n}}function sL(){return Pr}function nL(){return Pr=_i>0?Go(ws,--_i):0,fs--,Pr===10&&(fs=1,Vl--),Pr}function Di(){return Pr=_i<nb?Go(ws,_i++):0,fs++,Pr===10&&(fs=1,Vl++),Pr}function qa(){return Go(ws,_i)}function Jn(){return _i}function Zl(e,t){return us(ws,e,t)}function on(e){switch(e){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function lL(e){return Vl=fs=1,nb=Ki(ws=e),_i=0,[]}function cL(e){return ws="",e}function Zc(e){return ob(Zl(_i-1,Nh(e===91?e+2:e===40?e+1:e)))}function hL(e){for(;(Pr=qa())&&Pr<33;)Di();return on(e)>2||on(Pr)>3?"":" "}function dL(e,t){for(;--t&&Di()&&!(Pr<48||Pr>102||Pr>57&&Pr<65||Pr>70&&Pr<97););return Zl(e,Jn()+(t<6&&qa()==32&&Di()==32))}function Nh(e){for(;Di();)switch(Pr){case e:return _i;case 34:case 39:e!==34&&e!==39&&Nh(Pr);break;case 40:e===41&&Nh(e);break;case 92:Di();break}return _i}function uL(e,t){for(;Di()&&e+Pr!==57;)if(e+Pr===84&&qa()===47)break;return"/*"+Zl(t,_i-1)+"*"+Ks(e===47?e:Di())}function fL(e){for(;!on(qa());)Di();return Zl(e,_i)}function gL(e){return cL(tl("",null,null,null,[""],e=lL(e),0,[0],e))}function tl(e,t,r,i,a,o,s,n,l){for(var c=0,h=0,d=s,u=0,f=0,p=0,g=1,m=1,y=1,x=0,C=0,k="",v=a,T=o,F=i,A=k;m;)switch(p=C,C=Di()){case 40:p!=108&&Go(A,d-1)==58?(x++,A+="("):A+=Zc(C);break;case 41:x--,A+=")";break;case 34:case 39:case 91:A+=Zc(C);break;case 9:case 10:case 13:case 32:if(x>0){A+=Ks(C);break}A+=hL(p);break;case 92:A+=dL(Jn()-1,7);continue;case 47:switch(qa()){case 42:case 47:Pn(pL(uL(Di(),Jn()),t,r,l),l),(on(p||1)==5||on(qa()||1)==5)&&Ki(A)&&us(A,-1,void 0)!==" "&&(A+=" ");break;default:A+="/"}break;case 123*g:n[c++]=Ki(A)*y;case 125*g:case 59:case 0:if(x>0&&C){A+=Ks(C);break}switch(C){case 0:case 125:m=0;case 59+h:y==-1&&(A=Dh(A,/\f/g,"")),f>0&&(Ki(A)-d||g===0)&&Pn(f>32?Hg(A+";",i,r,d-1,l):Hg(Dh(A," ","")+";",i,r,d-2,l),l);break;case 59:A+=";";default:if(Pn(F=zg(A,t,r,c,h,a,n,k,v=[],T=[],d,o),o),C===123)if(h===0)tl(A,t,F,F,v,o,d,n,T);else{switch(u){case 99:if(Go(A,3)===110)break;case 108:if(Go(A,2)===97)break;default:h=0;case 100:case 109:case 115:}h?tl(e,F,F,i&&Pn(zg(e,F,F,0,0,a,n,k,a,v=[],d,T),T),a,T,d,n,i?v:T):tl(A,F,F,F,[""],T,0,n,T)}}c=h=f=0,g=y=1,k=A="",d=s;break;case 58:d=1+Ki(A),f=p;default:if(g<1){if(C==123)--g;else if(C==125&&g++==0&&nL()==125)continue}switch(A+=Ks(C),C*g){case 38:y=h>0?1:(A+="\f",-1);break;case 44:if(x>0)break;n[c++]=(Ki(A)-1)*y,y=1;break;case 64:qa()===45&&(A+=Zc(Di())),u=qa(),h=d=Ki(k=A+=fL(Jn())),C++;break;case 45:p===45&&Ki(A)==2&&(g=0)}}return o}function zg(e,t,r,i,a,o,s,n,l,c,h,d){for(var u=a-1,f=a===0?o:[""],p=sb(f),g=0,m=0,y=0;g<i;++g)for(var x=0,C=us(e,u+1,u=oL(m=s[g])),k=e;x<p;++x)(k=ob(m>0?f[x]+" "+C:Dh(C,/&\f/g,f[x])))&&(l[y++]=k);return su(e,t,r,a===0?rb:n,l,c,h,d)}function pL(e,t,r,i){return su(e,t,r,ou,Ks(sL()),us(e,2,-2),0,i)}function Hg(e,t,r,i,a){return su(e,t,r,ib,us(e,0,i),us(e,i+1,-1),i,a)}function qh(e,t){for(var r="",i=0;i<e.length;i++)r+=t(e[i],i,e,t)||"";return r}function mL(e,t,r,i){switch(e.type){case ab:if(e.children.length)break;case eL:case iL:case ib:return e.return=e.return||e.value;case ou:return"";case Rh:return e.return=e.value+"{"+qh(e.children,i)+"}";case rb:if(!Ki(e.value=e.props.join(",")))return""}return Ki(r=qh(e.children,i))?e.return=e.value+"{"+r+"}":""}function yL(e){var t=sb(e);return function(r,i,a,o){for(var s="",n=0;n<t;n++)s+=e[n](r,i,a,o)||"";return s}}var lb="c4",xL=b(e=>/^\s*C4Context|C4Container|C4Component|C4Dynamic|C4Deployment/.test(e),"detector"),bL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./B0LTdoMZ.js");return{diagram:t}},__vite__mapDeps([11,12]),import.meta.url);return{id:lb,diagram:e}},"loader"),CL={id:lb,detector:xL,loader:bL},wL=CL,cb="flowchart-v2",kL=b(e=>/^\s*(graph|flowchart)/.test(e),"detector"),SL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./B984L3ei.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:cb,diagram:e}},"loader"),vL={id:cb,detector:kL,loader:SL},ML=vL,hb="agentflow",TL=b(e=>/^\s*agentflow-beta\b/.test(e),"detector"),BL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./C2vLXngQ.js");return{diagram:t}},__vite__mapDeps([55,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:hb,diagram:e}},"loader"),_L={id:hb,detector:TL,loader:BL},LL=_L,db="swimlane",AL=b(e=>/^\s*swimlane-beta\b/.test(e),"detector"),FL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./CxHAlRVQ.js");return{diagram:t}},__vite__mapDeps([56,13,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:db,diagram:e}},"loader"),$L={id:db,detector:AL,loader:FL},EL=$L,ub="er",PL=b(e=>/^\s*erDiagram/.test(e),"detector"),IL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./C0U5HDdc.js");return{diagram:t}},__vite__mapDeps([57,15,16]),import.meta.url);return{id:ub,diagram:e}},"loader"),OL={id:ub,detector:PL,loader:IL},RL=OL,fb="gitGraph",DL=b(e=>/^\s*gitGraph/.test(e),"detector"),NL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./Dn6TxX1b.js");return{diagram:t}},__vite__mapDeps([58,59,60,61,3,4]),import.meta.url);return{id:fb,diagram:e}},"loader"),qL={id:fb,detector:DL,loader:NL},WL=qL,gb="gantt",zL=b(e=>/^\s*gantt/.test(e),"detector"),HL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./ppFDuElZ.js");return{diagram:t}},__vite__mapDeps([62,6,63]),import.meta.url);return{id:gb,diagram:e}},"loader"),YL={id:gb,detector:zL,loader:HL},XL=YL,pb="info",jL=b(e=>/^\s*info/.test(e),"detector"),GL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./B3Vpc0UD.js");return{diagram:t}},__vite__mapDeps([64,61,3,4]),import.meta.url);return{id:pb,diagram:e}},"loader"),UL={id:pb,detector:jL,loader:GL},mb="pie",VL=b(e=>/^\s*pie/.test(e),"detector"),ZL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./CM6ofsmm.js");return{diagram:t}},__vite__mapDeps([65,60,61,3,4,63]),import.meta.url);return{id:mb,diagram:e}},"loader"),KL={id:mb,detector:VL,loader:ZL},yb="quadrantChart",QL=b(e=>/^\s*quadrantChart/.test(e),"detector"),JL=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./CXryJZjo.js");return{diagram:t}},__vite__mapDeps([66,63]),import.meta.url);return{id:yb,diagram:e}},"loader"),tA={id:yb,detector:QL,loader:JL},eA=tA,xb="xychart",rA=b(e=>/^\s*xychart(-beta)?/.test(e),"detector"),iA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./D7KFkzTo.js");return{diagram:t}},__vite__mapDeps([67,63]),import.meta.url);return{id:xb,diagram:e}},"loader"),aA={id:xb,detector:rA,loader:iA},oA=aA,bb="requirement",sA=b(e=>/^\s*requirement(Diagram)?/.test(e),"detector"),nA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./qTbFtTyZ.js");return{diagram:t}},__vite__mapDeps([68,15,16]),import.meta.url);return{id:bb,diagram:e}},"loader"),lA={id:bb,detector:sA,loader:nA},cA=lA,Cb="sequence",hA=b(e=>/^\s*sequenceDiagram/.test(e),"detector"),dA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./CNmewsOv.js");return{diagram:t}},__vite__mapDeps([69,59,12]),import.meta.url);return{id:Cb,diagram:e}},"loader"),uA={id:Cb,detector:hA,loader:dA},fA=uA,wb="classDiagram",gA=b(e=>/^\s*classDiagram/.test(e),"detector"),pA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./qHzkHUJa.js");return{diagram:t}},__vite__mapDeps([70,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:wb,diagram:e}},"loader"),mA={id:wb,detector:gA,loader:pA},yA=mA,kb="stateDiagram",xA=b(e=>/^\s*stateDiagram/.test(e),"detector"),bA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./CJgNYK9V.js");return{diagram:t}},__vite__mapDeps([71,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:kb,diagram:e}},"loader"),CA={id:kb,detector:xA,loader:bA},wA=CA,Sb="journey",kA=b(e=>/^\s*journey/.test(e),"detector"),SA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./DDe9tE4g.js");return{diagram:t}},__vite__mapDeps([72,14,12]),import.meta.url);return{id:Sb,diagram:e}},"loader"),vA={id:Sb,detector:kA,loader:SA},MA=vA,In=4,Es=75,TA=b(e=>{const t=[];for(const a of e.split(/\s+/)){let o=[...a];for(;o.length>Es;)t.push(o.slice(0,Es).join("")),o=o.slice(Es);o.length>0&&t.push(o.join(""))}const r=[];let i="";for(const a of t){const o=i?`${i} ${a}`:a;[...o].length>Es?(r.push(i),i=a):i=o}if(i&&r.push(i),r.length>In){r.length=In;const a=r[In-1]??"";r[In-1]=`${[...a].slice(0,Es-3).join("")}...`}return r},"wrapErrorMessage"),BA=b((e,t,r,i)=>{Tt.debug(`rendering svg for syntax error
|
|
302
|
+
`);const a=J_(t),o=a.append("g"),s=TA(i?.db.getErrorMessage?.()??""),n=s.length>0?500+s.length*56:512;a.attr("viewBox",`0 0 2412 ${n}`),Gp(a,100,n,!0),o.append("path").attr("class","error-icon").attr("d","m411.313,123.313c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32-9.375,9.375-20.688-20.688c-12.484-12.5-32.766-12.5-45.25,0l-16,16c-1.261,1.261-2.304,2.648-3.31,4.051-21.739-8.561-45.324-13.426-70.065-13.426-105.867,0-192,86.133-192,192s86.133,192 192,192 192-86.133 192-192c0-24.741-4.864-48.327-13.426-70.065 1.402-1.007 2.79-2.049 4.051-3.31l16-16c12.5-12.492 12.5-32.758 0-45.25l-20.688-20.688 9.375-9.375 32.001-31.999zm-219.313,100.687c-52.938,0-96,43.063-96,96 0,8.836-7.164,16-16,16s-16-7.164-16-16c0-70.578 57.422-128 128-128 8.836,0 16,7.164 16,16s-7.164,16-16,16z"),o.append("path").attr("class","error-icon").attr("d","m459.02,148.98c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l16,16c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16.001-16z"),o.append("path").attr("class","error-icon").attr("d","m340.395,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688 6.25-6.25 6.25-16.375 0-22.625l-16-16c-6.25-6.25-16.375-6.25-22.625,0s-6.25,16.375 0,22.625l15.999,16z"),o.append("path").attr("class","error-icon").attr("d","m400,64c8.844,0 16-7.164 16-16v-32c0-8.836-7.156-16-16-16-8.844,0-16,7.164-16,16v32c0,8.836 7.156,16 16,16z"),o.append("path").attr("class","error-icon").attr("d","m496,96.586h-32c-8.844,0-16,7.164-16,16 0,8.836 7.156,16 16,16h32c8.844,0 16-7.164 16-16 0-8.836-7.156-16-16-16z"),o.append("path").attr("class","error-icon").attr("d","m436.98,75.605c3.125,3.125 7.219,4.688 11.313,4.688 4.094,0 8.188-1.563 11.313-4.688l32-32c6.25-6.25 6.25-16.375 0-22.625s-16.375-6.25-22.625,0l-32,32c-6.251,6.25-6.251,16.375-0.001,22.625z"),o.append("text").attr("class","error-text").attr("x",1440).attr("y",250).attr("font-size","150px").style("text-anchor","middle").text("Syntax error in text"),o.append("text").attr("class","error-text").attr("x",1250).attr("y",400).attr("font-size","100px").style("text-anchor","middle").text(`mermaid version ${r}`),s.forEach((l,c)=>{o.append("text").attr("class","error-text").attr("x",1440).attr("y",510+c*56).attr("font-size","42px").style("text-anchor","middle").text(l)})},"draw"),vb={draw:BA},_A=vb,Kc,LA={clear(){Kc=void 0},setErrorMessage(e){Kc=e},getErrorMessage(){return Kc}},AA={db:LA,renderer:vb,parser:{parse:b(()=>{},"parse")}},FA=AA,Mb="flowchart-elk",$A=b((e,t={})=>/^\s*flowchart-elk/.test(e)?(t.layout="elk",!0):!1,"detector"),EA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./B984L3ei.js").then(r=>r.f);return{diagram:t}},__vite__mapDeps([13,14,15,16,12,17,18,19,20,3,4,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,6,48,49,50,51,52,53,54]),import.meta.url);return{id:Mb,diagram:e}},"loader"),PA={id:Mb,detector:$A,loader:EA},IA=PA,Tb="timeline",OA=b(e=>/^\s*timeline/.test(e),"detector"),RA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./DO6bRkht.js");return{diagram:t}},[],import.meta.url);return{id:Tb,diagram:e}},"loader"),DA={id:Tb,detector:OA,loader:RA},NA=DA,Bb="mindmap",qA=b(e=>/^\s*mindmap/.test(e),"detector"),WA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./DfSU1zsS.js");return{diagram:t}},__vite__mapDeps([73,15,16]),import.meta.url);return{id:Bb,diagram:e}},"loader"),zA={id:Bb,detector:qA,loader:WA},HA=zA,_b="kanban",YA=b(e=>/^\s*kanban/.test(e),"detector"),XA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./DSaN60B-.js");return{diagram:t}},__vite__mapDeps([74,14]),import.meta.url);return{id:_b,diagram:e}},"loader"),jA={id:_b,detector:YA,loader:XA},GA=jA,Lb="sankey",UA=b(e=>/^\s*sankey(-beta)?/.test(e),"detector"),VA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./VaiKGhlm.js");return{diagram:t}},__vite__mapDeps([75,63]),import.meta.url);return{id:Lb,diagram:e}},"loader"),ZA={id:Lb,detector:UA,loader:VA},KA=ZA,Ab="packet",QA=b(e=>/^\s*packet(-beta)?/.test(e),"detector"),JA=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./CVNMYGFF.js");return{diagram:t}},__vite__mapDeps([76,60,61,3,4]),import.meta.url);return{id:Ab,diagram:e}},"loader"),t5={id:Ab,detector:QA,loader:JA},Fb="radar",e5=b(e=>/^\s*radar-beta/.test(e),"detector"),r5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./ChM8LZU3.js");return{diagram:t}},__vite__mapDeps([77,60,61,3,4]),import.meta.url);return{id:Fb,diagram:e}},"loader"),i5={id:Fb,detector:e5,loader:r5},$b="block",a5=b(e=>/^\s*block(-beta)?/.test(e),"detector"),o5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./Bq6eGKPr.js");return{diagram:t}},__vite__mapDeps([78,14,5]),import.meta.url);return{id:$b,diagram:e}},"loader"),s5={id:$b,detector:a5,loader:o5},n5=s5,Eb="treeView",l5=b(e=>/^\s*treeView-beta/.test(e),"detector"),c5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./BmpDuIkF.js");return{diagram:t}},__vite__mapDeps([79,59,60,61,3,4]),import.meta.url);return{id:Eb,diagram:e}},"loader"),h5={id:Eb,detector:l5,loader:c5},d5=h5,Pb="architecture",u5=b(e=>/^\s*architecture/.test(e),"detector"),f5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./D_Pty9qy.js");return{diagram:t}},__vite__mapDeps([80,60,61,3,4,10,6]),import.meta.url);return{id:Pb,diagram:e}},"loader"),g5={id:Pb,detector:u5,loader:f5},p5=g5,Ib="eventmodeling",m5=b(e=>/^\s*eventmodeling/.test(e),"detector"),y5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./CCeWyMrz.js");return{diagram:t}},__vite__mapDeps([81,60,61,3,4]),import.meta.url);return{id:Ib,diagram:e}},"loader"),x5={id:Ib,detector:m5,loader:y5},b5=x5,Ob="ishikawa",C5=b(e=>/^\s*ishikawa(-beta)?\b/i.test(e),"detector"),w5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./ly44q7lS.js");return{diagram:t}},[],import.meta.url);return{id:Ob,diagram:e}},"loader"),k5={id:Ob,detector:C5,loader:w5},Rb="venn",S5=b(e=>/^\s*venn-beta/.test(e),"detector"),v5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./CCyHGsx1.js");return{diagram:t}},[],import.meta.url);return{id:Rb,diagram:e}},"loader"),M5={id:Rb,detector:S5,loader:v5},T5=M5,Db="treemap",B5=b(e=>/^\s*treemap/.test(e),"detector"),_5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./C9Tn2aWq.js");return{diagram:t}},__vite__mapDeps([82,16,60,61,3,4,63]),import.meta.url);return{id:Db,diagram:e}},"loader"),L5={id:Db,detector:B5,loader:_5},Nb="usecase",A5=b(e=>/^\s*usecase-beta(?:\s|$)/.test(e),"detector"),F5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./DXFhywqj.js");return{diagram:t}},__vite__mapDeps([83,15,16]),import.meta.url);return{id:Nb,diagram:e}},"loader"),$5={id:Nb,detector:A5,loader:F5},qb="wardley",E5=b(e=>/^\s*wardley-beta/i.test(e),"detector"),P5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./Dgc550NC.js");return{diagram:t}},__vite__mapDeps([84,60,61,3,4]),import.meta.url);return{id:qb,diagram:e}},"loader"),I5={id:qb,detector:E5,loader:P5},O5=I5,Wb="cynefin",R5=b(e=>/^\s*cynefin-beta(?:[\s:]|$)/.test(e),"detector"),D5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./UgJ8KjVC.js");return{diagram:t}},__vite__mapDeps([85,60,61,3,4]),import.meta.url);return{id:Wb,diagram:e}},"loader"),N5={id:Wb,detector:R5,loader:D5},zb="railroad",q5=b(e=>/^\s*railroad-beta/i.test(e),"detector"),W5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./BehoboVr.js");return{diagram:t}},__vite__mapDeps([86,87,60,61,3,4]),import.meta.url);return{id:zb,diagram:e}},"loader"),z5={id:zb,detector:q5,loader:W5},Hb="railroadEbnf",H5=b(e=>/^\s*railroad-ebnf-beta/i.test(e),"detector"),Y5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./CtLD2qbA.js");return{diagram:t}},__vite__mapDeps([88,87,60,61,3,4]),import.meta.url);return{id:Hb,diagram:e}},"loader"),X5={id:Hb,detector:H5,loader:Y5},Yb="railroadAbnf",j5=b(e=>/^\s*railroad-abnf-beta/i.test(e),"detector"),G5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./DvDeEn1B.js");return{diagram:t}},__vite__mapDeps([89,87,60,61,3,4]),import.meta.url);return{id:Yb,diagram:e}},"loader"),U5={id:Yb,detector:j5,loader:G5},Xb="railroadPeg",V5=b(e=>/^\s*railroad-peg-beta/i.test(e),"detector"),Z5=b(async()=>{const{diagram:e}=await Ge(async()=>{const{diagram:t}=await import("./B-YLcmrj.js");return{diagram:t}},__vite__mapDeps([90,87,60,61,3,4]),import.meta.url);return{id:Xb,diagram:e}},"loader"),K5={id:Xb,detector:V5,loader:Z5},Yg=!1,Kl=b(()=>{Yg||(Yg=!0,cl("error",FA,e=>e.toLowerCase().trim()==="error"),cl("---",{db:{clear:b(()=>{},"clear")},styles:{},renderer:{draw:b(()=>{},"draw")},parser:{parse:b(()=>{throw new Error("Diagrams beginning with --- are not valid. If you were trying to use a YAML front-matter, please ensure that you've correctly opened and closed the YAML front-matter with un-indented `---` blocks")},"parse")},init:b(()=>null,"init")},e=>e.toLowerCase().trimStart().startsWith("---")),hh(IA,HA,p5),hh(LL,wL,GA,yA,RL,XL,UL,KL,cA,fA,EL,ML,NA,WL,wA,MA,eA,KA,t5,oA,n5,b5,d5,i5,k5,L5,z5,X5,U5,K5,T5,O5,N5,$5))},"addDiagrams"),Q5=b(async()=>{Tt.debug("Loading registered diagrams");const t=(await Promise.allSettled(Object.entries(yo).map(async([r,{detector:i,loader:a}])=>{if(a)try{ph(r)}catch{try{const{diagram:o,id:s}=await a();cl(s,o,i)}catch(o){throw Tt.error(`Failed to load external diagram with key ${r}. Removing from detectors.`),delete yo[r],o}}}))).filter(r=>r.status==="rejected");if(t.length>0){Tt.error(`Failed to load ${t.length} external diagrams`);for(const r of t)Tt.error(r);throw new Error(`Failed to load ${t.length} external diagrams`)}},"loadRegisteredDiagrams"),J5="graphics-document document";function jb(e,t){e.attr("role",J5),t!==""&&e.attr("aria-roledescription",t)}b(jb,"setA11yDiagramInfo");function Gb(e,t,r,i){if(e.insert!==void 0){if(r){const a=`chart-desc-${i}`;e.attr("aria-describedby",a),e.insert("desc",":first-child").attr("id",a).text(r)}if(t){const a=`chart-title-${i}`;e.attr("aria-labelledby",a),e.insert("title",":first-child").attr("id",a).text(t)}}}b(Gb,"addSVGa11yTitleDescription");var mo,Fl=(mo=class{constructor(t,r,i,a,o){this.type=t,this.text=r,this.db=i,this.parser=a,this.renderer=o}static async fromText(t,r={}){const i=typeof t=="string"?{cleaned:t}:t,a=Tr(),o=Ol(i.cleaned,a);try{ph(o)}catch{const u=JC(o);if(!u)throw new Pp(`Diagram ${o} not found.`);const{id:f,diagram:p}=await u();cl(f,p)}const{db:s,parser:n,renderer:l,init:c}=ph(o);n.parser&&(n.parser.yy=s),s.clear?.(),c?.(a),r.title&&s.setDiagramTitle?.(r.title);let h=i.cleaned;if(s.preserveCommentsWhenParsing&&i.withComments){const u=a.maxTextSize??ud.maxTextSize;i.withComments.length>u?Tt.warn(`Comment-preserving source exceeds maxTextSize (${i.withComments.length} > ${u}); parsing the comment-stripped text instead. Reported source positions will not account for comment lines.`):h=i.withComments}const d=oM(h)+`
|
|
303
303
|
`;return i.frontmatterLineOffset&&s.setFrontmatterLineOffset?.(i.frontmatterLineOffset),await n.parse(d),new mo(o,d,s,n,l)}async render(t,r){await this.renderer.draw(this.text,t,r,this)}getParser(){return this.parser}getType(){return this.type}},b(mo,"Diagram"),mo),Xg=[],tF=b(()=>{Xg.forEach(e=>{e()}),Xg=[]},"attachFunctions"),eF=b(e=>e.replace(/^\s*%%(?!{)[^\n]+\n?/gm,"").trimStart(),"cleanupComments");function Ub(e){const t=Ep(e);if(!t)return{text:e,metadata:{}};const r=t.indent,i=r?t.body.split(`
|
|
304
304
|
`).map(s=>s.startsWith(r)?s.slice(r.length):s).join(`
|
|
305
305
|
`):t.body;let a=RC(i,{schema:OC})??{};a=typeof a=="object"&&!Array.isArray(a)?a:{};const o={};return a.displayMode&&(o.displayMode=a.displayMode.toString()),a.title&&(o.title=a.title.toString()),a.config&&(o.config=a.config),{text:e.slice(t.length),metadata:o}}b(Ub,"extractFrontMatter");var rF=b(e=>e.replace(/\r\n?/g,`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as O,br as m,a_ as y,bz as R,b as T,bp as C}from"./DXyyWeag.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 z,bA as L,bS as Q,aD as V,aB as A,c9 as X,aG as Z,bI as tt}from"./DYhIMPy1.js";import{E as P}from"./CX_KiszT.js";import{I as et}from"./CjaOLL1c.js";import"./B0gQeWRk.js";import{f as S}from"./Bfr1QjPr.js";import{F as at,$ as ot,bL as st}from"./BTdkHPOB.js";import"./Cuqq8bL5.js";import{e as nt,b as rt}from"./
|
|
1
|
+
import{t as O,br as m,a_ as y,bz as R,b as T,bp as C}from"./DXyyWeag.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 z,bA as L,bS as Q,aD as V,aB as A,c9 as X,aG as Z,bI as tt}from"./DYhIMPy1.js";import{E as P}from"./CX_KiszT.js";import{I as et}from"./CjaOLL1c.js";import"./B0gQeWRk.js";import{f as S}from"./Bfr1QjPr.js";import{F as at,$ as ot,bL as st}from"./BTdkHPOB.js";import"./Cuqq8bL5.js";import{e as nt,b as rt}from"./DJtPzYvk.js";var it=A('<span aria-hidden="true"><!></span>'),lt=A('<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 E={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(),I=q(H);{var B=t=>{P(t,{class:"h-full min-h-0",density:"compact","data-workspace-home-panel-notice":"starting",icon:_=>{var r=it(),e=z(r);et(e,{size:16}),L(r),s(_,r)},title:_=>{p();var r=f();u(e=>d(r,e),[()=>C.workspaceHome_starting_label()]),s(_,r)},$$slots:{icon:!0,title:!0}})},F=t=>{P(t,{class:"h-full",get"data-workspace-home-panel-notice"(){return o().state},icon:e=>{{let a=X(()=>o().state==="moving"?ot:st);at(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=z(a);{var D=i=>{S(i,{variant:"outline",size:"sm",get disabled(){return w()},onclick:()=>h()?.(),children:(M,N)=>{p();var c=f();u(W=>d(c,W),[()=>C.workspaceHome_wait_label()]),s(M,c)},$$slots:{default:!0}})};y(l,i=>{o().canWait&&i(D)})}var G=Q(l,2);{var K=i=>{S(i,{variant:"outline",size:"sm",onclick:()=>x()?.(),children:(M,N)=>{p();var c=f();u(W=>d(c,W),[()=>C.workspaceHome_move_label()]),s(M,c)},$$slots:{default:!0}})};y(G,i=>{b()&&i(K)})}L(a),s(e,a)},$$slots:{icon:!0,title:!0,description:!0,actions:!0}})};y(I,t=>{o().starting?t(B):t(F,-1)})}return s(g,H),J(E)}const $=Symbol("workspace-home-panel");function wt(g){tt($,g)}function ht(){return Z($)}export{ct as W,ht as g,wt as s};
|