@intent-hq/web 2.361.1 → 2.361.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/{iDIfJ3iV.js → -7du9lfn.js} +1 -1
- package/web/app/immutable/chunks/{ByIgBfs_.js → 0_7FQkiC.js} +1 -1
- package/web/app/immutable/chunks/{BAyBEEFm.js → 1EW4b83o.js} +1 -1
- package/web/app/immutable/chunks/{B9t82so5.js → 2wJjyVNk.js} +2 -2
- package/web/app/immutable/chunks/{B_tHbtUI.js → 52-_4pXR.js} +1 -1
- package/web/app/immutable/chunks/{i9Ai-esv.js → 5NiJCy7J.js} +1 -1
- package/web/app/immutable/chunks/{BTpJekrR.js → 5u3dQlae.js} +1 -1
- package/web/app/immutable/chunks/{CEX--Xsn.js → 6d4Jv8Hz.js} +2 -2
- package/web/app/immutable/chunks/{j9e5aB7O.js → 7tcI69cn.js} +1 -1
- package/web/app/immutable/chunks/{BTYFFiiL.js → 8HLudOb-.js} +1 -1
- package/web/app/immutable/chunks/{ye2FbJ5D.js → 96DwTK9j.js} +2 -2
- package/web/app/immutable/chunks/{BIbN5V8o.js → As8lK70V.js} +1 -1
- package/web/app/immutable/chunks/{QNDivBsM.js → AxCVH26S.js} +1 -1
- package/web/app/immutable/chunks/{DxOUk2oJ.js → B07OdpUU.js} +3 -3
- package/web/app/immutable/chunks/{C7Y9ew7Z.js → B0JbhmMb.js} +1 -1
- package/web/app/immutable/chunks/{D6d4xhu_.js → B1Tr5BPZ.js} +1 -1
- package/web/app/immutable/chunks/{CigwWVbR.js → B2ns9OTA.js} +1 -1
- package/web/app/immutable/chunks/{WJw0rC-g.js → B4kCZd9W.js} +1 -1
- package/web/app/immutable/chunks/{BTl8ihCX.js → B5Pg9_MZ.js} +1 -1
- package/web/app/immutable/chunks/{_iJcPN5_.js → B9pYL5w0.js} +1 -1
- package/web/app/immutable/chunks/{q3oLC86w.js → B9tRD7MQ.js} +1 -1
- package/web/app/immutable/chunks/{DU2T1Vdb.js → BAgFsuQz.js} +1 -1
- package/web/app/immutable/chunks/{DMHNxEyN.js → BD9wTbmm.js} +1 -1
- package/web/app/immutable/chunks/{BdcgINI4.js → BG4tBRsm.js} +1 -1
- package/web/app/immutable/chunks/{BzTKzuhn.js → BGOuxFsr.js} +1 -1
- package/web/app/immutable/chunks/{CbvpJoHZ.js → BKHUH54N.js} +1 -1
- package/web/app/immutable/chunks/{Bmmvebpd.js → BKw6wLyE.js} +1 -1
- package/web/app/immutable/chunks/{DKAPPU9s.js → BLFlTVjy.js} +4 -4
- package/web/app/immutable/chunks/{i-66Uv-K.js → BMYcVUUM.js} +1 -1
- package/web/app/immutable/chunks/{8C8OyL-H.js → BOSMtVmb.js} +1 -1
- package/web/app/immutable/chunks/{CVFwlr2Z.js → BPG9IRUj.js} +1 -1
- package/web/app/immutable/chunks/{DHQj_UCz.js → BPRz9VyT.js} +1 -1
- package/web/app/immutable/chunks/{Dxv3G1Mb.js → BSM5O6JV.js} +1 -1
- package/web/app/immutable/chunks/{LbgKUbsl.js → BTR14c-t.js} +3 -3
- package/web/app/immutable/chunks/{C9vs7bl5.js → BWUH3HmG.js} +1 -1
- package/web/app/immutable/chunks/{CIDE3x9D.js → BZp1yALL.js} +1 -1
- package/web/app/immutable/chunks/{NAsYJxQg.js → BbIMIfqX.js} +1 -1
- package/web/app/immutable/chunks/BbV7MtxC.js +1 -0
- package/web/app/immutable/chunks/{wuYAM5lX.js → BeLtysng.js} +1 -1
- package/web/app/immutable/chunks/{DGzlSz-8.js → Bgk8kfr8.js} +1 -1
- package/web/app/immutable/chunks/Bhx5E4sN.js +2 -0
- package/web/app/immutable/chunks/{CD3p1vYG.js → Big1YQpq.js} +1 -1
- package/web/app/immutable/chunks/{DjcKhQp4.js → Bl0Adq86.js} +1 -1
- package/web/app/immutable/chunks/{Dg9xZYld.js → Bl2aLOn5.js} +1 -1
- package/web/app/immutable/chunks/{CzEsFefN.js → BskEvHZa.js} +1 -1
- package/web/app/immutable/chunks/{BShQ2LRb.js → Bt_RDNlI.js} +1 -1
- package/web/app/immutable/chunks/{D478BUHq.js → Bx_nP_MK.js} +1 -1
- package/web/app/immutable/chunks/{BVV3fM7W.js → Bya2sQrR.js} +1 -1
- package/web/app/immutable/chunks/{BqUUWX71.js → Byj6QL5F.js} +1 -1
- package/web/app/immutable/chunks/{BYx2Y144.js → C-Qm3bfA.js} +1 -1
- package/web/app/immutable/chunks/{BrQ0wqQy.js → C1wjuTFV.js} +1 -1
- package/web/app/immutable/chunks/{CU9Jo2EB.js → C3L3GwMq.js} +1 -1
- package/web/app/immutable/chunks/{DzGon3k8.js → C4qqiNcA.js} +1 -1
- package/web/app/immutable/chunks/{C_RGTtXj.js → C5cRG0yV.js} +3 -3
- package/web/app/immutable/chunks/{B1ScYY03.js → C9otdzZM.js} +4 -4
- package/web/app/immutable/chunks/{Ccaz1_yi.js → CGINFMqT.js} +1 -1
- package/web/app/immutable/chunks/{DUCIVWu4.js → CJHViisg.js} +3 -3
- package/web/app/immutable/chunks/{g5Oev8-0.js → CNUg0Cs8.js} +1 -1
- package/web/app/immutable/chunks/{CubYUWh2.js → CO15VKbw.js} +1 -1
- package/web/app/immutable/chunks/{BrYKR-SG.js → CVOsommd.js} +2 -2
- package/web/app/immutable/chunks/{CM4RKAei.js → C_z20mJT.js} +1 -1
- package/web/app/immutable/chunks/{Oa6WXH6c.js → Cb4s3Dt_.js} +3 -3
- package/web/app/immutable/chunks/{Cnly_zgc.js → CgS1Dv_8.js} +1 -1
- package/web/app/immutable/chunks/{Cn2kUD4R.js → Ch9oF0ek.js} +1 -1
- package/web/app/immutable/chunks/{D39Rrj4Y.js → CjorBqRt.js} +1 -1
- package/web/app/immutable/chunks/{C1d-f55y.js → CkVsI2Jc.js} +1 -1
- package/web/app/immutable/chunks/{CD6wiERl.js → CmVyGqNV.js} +2 -2
- package/web/app/immutable/chunks/{ZWDSGAzi.js → CpBPE3-0.js} +1 -1
- package/web/app/immutable/chunks/{DxNx74qV.js → CpHAR9_T.js} +1 -1
- package/web/app/immutable/chunks/{DlZbnYcc.js → CpY-WDD9.js} +1 -1
- package/web/app/immutable/chunks/{m2KtwqZj.js → Cq0xvhw9.js} +3 -3
- package/web/app/immutable/chunks/{BTli9eoV.js → Cq8fk3CH.js} +1 -1
- package/web/app/immutable/chunks/{BSQOiuf7.js → CrLichOk.js} +1 -1
- package/web/app/immutable/chunks/CsqD9xz6.js +2 -0
- package/web/app/immutable/chunks/{CuHcMIuh.js → CssvkQD7.js} +1 -1
- package/web/app/immutable/chunks/{p1enVnf-.js → CuoerPJp.js} +3 -3
- package/web/app/immutable/chunks/{BCKdYbDN.js → CvH6beJr.js} +1 -1
- package/web/app/immutable/chunks/{CtoSWfC3.js → CyQJi5fM.js} +1 -1
- package/web/app/immutable/chunks/{CDfNySzn.js → CytLF-ur.js} +6 -6
- package/web/app/immutable/chunks/{DSEn8hom.js → D00mCTUs.js} +1 -1
- package/web/app/immutable/chunks/{fUWZZKuh.js → D0VMf2Fp.js} +3 -3
- package/web/app/immutable/chunks/{BAL5XTLB.js → D0g6v2_u.js} +1 -1
- package/web/app/immutable/chunks/{IF38I4hJ.js → D1FSU9Gk.js} +1 -1
- package/web/app/immutable/chunks/{DP_4YjFn.js → D1Vat_ZV.js} +1 -1
- package/web/app/immutable/chunks/{C0w-ozGP.js → D3rVaYU0.js} +1 -1
- package/web/app/immutable/chunks/{CNrMRWtA.js → D4LnecGU.js} +2 -2
- package/web/app/immutable/chunks/{CfrI0flQ.js → D5kZvSPC.js} +1 -1
- package/web/app/immutable/chunks/{CGa_N4XN.js → D9H2UCuG.js} +1 -1
- package/web/app/immutable/chunks/{DhFCUcs_.js → DAwOD17b.js} +1 -1
- package/web/app/immutable/chunks/{DW6bFMyN.js → DC3pczce.js} +1 -1
- package/web/app/immutable/chunks/{9JxkPVF4.js → DD4-FHBp.js} +1 -1
- package/web/app/immutable/chunks/{LOqiMc_U.js → DHBQy6St.js} +1 -1
- package/web/app/immutable/chunks/{CGyzoULR.js → DHbwKi-E.js} +2 -2
- package/web/app/immutable/chunks/{CK1KGIDF.js → DQTzZEWU.js} +2 -2
- package/web/app/immutable/chunks/{Bx9jZIih.js → DVlYg0SZ.js} +3 -3
- package/web/app/immutable/chunks/{BPvTHi1E.js → DWWTsFh-.js} +1 -1
- package/web/app/immutable/chunks/{PRiKArA2.js → DXcrfgZH.js} +1 -1
- package/web/app/immutable/chunks/{CwzEnqS-.js → Db7PzaF_.js} +1 -1
- package/web/app/immutable/chunks/{BJ3gWX43.js → DjKDfA1m.js} +2 -2
- package/web/app/immutable/chunks/{jbEf1eyu.js → DkNdI_Wp.js} +1 -1
- package/web/app/immutable/chunks/{CWv2hgO9.js → DkgfeEA0.js} +1 -1
- package/web/app/immutable/chunks/{BpOARSV2.js → DlBKZ9jQ.js} +2 -2
- package/web/app/immutable/chunks/{Mq-KWmnJ.js → Ds8ezw9K.js} +1 -1
- package/web/app/immutable/chunks/{BSEFatJl.js → DsCJG1hb.js} +1 -1
- package/web/app/immutable/chunks/{Dr8wZpId.js → Dtqu7Pxg.js} +1 -1
- package/web/app/immutable/chunks/{LWmvlIUb.js → DuTju9rc.js} +1 -1
- package/web/app/immutable/chunks/{DJ5x8cvc.js → DvCS4TTw.js} +1 -1
- package/web/app/immutable/chunks/{HzX2dyQQ.js → DyIRpoZq.js} +1 -1
- package/web/app/immutable/chunks/{HtczSd2T.js → DzmdzUVi.js} +1 -1
- package/web/app/immutable/chunks/{DB-v9jra.js → MzfVdJbX.js} +1 -1
- package/web/app/immutable/chunks/{CY0JcuWq.js → OiHDtgNp.js} +1 -1
- package/web/app/immutable/chunks/{D_duQWml.js → QWfAA7k-.js} +1 -1
- package/web/app/immutable/chunks/{Bh3GosDM.js → TaZ6zGN1.js} +1 -1
- package/web/app/immutable/chunks/{CTRz9TAp.js → Tqm9-f9l.js} +1 -1
- package/web/app/immutable/chunks/{BffM0X9l.js → Vfi0Dmt8.js} +1 -1
- package/web/app/immutable/chunks/{DPVE_K_W.js → W67SWYQh.js} +1 -1
- package/web/app/immutable/chunks/{D3110at5.js → YhYmjxML.js} +1 -1
- package/web/app/immutable/chunks/{BCReWepB.js → aCDFJfWo.js} +1 -1
- package/web/app/immutable/chunks/{DtIte6Mn.js → aokikQw5.js} +47 -47
- package/web/app/immutable/chunks/{Dg8d6CfG.js → buVzC4lf.js} +1 -1
- package/web/app/immutable/chunks/{DfPFNZRA.js → c1DCm8IK.js} +1 -1
- package/web/app/immutable/chunks/{DnxaSjad.js → cU6Fqv3g.js} +1 -1
- package/web/app/immutable/chunks/{ChdfugfS.js → dGnsWF4N.js} +1 -1
- package/web/app/immutable/chunks/{DYUOfSUt.js → ivBdCvd6.js} +1 -1
- package/web/app/immutable/chunks/{DDJJ0r24.js → kbpbXlKS.js} +1 -1
- package/web/app/immutable/chunks/{Pyx0yui4.js → lZNvj_WH.js} +1 -1
- package/web/app/immutable/chunks/{Dd5fSdFI.js → rUCEwUE_.js} +1 -1
- package/web/app/immutable/chunks/{BM1o8cfq.js → t94_2IkW.js} +1 -1
- package/web/app/immutable/chunks/{DgcVHfLT.js → tSlfPnTD.js} +1 -1
- package/web/app/immutable/chunks/y2YthUTc.js +1 -0
- package/web/app/immutable/chunks/{DL8IL3dP.js → yTlZ1Sih.js} +1 -1
- package/web/app/immutable/entry/{app.0rhGzEA-.js → app.CYYj7JvH.js} +2 -2
- package/web/app/immutable/entry/start.BH_-Ros5.js +1 -0
- package/web/app/immutable/nodes/{0.7iTMX8MP.js → 0.vJoG8nTo.js} +1 -1
- package/web/app/immutable/nodes/{1.BwagR4s9.js → 1.Di6AbyQm.js} +1 -1
- package/web/app/immutable/nodes/{10.DuZeAxuV.js → 10.BkazfxT8.js} +16 -16
- package/web/app/immutable/nodes/{11.D7qyNhVk.js → 11.Ck_7PTgk.js} +4 -4
- package/web/app/immutable/nodes/{15.De8ZpDZ1.js → 15.DWwqZzAg.js} +1 -1
- package/web/app/immutable/nodes/{19.Df09vK0B.js → 19.CjDPuA-n.js} +2 -2
- package/web/app/immutable/nodes/{2.Dlt4LRYB.js → 2.B7bl9OWL.js} +4 -4
- package/web/app/immutable/nodes/{3.PjliZTHk.js → 3.CY1Mye6q.js} +1 -1
- package/web/app/immutable/nodes/{4.OFyddHWG.js → 4.sNrk6dxf.js} +1 -1
- package/web/app/immutable/nodes/{5.C7naJyKP.js → 5.BrOibHKo.js} +1 -1
- package/web/app/immutable/nodes/{6.k4q9sApB.js → 6.BVYLHxv3.js} +1 -1
- package/web/app/immutable/nodes/{7.C4plvmUt.js → 7.BZ0ZLzU_.js} +1 -1
- package/web/app/immutable/nodes/{8.tv1szX_U.js → 8.BNlg4qDc.js} +1 -1
- package/web/app/immutable/nodes/{9.gOkUPoOT.js → 9.C8X38wWW.js} +4 -4
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/chunks/Ct4BiqZH.js +0 -2
- package/web/app/immutable/chunks/D9WrKwE8.js +0 -1
- package/web/app/immutable/chunks/DbaZdUr0.js +0 -1
- package/web/app/immutable/chunks/tm_HKw3E.js +0 -2
- package/web/app/immutable/entry/start.piZarN4f.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as fe}from"./
|
|
1
|
+
import{g as fe}from"./kbpbXlKS.js";import{b as o,ay as te,X as U,aX as ye,ad as be,ah as me,aL as ke,b3 as Ee,O as K,aV as F,ax as _e,J as Se,an as Ne,au as ce,H as le}from"./C9otdzZM.js";var $=(function(){var e=o(function(O,s,n,r){for(n=n||{},r=O.length;r--;n[O[r]]=s);return n},"o"),h=[1,4],p=[1,13],i=[1,12],d=[1,15],k=[1,16],m=[1,20],l=[1,19],D=[6,7,8],I=[1,26],g=[1,24],w=[1,25],E=[6,7,11],G=[1,31],N=[6,7,11,24],V=[1,6,13,16,17,20,23],f=[1,35],A=[1,36],L=[1,6,7,11,13,16,17,20,23],H=[1,38],T={trace:o(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,KANBAN:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,shapeData:15,ICON:16,CLASS:17,nodeWithId:18,nodeWithoutId:19,NODE_DSTART:20,NODE_DESCR:21,NODE_DEND:22,NODE_ID:23,SHAPE_DATA:24,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"KANBAN",11:"EOF",13:"SPACELIST",16:"ICON",17:"CLASS",20:"NODE_DSTART",21:"NODE_DESCR",22:"NODE_DEND",23:"NODE_ID",24:"SHAPE_DATA"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,3],[12,2],[12,2],[12,2],[12,1],[12,2],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[19,3],[18,1],[18,4],[15,2],[15,1]],performAction:o(function(s,n,r,a,u,t,M){var c=t.length-1;switch(u){case 6:case 7:return a;case 8:a.getLogger().trace("Stop NL ");break;case 9:a.getLogger().trace("Stop EOF ");break;case 11:a.getLogger().trace("Stop NL2 ");break;case 12:a.getLogger().trace("Stop EOF2 ");break;case 15:a.getLogger().info("Node: ",t[c-1].id),a.addNode(t[c-2].length,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 16:a.getLogger().info("Node: ",t[c].id),a.addNode(t[c-1].length,t[c].id,t[c].descr,t[c].type);break;case 17:a.getLogger().trace("Icon: ",t[c]),a.decorateNode({icon:t[c]});break;case 18:case 23:a.decorateNode({class:t[c]});break;case 19:a.getLogger().trace("SPACELIST");break;case 20:a.getLogger().trace("Node: ",t[c-1].id),a.addNode(0,t[c-1].id,t[c-1].descr,t[c-1].type,t[c]);break;case 21:a.getLogger().trace("Node: ",t[c].id),a.addNode(0,t[c].id,t[c].descr,t[c].type);break;case 22:a.decorateNode({icon:t[c]});break;case 27:a.getLogger().trace("node found ..",t[c-2]),this.$={id:t[c-1],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 28:this.$={id:t[c],descr:t[c],type:0};break;case 29:a.getLogger().trace("node found ..",t[c-3]),this.$={id:t[c-3],descr:t[c-1],type:a.getType(t[c-2],t[c])};break;case 30:this.$=t[c-1]+t[c];break;case 31:this.$=t[c];break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:h},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:h},{6:p,7:[1,10],9:9,12:11,13:i,14:14,16:d,17:k,18:17,19:18,20:m,23:l},e(D,[2,3]),{1:[2,2]},e(D,[2,4]),e(D,[2,5]),{1:[2,6],6:p,12:21,13:i,14:14,16:d,17:k,18:17,19:18,20:m,23:l},{6:p,9:22,12:11,13:i,14:14,16:d,17:k,18:17,19:18,20:m,23:l},{6:I,7:g,10:23,11:w},e(E,[2,24],{18:17,19:18,14:27,16:[1,28],17:[1,29],20:m,23:l}),e(E,[2,19]),e(E,[2,21],{15:30,24:G}),e(E,[2,22]),e(E,[2,23]),e(N,[2,25]),e(N,[2,26]),e(N,[2,28],{20:[1,32]}),{21:[1,33]},{6:I,7:g,10:34,11:w},{1:[2,7],6:p,12:21,13:i,14:14,16:d,17:k,18:17,19:18,20:m,23:l},e(V,[2,14],{7:f,11:A}),e(L,[2,8]),e(L,[2,9]),e(L,[2,10]),e(E,[2,16],{15:37,24:G}),e(E,[2,17]),e(E,[2,18]),e(E,[2,20],{24:H}),e(N,[2,31]),{21:[1,39]},{22:[1,40]},e(V,[2,13],{7:f,11:A}),e(L,[2,11]),e(L,[2,12]),e(E,[2,15],{24:H}),e(N,[2,30]),{22:[1,41]},e(N,[2,27]),e(N,[2,29])],defaultActions:{2:[2,1],6:[2,2]},parseError:o(function(s,n){if(n.recoverable)this.trace(s);else{var r=new Error(s);throw r.hash=n,r}},"parseError"),parse:o(function(s){var n=this,r=[0],a=[],u=[null],t=[],M=this.table,c="",W=0,ie=0,ue=2,re=1,ge=t.slice.call(arguments,1),b=Object.create(this.lexer),R={yy:{}};for(var J in this.yy)Object.prototype.hasOwnProperty.call(this.yy,J)&&(R.yy[J]=this.yy[J]);b.setInput(s,R.yy),R.yy.lexer=b,R.yy.parser=this,typeof b.yylloc>"u"&&(b.yylloc={});var q=b.yylloc;t.push(q);var de=b.options&&b.options.ranges;typeof R.yy.parseError=="function"?this.parseError=R.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function pe(S){r.length=r.length-2*S,u.length=u.length-S,t.length=t.length-S}o(pe,"popStack");function ae(){var S;return S=a.pop()||b.lex()||re,typeof S!="number"&&(S instanceof Array&&(a=S,S=a.pop()),S=n.symbols_[S]||S),S}o(ae,"lex");for(var _,P,x,Q,j={},z,C,oe,X;;){if(P=r[r.length-1],this.defaultActions[P]?x=this.defaultActions[P]:((_===null||typeof _>"u")&&(_=ae()),x=M[P]&&M[P][_]),typeof x>"u"||!x.length||!x[0]){var Z="";X=[];for(z in M[P])this.terminals_[z]&&z>ue&&X.push("'"+this.terminals_[z]+"'");b.showPosition?Z="Parse error on line "+(W+1)+`:
|
|
2
2
|
`+b.showPosition()+`
|
|
3
3
|
Expecting `+X.join(", ")+", got '"+(this.terminals_[_]||_)+"'":Z="Parse error on line "+(W+1)+": Unexpected "+(_==re?"end of input":"'"+(this.terminals_[_]||_)+"'"),this.parseError(Z,{text:b.match,token:this.terminals_[_]||_,line:b.yylineno,loc:q,expected:X})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+_);switch(x[0]){case 1:r.push(_),u.push(b.yytext),t.push(b.yylloc),r.push(x[1]),_=null,ie=b.yyleng,c=b.yytext,W=b.yylineno,q=b.yylloc;break;case 2:if(C=this.productions_[x[1]][1],j.$=u[u.length-C],j._$={first_line:t[t.length-(C||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(C||1)].first_column,last_column:t[t.length-1].last_column},de&&(j._$.range=[t[t.length-(C||1)].range[0],t[t.length-1].range[1]]),Q=this.performAction.apply(j,[c,ie,W,R.yy,x[1],u,t].concat(ge)),typeof Q<"u")return Q;C&&(r=r.slice(0,-1*C*2),u=u.slice(0,-1*C),t=t.slice(0,-1*C)),r.push(this.productions_[x[1]][0]),u.push(j.$),t.push(j._$),oe=M[r[r.length-2]][r[r.length-1]],r.push(oe);break;case 3:return!0}}return!0},"parse")},Y=(function(){var O={EOF:1,parseError:o(function(n,r){if(this.yy.parser)this.yy.parser.parseError(n,r);else throw new Error(n)},"parseError"),setInput:o(function(s,n){return this.yy=n||this.yy||{},this._input=s,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:o(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var n=s.match(/(?:\r\n?|\n).*/g);return n?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:o(function(s){var n=s.length,r=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-n),this.offset-=n;var a=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),r.length-1&&(this.yylineno-=r.length-1);var u=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===a.length?this.yylloc.first_column:0)+a[a.length-r.length].length-r[0].length:this.yylloc.first_column-n},this.options.ranges&&(this.yylloc.range=[u[0],u[0]+this.yyleng-n]),this.yyleng=this.yytext.length,this},"unput"),more:o(function(){return this._more=!0,this},"more"),reject:o(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
|
|
4
4
|
`+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:o(function(s){this.unput(this.match.slice(s))},"less"),pastInput:o(function(){var s=this.matched.substr(0,this.matched.length-this.match.length);return(s.length>20?"...":"")+s.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:o(function(){var s=this.match;return s.length<20&&(s+=this._input.substr(0,20-s.length)),(s.substr(0,20)+(s.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:o(function(){var s=this.pastInput(),n=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{U as be,aZ as we,Y as _e,b0 as De,V as Se,a_ as Ce,b as l,X as dt,aW as vt,B as Me,L as U,ay as st,z as Ee,P as Ie,r as $e,bh as Ye}from"./B1ScYY03.js";import{g as It}from"./BdWqymET.js";import{t as Ae,d as Fe,m as Le,l as Oe,h as We,g as Zt,p as Qt,u as Pe,q as Ve,i as ze,v as Re,x as Ne,w as He,n as Be,e as Kt,j as Jt,k as te,s as ee,a as re}from"./CzEsFefN.js";function qe(t){return t}var Tt=1,Yt=2,Ft=3,xt=4,se=1e-6;function Ge(t){return"translate("+t+",0)"}function Xe(t){return"translate(0,"+t+")"}function je(t){return e=>+t(e)}function Ue(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),s=>+t(s)+e}function Ze(){return!this.__axis}function de(t,e){var s=[],r=null,i=null,g=6,y=6,b=3,S=typeof window<"u"&&window.devicePixelRatio>1?0:.5,L=t===Tt||t===xt?-1:1,_=t===xt||t===Yt?"x":"y",W=t===Tt||t===Ft?Ge:Xe;function w(D){var N=r??(e.ticks?e.ticks.apply(e,s):e.domain()),V=i??(e.tickFormat?e.tickFormat.apply(e,s):qe),k=Math.max(g,0)+b,M=e.range(),P=+M[0]+S,O=+M[M.length-1]+S,B=(e.bandwidth?Ue:je)(e.copy(),S),H=D.selection?D.selection():D,I=H.selectAll(".domain").data([null]),x=H.selectAll(".tick").data(N,e).order(),h=x.exit(),E=x.enter().append("g").attr("class","tick"),f=x.select("line"),T=x.select("text");I=I.merge(I.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),x=x.merge(E),f=f.merge(E.append("line").attr("stroke","currentColor").attr(_+"2",L*g)),T=T.merge(E.append("text").attr("fill","currentColor").attr(_,L*k).attr("dy",t===Tt?"0em":t===Ft?"0.71em":"0.32em")),D!==H&&(I=I.transition(D),x=x.transition(D),f=f.transition(D),T=T.transition(D),h=h.transition(D).attr("opacity",se).attr("transform",function(v){return isFinite(v=B(v))?W(v+S):this.getAttribute("transform")}),E.attr("opacity",se).attr("transform",function(v){var p=this.parentNode.__axis;return W((p&&isFinite(p=p(v))?p:B(v))+S)})),h.remove(),I.attr("d",t===xt||t===Yt?y?"M"+L*y+","+P+"H"+S+"V"+O+"H"+L*y:"M"+S+","+P+"V"+O:y?"M"+P+","+L*y+"V"+S+"H"+O+"V"+L*y:"M"+P+","+S+"H"+O),x.attr("opacity",1).attr("transform",function(v){return W(B(v)+S)}),f.attr(_+"2",L*g),T.attr(_,L*k).text(V),H.filter(Ze).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Yt?"start":t===xt?"end":"middle"),H.each(function(){this.__axis=B})}return w.scale=function(D){return arguments.length?(e=D,w):e},w.ticks=function(){return s=Array.from(arguments),w},w.tickArguments=function(D){return arguments.length?(s=D==null?[]:Array.from(D),w):s.slice()},w.tickValues=function(D){return arguments.length?(r=D==null?null:Array.from(D),w):r&&r.slice()},w.tickFormat=function(D){return arguments.length?(i=D,w):i},w.tickSize=function(D){return arguments.length?(g=y=+D,w):g},w.tickSizeInner=function(D){return arguments.length?(g=+D,w):g},w.tickSizeOuter=function(D){return arguments.length?(y=+D,w):y},w.tickPadding=function(D){return arguments.length?(b=+D,w):b},w.offset=function(D){return arguments.length?(S=+D,w):S},w}function Qe(t){return de(Tt,t)}function Ke(t){return de(Ft,t)}var bt={exports:{}},Je=bt.exports,ne;function tr(){return ne||(ne=1,(function(t,e){(function(s,r){t.exports=r()})(Je,(function(){var s="day";return function(r,i,g){var y=function(L){return L.add(4-L.isoWeekday(),s)},b=i.prototype;b.isoWeekYear=function(){return y(this).year()},b.isoWeek=function(L){if(!this.$utils().u(L))return this.add(7*(L-this.isoWeek()),s);var _,W,w,D,N=y(this),V=(_=this.isoWeekYear(),W=this.$u,w=(W?g.utc:g)().year(_).startOf("year"),D=4-w.isoWeekday(),w.isoWeekday()>4&&(D+=7),w.add(D,s));return N.diff(V,"week")+1},b.isoWeekday=function(L){return this.$utils().u(L)?this.day()||7:this.day(this.day()%7?L:L-7)};var S=b.startOf;b.startOf=function(L,_){var W=this.$utils(),w=!!W.u(_)||_;return W.p(L)==="isoweek"?w?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):S.bind(this)(L,_)}}}))})(bt)),bt.exports}var er=tr();const rr=It(er);var wt={exports:{}},sr=wt.exports,ie;function nr(){return ie||(ie=1,(function(t,e){(function(s,r){t.exports=r()})(sr,(function(){var s={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,g=/\d\d/,y=/\d\d?/,b=/\d*[^-_:/,()\s\d]+/,S={},L=function(k){return(k=+k)+(k>68?1900:2e3)},_=function(k){return function(M){this[k]=+M}},W=[/[+-]\d\d:?(\d\d)?|Z/,function(k){(this.zone||(this.zone={})).offset=(function(M){if(!M||M==="Z")return 0;var P=M.match(/([+-]|\d\d)/g),O=60*P[1]+(+P[2]||0);return O===0?0:P[0]==="+"?-O:O})(k)}],w=function(k){var M=S[k];return M&&(M.indexOf?M:M.s.concat(M.f))},D=function(k,M){var P,O=S.meridiem;if(O){for(var B=1;B<=24;B+=1)if(k.indexOf(O(B,0,M))>-1){P=B>12;break}}else P=k===(M?"pm":"PM");return P},N={A:[b,function(k){this.afternoon=D(k,!1)}],a:[b,function(k){this.afternoon=D(k,!0)}],Q:[i,function(k){this.month=3*(k-1)+1}],S:[i,function(k){this.milliseconds=100*+k}],SS:[g,function(k){this.milliseconds=10*+k}],SSS:[/\d{3}/,function(k){this.milliseconds=+k}],s:[y,_("seconds")],ss:[y,_("seconds")],m:[y,_("minutes")],mm:[y,_("minutes")],H:[y,_("hours")],h:[y,_("hours")],HH:[y,_("hours")],hh:[y,_("hours")],D:[y,_("day")],DD:[g,_("day")],Do:[b,function(k){var M=S.ordinal,P=k.match(/\d+/);if(this.day=P[0],M)for(var O=1;O<=31;O+=1)M(O).replace(/\[|\]/g,"")===k&&(this.day=O)}],w:[y,_("week")],ww:[g,_("week")],M:[y,_("month")],MM:[g,_("month")],MMM:[b,function(k){var M=w("months"),P=(w("monthsShort")||M.map((function(O){return O.slice(0,3)}))).indexOf(k)+1;if(P<1)throw new Error;this.month=P%12||P}],MMMM:[b,function(k){var M=w("months").indexOf(k)+1;if(M<1)throw new Error;this.month=M%12||M}],Y:[/[+-]?\d+/,_("year")],YY:[g,function(k){this.year=L(k)}],YYYY:[/\d{4}/,_("year")],Z:W,ZZ:W};function V(k){var M,P;M=k,P=S&&S.formats;for(var O=(k=M.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(f,T,v){var p=v&&v.toUpperCase();return T||P[v]||s[v]||P[p].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(a,d,m){return d||m.slice(1)}))}))).match(r),B=O.length,H=0;H<B;H+=1){var I=O[H],x=N[I],h=x&&x[0],E=x&&x[1];O[H]=E?{regex:h,parser:E}:I.replace(/^\[|\]$/g,"")}return function(f){for(var T={},v=0,p=0;v<B;v+=1){var a=O[v];if(typeof a=="string")p+=a.length;else{var d=a.regex,m=a.parser,u=f.slice(p),C=d.exec(u)[0];m.call(T,C),f=f.replace(C,"")}}return(function(n){var $=n.afternoon;if($!==void 0){var o=n.hours;$?o<12&&(n.hours+=12):o===12&&(n.hours=0),delete n.afternoon}})(T),T}}return function(k,M,P){P.p.customParseFormat=!0,k&&k.parseTwoDigitYear&&(L=k.parseTwoDigitYear);var O=M.prototype,B=O.parse;O.parse=function(H){var I=H.date,x=H.utc,h=H.args;this.$u=x;var E=h[1];if(typeof E=="string"){var f=h[2]===!0,T=h[3]===!0,v=f||T,p=h[2];T&&(p=h[2]),S=this.$locale(),!f&&p&&(S=P.Ls[p]),this.$d=(function(u,C,n,$){try{if(["x","X"].indexOf(C)>-1)return new Date((C==="X"?1e3:1)*u);var o=V(C)(u),G=o.year,c=o.month,Y=o.day,A=o.hours,R=o.minutes,F=o.seconds,q=o.milliseconds,z=o.zone,nt=o.week,at=new Date,yt=Y||(G||c?1:at.getDate()),lt=G||at.getFullYear(),X=0;G&&!c||(X=c>0?c-1:at.getMonth());var K,Z=A||0,ot=R||0,J=F||0,it=q||0;return z?new Date(Date.UTC(lt,X,yt,Z,ot,J,it+60*z.offset*1e3)):n?new Date(Date.UTC(lt,X,yt,Z,ot,J,it)):(K=new Date(lt,X,yt,Z,ot,J,it),nt&&(K=$(K).week(nt).toDate()),K)}catch{return new Date("")}})(I,E,x,P),this.init(),p&&p!==!0&&(this.$L=this.locale(p).$L),v&&I!=this.format(E)&&(this.$d=new Date("")),S={}}else if(E instanceof Array)for(var a=E.length,d=1;d<=a;d+=1){h[1]=E[d-1];var m=P.apply(this,h);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}d===a&&(this.$d=new Date(""))}else B.call(this,H)}}}))})(wt)),wt.exports}var ir=nr();const ar=It(ir);var _t={exports:{}},or=_t.exports,ae;function cr(){return ae||(ae=1,(function(t,e){(function(s,r){t.exports=r()})(or,(function(){return function(s,r){var i=r.prototype,g=i.format;i.format=function(y){var b=this,S=this.$locale();if(!this.isValid())return g.bind(this)(y);var L=this.$utils(),_=(y||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(W){switch(W){case"Q":return Math.ceil((b.$M+1)/3);case"Do":return S.ordinal(b.$D);case"gggg":return b.weekYear();case"GGGG":return b.isoWeekYear();case"wo":return S.ordinal(b.week(),"W");case"w":case"ww":return L.s(b.week(),W==="w"?1:2,"0");case"W":case"WW":return L.s(b.isoWeek(),W==="W"?1:2,"0");case"k":case"kk":return L.s(String(b.$H===0?24:b.$H),W==="k"?1:2,"0");case"X":return Math.floor(b.$d.getTime()/1e3);case"x":return b.$d.getTime();case"z":return"["+b.offsetName()+"]";case"zzz":return"["+b.offsetName("long")+"]";default:return W}}));return g.bind(this)(_)}}}))})(_t)),_t.exports}var lr=cr();const ur=It(lr);var Dt={exports:{}},dr=Dt.exports,oe;function fr(){return oe||(oe=1,(function(t,e){(function(s,r){t.exports=r()})(dr,(function(){var s,r,i=1e3,g=6e4,y=36e5,b=864e5,S=31536e6,L=2628e6,_=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,W=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,w={years:S,months:L,days:b,hours:y,minutes:g,seconds:i,milliseconds:1,weeks:6048e5},D=function(I){return I instanceof B},N=function(I,x,h){return new B(I,h,x.$l)},V=function(I){return r.p(I)+"s"},k=function(I){return I<0},M=function(I){return k(I)?Math.ceil(I):Math.floor(I)},P=function(I){return Math.abs(I)},O=function(I,x){return I?k(I)?{negative:!0,format:""+P(I)+x}:{negative:!1,format:""+I+x}:{negative:!1,format:""}},B=(function(){function I(h,E,f){var T=this;if(this.$d={},this.$l=f,h===void 0&&(this.$ms=0,this.parseFromMilliseconds()),E)return N(h*w[V(E)],this);if(typeof h=="number")return this.$ms=h,this.parseFromMilliseconds(),this;if(typeof h=="object")return Object.keys(h).forEach((function(a){T.$d[V(a)]=h[a]})),this.calMilliseconds(),this;if(typeof h=="string"){var v=h.match(_);if(v){var p=v.slice(2).map((function(a){return a!=null?Number(a):0}));return this.$d.years=p[0],this.$d.months=p[1],this.$d.weeks=p[2],this.$d.days=p[3],this.$d.hours=p[4],this.$d.minutes=p[5],this.$d.seconds=p[6],this.calMilliseconds(),this}}return this}var x=I.prototype;return x.calMilliseconds=function(){var h=this;this.$ms=Object.keys(this.$d).reduce((function(E,f){return E+(h.$d[f]||0)*w[f]}),0)},x.parseFromMilliseconds=function(){var h=this.$ms;this.$d.years=M(h/S),h%=S,this.$d.months=M(h/L),h%=L,this.$d.days=M(h/b),h%=b,this.$d.hours=M(h/y),h%=y,this.$d.minutes=M(h/g),h%=g,this.$d.seconds=M(h/i),h%=i,this.$d.milliseconds=h},x.toISOString=function(){var h=O(this.$d.years,"Y"),E=O(this.$d.months,"M"),f=+this.$d.days||0;this.$d.weeks&&(f+=7*this.$d.weeks);var T=O(f,"D"),v=O(this.$d.hours,"H"),p=O(this.$d.minutes,"M"),a=this.$d.seconds||0;this.$d.milliseconds&&(a+=this.$d.milliseconds/1e3,a=Math.round(1e3*a)/1e3);var d=O(a,"S"),m=h.negative||E.negative||T.negative||v.negative||p.negative||d.negative,u=v.format||p.format||d.format?"T":"",C=(m?"-":"")+"P"+h.format+E.format+T.format+u+v.format+p.format+d.format;return C==="P"||C==="-P"?"P0D":C},x.toJSON=function(){return this.toISOString()},x.format=function(h){var E=h||"YYYY-MM-DDTHH:mm:ss",f={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return E.replace(W,(function(T,v){return v||String(f[T])}))},x.as=function(h){return this.$ms/w[V(h)]},x.get=function(h){var E=this.$ms,f=V(h);return f==="milliseconds"?E%=1e3:E=f==="weeks"?M(E/w[f]):this.$d[f],E||0},x.add=function(h,E,f){var T;return T=E?h*w[V(E)]:D(h)?h.$ms:N(h,this).$ms,N(this.$ms+T*(f?-1:1),this)},x.subtract=function(h,E){return this.add(h,E,!0)},x.locale=function(h){var E=this.clone();return E.$l=h,E},x.clone=function(){return N(this.$ms,this)},x.humanize=function(h){return s().add(this.$ms,"ms").locale(this.$l).fromNow(!h)},x.valueOf=function(){return this.asMilliseconds()},x.milliseconds=function(){return this.get("milliseconds")},x.asMilliseconds=function(){return this.as("milliseconds")},x.seconds=function(){return this.get("seconds")},x.asSeconds=function(){return this.as("seconds")},x.minutes=function(){return this.get("minutes")},x.asMinutes=function(){return this.as("minutes")},x.hours=function(){return this.get("hours")},x.asHours=function(){return this.as("hours")},x.days=function(){return this.get("days")},x.asDays=function(){return this.as("days")},x.weeks=function(){return this.get("weeks")},x.asWeeks=function(){return this.as("weeks")},x.months=function(){return this.get("months")},x.asMonths=function(){return this.as("months")},x.years=function(){return this.get("years")},x.asYears=function(){return this.as("years")},I})(),H=function(I,x,h){return I.add(x.years()*h,"y").add(x.months()*h,"M").add(x.days()*h,"d").add(x.hours()*h,"h").add(x.minutes()*h,"m").add(x.seconds()*h,"s").add(x.milliseconds()*h,"ms")};return function(I,x,h){s=h,r=h().$utils(),h.duration=function(T,v){var p=h.locale();return N(T,{$l:p},v)},h.isDuration=D;var E=x.prototype.add,f=x.prototype.subtract;x.prototype.add=function(T,v){return D(T)?H(this,T,1):E.bind(this)(T,v)},x.prototype.subtract=function(T,v){return D(T)?H(this,T,-1):f.bind(this)(T,v)}}}))})(Dt)),Dt.exports}var hr=fr();const mr=It(hr);var Lt=(function(){var t=l(function(p,a,d,m){for(d=d||{},m=p.length;m--;d[p[m]]=a);return d},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],s=[1,26],r=[1,27],i=[1,28],g=[1,29],y=[1,30],b=[1,31],S=[1,32],L=[1,33],_=[1,34],W=[1,9],w=[1,10],D=[1,11],N=[1,12],V=[1,13],k=[1,14],M=[1,15],P=[1,16],O=[1,19],B=[1,20],H=[1,21],I=[1,22],x=[1,23],h=[1,25],E=[1,35],f={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:l(function(a,d,m,u,C,n,$){var o=n.length-1;switch(C){case 1:return n[o-1];case 2:this.$=[];break;case 3:n[o-1].push(n[o]),this.$=n[o-1];break;case 4:case 5:this.$=n[o];break;case 6:case 7:this.$=[];break;case 8:u.setWeekday("monday");break;case 9:u.setWeekday("tuesday");break;case 10:u.setWeekday("wednesday");break;case 11:u.setWeekday("thursday");break;case 12:u.setWeekday("friday");break;case 13:u.setWeekday("saturday");break;case 14:u.setWeekday("sunday");break;case 15:u.setWeekend("friday");break;case 16:u.setWeekend("saturday");break;case 17:u.setDateFormat(n[o].substr(11)),this.$=n[o].substr(11);break;case 18:u.enableInclusiveEndDates(),this.$=n[o].substr(18);break;case 19:u.TopAxis(),this.$=n[o].substr(8);break;case 20:u.setAxisFormat(n[o].substr(11)),this.$=n[o].substr(11);break;case 21:u.setTickInterval(n[o].substr(13)),this.$=n[o].substr(13);break;case 22:u.setExcludes(n[o].substr(9)),this.$=n[o].substr(9);break;case 23:u.setIncludes(n[o].substr(9)),this.$=n[o].substr(9);break;case 24:u.setTodayMarker(n[o].substr(12)),this.$=n[o].substr(12);break;case 27:u.setDiagramTitle(n[o].substr(6)),this.$=n[o].substr(6);break;case 28:this.$=n[o].trim(),u.setAccTitle(this.$);break;case 29:case 30:this.$=n[o].trim(),u.setAccDescription(this.$);break;case 31:u.addSection(n[o].substr(8)),this.$=n[o].substr(8);break;case 33:u.addTask(n[o-1],n[o]),this.$="task";break;case 34:this.$=n[o-1],u.setClickEvent(n[o-1],n[o],null);break;case 35:this.$=n[o-2],u.setClickEvent(n[o-2],n[o-1],n[o]);break;case 36:this.$=n[o-2],u.setClickEvent(n[o-2],n[o-1],null),u.setLink(n[o-2],n[o]);break;case 37:this.$=n[o-3],u.setClickEvent(n[o-3],n[o-2],n[o-1]),u.setLink(n[o-3],n[o]);break;case 38:this.$=n[o-2],u.setClickEvent(n[o-2],n[o],null),u.setLink(n[o-2],n[o-1]);break;case 39:this.$=n[o-3],u.setClickEvent(n[o-3],n[o-1],n[o]),u.setLink(n[o-3],n[o-2]);break;case 40:this.$=n[o-1],u.setLink(n[o-1],n[o]);break;case 41:case 47:this.$=n[o-1]+" "+n[o];break;case 42:case 43:case 45:this.$=n[o-2]+" "+n[o-1]+" "+n[o];break;case 44:case 46:this.$=n[o-3]+" "+n[o-2]+" "+n[o-1]+" "+n[o];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:s,13:r,14:i,15:g,16:y,17:b,18:S,19:18,20:L,21:_,22:W,23:w,24:D,25:N,26:V,27:k,28:M,29:P,30:O,31:B,33:H,35:I,36:x,37:24,38:h,40:E},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:s,13:r,14:i,15:g,16:y,17:b,18:S,19:18,20:L,21:_,22:W,23:w,24:D,25:N,26:V,27:k,28:M,29:P,30:O,31:B,33:H,35:I,36:x,37:24,38:h,40:E},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:l(function(a,d){if(d.recoverable)this.trace(a);else{var m=new Error(a);throw m.hash=d,m}},"parseError"),parse:l(function(a){var d=this,m=[0],u=[],C=[null],n=[],$=this.table,o="",G=0,c=0,Y=2,A=1,R=n.slice.call(arguments,1),F=Object.create(this.lexer),q={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(q.yy[z]=this.yy[z]);F.setInput(a,q.yy),q.yy.lexer=F,q.yy.parser=this,typeof F.yylloc>"u"&&(F.yylloc={});var nt=F.yylloc;n.push(nt);var at=F.options&&F.options.ranges;typeof q.yy.parseError=="function"?this.parseError=q.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function yt(Q){m.length=m.length-2*Q,C.length=C.length-Q,n.length=n.length-Q}l(yt,"popStack");function lt(){var Q;return Q=u.pop()||F.lex()||A,typeof Q!="number"&&(Q instanceof Array&&(u=Q,Q=u.pop()),Q=d.symbols_[Q]||Q),Q}l(lt,"lex");for(var X,K,Z,ot,J={},it,tt,Ut,pt;;){if(K=m[m.length-1],this.defaultActions[K]?Z=this.defaultActions[K]:((X===null||typeof X>"u")&&(X=lt()),Z=$[K]&&$[K][X]),typeof Z>"u"||!Z.length||!Z[0]){var $t="";pt=[];for(it in $[K])this.terminals_[it]&&it>Y&&pt.push("'"+this.terminals_[it]+"'");F.showPosition?$t="Parse error on line "+(G+1)+`:
|
|
1
|
+
import{U as be,aZ as we,Y as _e,b0 as De,V as Se,a_ as Ce,b as l,X as dt,aW as vt,B as Me,L as U,ay as st,z as Ee,P as Ie,r as $e,bh as Ye}from"./C9otdzZM.js";import{g as It}from"./BdWqymET.js";import{t as Ae,d as Fe,m as Le,l as Oe,h as We,g as Zt,p as Qt,u as Pe,q as Ve,i as ze,v as Re,x as Ne,w as He,n as Be,e as Kt,j as Jt,k as te,s as ee,a as re}from"./BskEvHZa.js";function qe(t){return t}var Tt=1,Yt=2,Ft=3,xt=4,se=1e-6;function Ge(t){return"translate("+t+",0)"}function Xe(t){return"translate(0,"+t+")"}function je(t){return e=>+t(e)}function Ue(t,e){return e=Math.max(0,t.bandwidth()-e*2)/2,t.round()&&(e=Math.round(e)),s=>+t(s)+e}function Ze(){return!this.__axis}function de(t,e){var s=[],r=null,i=null,g=6,y=6,b=3,S=typeof window<"u"&&window.devicePixelRatio>1?0:.5,L=t===Tt||t===xt?-1:1,_=t===xt||t===Yt?"x":"y",W=t===Tt||t===Ft?Ge:Xe;function w(D){var N=r??(e.ticks?e.ticks.apply(e,s):e.domain()),V=i??(e.tickFormat?e.tickFormat.apply(e,s):qe),k=Math.max(g,0)+b,M=e.range(),P=+M[0]+S,O=+M[M.length-1]+S,B=(e.bandwidth?Ue:je)(e.copy(),S),H=D.selection?D.selection():D,I=H.selectAll(".domain").data([null]),x=H.selectAll(".tick").data(N,e).order(),h=x.exit(),E=x.enter().append("g").attr("class","tick"),f=x.select("line"),T=x.select("text");I=I.merge(I.enter().insert("path",".tick").attr("class","domain").attr("stroke","currentColor")),x=x.merge(E),f=f.merge(E.append("line").attr("stroke","currentColor").attr(_+"2",L*g)),T=T.merge(E.append("text").attr("fill","currentColor").attr(_,L*k).attr("dy",t===Tt?"0em":t===Ft?"0.71em":"0.32em")),D!==H&&(I=I.transition(D),x=x.transition(D),f=f.transition(D),T=T.transition(D),h=h.transition(D).attr("opacity",se).attr("transform",function(v){return isFinite(v=B(v))?W(v+S):this.getAttribute("transform")}),E.attr("opacity",se).attr("transform",function(v){var p=this.parentNode.__axis;return W((p&&isFinite(p=p(v))?p:B(v))+S)})),h.remove(),I.attr("d",t===xt||t===Yt?y?"M"+L*y+","+P+"H"+S+"V"+O+"H"+L*y:"M"+S+","+P+"V"+O:y?"M"+P+","+L*y+"V"+S+"H"+O+"V"+L*y:"M"+P+","+S+"H"+O),x.attr("opacity",1).attr("transform",function(v){return W(B(v)+S)}),f.attr(_+"2",L*g),T.attr(_,L*k).text(V),H.filter(Ze).attr("fill","none").attr("font-size",10).attr("font-family","sans-serif").attr("text-anchor",t===Yt?"start":t===xt?"end":"middle"),H.each(function(){this.__axis=B})}return w.scale=function(D){return arguments.length?(e=D,w):e},w.ticks=function(){return s=Array.from(arguments),w},w.tickArguments=function(D){return arguments.length?(s=D==null?[]:Array.from(D),w):s.slice()},w.tickValues=function(D){return arguments.length?(r=D==null?null:Array.from(D),w):r&&r.slice()},w.tickFormat=function(D){return arguments.length?(i=D,w):i},w.tickSize=function(D){return arguments.length?(g=y=+D,w):g},w.tickSizeInner=function(D){return arguments.length?(g=+D,w):g},w.tickSizeOuter=function(D){return arguments.length?(y=+D,w):y},w.tickPadding=function(D){return arguments.length?(b=+D,w):b},w.offset=function(D){return arguments.length?(S=+D,w):S},w}function Qe(t){return de(Tt,t)}function Ke(t){return de(Ft,t)}var bt={exports:{}},Je=bt.exports,ne;function tr(){return ne||(ne=1,(function(t,e){(function(s,r){t.exports=r()})(Je,(function(){var s="day";return function(r,i,g){var y=function(L){return L.add(4-L.isoWeekday(),s)},b=i.prototype;b.isoWeekYear=function(){return y(this).year()},b.isoWeek=function(L){if(!this.$utils().u(L))return this.add(7*(L-this.isoWeek()),s);var _,W,w,D,N=y(this),V=(_=this.isoWeekYear(),W=this.$u,w=(W?g.utc:g)().year(_).startOf("year"),D=4-w.isoWeekday(),w.isoWeekday()>4&&(D+=7),w.add(D,s));return N.diff(V,"week")+1},b.isoWeekday=function(L){return this.$utils().u(L)?this.day()||7:this.day(this.day()%7?L:L-7)};var S=b.startOf;b.startOf=function(L,_){var W=this.$utils(),w=!!W.u(_)||_;return W.p(L)==="isoweek"?w?this.date(this.date()-(this.isoWeekday()-1)).startOf("day"):this.date(this.date()-1-(this.isoWeekday()-1)+7).endOf("day"):S.bind(this)(L,_)}}}))})(bt)),bt.exports}var er=tr();const rr=It(er);var wt={exports:{}},sr=wt.exports,ie;function nr(){return ie||(ie=1,(function(t,e){(function(s,r){t.exports=r()})(sr,(function(){var s={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},r=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|Q|YYYY|YY?|ww?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,i=/\d/,g=/\d\d/,y=/\d\d?/,b=/\d*[^-_:/,()\s\d]+/,S={},L=function(k){return(k=+k)+(k>68?1900:2e3)},_=function(k){return function(M){this[k]=+M}},W=[/[+-]\d\d:?(\d\d)?|Z/,function(k){(this.zone||(this.zone={})).offset=(function(M){if(!M||M==="Z")return 0;var P=M.match(/([+-]|\d\d)/g),O=60*P[1]+(+P[2]||0);return O===0?0:P[0]==="+"?-O:O})(k)}],w=function(k){var M=S[k];return M&&(M.indexOf?M:M.s.concat(M.f))},D=function(k,M){var P,O=S.meridiem;if(O){for(var B=1;B<=24;B+=1)if(k.indexOf(O(B,0,M))>-1){P=B>12;break}}else P=k===(M?"pm":"PM");return P},N={A:[b,function(k){this.afternoon=D(k,!1)}],a:[b,function(k){this.afternoon=D(k,!0)}],Q:[i,function(k){this.month=3*(k-1)+1}],S:[i,function(k){this.milliseconds=100*+k}],SS:[g,function(k){this.milliseconds=10*+k}],SSS:[/\d{3}/,function(k){this.milliseconds=+k}],s:[y,_("seconds")],ss:[y,_("seconds")],m:[y,_("minutes")],mm:[y,_("minutes")],H:[y,_("hours")],h:[y,_("hours")],HH:[y,_("hours")],hh:[y,_("hours")],D:[y,_("day")],DD:[g,_("day")],Do:[b,function(k){var M=S.ordinal,P=k.match(/\d+/);if(this.day=P[0],M)for(var O=1;O<=31;O+=1)M(O).replace(/\[|\]/g,"")===k&&(this.day=O)}],w:[y,_("week")],ww:[g,_("week")],M:[y,_("month")],MM:[g,_("month")],MMM:[b,function(k){var M=w("months"),P=(w("monthsShort")||M.map((function(O){return O.slice(0,3)}))).indexOf(k)+1;if(P<1)throw new Error;this.month=P%12||P}],MMMM:[b,function(k){var M=w("months").indexOf(k)+1;if(M<1)throw new Error;this.month=M%12||M}],Y:[/[+-]?\d+/,_("year")],YY:[g,function(k){this.year=L(k)}],YYYY:[/\d{4}/,_("year")],Z:W,ZZ:W};function V(k){var M,P;M=k,P=S&&S.formats;for(var O=(k=M.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,(function(f,T,v){var p=v&&v.toUpperCase();return T||P[v]||s[v]||P[p].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,(function(a,d,m){return d||m.slice(1)}))}))).match(r),B=O.length,H=0;H<B;H+=1){var I=O[H],x=N[I],h=x&&x[0],E=x&&x[1];O[H]=E?{regex:h,parser:E}:I.replace(/^\[|\]$/g,"")}return function(f){for(var T={},v=0,p=0;v<B;v+=1){var a=O[v];if(typeof a=="string")p+=a.length;else{var d=a.regex,m=a.parser,u=f.slice(p),C=d.exec(u)[0];m.call(T,C),f=f.replace(C,"")}}return(function(n){var $=n.afternoon;if($!==void 0){var o=n.hours;$?o<12&&(n.hours+=12):o===12&&(n.hours=0),delete n.afternoon}})(T),T}}return function(k,M,P){P.p.customParseFormat=!0,k&&k.parseTwoDigitYear&&(L=k.parseTwoDigitYear);var O=M.prototype,B=O.parse;O.parse=function(H){var I=H.date,x=H.utc,h=H.args;this.$u=x;var E=h[1];if(typeof E=="string"){var f=h[2]===!0,T=h[3]===!0,v=f||T,p=h[2];T&&(p=h[2]),S=this.$locale(),!f&&p&&(S=P.Ls[p]),this.$d=(function(u,C,n,$){try{if(["x","X"].indexOf(C)>-1)return new Date((C==="X"?1e3:1)*u);var o=V(C)(u),G=o.year,c=o.month,Y=o.day,A=o.hours,R=o.minutes,F=o.seconds,q=o.milliseconds,z=o.zone,nt=o.week,at=new Date,yt=Y||(G||c?1:at.getDate()),lt=G||at.getFullYear(),X=0;G&&!c||(X=c>0?c-1:at.getMonth());var K,Z=A||0,ot=R||0,J=F||0,it=q||0;return z?new Date(Date.UTC(lt,X,yt,Z,ot,J,it+60*z.offset*1e3)):n?new Date(Date.UTC(lt,X,yt,Z,ot,J,it)):(K=new Date(lt,X,yt,Z,ot,J,it),nt&&(K=$(K).week(nt).toDate()),K)}catch{return new Date("")}})(I,E,x,P),this.init(),p&&p!==!0&&(this.$L=this.locale(p).$L),v&&I!=this.format(E)&&(this.$d=new Date("")),S={}}else if(E instanceof Array)for(var a=E.length,d=1;d<=a;d+=1){h[1]=E[d-1];var m=P.apply(this,h);if(m.isValid()){this.$d=m.$d,this.$L=m.$L,this.init();break}d===a&&(this.$d=new Date(""))}else B.call(this,H)}}}))})(wt)),wt.exports}var ir=nr();const ar=It(ir);var _t={exports:{}},or=_t.exports,ae;function cr(){return ae||(ae=1,(function(t,e){(function(s,r){t.exports=r()})(or,(function(){return function(s,r){var i=r.prototype,g=i.format;i.format=function(y){var b=this,S=this.$locale();if(!this.isValid())return g.bind(this)(y);var L=this.$utils(),_=(y||"YYYY-MM-DDTHH:mm:ssZ").replace(/\[([^\]]+)]|Q|wo|ww|w|WW|W|zzz|z|gggg|GGGG|Do|X|x|k{1,2}|S/g,(function(W){switch(W){case"Q":return Math.ceil((b.$M+1)/3);case"Do":return S.ordinal(b.$D);case"gggg":return b.weekYear();case"GGGG":return b.isoWeekYear();case"wo":return S.ordinal(b.week(),"W");case"w":case"ww":return L.s(b.week(),W==="w"?1:2,"0");case"W":case"WW":return L.s(b.isoWeek(),W==="W"?1:2,"0");case"k":case"kk":return L.s(String(b.$H===0?24:b.$H),W==="k"?1:2,"0");case"X":return Math.floor(b.$d.getTime()/1e3);case"x":return b.$d.getTime();case"z":return"["+b.offsetName()+"]";case"zzz":return"["+b.offsetName("long")+"]";default:return W}}));return g.bind(this)(_)}}}))})(_t)),_t.exports}var lr=cr();const ur=It(lr);var Dt={exports:{}},dr=Dt.exports,oe;function fr(){return oe||(oe=1,(function(t,e){(function(s,r){t.exports=r()})(dr,(function(){var s,r,i=1e3,g=6e4,y=36e5,b=864e5,S=31536e6,L=2628e6,_=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/,W=/\[([^\]]+)]|YYYY|YY|Y|M{1,2}|D{1,2}|H{1,2}|m{1,2}|s{1,2}|SSS/g,w={years:S,months:L,days:b,hours:y,minutes:g,seconds:i,milliseconds:1,weeks:6048e5},D=function(I){return I instanceof B},N=function(I,x,h){return new B(I,h,x.$l)},V=function(I){return r.p(I)+"s"},k=function(I){return I<0},M=function(I){return k(I)?Math.ceil(I):Math.floor(I)},P=function(I){return Math.abs(I)},O=function(I,x){return I?k(I)?{negative:!0,format:""+P(I)+x}:{negative:!1,format:""+I+x}:{negative:!1,format:""}},B=(function(){function I(h,E,f){var T=this;if(this.$d={},this.$l=f,h===void 0&&(this.$ms=0,this.parseFromMilliseconds()),E)return N(h*w[V(E)],this);if(typeof h=="number")return this.$ms=h,this.parseFromMilliseconds(),this;if(typeof h=="object")return Object.keys(h).forEach((function(a){T.$d[V(a)]=h[a]})),this.calMilliseconds(),this;if(typeof h=="string"){var v=h.match(_);if(v){var p=v.slice(2).map((function(a){return a!=null?Number(a):0}));return this.$d.years=p[0],this.$d.months=p[1],this.$d.weeks=p[2],this.$d.days=p[3],this.$d.hours=p[4],this.$d.minutes=p[5],this.$d.seconds=p[6],this.calMilliseconds(),this}}return this}var x=I.prototype;return x.calMilliseconds=function(){var h=this;this.$ms=Object.keys(this.$d).reduce((function(E,f){return E+(h.$d[f]||0)*w[f]}),0)},x.parseFromMilliseconds=function(){var h=this.$ms;this.$d.years=M(h/S),h%=S,this.$d.months=M(h/L),h%=L,this.$d.days=M(h/b),h%=b,this.$d.hours=M(h/y),h%=y,this.$d.minutes=M(h/g),h%=g,this.$d.seconds=M(h/i),h%=i,this.$d.milliseconds=h},x.toISOString=function(){var h=O(this.$d.years,"Y"),E=O(this.$d.months,"M"),f=+this.$d.days||0;this.$d.weeks&&(f+=7*this.$d.weeks);var T=O(f,"D"),v=O(this.$d.hours,"H"),p=O(this.$d.minutes,"M"),a=this.$d.seconds||0;this.$d.milliseconds&&(a+=this.$d.milliseconds/1e3,a=Math.round(1e3*a)/1e3);var d=O(a,"S"),m=h.negative||E.negative||T.negative||v.negative||p.negative||d.negative,u=v.format||p.format||d.format?"T":"",C=(m?"-":"")+"P"+h.format+E.format+T.format+u+v.format+p.format+d.format;return C==="P"||C==="-P"?"P0D":C},x.toJSON=function(){return this.toISOString()},x.format=function(h){var E=h||"YYYY-MM-DDTHH:mm:ss",f={Y:this.$d.years,YY:r.s(this.$d.years,2,"0"),YYYY:r.s(this.$d.years,4,"0"),M:this.$d.months,MM:r.s(this.$d.months,2,"0"),D:this.$d.days,DD:r.s(this.$d.days,2,"0"),H:this.$d.hours,HH:r.s(this.$d.hours,2,"0"),m:this.$d.minutes,mm:r.s(this.$d.minutes,2,"0"),s:this.$d.seconds,ss:r.s(this.$d.seconds,2,"0"),SSS:r.s(this.$d.milliseconds,3,"0")};return E.replace(W,(function(T,v){return v||String(f[T])}))},x.as=function(h){return this.$ms/w[V(h)]},x.get=function(h){var E=this.$ms,f=V(h);return f==="milliseconds"?E%=1e3:E=f==="weeks"?M(E/w[f]):this.$d[f],E||0},x.add=function(h,E,f){var T;return T=E?h*w[V(E)]:D(h)?h.$ms:N(h,this).$ms,N(this.$ms+T*(f?-1:1),this)},x.subtract=function(h,E){return this.add(h,E,!0)},x.locale=function(h){var E=this.clone();return E.$l=h,E},x.clone=function(){return N(this.$ms,this)},x.humanize=function(h){return s().add(this.$ms,"ms").locale(this.$l).fromNow(!h)},x.valueOf=function(){return this.asMilliseconds()},x.milliseconds=function(){return this.get("milliseconds")},x.asMilliseconds=function(){return this.as("milliseconds")},x.seconds=function(){return this.get("seconds")},x.asSeconds=function(){return this.as("seconds")},x.minutes=function(){return this.get("minutes")},x.asMinutes=function(){return this.as("minutes")},x.hours=function(){return this.get("hours")},x.asHours=function(){return this.as("hours")},x.days=function(){return this.get("days")},x.asDays=function(){return this.as("days")},x.weeks=function(){return this.get("weeks")},x.asWeeks=function(){return this.as("weeks")},x.months=function(){return this.get("months")},x.asMonths=function(){return this.as("months")},x.years=function(){return this.get("years")},x.asYears=function(){return this.as("years")},I})(),H=function(I,x,h){return I.add(x.years()*h,"y").add(x.months()*h,"M").add(x.days()*h,"d").add(x.hours()*h,"h").add(x.minutes()*h,"m").add(x.seconds()*h,"s").add(x.milliseconds()*h,"ms")};return function(I,x,h){s=h,r=h().$utils(),h.duration=function(T,v){var p=h.locale();return N(T,{$l:p},v)},h.isDuration=D;var E=x.prototype.add,f=x.prototype.subtract;x.prototype.add=function(T,v){return D(T)?H(this,T,1):E.bind(this)(T,v)},x.prototype.subtract=function(T,v){return D(T)?H(this,T,-1):f.bind(this)(T,v)}}}))})(Dt)),Dt.exports}var hr=fr();const mr=It(hr);var Lt=(function(){var t=l(function(p,a,d,m){for(d=d||{},m=p.length;m--;d[p[m]]=a);return d},"o"),e=[6,8,10,12,13,14,15,16,17,18,20,21,22,23,24,25,26,27,28,29,30,31,33,35,36,38,40],s=[1,26],r=[1,27],i=[1,28],g=[1,29],y=[1,30],b=[1,31],S=[1,32],L=[1,33],_=[1,34],W=[1,9],w=[1,10],D=[1,11],N=[1,12],V=[1,13],k=[1,14],M=[1,15],P=[1,16],O=[1,19],B=[1,20],H=[1,21],I=[1,22],x=[1,23],h=[1,25],E=[1,35],f={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,gantt:4,document:5,EOF:6,line:7,SPACE:8,statement:9,NL:10,weekday:11,weekday_monday:12,weekday_tuesday:13,weekday_wednesday:14,weekday_thursday:15,weekday_friday:16,weekday_saturday:17,weekday_sunday:18,weekend:19,weekend_friday:20,weekend_saturday:21,dateFormat:22,inclusiveEndDates:23,topAxis:24,axisFormat:25,tickInterval:26,excludes:27,includes:28,todayMarker:29,title:30,acc_title:31,acc_title_value:32,acc_descr:33,acc_descr_value:34,acc_descr_multiline_value:35,section:36,clickStatement:37,taskTxt:38,taskData:39,click:40,callbackname:41,callbackargs:42,href:43,clickStatementDebug:44,$accept:0,$end:1},terminals_:{2:"error",4:"gantt",6:"EOF",8:"SPACE",10:"NL",12:"weekday_monday",13:"weekday_tuesday",14:"weekday_wednesday",15:"weekday_thursday",16:"weekday_friday",17:"weekday_saturday",18:"weekday_sunday",20:"weekend_friday",21:"weekend_saturday",22:"dateFormat",23:"inclusiveEndDates",24:"topAxis",25:"axisFormat",26:"tickInterval",27:"excludes",28:"includes",29:"todayMarker",30:"title",31:"acc_title",32:"acc_title_value",33:"acc_descr",34:"acc_descr_value",35:"acc_descr_multiline_value",36:"section",38:"taskTxt",39:"taskData",40:"click",41:"callbackname",42:"callbackargs",43:"href"},productions_:[0,[3,3],[5,0],[5,2],[7,2],[7,1],[7,1],[7,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[11,1],[19,1],[19,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,1],[9,2],[9,2],[9,1],[9,1],[9,1],[9,2],[37,2],[37,3],[37,3],[37,4],[37,3],[37,4],[37,2],[44,2],[44,3],[44,3],[44,4],[44,3],[44,4],[44,2]],performAction:l(function(a,d,m,u,C,n,$){var o=n.length-1;switch(C){case 1:return n[o-1];case 2:this.$=[];break;case 3:n[o-1].push(n[o]),this.$=n[o-1];break;case 4:case 5:this.$=n[o];break;case 6:case 7:this.$=[];break;case 8:u.setWeekday("monday");break;case 9:u.setWeekday("tuesday");break;case 10:u.setWeekday("wednesday");break;case 11:u.setWeekday("thursday");break;case 12:u.setWeekday("friday");break;case 13:u.setWeekday("saturday");break;case 14:u.setWeekday("sunday");break;case 15:u.setWeekend("friday");break;case 16:u.setWeekend("saturday");break;case 17:u.setDateFormat(n[o].substr(11)),this.$=n[o].substr(11);break;case 18:u.enableInclusiveEndDates(),this.$=n[o].substr(18);break;case 19:u.TopAxis(),this.$=n[o].substr(8);break;case 20:u.setAxisFormat(n[o].substr(11)),this.$=n[o].substr(11);break;case 21:u.setTickInterval(n[o].substr(13)),this.$=n[o].substr(13);break;case 22:u.setExcludes(n[o].substr(9)),this.$=n[o].substr(9);break;case 23:u.setIncludes(n[o].substr(9)),this.$=n[o].substr(9);break;case 24:u.setTodayMarker(n[o].substr(12)),this.$=n[o].substr(12);break;case 27:u.setDiagramTitle(n[o].substr(6)),this.$=n[o].substr(6);break;case 28:this.$=n[o].trim(),u.setAccTitle(this.$);break;case 29:case 30:this.$=n[o].trim(),u.setAccDescription(this.$);break;case 31:u.addSection(n[o].substr(8)),this.$=n[o].substr(8);break;case 33:u.addTask(n[o-1],n[o]),this.$="task";break;case 34:this.$=n[o-1],u.setClickEvent(n[o-1],n[o],null);break;case 35:this.$=n[o-2],u.setClickEvent(n[o-2],n[o-1],n[o]);break;case 36:this.$=n[o-2],u.setClickEvent(n[o-2],n[o-1],null),u.setLink(n[o-2],n[o]);break;case 37:this.$=n[o-3],u.setClickEvent(n[o-3],n[o-2],n[o-1]),u.setLink(n[o-3],n[o]);break;case 38:this.$=n[o-2],u.setClickEvent(n[o-2],n[o],null),u.setLink(n[o-2],n[o-1]);break;case 39:this.$=n[o-3],u.setClickEvent(n[o-3],n[o-1],n[o]),u.setLink(n[o-3],n[o-2]);break;case 40:this.$=n[o-1],u.setLink(n[o-1],n[o]);break;case 41:case 47:this.$=n[o-1]+" "+n[o];break;case 42:case 43:case 45:this.$=n[o-2]+" "+n[o-1]+" "+n[o];break;case 44:case 46:this.$=n[o-3]+" "+n[o-2]+" "+n[o-1]+" "+n[o];break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},t(e,[2,2],{5:3}),{6:[1,4],7:5,8:[1,6],9:7,10:[1,8],11:17,12:s,13:r,14:i,15:g,16:y,17:b,18:S,19:18,20:L,21:_,22:W,23:w,24:D,25:N,26:V,27:k,28:M,29:P,30:O,31:B,33:H,35:I,36:x,37:24,38:h,40:E},t(e,[2,7],{1:[2,1]}),t(e,[2,3]),{9:36,11:17,12:s,13:r,14:i,15:g,16:y,17:b,18:S,19:18,20:L,21:_,22:W,23:w,24:D,25:N,26:V,27:k,28:M,29:P,30:O,31:B,33:H,35:I,36:x,37:24,38:h,40:E},t(e,[2,5]),t(e,[2,6]),t(e,[2,17]),t(e,[2,18]),t(e,[2,19]),t(e,[2,20]),t(e,[2,21]),t(e,[2,22]),t(e,[2,23]),t(e,[2,24]),t(e,[2,25]),t(e,[2,26]),t(e,[2,27]),{32:[1,37]},{34:[1,38]},t(e,[2,30]),t(e,[2,31]),t(e,[2,32]),{39:[1,39]},t(e,[2,8]),t(e,[2,9]),t(e,[2,10]),t(e,[2,11]),t(e,[2,12]),t(e,[2,13]),t(e,[2,14]),t(e,[2,15]),t(e,[2,16]),{41:[1,40],43:[1,41]},t(e,[2,4]),t(e,[2,28]),t(e,[2,29]),t(e,[2,33]),t(e,[2,34],{42:[1,42],43:[1,43]}),t(e,[2,40],{41:[1,44]}),t(e,[2,35],{43:[1,45]}),t(e,[2,36]),t(e,[2,38],{42:[1,46]}),t(e,[2,37]),t(e,[2,39])],defaultActions:{},parseError:l(function(a,d){if(d.recoverable)this.trace(a);else{var m=new Error(a);throw m.hash=d,m}},"parseError"),parse:l(function(a){var d=this,m=[0],u=[],C=[null],n=[],$=this.table,o="",G=0,c=0,Y=2,A=1,R=n.slice.call(arguments,1),F=Object.create(this.lexer),q={yy:{}};for(var z in this.yy)Object.prototype.hasOwnProperty.call(this.yy,z)&&(q.yy[z]=this.yy[z]);F.setInput(a,q.yy),q.yy.lexer=F,q.yy.parser=this,typeof F.yylloc>"u"&&(F.yylloc={});var nt=F.yylloc;n.push(nt);var at=F.options&&F.options.ranges;typeof q.yy.parseError=="function"?this.parseError=q.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function yt(Q){m.length=m.length-2*Q,C.length=C.length-Q,n.length=n.length-Q}l(yt,"popStack");function lt(){var Q;return Q=u.pop()||F.lex()||A,typeof Q!="number"&&(Q instanceof Array&&(u=Q,Q=u.pop()),Q=d.symbols_[Q]||Q),Q}l(lt,"lex");for(var X,K,Z,ot,J={},it,tt,Ut,pt;;){if(K=m[m.length-1],this.defaultActions[K]?Z=this.defaultActions[K]:((X===null||typeof X>"u")&&(X=lt()),Z=$[K]&&$[K][X]),typeof Z>"u"||!Z.length||!Z[0]){var $t="";pt=[];for(it in $[K])this.terminals_[it]&&it>Y&&pt.push("'"+this.terminals_[it]+"'");F.showPosition?$t="Parse error on line "+(G+1)+`:
|
|
2
2
|
`+F.showPosition()+`
|
|
3
3
|
Expecting `+pt.join(", ")+", got '"+(this.terminals_[X]||X)+"'":$t="Parse error on line "+(G+1)+": Unexpected "+(X==A?"end of input":"'"+(this.terminals_[X]||X)+"'"),this.parseError($t,{text:F.match,token:this.terminals_[X]||X,line:F.yylineno,loc:nt,expected:pt})}if(Z[0]instanceof Array&&Z.length>1)throw new Error("Parse Error: multiple actions possible at state: "+K+", token: "+X);switch(Z[0]){case 1:m.push(X),C.push(F.yytext),n.push(F.yylloc),m.push(Z[1]),X=null,c=F.yyleng,o=F.yytext,G=F.yylineno,nt=F.yylloc;break;case 2:if(tt=this.productions_[Z[1]][1],J.$=C[C.length-tt],J._$={first_line:n[n.length-(tt||1)].first_line,last_line:n[n.length-1].last_line,first_column:n[n.length-(tt||1)].first_column,last_column:n[n.length-1].last_column},at&&(J._$.range=[n[n.length-(tt||1)].range[0],n[n.length-1].range[1]]),ot=this.performAction.apply(J,[o,c,G,q.yy,Z[1],C,n].concat(R)),typeof ot<"u")return ot;tt&&(m=m.slice(0,-1*tt*2),C=C.slice(0,-1*tt),n=n.slice(0,-1*tt)),m.push(this.productions_[Z[1]][0]),C.push(J.$),n.push(J._$),Ut=$[m[m.length-2]][m[m.length-1]],m.push(Ut);break;case 3:return!0}}return!0},"parse")},T=(function(){var p={EOF:1,parseError:l(function(d,m){if(this.yy.parser)this.yy.parser.parseError(d,m);else throw new Error(d)},"parseError"),setInput:l(function(a,d){return this.yy=d||this.yy||{},this._input=a,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:l(function(){var a=this._input[0];this.yytext+=a,this.yyleng++,this.offset++,this.match+=a,this.matched+=a;var d=a.match(/(?:\r\n?|\n).*/g);return d?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),a},"input"),unput:l(function(a){var d=a.length,m=a.split(/(?:\r\n?|\n)/g);this._input=a+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-d),this.offset-=d;var u=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),m.length-1&&(this.yylineno-=m.length-1);var C=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:m?(m.length===u.length?this.yylloc.first_column:0)+u[u.length-m.length].length-m[0].length:this.yylloc.first_column-d},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-d]),this.yyleng=this.yytext.length,this},"unput"),more:l(function(){return this._more=!0,this},"more"),reject:l(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:l(function(a){this.unput(this.match.slice(a))},"less"),pastInput:l(function(){var a=this.matched.substr(0,this.matched.length-this.match.length);return(a.length>20?"...":"")+a.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:l(function(){var a=this.match;return a.length<20&&(a+=this._input.substr(0,20-a.length)),(a.substr(0,20)+(a.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:l(function(){var a=this.pastInput(),d=new Array(a.length+1).join("-");return a+this.upcomingInput()+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{R as st}from"./BEyxbMng.js";import{nK as ct,bl as ut}from"./BkzMrEqG.js";import{g as dt}from"./CMiilI_P.js";import{t as $e,bo as g,bw as Ae,b as Ue,bm as u,br as mt}from"./AeC4KVgG.js";import{ai as We,bs as Ee,ca as xe,aD as e,a7 as we,ay as te,W as y,bn as Te,bV as se,aA as v,a5 as pe,bS as E,bH as P,bA as ge,b_ as X,aj as Ce,aw as Ne,bl as ye,bO as ne,aB as Z,c9 as z,be as Me,b$ as Ie}from"./CJxGDkBm.js";import{i as q}from"./k2awEenT.js";import{k as ft}from"./HftJbvyF.js";import{s as ke,e as qe,f as pt,g as gt}from"./DrHJ7oPv.js";import{b as Se}from"./NtFyWdpR.js";import{c as me}from"./ZcoUa9Jg.js";import{K as Ge}from"./CkCQ3HCp.js";import{a as vt}from"./CC7to1B5.js";import{k as _e}from"./DbaZdUr0.js";import{f as Le}from"./DJM6amHV.js";import"./jhNNYE0v.js";import{l as Ke,f as Je,m as _t,a as ht}from"./DWUO9rBe.js";import"./ChTqQfQN.js";import"./BNODdf6r.js";import{p as He,b as Qe,a as et,M as tt}from"./-6dzlBdM.js";import{M as ze}from"./CkHTSBAH.js";import"./Bw3fY4XA.js";import{M as nt}from"./B-AWjR8f.js";import{bK as Re}from"./jbEf1eyu.js";import{s as je}from"./Dp2nUoTL.js";import{F as Pe,d2 as bt,bV as wt,bW as yt,cp as xt,bE as kt,cq as Ct,aY as Pt,a7 as Lt}from"./Ci7mS1ie.js";import{S as Mt}from"./BDwdwGgf.js";import{n as It,g as zt}from"./DsyH2ZOJ.js";import{e as De}from"./CswzK9Go.js";import{b as $t,c as At}from"./DpqAXGKG.js";import{P as Ut}from"./G2FM8dd1.js";import{h as Et}from"./Ct4BiqZH.js";import{t as Tt}from"./DAsc1V4f.js";function Nt(i,t){return i?.isExternalLink===!0&&typeof i.workspaceId=="string"&&i.workspaceId?i.workspaceId:t||void 0}function St(i,t,o){const c=i.label||i.id||"mention";if(i.type==="member")return st(c);if(i.type==="note"&&i.id&&o){const s=Nt(i.meta,t),_=s?o(s,i.id)?.trim():void 0;if(_)return _}return c}function Vn(i,t,o){if(typeof document>"u"||!i.includes('data-type="note"'))return i;const c=document.createElement("template");c.innerHTML=i;let s=!1;for(const _ of c.content.querySelectorAll('[data-mention][data-type="note"]')){let h=null;try{h=JSON.parse(_.getAttribute("data-meta")||"{}")}catch{h=null}const I=_.textContent??"",C=St({type:"note",id:_.getAttribute("data-id"),label:I,meta:h},t,o);C!==I&&(_.textContent=C,s=!0)}return s?c.innerHTML:i}const Zn=(i,t)=>{let o;try{o=dt().state}catch{return}const c=o?.workspaceNotes?.byWorkspaceId?.[i]?.notes;return c?ct(c,t)?.title:void 0};var Kt=Z('<p class="mt-2 max-w-[90vw] rounded-md bg-black/60 px-3 py-1.5 text-center text-sm text-white"> </p>'),Rt=Z('<div data-media-lightbox-root="" data-image-lightbox-root="" class="fixed inset-0 z-[1000] flex cursor-zoom-out flex-col items-center justify-center bg-black/80 p-4 backdrop-blur-sm" style="pointer-events: auto;" role="dialog" aria-modal="true" tabindex="-1"><div class="absolute right-4 top-4 z-[1002] flex items-center gap-1"><!> <!></div> <div class="flex min-h-0 w-full flex-1 items-center justify-center"><!></div> <!></div>');function Ye(i,t){if(new.target)return $e({component:Ye,...i});Ee(t,!0);let o=g(t,"open",15,!1),c=g(t,"ariaLabel",7),s=g(t,"closeLabel",7),_=g(t,"onClose",7),h=g(t,"openerElement",7,null),I=g(t,"children",7),C=g(t,"actions",7),T=g(t,"caption",7),w=g(t,"onKeydown",7),L=g(t,"onCopy",7);const S=$t(),d=At(b);let M=se(null),N=se(null);function b(){o()&&(o(!1),_()?.(),h()?.isConnected&&h().focus({preventScroll:!0}))}function O(n){(n.target instanceof Element?n.target:null)?.closest('[data-media-lightbox-content], [role="toolbar"], button, input')||b()}function K(n){if(w()?.(n),n.defaultPrevented||n.key!=="Tab"||!e(M))return;const r=Array.from(e(M).querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')),m=r[0],l=r[r.length-1];!m||!l||(n.shiftKey&&document.activeElement===m?(n.preventDefault(),l.focus()):!n.shiftKey&&document.activeElement===l&&(n.preventDefault(),m.focus()))}xe(()=>{if(o())return He(b)}),xe(()=>{!o()||!e(N)||requestAnimationFrame(()=>e(N)?.focus())});var ae={get open(){return o()},set open(n=!1){o(n),v()},get ariaLabel(){return c()},set ariaLabel(n){c(n),v()},get closeLabel(){return s()},set closeLabel(n){s(n),v()},get onClose(){return _()},set onClose(n){_(n),v()},get openerElement(){return h()},set openerElement(n=null){h(n),v()},get children(){return I()},set children(n){I(n),v()},get actions(){return C()},set actions(n){C(n),v()},get caption(){return T()},set caption(n){T(n),v()},get onKeydown(){return w()},set onKeydown(n){w(n),v()},get onCopy(){return L()},set onCopy(n){L(n),v()},$set:Ae,$on:(n,r)=>Ue(t,n,r)},B=we(),G=te(B);{var J=n=>{{let r=z(()=>S?.target()??"body");Ut(n,{get target(){return e(r)},zIndex:1e3,children:(m,l)=>{var f=Rt(),k=pe(f),$=pe(k);{var R=x=>{var re=we(),D=te(re);je(D,C),y(x,re)};q($,x=>{C()&&x(R)})}var Q=E($,2);Le(Q,{variant:"ghost",size:"icon",class:"text-white hover:bg-white/20 hover:text-white",onclick:b,get"aria-label"(){return s()},get ref(){return e(N)},set ref(x){P(N,x,!0)},children:(x,re)=>{Pe(x,{get icon(){return bt},size:"lg"})},$$slots:{default:!0}}),ge(k),De(k,x=>d?.(x));var j=E(k,2),F=pe(j);je(F,I),ge(j),De(j,x=>d?.(x));var W=E(j,2);{var ce=x=>{var re=Kt(),D=ye(re,!0);X(()=>ne(D,T())),y(x,re)};q(W,x=>{T()&&x(ce)})}ge(f),Se(f,x=>P(M,x),()=>e(M)),X(()=>ke(f,"aria-label",c())),Ce("click",f,O),Ce("keydown",f,K),Ne("copy",f,function(...x){L()?.apply(this,x)}),It(3,f,()=>zt,()=>({tier:"moderate"})),y(m,f)},$$slots:{default:!0}})}};q(G,n=>{o()&&n(J)})}return y(i,B),Te(ae)}We(["click","keydown"]);function Xe(i){if(!i.startsWith("workspace-file://"))return null;const o=i.slice(17).split(/[?#]/)[0].split("/"),c=o[0],s=o.slice(1);if(!c||s.length===0)return null;const _=[];for(const h of s){if(!h)return null;try{_.push(decodeURIComponent(h))}catch{return null}}return{workspaceId:c,path:_.join("/")}}function at(i){try{return new URL(i).protocol==="https:"}catch{return!1}}function Ve(i){const t=/^data:([^;,]+);base64,(.*)$/s.exec(i);return t?{mimeType:t[1],base64:t[2]}:null}function Ze(i){return at(i)||Xe(i)!==null||/^workspace-asset:\/\/[^/?#]+/.test(i)||/^data:image\/[a-z0-9.+-]+(?:;[^,]*)?,/i.test(i)}function rt(i){if(i.length===0)return 0;let t=0;return i.endsWith("==")?t=2:i.endsWith("=")&&(t=1),Math.floor(i.length*3/4)-t}function Ft(i,t){const o=atob(i),c=new Uint8Array(o.length);for(let s=0;s<o.length;s++)c[s]=o.charCodeAt(s);return new Blob([c],{type:t})}const Ot={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/avif":"avif","image/bmp":"bmp"};function Bt(i){if(i.workspacePath){const s=i.workspacePath.split("/").pop();if(s)return s}const t=(i.imageName||"image").replace(/[/\\]/g,"_");if(/\.[A-Za-z0-9]+$/.test(t))return t;const o=i.mimeType?.split(";")[0].trim().toLowerCase(),c=o&&Ot[o]||"png";return`${t}.${c}`}var jt=Z('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="image-info-dimensions"> </div>'),Dt=Z('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="image-info-size"> </div>'),Vt=Z("<!> <!> <!>",1),Zt=Z("<!> <!> <!> <!>",1),Wt=Z("<!> <!>",1);function ot(i,t){if(new.target)return $e({component:ot,...i});Ee(t,!0);let o=g(t,"imageUrl",7),c=g(t,"imageName",7),s=g(t,"open",15,!1),_=g(t,"triggerClass",7),h=g(t,"contentClass",7);const I=z(()=>Ve(o())),C=z(()=>Xe(o())),T=z(()=>at(o()));let w=se(null),L=se(null),S=null;function d(){if(S===o())return;const l=S=o();P(w,null),P(L,e(I)?rt(e(I).base64):null,!0);const f=new Image;f.onload=()=>{S===l&&P(w,{width:f.naturalWidth,height:f.naturalHeight},!0)},f.src=o(),e(I)||fetch(o()).then(k=>k.ok?k.blob():null).then(k=>{k&&S===l&&P(L,k.size,!0)}).catch(()=>{})}xe(()=>{s()&&d()}),xe(()=>{if(s())return He(()=>{s(!1)})});async function M(l=o()){const f=Ve(l);if(f)return Ft(f.base64,f.mimeType);const k=await fetch(l);if(!k.ok)throw new Error(`Image fetch failed: ${k.status}`);return await k.blob()}async function N(){let l=null;try{let f=o(),k=e(I)?.mimeType;if(!e(I)){const R=await M();k=R.type,l=URL.createObjectURL(R),f=l}const $=document.createElement("a");$.href=f,$.download=Bt({workspacePath:e(C)?.path,imageName:c(),mimeType:k}),document.body.appendChild($);try{$.click()}finally{$.remove()}}catch{_e.error(u.ui_imageActionsMenu_downloadFailed_error())}finally{l&&URL.revokeObjectURL(l)}}async function b(){if(e(C))try{await Re(e(C).path),_e.success(u.ui_imageActionsMenu_pathCopied_label())}catch{_e.error(u.ui_imageActionsMenu_copyFailed_error())}}async function O(){if(e(T))try{await Re(o()),_e.success(u.ui_imageActionsMenu_linkCopied_label())}catch{_e.error(u.ui_imageActionsMenu_copyFailed_error())}}async function K(l){let f,k;try{let $;if(l.type.split(";")[0].trim()==="image/svg+xml"){k=URL.createObjectURL(l);const j=new Image;j.src=k,await j.decode(),$=j}else $=f=await createImageBitmap(l);const R=document.createElement("canvas");R.width=$ instanceof HTMLImageElement?$.naturalWidth:$.width,R.height=$ instanceof HTMLImageElement?$.naturalHeight:$.height;const Q=R.getContext("2d");if(!Q)throw new Error("2d canvas context unavailable");return Q.drawImage($,0,0),await new Promise((j,F)=>{R.toBlob(W=>W?j(W):F(new Error("canvas toBlob failed")),"image/png")})}finally{f?.close(),k&&URL.revokeObjectURL(k)}}async function ae(l=o()){try{let f=await M(l);f.type!=="image/png"&&(f=await K(f)),await navigator.clipboard.write([new ClipboardItem({"image/png":f})]),_e.success(u.ui_imageActionsMenu_imageCopied_label())}catch{_e.error(u.ui_imageActionsMenu_copyFailed_error())}}function B(l,f=o()){return l.defaultPrevented||!Ze(f)||l instanceof KeyboardEvent&&(l.key.toLowerCase()!=="c"||!(l.metaKey||l.ctrlKey)||l.altKey||l.shiftKey||l.isComposing)||vt(l.target)||document.getSelection()?.toString()?!1:(l.preventDefault(),l.stopPropagation(),l instanceof KeyboardEvent&&l.repeat||(ae(f),s(!1)),!0)}var G={handleCopy:B,get imageUrl(){return o()},set imageUrl(l){o(l),v()},get imageName(){return c()},set imageName(l){c(l),v()},get open(){return s()},set open(l=!1){s(l),v()},get triggerClass(){return _()},set triggerClass(l){_(l),v()},get contentClass(){return h()},set contentClass(l){h(l),v()},$set:Ae,$on:(l,f)=>Ue(t,l,f)},J=we(),n=te(J);{var r=l=>{var f=we(),k=te(f);me(k,()=>tt,($,R)=>{R($,{get open(){return s()},set open(Q){s(Q)},children:(Q,j)=>{var F=Wt(),W=te(F);{const x=(D,he)=>{let oe=()=>(he?.()).props;{let V=z(()=>u.ui_imageActionsMenu_trigger_ariaLabel());Le(D,mt(oe,{variant:"plain",size:"icon-sm",wrapContent:!1,get active(){return s()},get"aria-label"(){return e(V)},children:(ie,fe)=>{Ge(ie,{class:"size-3.5"})},$$slots:{default:!0}}))}};let re=z(()=>qe("flex h-7 w-7 items-center justify-center rounded-md bg-black/60 text-white","hover:bg-black/75",_()));me(W,()=>Qe,(D,he)=>{he(D,{get class(){return e(re)},onclick:oe=>oe.stopPropagation(),onkeydown:oe=>B(oe),oncopy:oe=>B(oe),child:x,$$slots:{child:!0}})})}var ce=E(W,2);me(ce,()=>et,(x,re)=>{re(x,{get class(){return h()},align:"end",onkeydown:D=>B(D),oncopy:D=>B(D),children:(D,he)=>{var oe=Zt(),V=te(oe);me(V,()=>ze,(A,Y)=>{Y(A,{onSelect:()=>void N(),children:(U,ee)=>{Me();var le=Ie();X(ue=>ne(le,ue),[()=>u.ui_imageActionsMenu_download_label()]),y(U,le)},$$slots:{default:!0}})});var ie=E(V,2);me(ie,()=>ze,(A,Y)=>{Y(A,{onSelect:()=>void ae(),children:(U,ee)=>{Me();var le=Ie();X(ue=>ne(le,ue),[()=>u.ui_imageActionsMenu_copyImage_label()]),y(U,le)},$$slots:{default:!0}})});var fe=E(ie,2);{var a=A=>{var Y=we(),U=te(Y);me(U,()=>ze,(ee,le)=>{le(ee,{onSelect:()=>void b(),children:(ue,Fe)=>{Me();var de=Ie();X(be=>ne(de,be),[()=>u.ui_imageActionsMenu_copyPath_label()]),y(ue,de)},$$slots:{default:!0}})}),y(A,Y)},p=A=>{var Y=we(),U=te(Y);me(U,()=>ze,(ee,le)=>{le(ee,{onSelect:()=>void O(),children:(ue,Fe)=>{Me();var de=Ie();X(be=>ne(de,be),[()=>u.ui_imageActionsMenu_copyLink_label()]),y(ue,de)},$$slots:{default:!0}})}),y(A,Y)};q(fe,A=>{e(C)?A(a):e(T)&&A(p,1)})}var H=E(fe,2);{var ve=A=>{var Y=Vt(),U=te(Y);me(U,()=>nt,(de,be)=>{be(de,{})});var ee=E(U,2);{var le=de=>{var be=jt(),Oe=ye(be,!0);X(Be=>ne(Oe,Be),[()=>u.ui_imageActionsMenu_dimensions_label({width:Ke(e(w).width),height:Ke(e(w).height)})]),y(de,be)};q(ee,de=>{e(w)&&de(le)})}var ue=E(ee,2);{var Fe=de=>{var be=Dt(),Oe=ye(be,!0);X(Be=>ne(Oe,Be),[()=>Je(e(L))]),y(de,be)};q(ue,de=>{e(L)!==null&&de(Fe)})}y(A,Y)};q(H,A=>{(e(w)||e(L)!==null)&&A(ve)})}y(D,oe)},$$slots:{default:!0}})}),y(Q,F)},$$slots:{default:!0}})}),y(l,f)},m=z(()=>Ze(o()));q(n,l=>{e(m)&&l(r)})}return y(i,J),Te(G)}var Ht=Z('<div role="application" tabindex="0" data-testid="zoom-pan-viewport"><div class="flex h-full w-full items-center justify-center will-change-transform" data-testid="zoom-pan-content"><!></div> <div class="absolute bottom-4 left-1/2 z-10 flex -translate-x-1/2 cursor-default items-center gap-2 rounded-full bg-black/60 px-3 py-1.5 backdrop-blur-sm" role="toolbar" tabindex="-1" data-testid="zoom-pan-controls"><!> <div class="w-36"><!></div> <!> <span class="min-w-12 text-center text-xs tabular-nums text-white/90" data-testid="zoom-pan-percent"> </span> <!></div></div>');function it(i,t){if(new.target)return $e({component:it,...i});Ee(t,!0);let o=g(t,"children",7),c=g(t,"minZoom",7,.25),s=g(t,"maxZoom",7,8),_=g(t,"onScaleChange",7);const h=1.25,I=.0015,C=.01,T=4;let w=se(1),L=se(0),S=se(0),d=se(!1),M=se(null);xe(()=>{_()?.(e(w))});let N=null,b=0,O=0,K=0,ae=!1;const B=z(()=>_t(e(w),{style:"percent",maximumFractionDigits:0}));function G(a){return Math.min(s(),Math.max(c(),a))}function J(a,p,H){const ve=G(H),A=e(M)?.getBoundingClientRect(),Y=A?a-A.left:0,U=A?p-A.top:0;P(L,Y-(Y-e(L))/e(w)*ve),P(S,U-(U-e(S))/e(w)*ve),P(w,ve,!0)}function n(a){const p=e(M)?.getBoundingClientRect();p?J(p.left+p.width/2,p.top+p.height/2,a):P(w,G(a),!0)}function r(){P(w,1),P(L,0),P(S,0)}function m(a){a.preventDefault();const p=a.ctrlKey?C:I;J(a.clientX,a.clientY,e(w)*Math.exp(-a.deltaY*p))}xe(()=>{const a=e(M);if(a)return a.addEventListener("wheel",m,{passive:!1}),()=>a.removeEventListener("wheel",m)});function l(a){if(a.metaKey||a.ctrlKey||a.altKey)return!1;if(a.key==="+"||a.key==="=")n(e(w)*h);else if(a.key==="-")n(e(w)/h);else if(a.key==="0")r();else return!1;return a.preventDefault(),!0}function f(a){if(a.button>0)return;P(d,!0),N=a.pointerId,b=a.clientX,O=a.clientY,K=0;const p=a.currentTarget;typeof p.setPointerCapture=="function"&&p.setPointerCapture(a.pointerId)}function k(a){if(!e(d)||a.pointerId!==N)return;const p=a.clientX-b,H=a.clientY-O;K+=Math.abs(p)+Math.abs(H),P(L,e(L)+p),P(S,e(S)+H),b=a.clientX,O=a.clientY}function $(a){if(!e(d)||a.pointerId!==N)return;P(d,!1),N=null,K>T&&(ae=!0);const p=a.currentTarget;typeof p.hasPointerCapture=="function"&&typeof p.releasePointerCapture=="function"&&p.hasPointerCapture(a.pointerId)&&p.releasePointerCapture(a.pointerId)}function R(a){ae&&(ae=!1,a.preventDefault(),a.stopPropagation())}function Q(a){const p=Number.parseFloat(a.currentTarget.value);Number.isFinite(p)&&n(p)}var j={handleKeydown:l,get children(){return o()},set children(a){o(a),v()},get minZoom(){return c()},set minZoom(a=.25){c(a),v()},get maxZoom(){return s()},set maxZoom(a=8){s(a),v()},get onScaleChange(){return _()},set onScaleChange(a){_(a),v()},$set:Ae,$on:(a,p)=>Ue(t,a,p)},F=Ht(),W=pe(F),ce=pe(W);je(ce,o),ge(W);var x=E(W,2),re=pe(x);{let a=z(()=>u.ui_zoomPanViewport_zoomOut_ariaLabel()),p=z(()=>u.ui_zoomPanViewport_zoomOut_ariaLabel());Le(re,{variant:"ghost",size:"icon-sm",class:"text-white hover:bg-white/20 hover:text-white",onclick:()=>n(e(w)/h),get"aria-label"(){return e(a)},get title(){return e(p)},children:(H,ve)=>{Pe(H,{get icon(){return wt}})},$$slots:{default:!0}})}var D=E(re,2),he=pe(D);{let a=z(()=>u.ui_zoomPanViewport_zoomSlider_ariaLabel()),p=z(()=>u.ui_zoomPanViewport_zoomSlider_ariaLabel());Mt(he,{class:"accent-white",get min(){return c()},get max(){return s()},step:"0.01",get value(){return e(w)},oninput:Q,get"aria-label"(){return e(a)},get title(){return e(p)},"data-testid":"zoom-pan-slider"})}ge(D);var oe=E(D,2);{let a=z(()=>u.ui_zoomPanViewport_zoomIn_ariaLabel()),p=z(()=>u.ui_zoomPanViewport_zoomIn_ariaLabel());Le(oe,{variant:"ghost",size:"icon-sm",class:"text-white hover:bg-white/20 hover:text-white",onclick:()=>n(e(w)*h),get"aria-label"(){return e(a)},get title(){return e(p)},children:(H,ve)=>{Pe(H,{get icon(){return yt}})},$$slots:{default:!0}})}var V=E(oe,2),ie=ye(V,!0),fe=E(V,2);{let a=z(()=>u.ui_zoomPanViewport_resetZoom_ariaLabel()),p=z(()=>u.ui_zoomPanViewport_resetZoom_ariaLabel());Le(fe,{variant:"ghost",size:"icon-sm",class:"text-white hover:bg-white/20 hover:text-white",onclick:r,get"aria-label"(){return e(a)},get title(){return e(p)},children:(H,ve)=>{Pe(H,{get icon(){return xt}})},$$slots:{default:!0}})}return ge(x),ge(F),Se(F,a=>P(M,a),()=>e(M)),X((a,p)=>{pt(F,1,`relative h-full w-full touch-none select-none overflow-hidden ${e(d)?"cursor-grabbing":"cursor-grab"}`),ke(F,"aria-label",a),gt(W,`transform: translate(${e(L)??""}px, ${e(S)??""}px) scale(${e(w)??""}); transform-origin: 0 0;`),ke(x,"aria-label",p),ne(ie,e(B))},[()=>u.ui_zoomPanViewport_viewport_ariaLabel(),()=>u.ui_zoomPanViewport_controls_ariaLabel()]),Ce("pointerdown",F,f),Ce("pointermove",F,k),Ce("pointerup",F,$),Ne("pointercancel",F,$),Ne("click",F,R,!0),Ce("keydown",F,l),Ce("pointerdown",x,a=>a.stopPropagation()),y(i,F),Te(j)}We(["pointerdown","pointermove","pointerup","keydown"]);var Yt=Z('<img class="max-h-[90vh] max-w-[90vw] rounded-lg object-contain" draggable="false" data-media-lightbox-content=""/>');function Xt(i,t){if(new.target)return $e({component:Xt,...i});Ee(t,!0);const o=b=>{var O=we(),K=te(O);{var ae=B=>{Se(ot(B,{get imageUrl(){return s()},get imageName(){return _()},triggerClass:"h-9 w-9 bg-white/0 hover:bg-white/20",contentClass:"z-[1003]",get open(){return e(L)},set open(G){P(L,G,!0)}}),G=>P(w,G,!0),()=>e(w))};q(K,B=>{C()&&B(ae)})}y(b,O)};let c=g(t,"open",15,!1),s=g(t,"imageUrl",7),_=g(t,"imageName",23,()=>u.ui_imageLightbox_image_alt()),h=g(t,"onClose",7),I=g(t,"openerElement",7,null),C=g(t,"showActionsMenu",7,!1),T=se(void 0),w=se(void 0),L=se(!1);xe(()=>{c()||P(L,!1)});function S(b){d(b),b.defaultPrevented||e(T)?.handleKeydown(b)}function d(b){c()&&C()&&e(w)?.handleCopy(b)}function M(b){!C()||!Ze(s())||(b.preventDefault(),b.stopPropagation(),P(L,!0))}var N={get open(){return c()},set open(b=!1){c(b),v()},get imageUrl(){return s()},set imageUrl(b){s(b),v()},get imageName(){return _()},set imageName(b=u.ui_imageLightbox_image_alt()){_(b),v()},get onClose(){return h()},set onClose(b){h(b),v()},get openerElement(){return I()},set openerElement(b=null){I(b),v()},get showActionsMenu(){return C()},set showActionsMenu(b=!1){C(b),v()},$set:Ae,$on:(b,O)=>Ue(t,b,O)};{let b=z(()=>u.ui_imageLightbox_preview_ariaLabel()),O=z(()=>u.ui_imageLightbox_close_ariaLabel());Ye(i,{get ariaLabel(){return e(b)},get closeLabel(){return e(O)},get onClose(){return h()},get openerElement(){return I()},get actions(){return o},onKeydown:S,onCopy:d,get open(){return c()},set open(K){c(K)},children:(K,ae)=>{var B=we(),G=te(B);ft(G,s,J=>{Se(it(J,{children:(n,r)=>{var m=Yt();X(()=>{ke(m,"src",s()),ke(m,"alt",_())}),Ce("contextmenu",m,M),y(n,m)},$$slots:{default:!0}}),n=>P(T,n,!0),()=>e(T))}),y(K,B)},$$slots:{default:!0}})}return Te(N)}We(["contextmenu"]);var qt=Z('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="video-info-duration"> </div>'),Gt=Z('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="video-info-dimensions"> </div>'),Jt=Z('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="video-info-size"> </div>'),Qt=Z("<!> <!> <!> <!>",1),en=Z("<!> <!> <!>",1),tn=Z("<!> <!>",1);function lt(i,t){if(new.target)return $e({component:lt,...i});Ee(t,!0);let o=g(t,"videoUrl",7),c=g(t,"videoName",7),s=g(t,"sourceKind",7),_=g(t,"mimeType",7),h=g(t,"open",15,!1),I=g(t,"triggerClass",7),C=g(t,"contentClass",7);const T=z(()=>Ve(o())),w=z(()=>Xe(o())),L=z(()=>s()??(e(T)?"inline":e(w)?"workspace":"remote"));let S=se(null),d=se(null),M=se(null),N=null;function b(){if(N===o())return;const n=N=o();P(S,null),P(d,null),P(M,e(T)?rt(e(T).base64):null,!0);const r=document.createElement("video");r.preload="metadata",r.onloadedmetadata=()=>{N===n&&(Number.isFinite(r.duration)&&r.duration>0&&P(S,r.duration,!0),r.videoWidth>0&&r.videoHeight>0&&P(d,{width:r.videoWidth,height:r.videoHeight},!0))},r.src=o(),e(T)||fetch(o()).then(m=>m.ok?m.blob():null).then(m=>{m&&N===n&&P(M,m.size,!0)}).catch(()=>{})}function O(){const n=e(w)?.path.split("/").pop();if(n)return n;const r=(c()||"video").replace(/[/\\]/g,"_");if(/\.[A-Za-z0-9]+$/.test(r))return r;const m=(_()??e(T)?.mimeType)==="video/webm"?"webm":"mp4";return`${r}.${m}`}async function K(){let n=null;try{let r=o();if(!e(T)){const l=await fetch(o());if(!l.ok)throw new Error(`Video fetch failed: ${l.status}`);n=URL.createObjectURL(await l.blob()),r=n}const m=document.createElement("a");m.href=r,m.download=O(),document.body.appendChild(m),m.click(),m.remove(),n&&URL.revokeObjectURL(n)}catch{n&&URL.revokeObjectURL(n),_e.error(u.ui_videoActionsMenu_downloadFailed_error())}}async function ae(n,r){try{await Re(n),_e.success(r)}catch{_e.error(u.ui_videoActionsMenu_copyFailed_error())}}xe(()=>{h()&&b()}),xe(()=>{if(h())return He(()=>{h(!1)})});var B={get videoUrl(){return o()},set videoUrl(n){o(n),v()},get videoName(){return c()},set videoName(n){c(n),v()},get sourceKind(){return s()},set sourceKind(n){s(n),v()},get mimeType(){return _()},set mimeType(n){_(n),v()},get open(){return h()},set open(n=!1){h(n),v()},get triggerClass(){return I()},set triggerClass(n){I(n),v()},get contentClass(){return C()},set contentClass(n){C(n),v()},$set:Ae,$on:(n,r)=>Ue(t,n,r)},G=we(),J=te(G);return me(J,()=>tt,(n,r)=>{r(n,{get open(){return h()},set open(m){h(m)},children:(m,l)=>{var f=tn(),k=te(f);{let R=z(()=>qe("flex h-7 w-7 items-center justify-center rounded-md bg-black/60 text-white","hover:bg-black/75",I())),Q=z(()=>u.ui_videoActionsMenu_trigger_ariaLabel());me(k,()=>Qe,(j,F)=>{F(j,{get class(){return e(R)},get"aria-label"(){return e(Q)},onclick:W=>W.stopPropagation(),children:(W,ce)=>{Ge(W,{class:"size-3.5"})},$$slots:{default:!0}})})}var $=E(k,2);me($,()=>et,(R,Q)=>{Q(R,{get class(){return C()},align:"end",children:(j,F)=>{var W=en(),ce=te(W);me(ce,()=>ze,(V,ie)=>{ie(V,{onSelect:()=>void K(),children:(fe,a)=>{Me();var p=Ie();X(H=>ne(p,H),[()=>u.ui_videoActionsMenu_download_label()]),y(fe,p)},$$slots:{default:!0}})});var x=E(ce,2);{var re=V=>{var ie=we(),fe=te(ie);me(fe,()=>ze,(a,p)=>{p(a,{onSelect:()=>void ae(e(w).path,u.ui_videoActionsMenu_pathCopied_label()),children:(H,ve)=>{Me();var A=Ie();X(Y=>ne(A,Y),[()=>u.ui_videoActionsMenu_copyPath_label()]),y(H,A)},$$slots:{default:!0}})}),y(V,ie)},D=V=>{var ie=we(),fe=te(ie);me(fe,()=>ze,(a,p)=>{p(a,{onSelect:()=>void ae(o(),u.ui_videoActionsMenu_linkCopied_label()),children:(H,ve)=>{Me();var A=Ie();X(Y=>ne(A,Y),[()=>u.ui_videoActionsMenu_copyLink_label()]),y(H,A)},$$slots:{default:!0}})}),y(V,ie)};q(x,V=>{e(L)==="workspace"&&e(w)?V(re):e(L)==="remote"&&V(D,1)})}var he=E(x,2);{var oe=V=>{var ie=Qt(),fe=te(ie);me(fe,()=>nt,(U,ee)=>{ee(U,{})});var a=E(fe,2);{var p=U=>{var ee=qt(),le=ye(ee,!0);X(ue=>ne(le,ue),[()=>u.ui_videoActionsMenu_duration_label({duration:ht(e(S)*1e3)})]),y(U,ee)};q(a,U=>{e(S)!==null&&U(p)})}var H=E(a,2);{var ve=U=>{var ee=Gt(),le=ye(ee,!0);X(ue=>ne(le,ue),[()=>u.ui_videoActionsMenu_dimensions_label({width:Ke(e(d).width),height:Ke(e(d).height)})]),y(U,ee)};q(H,U=>{e(d)&&U(ve)})}var A=E(H,2);{var Y=U=>{var ee=Jt(),le=ye(ee,!0);X(ue=>ne(le,ue),[()=>Je(e(M))]),y(U,ee)};q(A,U=>{e(M)!==null&&U(Y)})}y(V,ie)};q(he,V=>{(e(S)!==null||e(d)||e(M)!==null)&&V(oe)})}y(j,W)},$$slots:{default:!0}})}),y(m,f)},$$slots:{default:!0}})}),y(i,G),Te(B)}var nn=Z('<p class="type-body text-white/80" role="status"> </p>'),an=Z('<div data-media-lightbox-content="" data-video-lightbox-root="" class="flex max-h-[90vh] max-w-[90vw] cursor-default flex-col items-center gap-3"><video controls="" preload="metadata" playsinline="" class="max-h-[85vh] max-w-[90vw] rounded-lg bg-black object-contain shadow-(--elevation-overlay)" data-testid="chat-video-player"> </video> <!></div>',2);function rn(i,t){if(new.target)return $e({component:rn,...i});Ee(t,!0);const o=d=>{lt(d,{get videoUrl(){return s()},get videoName(){return _()},get sourceKind(){return I()},get mimeType(){return C()},triggerClass:"h-9 w-9 bg-white/0 hover:bg-white/20",contentClass:"z-[1003]"})};let c=g(t,"open",15,!1),s=g(t,"videoUrl",7),_=g(t,"videoName",23,()=>u.chat_videoBlock_fromAgent_label()),h=g(t,"poster",7),I=g(t,"sourceKind",7),C=g(t,"mimeType",7),T=g(t,"openerElement",7,null),w=g(t,"onClose",7),L=se(!1);xe(()=>{!c()||!s()||P(L,!1)});var S={get open(){return c()},set open(d=!1){c(d),v()},get videoUrl(){return s()},set videoUrl(d){s(d),v()},get videoName(){return _()},set videoName(d=u.chat_videoBlock_fromAgent_label()){_(d),v()},get poster(){return h()},set poster(d){h(d),v()},get sourceKind(){return I()},set sourceKind(d){I(d),v()},get mimeType(){return C()},set mimeType(d){C(d),v()},get openerElement(){return T()},set openerElement(d=null){T(d),v()},get onClose(){return w()},set onClose(d){w(d),v()},$set:Ae,$on:(d,M)=>Ue(t,d,M)};{let d=z(()=>u.chat_videoBlock_dialog_title({name:_()})),M=z(()=>u.chat_videoBlock_close_ariaLabel());Ye(i,{get ariaLabel(){return e(d)},get closeLabel(){return e(M)},get openerElement(){return T()},get onClose(){return w()},get actions(){return o},get open(){return c()},set open(N){c(N)},children:(N,b)=>{var O=an(),K=pe(O),ae=ye(K,!0),B=E(K,2);{var G=J=>{var n=nn(),r=ye(n,!0);X(m=>ne(r,m),[()=>u.chat_videoBlock_unavailable_description()]),y(J,n)};q(B,J=>{e(L)&&J(G)})}ge(O),X(J=>{ke(K,"src",s()),ke(K,"poster",h()),ke(K,"aria-label",_()),ne(ae,J)},[()=>u.chat_videoBlock_unsupported_description()]),Ne("error",K,()=>P(L,!0)),y(N,O)},$$slots:{default:!0}})}return Te(S)}var on=Z('<span class="block truncate text-foreground"> </span>'),ln=Z("<!> ",1),sn=Z("<!> <!>",1),cn=Z('<span class="flex shrink-0 flex-wrap items-center gap-1"><!> <!></span>'),un=Z('<div class="type-caption flex w-fit min-w-0 max-w-full items-center gap-3 whitespace-normal py-1 text-muted-foreground" role="status" data-testid="media-unavailable"><span class="flex min-w-0 max-w-full flex-1 items-start gap-2"><span class="first-line-icon" aria-hidden="true"><!></span> <span class="min-w-0"><!> <span class="block break-words"> </span></span></span> <!></div>');function dn(i,t){if(new.target)return $e({component:dn,...i});Ee(t,!0);let o=g(t,"name",7),c=g(t,"reason",7),s=g(t,"path",7),_=g(t,"workspaceId",7),h=g(t,"onRetry",7);const I=z(()=>c()==="missing"?u.ui_mediaUnavailable_missing_description():c()==="unsupported"?u.ui_mediaUnavailable_unsupported_description():c()==="other-workspace"?u.ui_mediaUnavailable_otherWorkspace_description():c()==="invalid-link"?u.ui_mediaUnavailable_invalidLink_description():u.ui_mediaUnavailable_loadFailed_description());function C(r){r.preventDefault(),r.stopPropagation()}function T(r){C(r),h()?.()}async function w(r){if(C(r),!!s())try{await Re(s()),_e.success(u.ui_imageActionsMenu_pathCopied_label())}catch{_e.error(u.ui_imageActionsMenu_copyFailed_error())}}function L(r){if(C(r),!s()||!_())return;const m=s().split("/").map(encodeURIComponent).join("/");Et(`intent://local/file/${m}`,{workspaceId:ut(_())})}var S={get name(){return o()},set name(r){o(r),v()},get reason(){return c()},set reason(r){c(r),v()},get path(){return s()},set path(r){s(r),v()},get workspaceId(){return _()},set workspaceId(r){_(r),v()},get onRetry(){return h()},set onRetry(r){h(r),v()},$set:Ae,$on:(r,m)=>Ue(t,r,m)},d=un(),M=pe(d),N=pe(M),b=pe(N);Pe(b,{get icon(){return kt},class:"size-3.5"}),ge(N);var O=E(N,2),K=pe(O);{var ae=r=>{var m=on(),l=ye(m,!0);De(m,(f,k)=>Tt?.(f,k),o),X(()=>ne(l,o())),y(r,m)};q(K,r=>{o()&&r(ae)})}var B=E(K,2),G=ye(B,!0);ge(O),ge(M);var J=E(M,2);{var n=r=>{var m=cn(),l=pe(m);{var f=R=>{{let Q=z(()=>u.chat_shared_retry_label());Le(R,{variant:"ghost",size:"icon-compact",get tooltip(){return e(Q)},onclick:T,children:(j,F)=>{Pe(j,{get icon(){return Ct},size:"xs"})},$$slots:{default:!0}})}};q(l,R=>{h()&&R(f)})}var k=E(l,2);{var $=R=>{var Q=sn(),j=te(Q);{var F=ce=>{Le(ce,{variant:"ghost",size:"compact",onclick:L,children:(x,re)=>{var D=ln(),he=te(D);Pe(he,{get icon(){return Lt},size:"xs"});var oe=E(he);X(V=>ne(oe,` ${V??""}`),[()=>u.chat_changesPanel_openFile_tooltip()]),y(x,D)},$$slots:{default:!0}})};q(j,ce=>{_()&&c()!=="other-workspace"&&c()!=="invalid-link"&&ce(F)})}var W=E(j,2);{let ce=z(()=>u.ui_imageActionsMenu_copyPath_label());Le(W,{variant:"ghost",size:"icon-compact",get tooltip(){return e(ce)},onclick:w,children:(x,re)=>{Pe(x,{get icon(){return Pt},size:"xs"})},$$slots:{default:!0}})}y(R,Q)};q(k,R=>{s()&&R($)})}ge(m),y(r,m)};q(J,r=>{(h()||s())&&r(n)})}return ge(d),X(()=>{ke(d,"data-reason",c()),ne(G,e(I))}),y(i,d),Te(S)}export{ot as I,Ye as M,lt as V,it as Z,Xt as a,dn as b,rn as c,Ze as d,St as m,Xe as p,Vn as r,Zn as s};
|
|
1
|
+
import{R as st}from"./BEyxbMng.js";import{nK as ct,bl as ut}from"./BkzMrEqG.js";import{g as dt}from"./CMiilI_P.js";import{t as $e,bo as g,bw as Ae,b as Ue,bm as u,br as mt}from"./AeC4KVgG.js";import{ai as We,bs as Ee,ca as xe,aD as e,a7 as we,ay as te,W as y,bn as Te,bV as se,aA as v,a5 as pe,bS as E,bH as P,bA as ge,b_ as X,aj as Ce,aw as Ne,bl as ye,bO as ne,aB as Z,c9 as z,be as Me,b$ as Ie}from"./CJxGDkBm.js";import{i as q}from"./k2awEenT.js";import{k as ft}from"./HftJbvyF.js";import{s as ke,e as qe,f as pt,g as gt}from"./DrHJ7oPv.js";import{b as Se}from"./NtFyWdpR.js";import{c as me}from"./ZcoUa9Jg.js";import{K as Ge}from"./CkCQ3HCp.js";import{a as vt}from"./CC7to1B5.js";import{m as _e}from"./BbV7MtxC.js";import{f as Le}from"./DJM6amHV.js";import"./jhNNYE0v.js";import{l as Ke,f as Je,m as _t,a as ht}from"./DWUO9rBe.js";import"./ChTqQfQN.js";import"./BNODdf6r.js";import{p as He,b as Qe,a as et,M as tt}from"./-6dzlBdM.js";import{M as ze}from"./CkHTSBAH.js";import"./Bw3fY4XA.js";import{M as nt}from"./B-AWjR8f.js";import{bK as Re}from"./DkNdI_Wp.js";import{s as je}from"./Dp2nUoTL.js";import{F as Pe,d2 as bt,bV as wt,bW as yt,cp as xt,bE as kt,cq as Ct,aY as Pt,a7 as Lt}from"./Ci7mS1ie.js";import{S as Mt}from"./BDwdwGgf.js";import{n as It,g as zt}from"./DsyH2ZOJ.js";import{e as De}from"./CswzK9Go.js";import{b as $t,c as At}from"./DpqAXGKG.js";import{P as Ut}from"./G2FM8dd1.js";import{h as Et}from"./CsqD9xz6.js";import{t as Tt}from"./DAsc1V4f.js";function Nt(i,t){return i?.isExternalLink===!0&&typeof i.workspaceId=="string"&&i.workspaceId?i.workspaceId:t||void 0}function St(i,t,o){const c=i.label||i.id||"mention";if(i.type==="member")return st(c);if(i.type==="note"&&i.id&&o){const s=Nt(i.meta,t),_=s?o(s,i.id)?.trim():void 0;if(_)return _}return c}function Vn(i,t,o){if(typeof document>"u"||!i.includes('data-type="note"'))return i;const c=document.createElement("template");c.innerHTML=i;let s=!1;for(const _ of c.content.querySelectorAll('[data-mention][data-type="note"]')){let h=null;try{h=JSON.parse(_.getAttribute("data-meta")||"{}")}catch{h=null}const I=_.textContent??"",C=St({type:"note",id:_.getAttribute("data-id"),label:I,meta:h},t,o);C!==I&&(_.textContent=C,s=!0)}return s?c.innerHTML:i}const Zn=(i,t)=>{let o;try{o=dt().state}catch{return}const c=o?.workspaceNotes?.byWorkspaceId?.[i]?.notes;return c?ct(c,t)?.title:void 0};var Kt=Z('<p class="mt-2 max-w-[90vw] rounded-md bg-black/60 px-3 py-1.5 text-center text-sm text-white"> </p>'),Rt=Z('<div data-media-lightbox-root="" data-image-lightbox-root="" class="fixed inset-0 z-[1000] flex cursor-zoom-out flex-col items-center justify-center bg-black/80 p-4 backdrop-blur-sm" style="pointer-events: auto;" role="dialog" aria-modal="true" tabindex="-1"><div class="absolute right-4 top-4 z-[1002] flex items-center gap-1"><!> <!></div> <div class="flex min-h-0 w-full flex-1 items-center justify-center"><!></div> <!></div>');function Ye(i,t){if(new.target)return $e({component:Ye,...i});Ee(t,!0);let o=g(t,"open",15,!1),c=g(t,"ariaLabel",7),s=g(t,"closeLabel",7),_=g(t,"onClose",7),h=g(t,"openerElement",7,null),I=g(t,"children",7),C=g(t,"actions",7),T=g(t,"caption",7),w=g(t,"onKeydown",7),L=g(t,"onCopy",7);const S=$t(),d=At(b);let M=se(null),N=se(null);function b(){o()&&(o(!1),_()?.(),h()?.isConnected&&h().focus({preventScroll:!0}))}function O(n){(n.target instanceof Element?n.target:null)?.closest('[data-media-lightbox-content], [role="toolbar"], button, input')||b()}function K(n){if(w()?.(n),n.defaultPrevented||n.key!=="Tab"||!e(M))return;const r=Array.from(e(M).querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')),m=r[0],l=r[r.length-1];!m||!l||(n.shiftKey&&document.activeElement===m?(n.preventDefault(),l.focus()):!n.shiftKey&&document.activeElement===l&&(n.preventDefault(),m.focus()))}xe(()=>{if(o())return He(b)}),xe(()=>{!o()||!e(N)||requestAnimationFrame(()=>e(N)?.focus())});var ae={get open(){return o()},set open(n=!1){o(n),v()},get ariaLabel(){return c()},set ariaLabel(n){c(n),v()},get closeLabel(){return s()},set closeLabel(n){s(n),v()},get onClose(){return _()},set onClose(n){_(n),v()},get openerElement(){return h()},set openerElement(n=null){h(n),v()},get children(){return I()},set children(n){I(n),v()},get actions(){return C()},set actions(n){C(n),v()},get caption(){return T()},set caption(n){T(n),v()},get onKeydown(){return w()},set onKeydown(n){w(n),v()},get onCopy(){return L()},set onCopy(n){L(n),v()},$set:Ae,$on:(n,r)=>Ue(t,n,r)},B=we(),G=te(B);{var J=n=>{{let r=z(()=>S?.target()??"body");Ut(n,{get target(){return e(r)},zIndex:1e3,children:(m,l)=>{var f=Rt(),k=pe(f),$=pe(k);{var R=x=>{var re=we(),D=te(re);je(D,C),y(x,re)};q($,x=>{C()&&x(R)})}var Q=E($,2);Le(Q,{variant:"ghost",size:"icon",class:"text-white hover:bg-white/20 hover:text-white",onclick:b,get"aria-label"(){return s()},get ref(){return e(N)},set ref(x){P(N,x,!0)},children:(x,re)=>{Pe(x,{get icon(){return bt},size:"lg"})},$$slots:{default:!0}}),ge(k),De(k,x=>d?.(x));var j=E(k,2),F=pe(j);je(F,I),ge(j),De(j,x=>d?.(x));var W=E(j,2);{var ce=x=>{var re=Kt(),D=ye(re,!0);X(()=>ne(D,T())),y(x,re)};q(W,x=>{T()&&x(ce)})}ge(f),Se(f,x=>P(M,x),()=>e(M)),X(()=>ke(f,"aria-label",c())),Ce("click",f,O),Ce("keydown",f,K),Ne("copy",f,function(...x){L()?.apply(this,x)}),It(3,f,()=>zt,()=>({tier:"moderate"})),y(m,f)},$$slots:{default:!0}})}};q(G,n=>{o()&&n(J)})}return y(i,B),Te(ae)}We(["click","keydown"]);function Xe(i){if(!i.startsWith("workspace-file://"))return null;const o=i.slice(17).split(/[?#]/)[0].split("/"),c=o[0],s=o.slice(1);if(!c||s.length===0)return null;const _=[];for(const h of s){if(!h)return null;try{_.push(decodeURIComponent(h))}catch{return null}}return{workspaceId:c,path:_.join("/")}}function at(i){try{return new URL(i).protocol==="https:"}catch{return!1}}function Ve(i){const t=/^data:([^;,]+);base64,(.*)$/s.exec(i);return t?{mimeType:t[1],base64:t[2]}:null}function Ze(i){return at(i)||Xe(i)!==null||/^workspace-asset:\/\/[^/?#]+/.test(i)||/^data:image\/[a-z0-9.+-]+(?:;[^,]*)?,/i.test(i)}function rt(i){if(i.length===0)return 0;let t=0;return i.endsWith("==")?t=2:i.endsWith("=")&&(t=1),Math.floor(i.length*3/4)-t}function Ft(i,t){const o=atob(i),c=new Uint8Array(o.length);for(let s=0;s<o.length;s++)c[s]=o.charCodeAt(s);return new Blob([c],{type:t})}const Ot={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/avif":"avif","image/bmp":"bmp"};function Bt(i){if(i.workspacePath){const s=i.workspacePath.split("/").pop();if(s)return s}const t=(i.imageName||"image").replace(/[/\\]/g,"_");if(/\.[A-Za-z0-9]+$/.test(t))return t;const o=i.mimeType?.split(";")[0].trim().toLowerCase(),c=o&&Ot[o]||"png";return`${t}.${c}`}var jt=Z('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="image-info-dimensions"> </div>'),Dt=Z('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="image-info-size"> </div>'),Vt=Z("<!> <!> <!>",1),Zt=Z("<!> <!> <!> <!>",1),Wt=Z("<!> <!>",1);function ot(i,t){if(new.target)return $e({component:ot,...i});Ee(t,!0);let o=g(t,"imageUrl",7),c=g(t,"imageName",7),s=g(t,"open",15,!1),_=g(t,"triggerClass",7),h=g(t,"contentClass",7);const I=z(()=>Ve(o())),C=z(()=>Xe(o())),T=z(()=>at(o()));let w=se(null),L=se(null),S=null;function d(){if(S===o())return;const l=S=o();P(w,null),P(L,e(I)?rt(e(I).base64):null,!0);const f=new Image;f.onload=()=>{S===l&&P(w,{width:f.naturalWidth,height:f.naturalHeight},!0)},f.src=o(),e(I)||fetch(o()).then(k=>k.ok?k.blob():null).then(k=>{k&&S===l&&P(L,k.size,!0)}).catch(()=>{})}xe(()=>{s()&&d()}),xe(()=>{if(s())return He(()=>{s(!1)})});async function M(l=o()){const f=Ve(l);if(f)return Ft(f.base64,f.mimeType);const k=await fetch(l);if(!k.ok)throw new Error(`Image fetch failed: ${k.status}`);return await k.blob()}async function N(){let l=null;try{let f=o(),k=e(I)?.mimeType;if(!e(I)){const R=await M();k=R.type,l=URL.createObjectURL(R),f=l}const $=document.createElement("a");$.href=f,$.download=Bt({workspacePath:e(C)?.path,imageName:c(),mimeType:k}),document.body.appendChild($);try{$.click()}finally{$.remove()}}catch{_e.error(u.ui_imageActionsMenu_downloadFailed_error())}finally{l&&URL.revokeObjectURL(l)}}async function b(){if(e(C))try{await Re(e(C).path),_e.success(u.ui_imageActionsMenu_pathCopied_label())}catch{_e.error(u.ui_imageActionsMenu_copyFailed_error())}}async function O(){if(e(T))try{await Re(o()),_e.success(u.ui_imageActionsMenu_linkCopied_label())}catch{_e.error(u.ui_imageActionsMenu_copyFailed_error())}}async function K(l){let f,k;try{let $;if(l.type.split(";")[0].trim()==="image/svg+xml"){k=URL.createObjectURL(l);const j=new Image;j.src=k,await j.decode(),$=j}else $=f=await createImageBitmap(l);const R=document.createElement("canvas");R.width=$ instanceof HTMLImageElement?$.naturalWidth:$.width,R.height=$ instanceof HTMLImageElement?$.naturalHeight:$.height;const Q=R.getContext("2d");if(!Q)throw new Error("2d canvas context unavailable");return Q.drawImage($,0,0),await new Promise((j,F)=>{R.toBlob(W=>W?j(W):F(new Error("canvas toBlob failed")),"image/png")})}finally{f?.close(),k&&URL.revokeObjectURL(k)}}async function ae(l=o()){try{let f=await M(l);f.type!=="image/png"&&(f=await K(f)),await navigator.clipboard.write([new ClipboardItem({"image/png":f})]),_e.success(u.ui_imageActionsMenu_imageCopied_label())}catch{_e.error(u.ui_imageActionsMenu_copyFailed_error())}}function B(l,f=o()){return l.defaultPrevented||!Ze(f)||l instanceof KeyboardEvent&&(l.key.toLowerCase()!=="c"||!(l.metaKey||l.ctrlKey)||l.altKey||l.shiftKey||l.isComposing)||vt(l.target)||document.getSelection()?.toString()?!1:(l.preventDefault(),l.stopPropagation(),l instanceof KeyboardEvent&&l.repeat||(ae(f),s(!1)),!0)}var G={handleCopy:B,get imageUrl(){return o()},set imageUrl(l){o(l),v()},get imageName(){return c()},set imageName(l){c(l),v()},get open(){return s()},set open(l=!1){s(l),v()},get triggerClass(){return _()},set triggerClass(l){_(l),v()},get contentClass(){return h()},set contentClass(l){h(l),v()},$set:Ae,$on:(l,f)=>Ue(t,l,f)},J=we(),n=te(J);{var r=l=>{var f=we(),k=te(f);me(k,()=>tt,($,R)=>{R($,{get open(){return s()},set open(Q){s(Q)},children:(Q,j)=>{var F=Wt(),W=te(F);{const x=(D,he)=>{let oe=()=>(he?.()).props;{let V=z(()=>u.ui_imageActionsMenu_trigger_ariaLabel());Le(D,mt(oe,{variant:"plain",size:"icon-sm",wrapContent:!1,get active(){return s()},get"aria-label"(){return e(V)},children:(ie,fe)=>{Ge(ie,{class:"size-3.5"})},$$slots:{default:!0}}))}};let re=z(()=>qe("flex h-7 w-7 items-center justify-center rounded-md bg-black/60 text-white","hover:bg-black/75",_()));me(W,()=>Qe,(D,he)=>{he(D,{get class(){return e(re)},onclick:oe=>oe.stopPropagation(),onkeydown:oe=>B(oe),oncopy:oe=>B(oe),child:x,$$slots:{child:!0}})})}var ce=E(W,2);me(ce,()=>et,(x,re)=>{re(x,{get class(){return h()},align:"end",onkeydown:D=>B(D),oncopy:D=>B(D),children:(D,he)=>{var oe=Zt(),V=te(oe);me(V,()=>ze,(A,Y)=>{Y(A,{onSelect:()=>void N(),children:(U,ee)=>{Me();var le=Ie();X(ue=>ne(le,ue),[()=>u.ui_imageActionsMenu_download_label()]),y(U,le)},$$slots:{default:!0}})});var ie=E(V,2);me(ie,()=>ze,(A,Y)=>{Y(A,{onSelect:()=>void ae(),children:(U,ee)=>{Me();var le=Ie();X(ue=>ne(le,ue),[()=>u.ui_imageActionsMenu_copyImage_label()]),y(U,le)},$$slots:{default:!0}})});var fe=E(ie,2);{var a=A=>{var Y=we(),U=te(Y);me(U,()=>ze,(ee,le)=>{le(ee,{onSelect:()=>void b(),children:(ue,Fe)=>{Me();var de=Ie();X(be=>ne(de,be),[()=>u.ui_imageActionsMenu_copyPath_label()]),y(ue,de)},$$slots:{default:!0}})}),y(A,Y)},p=A=>{var Y=we(),U=te(Y);me(U,()=>ze,(ee,le)=>{le(ee,{onSelect:()=>void O(),children:(ue,Fe)=>{Me();var de=Ie();X(be=>ne(de,be),[()=>u.ui_imageActionsMenu_copyLink_label()]),y(ue,de)},$$slots:{default:!0}})}),y(A,Y)};q(fe,A=>{e(C)?A(a):e(T)&&A(p,1)})}var H=E(fe,2);{var ve=A=>{var Y=Vt(),U=te(Y);me(U,()=>nt,(de,be)=>{be(de,{})});var ee=E(U,2);{var le=de=>{var be=jt(),Oe=ye(be,!0);X(Be=>ne(Oe,Be),[()=>u.ui_imageActionsMenu_dimensions_label({width:Ke(e(w).width),height:Ke(e(w).height)})]),y(de,be)};q(ee,de=>{e(w)&&de(le)})}var ue=E(ee,2);{var Fe=de=>{var be=Dt(),Oe=ye(be,!0);X(Be=>ne(Oe,Be),[()=>Je(e(L))]),y(de,be)};q(ue,de=>{e(L)!==null&&de(Fe)})}y(A,Y)};q(H,A=>{(e(w)||e(L)!==null)&&A(ve)})}y(D,oe)},$$slots:{default:!0}})}),y(Q,F)},$$slots:{default:!0}})}),y(l,f)},m=z(()=>Ze(o()));q(n,l=>{e(m)&&l(r)})}return y(i,J),Te(G)}var Ht=Z('<div role="application" tabindex="0" data-testid="zoom-pan-viewport"><div class="flex h-full w-full items-center justify-center will-change-transform" data-testid="zoom-pan-content"><!></div> <div class="absolute bottom-4 left-1/2 z-10 flex -translate-x-1/2 cursor-default items-center gap-2 rounded-full bg-black/60 px-3 py-1.5 backdrop-blur-sm" role="toolbar" tabindex="-1" data-testid="zoom-pan-controls"><!> <div class="w-36"><!></div> <!> <span class="min-w-12 text-center text-xs tabular-nums text-white/90" data-testid="zoom-pan-percent"> </span> <!></div></div>');function it(i,t){if(new.target)return $e({component:it,...i});Ee(t,!0);let o=g(t,"children",7),c=g(t,"minZoom",7,.25),s=g(t,"maxZoom",7,8),_=g(t,"onScaleChange",7);const h=1.25,I=.0015,C=.01,T=4;let w=se(1),L=se(0),S=se(0),d=se(!1),M=se(null);xe(()=>{_()?.(e(w))});let N=null,b=0,O=0,K=0,ae=!1;const B=z(()=>_t(e(w),{style:"percent",maximumFractionDigits:0}));function G(a){return Math.min(s(),Math.max(c(),a))}function J(a,p,H){const ve=G(H),A=e(M)?.getBoundingClientRect(),Y=A?a-A.left:0,U=A?p-A.top:0;P(L,Y-(Y-e(L))/e(w)*ve),P(S,U-(U-e(S))/e(w)*ve),P(w,ve,!0)}function n(a){const p=e(M)?.getBoundingClientRect();p?J(p.left+p.width/2,p.top+p.height/2,a):P(w,G(a),!0)}function r(){P(w,1),P(L,0),P(S,0)}function m(a){a.preventDefault();const p=a.ctrlKey?C:I;J(a.clientX,a.clientY,e(w)*Math.exp(-a.deltaY*p))}xe(()=>{const a=e(M);if(a)return a.addEventListener("wheel",m,{passive:!1}),()=>a.removeEventListener("wheel",m)});function l(a){if(a.metaKey||a.ctrlKey||a.altKey)return!1;if(a.key==="+"||a.key==="=")n(e(w)*h);else if(a.key==="-")n(e(w)/h);else if(a.key==="0")r();else return!1;return a.preventDefault(),!0}function f(a){if(a.button>0)return;P(d,!0),N=a.pointerId,b=a.clientX,O=a.clientY,K=0;const p=a.currentTarget;typeof p.setPointerCapture=="function"&&p.setPointerCapture(a.pointerId)}function k(a){if(!e(d)||a.pointerId!==N)return;const p=a.clientX-b,H=a.clientY-O;K+=Math.abs(p)+Math.abs(H),P(L,e(L)+p),P(S,e(S)+H),b=a.clientX,O=a.clientY}function $(a){if(!e(d)||a.pointerId!==N)return;P(d,!1),N=null,K>T&&(ae=!0);const p=a.currentTarget;typeof p.hasPointerCapture=="function"&&typeof p.releasePointerCapture=="function"&&p.hasPointerCapture(a.pointerId)&&p.releasePointerCapture(a.pointerId)}function R(a){ae&&(ae=!1,a.preventDefault(),a.stopPropagation())}function Q(a){const p=Number.parseFloat(a.currentTarget.value);Number.isFinite(p)&&n(p)}var j={handleKeydown:l,get children(){return o()},set children(a){o(a),v()},get minZoom(){return c()},set minZoom(a=.25){c(a),v()},get maxZoom(){return s()},set maxZoom(a=8){s(a),v()},get onScaleChange(){return _()},set onScaleChange(a){_(a),v()},$set:Ae,$on:(a,p)=>Ue(t,a,p)},F=Ht(),W=pe(F),ce=pe(W);je(ce,o),ge(W);var x=E(W,2),re=pe(x);{let a=z(()=>u.ui_zoomPanViewport_zoomOut_ariaLabel()),p=z(()=>u.ui_zoomPanViewport_zoomOut_ariaLabel());Le(re,{variant:"ghost",size:"icon-sm",class:"text-white hover:bg-white/20 hover:text-white",onclick:()=>n(e(w)/h),get"aria-label"(){return e(a)},get title(){return e(p)},children:(H,ve)=>{Pe(H,{get icon(){return wt}})},$$slots:{default:!0}})}var D=E(re,2),he=pe(D);{let a=z(()=>u.ui_zoomPanViewport_zoomSlider_ariaLabel()),p=z(()=>u.ui_zoomPanViewport_zoomSlider_ariaLabel());Mt(he,{class:"accent-white",get min(){return c()},get max(){return s()},step:"0.01",get value(){return e(w)},oninput:Q,get"aria-label"(){return e(a)},get title(){return e(p)},"data-testid":"zoom-pan-slider"})}ge(D);var oe=E(D,2);{let a=z(()=>u.ui_zoomPanViewport_zoomIn_ariaLabel()),p=z(()=>u.ui_zoomPanViewport_zoomIn_ariaLabel());Le(oe,{variant:"ghost",size:"icon-sm",class:"text-white hover:bg-white/20 hover:text-white",onclick:()=>n(e(w)*h),get"aria-label"(){return e(a)},get title(){return e(p)},children:(H,ve)=>{Pe(H,{get icon(){return yt}})},$$slots:{default:!0}})}var V=E(oe,2),ie=ye(V,!0),fe=E(V,2);{let a=z(()=>u.ui_zoomPanViewport_resetZoom_ariaLabel()),p=z(()=>u.ui_zoomPanViewport_resetZoom_ariaLabel());Le(fe,{variant:"ghost",size:"icon-sm",class:"text-white hover:bg-white/20 hover:text-white",onclick:r,get"aria-label"(){return e(a)},get title(){return e(p)},children:(H,ve)=>{Pe(H,{get icon(){return xt}})},$$slots:{default:!0}})}return ge(x),ge(F),Se(F,a=>P(M,a),()=>e(M)),X((a,p)=>{pt(F,1,`relative h-full w-full touch-none select-none overflow-hidden ${e(d)?"cursor-grabbing":"cursor-grab"}`),ke(F,"aria-label",a),gt(W,`transform: translate(${e(L)??""}px, ${e(S)??""}px) scale(${e(w)??""}); transform-origin: 0 0;`),ke(x,"aria-label",p),ne(ie,e(B))},[()=>u.ui_zoomPanViewport_viewport_ariaLabel(),()=>u.ui_zoomPanViewport_controls_ariaLabel()]),Ce("pointerdown",F,f),Ce("pointermove",F,k),Ce("pointerup",F,$),Ne("pointercancel",F,$),Ne("click",F,R,!0),Ce("keydown",F,l),Ce("pointerdown",x,a=>a.stopPropagation()),y(i,F),Te(j)}We(["pointerdown","pointermove","pointerup","keydown"]);var Yt=Z('<img class="max-h-[90vh] max-w-[90vw] rounded-lg object-contain" draggable="false" data-media-lightbox-content=""/>');function Xt(i,t){if(new.target)return $e({component:Xt,...i});Ee(t,!0);const o=b=>{var O=we(),K=te(O);{var ae=B=>{Se(ot(B,{get imageUrl(){return s()},get imageName(){return _()},triggerClass:"h-9 w-9 bg-white/0 hover:bg-white/20",contentClass:"z-[1003]",get open(){return e(L)},set open(G){P(L,G,!0)}}),G=>P(w,G,!0),()=>e(w))};q(K,B=>{C()&&B(ae)})}y(b,O)};let c=g(t,"open",15,!1),s=g(t,"imageUrl",7),_=g(t,"imageName",23,()=>u.ui_imageLightbox_image_alt()),h=g(t,"onClose",7),I=g(t,"openerElement",7,null),C=g(t,"showActionsMenu",7,!1),T=se(void 0),w=se(void 0),L=se(!1);xe(()=>{c()||P(L,!1)});function S(b){d(b),b.defaultPrevented||e(T)?.handleKeydown(b)}function d(b){c()&&C()&&e(w)?.handleCopy(b)}function M(b){!C()||!Ze(s())||(b.preventDefault(),b.stopPropagation(),P(L,!0))}var N={get open(){return c()},set open(b=!1){c(b),v()},get imageUrl(){return s()},set imageUrl(b){s(b),v()},get imageName(){return _()},set imageName(b=u.ui_imageLightbox_image_alt()){_(b),v()},get onClose(){return h()},set onClose(b){h(b),v()},get openerElement(){return I()},set openerElement(b=null){I(b),v()},get showActionsMenu(){return C()},set showActionsMenu(b=!1){C(b),v()},$set:Ae,$on:(b,O)=>Ue(t,b,O)};{let b=z(()=>u.ui_imageLightbox_preview_ariaLabel()),O=z(()=>u.ui_imageLightbox_close_ariaLabel());Ye(i,{get ariaLabel(){return e(b)},get closeLabel(){return e(O)},get onClose(){return h()},get openerElement(){return I()},get actions(){return o},onKeydown:S,onCopy:d,get open(){return c()},set open(K){c(K)},children:(K,ae)=>{var B=we(),G=te(B);ft(G,s,J=>{Se(it(J,{children:(n,r)=>{var m=Yt();X(()=>{ke(m,"src",s()),ke(m,"alt",_())}),Ce("contextmenu",m,M),y(n,m)},$$slots:{default:!0}}),n=>P(T,n,!0),()=>e(T))}),y(K,B)},$$slots:{default:!0}})}return Te(N)}We(["contextmenu"]);var qt=Z('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="video-info-duration"> </div>'),Gt=Z('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="video-info-dimensions"> </div>'),Jt=Z('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="video-info-size"> </div>'),Qt=Z("<!> <!> <!> <!>",1),en=Z("<!> <!> <!>",1),tn=Z("<!> <!>",1);function lt(i,t){if(new.target)return $e({component:lt,...i});Ee(t,!0);let o=g(t,"videoUrl",7),c=g(t,"videoName",7),s=g(t,"sourceKind",7),_=g(t,"mimeType",7),h=g(t,"open",15,!1),I=g(t,"triggerClass",7),C=g(t,"contentClass",7);const T=z(()=>Ve(o())),w=z(()=>Xe(o())),L=z(()=>s()??(e(T)?"inline":e(w)?"workspace":"remote"));let S=se(null),d=se(null),M=se(null),N=null;function b(){if(N===o())return;const n=N=o();P(S,null),P(d,null),P(M,e(T)?rt(e(T).base64):null,!0);const r=document.createElement("video");r.preload="metadata",r.onloadedmetadata=()=>{N===n&&(Number.isFinite(r.duration)&&r.duration>0&&P(S,r.duration,!0),r.videoWidth>0&&r.videoHeight>0&&P(d,{width:r.videoWidth,height:r.videoHeight},!0))},r.src=o(),e(T)||fetch(o()).then(m=>m.ok?m.blob():null).then(m=>{m&&N===n&&P(M,m.size,!0)}).catch(()=>{})}function O(){const n=e(w)?.path.split("/").pop();if(n)return n;const r=(c()||"video").replace(/[/\\]/g,"_");if(/\.[A-Za-z0-9]+$/.test(r))return r;const m=(_()??e(T)?.mimeType)==="video/webm"?"webm":"mp4";return`${r}.${m}`}async function K(){let n=null;try{let r=o();if(!e(T)){const l=await fetch(o());if(!l.ok)throw new Error(`Video fetch failed: ${l.status}`);n=URL.createObjectURL(await l.blob()),r=n}const m=document.createElement("a");m.href=r,m.download=O(),document.body.appendChild(m),m.click(),m.remove(),n&&URL.revokeObjectURL(n)}catch{n&&URL.revokeObjectURL(n),_e.error(u.ui_videoActionsMenu_downloadFailed_error())}}async function ae(n,r){try{await Re(n),_e.success(r)}catch{_e.error(u.ui_videoActionsMenu_copyFailed_error())}}xe(()=>{h()&&b()}),xe(()=>{if(h())return He(()=>{h(!1)})});var B={get videoUrl(){return o()},set videoUrl(n){o(n),v()},get videoName(){return c()},set videoName(n){c(n),v()},get sourceKind(){return s()},set sourceKind(n){s(n),v()},get mimeType(){return _()},set mimeType(n){_(n),v()},get open(){return h()},set open(n=!1){h(n),v()},get triggerClass(){return I()},set triggerClass(n){I(n),v()},get contentClass(){return C()},set contentClass(n){C(n),v()},$set:Ae,$on:(n,r)=>Ue(t,n,r)},G=we(),J=te(G);return me(J,()=>tt,(n,r)=>{r(n,{get open(){return h()},set open(m){h(m)},children:(m,l)=>{var f=tn(),k=te(f);{let R=z(()=>qe("flex h-7 w-7 items-center justify-center rounded-md bg-black/60 text-white","hover:bg-black/75",I())),Q=z(()=>u.ui_videoActionsMenu_trigger_ariaLabel());me(k,()=>Qe,(j,F)=>{F(j,{get class(){return e(R)},get"aria-label"(){return e(Q)},onclick:W=>W.stopPropagation(),children:(W,ce)=>{Ge(W,{class:"size-3.5"})},$$slots:{default:!0}})})}var $=E(k,2);me($,()=>et,(R,Q)=>{Q(R,{get class(){return C()},align:"end",children:(j,F)=>{var W=en(),ce=te(W);me(ce,()=>ze,(V,ie)=>{ie(V,{onSelect:()=>void K(),children:(fe,a)=>{Me();var p=Ie();X(H=>ne(p,H),[()=>u.ui_videoActionsMenu_download_label()]),y(fe,p)},$$slots:{default:!0}})});var x=E(ce,2);{var re=V=>{var ie=we(),fe=te(ie);me(fe,()=>ze,(a,p)=>{p(a,{onSelect:()=>void ae(e(w).path,u.ui_videoActionsMenu_pathCopied_label()),children:(H,ve)=>{Me();var A=Ie();X(Y=>ne(A,Y),[()=>u.ui_videoActionsMenu_copyPath_label()]),y(H,A)},$$slots:{default:!0}})}),y(V,ie)},D=V=>{var ie=we(),fe=te(ie);me(fe,()=>ze,(a,p)=>{p(a,{onSelect:()=>void ae(o(),u.ui_videoActionsMenu_linkCopied_label()),children:(H,ve)=>{Me();var A=Ie();X(Y=>ne(A,Y),[()=>u.ui_videoActionsMenu_copyLink_label()]),y(H,A)},$$slots:{default:!0}})}),y(V,ie)};q(x,V=>{e(L)==="workspace"&&e(w)?V(re):e(L)==="remote"&&V(D,1)})}var he=E(x,2);{var oe=V=>{var ie=Qt(),fe=te(ie);me(fe,()=>nt,(U,ee)=>{ee(U,{})});var a=E(fe,2);{var p=U=>{var ee=qt(),le=ye(ee,!0);X(ue=>ne(le,ue),[()=>u.ui_videoActionsMenu_duration_label({duration:ht(e(S)*1e3)})]),y(U,ee)};q(a,U=>{e(S)!==null&&U(p)})}var H=E(a,2);{var ve=U=>{var ee=Gt(),le=ye(ee,!0);X(ue=>ne(le,ue),[()=>u.ui_videoActionsMenu_dimensions_label({width:Ke(e(d).width),height:Ke(e(d).height)})]),y(U,ee)};q(H,U=>{e(d)&&U(ve)})}var A=E(H,2);{var Y=U=>{var ee=Jt(),le=ye(ee,!0);X(ue=>ne(le,ue),[()=>Je(e(M))]),y(U,ee)};q(A,U=>{e(M)!==null&&U(Y)})}y(V,ie)};q(he,V=>{(e(S)!==null||e(d)||e(M)!==null)&&V(oe)})}y(j,W)},$$slots:{default:!0}})}),y(m,f)},$$slots:{default:!0}})}),y(i,G),Te(B)}var nn=Z('<p class="type-body text-white/80" role="status"> </p>'),an=Z('<div data-media-lightbox-content="" data-video-lightbox-root="" class="flex max-h-[90vh] max-w-[90vw] cursor-default flex-col items-center gap-3"><video controls="" preload="metadata" playsinline="" class="max-h-[85vh] max-w-[90vw] rounded-lg bg-black object-contain shadow-(--elevation-overlay)" data-testid="chat-video-player"> </video> <!></div>',2);function rn(i,t){if(new.target)return $e({component:rn,...i});Ee(t,!0);const o=d=>{lt(d,{get videoUrl(){return s()},get videoName(){return _()},get sourceKind(){return I()},get mimeType(){return C()},triggerClass:"h-9 w-9 bg-white/0 hover:bg-white/20",contentClass:"z-[1003]"})};let c=g(t,"open",15,!1),s=g(t,"videoUrl",7),_=g(t,"videoName",23,()=>u.chat_videoBlock_fromAgent_label()),h=g(t,"poster",7),I=g(t,"sourceKind",7),C=g(t,"mimeType",7),T=g(t,"openerElement",7,null),w=g(t,"onClose",7),L=se(!1);xe(()=>{!c()||!s()||P(L,!1)});var S={get open(){return c()},set open(d=!1){c(d),v()},get videoUrl(){return s()},set videoUrl(d){s(d),v()},get videoName(){return _()},set videoName(d=u.chat_videoBlock_fromAgent_label()){_(d),v()},get poster(){return h()},set poster(d){h(d),v()},get sourceKind(){return I()},set sourceKind(d){I(d),v()},get mimeType(){return C()},set mimeType(d){C(d),v()},get openerElement(){return T()},set openerElement(d=null){T(d),v()},get onClose(){return w()},set onClose(d){w(d),v()},$set:Ae,$on:(d,M)=>Ue(t,d,M)};{let d=z(()=>u.chat_videoBlock_dialog_title({name:_()})),M=z(()=>u.chat_videoBlock_close_ariaLabel());Ye(i,{get ariaLabel(){return e(d)},get closeLabel(){return e(M)},get openerElement(){return T()},get onClose(){return w()},get actions(){return o},get open(){return c()},set open(N){c(N)},children:(N,b)=>{var O=an(),K=pe(O),ae=ye(K,!0),B=E(K,2);{var G=J=>{var n=nn(),r=ye(n,!0);X(m=>ne(r,m),[()=>u.chat_videoBlock_unavailable_description()]),y(J,n)};q(B,J=>{e(L)&&J(G)})}ge(O),X(J=>{ke(K,"src",s()),ke(K,"poster",h()),ke(K,"aria-label",_()),ne(ae,J)},[()=>u.chat_videoBlock_unsupported_description()]),Ne("error",K,()=>P(L,!0)),y(N,O)},$$slots:{default:!0}})}return Te(S)}var on=Z('<span class="block truncate text-foreground"> </span>'),ln=Z("<!> ",1),sn=Z("<!> <!>",1),cn=Z('<span class="flex shrink-0 flex-wrap items-center gap-1"><!> <!></span>'),un=Z('<div class="type-caption flex w-fit min-w-0 max-w-full items-center gap-3 whitespace-normal py-1 text-muted-foreground" role="status" data-testid="media-unavailable"><span class="flex min-w-0 max-w-full flex-1 items-start gap-2"><span class="first-line-icon" aria-hidden="true"><!></span> <span class="min-w-0"><!> <span class="block break-words"> </span></span></span> <!></div>');function dn(i,t){if(new.target)return $e({component:dn,...i});Ee(t,!0);let o=g(t,"name",7),c=g(t,"reason",7),s=g(t,"path",7),_=g(t,"workspaceId",7),h=g(t,"onRetry",7);const I=z(()=>c()==="missing"?u.ui_mediaUnavailable_missing_description():c()==="unsupported"?u.ui_mediaUnavailable_unsupported_description():c()==="other-workspace"?u.ui_mediaUnavailable_otherWorkspace_description():c()==="invalid-link"?u.ui_mediaUnavailable_invalidLink_description():u.ui_mediaUnavailable_loadFailed_description());function C(r){r.preventDefault(),r.stopPropagation()}function T(r){C(r),h()?.()}async function w(r){if(C(r),!!s())try{await Re(s()),_e.success(u.ui_imageActionsMenu_pathCopied_label())}catch{_e.error(u.ui_imageActionsMenu_copyFailed_error())}}function L(r){if(C(r),!s()||!_())return;const m=s().split("/").map(encodeURIComponent).join("/");Et(`intent://local/file/${m}`,{workspaceId:ut(_())})}var S={get name(){return o()},set name(r){o(r),v()},get reason(){return c()},set reason(r){c(r),v()},get path(){return s()},set path(r){s(r),v()},get workspaceId(){return _()},set workspaceId(r){_(r),v()},get onRetry(){return h()},set onRetry(r){h(r),v()},$set:Ae,$on:(r,m)=>Ue(t,r,m)},d=un(),M=pe(d),N=pe(M),b=pe(N);Pe(b,{get icon(){return kt},class:"size-3.5"}),ge(N);var O=E(N,2),K=pe(O);{var ae=r=>{var m=on(),l=ye(m,!0);De(m,(f,k)=>Tt?.(f,k),o),X(()=>ne(l,o())),y(r,m)};q(K,r=>{o()&&r(ae)})}var B=E(K,2),G=ye(B,!0);ge(O),ge(M);var J=E(M,2);{var n=r=>{var m=cn(),l=pe(m);{var f=R=>{{let Q=z(()=>u.chat_shared_retry_label());Le(R,{variant:"ghost",size:"icon-compact",get tooltip(){return e(Q)},onclick:T,children:(j,F)=>{Pe(j,{get icon(){return Ct},size:"xs"})},$$slots:{default:!0}})}};q(l,R=>{h()&&R(f)})}var k=E(l,2);{var $=R=>{var Q=sn(),j=te(Q);{var F=ce=>{Le(ce,{variant:"ghost",size:"compact",onclick:L,children:(x,re)=>{var D=ln(),he=te(D);Pe(he,{get icon(){return Lt},size:"xs"});var oe=E(he);X(V=>ne(oe,` ${V??""}`),[()=>u.chat_changesPanel_openFile_tooltip()]),y(x,D)},$$slots:{default:!0}})};q(j,ce=>{_()&&c()!=="other-workspace"&&c()!=="invalid-link"&&ce(F)})}var W=E(j,2);{let ce=z(()=>u.ui_imageActionsMenu_copyPath_label());Le(W,{variant:"ghost",size:"icon-compact",get tooltip(){return e(ce)},onclick:w,children:(x,re)=>{Pe(x,{get icon(){return Pt},size:"xs"})},$$slots:{default:!0}})}y(R,Q)};q(k,R=>{s()&&R($)})}ge(m),y(r,m)};q(J,r=>{(h()||s())&&r(n)})}return ge(d),X(()=>{ke(d,"data-reason",c()),ne(G,e(I))}),y(i,d),Te(S)}export{ot as I,Ye as M,lt as V,it as Z,Xt as a,dn as b,rn as c,Ze as d,St as m,Xe as p,Vn as r,Zn as s};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{p as re}from"./
|
|
1
|
+
import{p as re}from"./DAwOD17b.js";import{Y as oe,b0 as se,aZ as de,U as le,V as ce,a_ as me,b as o,ay as g,X as R,aW as ue,b4 as xe,r as fe,q as ge,W as B,O as he,aV as P,bi as S,m as pe}from"./C9otdzZM.js";import{p as be,i as ve}from"./CfNfee-Y.js";var D="position frame",N="frame positioned",k="position relation",T="relation positioned",we=o(function(e){g.debug("options str",e)},"setOptions"),ye=o(function(){return{}},"getOptions"),Pe=o(function(){C(),fe()},"clear");function C(){w={}}o(C,"reset");var Se=he.eventmodeling,ke=o(()=>ge({...Se,...B().eventmodeling}),"getConfig"),w={};function O(){let e=Fe;const{ast:n}=w,t=E();if(!n)throw new Error("No data for EventModel");return n.frames.forEach((i,a)=>{const r=L(i,n.dataEntities,t);e=v(e,{$kind:D,index:a,frame:i,textProps:r});let d;K(i)?(g.debug("source frame",i.sourceFrames),d=n.frames.filter(l=>i.sourceFrames.some(c=>c.$refText===l.name)),d.forEach(l=>{e=v(e,{$kind:k,index:a,frame:i,sourceFrame:l})})):e=v(e,{$kind:k,index:a,frame:i})}),e={...e,sortedSwimlanesArray:A(e.swimlanes)},e}o(O,"getState");function W(e){w.ast=void 0;const n=new Set;for(const t of e.frames){if(n.has(t.name)){const i=t.$cstNode?.range.start.line,a=i===void 0?"":` on line ${i+1}`;throw new Error(`Duplicate event modeling frame ID "${t.name}"${a}`)}n.add(t.name)}w.ast=e}o(W,"setAst");var s={swimlaneMinHeight:70,swimlanePadding:15,swimlaneGap:10,boxPadding:10,boxOverlap:90,boxDefaultY:0,boxMinWidth:80,boxMaxWidth:450,boxMinHeight:80,boxMaxHeight:750,contentStartX:250,textMaxWidth:430,boxTextFontWeight:"bold",boxTextPadding:10,swimlaneTextFontWeight:"bold",labelUiAutomation:"UI/Automation",labelUiAutomationPrefix:"UI/A: ",labelCommandReadModel:"Command/Read Model",labelCommandReadModelPrefix:"C/RM: ",labelEvents:"Events",labelEventsPrefix:"Stream: "};function E(){return s}o(E,"getDiagramProps");var Fe={boxes:[],swimlanes:{},relations:[],maxR:0,sortedSwimlanesArray:[]};function I(e){const n=e.split(".");if(n.length===2)return n[0]}o(I,"extractNamespace");function H(e){const n=e.split(".");return n.length===2?n[1]:e}o(H,"extractName");function U(e,n){if(!(!n||n.length===0))return Object.values(e).find(t=>t.namespace===n)}o(U,"findSwimlaneByNamespace");function b(e,n,t){return Math.max(n,...Object.keys(e).filter(i=>{const a=Number.parseInt(i);return a>n&&a<t}).map(i=>Number.parseInt(i)))+1}o(b,"findNextAvailableIndex");function _(e,n){const t=I(e.entityIdentifier),i=U(n,t);switch(e.modelEntityType){case"ui":case"pcr":case"processor":return i?{index:i.index,label:i.namespace||s.labelUiAutomation}:t?{index:b(n,0,100),label:s.labelUiAutomationPrefix+t}:{index:0,label:s.labelUiAutomation};case"rmo":case"readmodel":case"cmd":case"command":return i?{index:i.index,label:i.namespace||s.labelCommandReadModel}:t?{index:b(n,100,200),label:s.labelCommandReadModelPrefix+t}:{index:100,label:s.labelCommandReadModel};case"evt":case"event":default:return i?{index:i.index,label:i.namespace||s.labelEvents}:t?{index:b(n,200,300),label:s.labelEventsPrefix+t}:{index:200,label:s.labelEvents}}}o(_,"calculateSwimlaneProps");function V(e){const{themeVariables:n}=B();switch(e.modelEntityType){case"ui":return{fill:n.emUiFill??"white",stroke:n.emUiStroke??"#dbdada"};case"pcr":case"processor":return{fill:n.emProcessorFill??"#edb3f6",stroke:n.emProcessorStroke??"#b88cbf"};case"rmo":case"readmodel":return{fill:n.emReadModelFill??"#d3f1a2",stroke:n.emReadModelStroke??"#a3b732"};case"cmd":case"command":return{fill:n.emCommandFill??"#bcd6fe",stroke:n.emCommandStroke??"#679ac3"};case"evt":case"event":return{fill:n.emEventFill??"#ffb778",stroke:n.emEventStroke??"#c19a0f"};default:return{fill:"red",stroke:"black"}}}o(V,"calculateEntityVisualProps");function L(e,n,t){const i=B(),a=P(H(e.entityIdentifier)??"",i);let r;const d={fontSize:16,fontWeight:700,fontFamily:'"trebuchet ms", verdana, arial, sans-serif',joinWith:"<br/>"};let c=`<b>${S(a,t.textMaxWidth,d)}</b>`;if(e.dataInlineValue&&(r=e.dataInlineValue,r=r.substring(r.indexOf("{")+1),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" "," ")),e.dataReference){const p=n.find(y=>y.name===e.dataReference?.$refText);p&&(r=p.dataBlockValue,r=r.substring(r.indexOf(`{
|
|
2
2
|
`)+2),r=r.substring(0,r.lastIndexOf("}")-1),r=P(r,i),r=S(r,t.textMaxWidth,d),r=r.replaceAll(" "," "),r+="<br/>")}const m=r!==void 0;m&&(c+=`<br/><br/><code style="text-align: left; display: block;max-width:${t.textMaxWidth}px">${r}</code>`);const x={fontSize:d.fontSize,fontWeight:d.fontWeight,fontFamily:d.fontFamily},u=pe(c,x),h=m?u.width/3:u.width,f={content:c,width:h,height:u.height};return g.debug(`[${e.name}] ${e.entityIdentifier} text`,f),f}o(L,"calculateTextProps");function G(e,n){const t=n,i=V(t.frame),a={width:t.textProps.width+2*s.boxTextPadding,height:t.textProps.height+2*s.boxTextPadding};return[{$kind:N,frame:t.frame,index:t.index,visual:i,dimension:a,textProps:t.textProps}]}o(G,"decidePositionFrame");function X(e,n,t){return n===void 0?s.contentStartX:n.index===e.index&&e.r?e.r+s.boxPadding:t===void 0?s.contentStartX:t.r-s.boxOverlap+s.boxPadding}o(X,"calculateX");function Y(e,n){const t=[...e.map(i=>i.r),n];return Math.max(...t)}o(Y,"calculateMaxRight");function A(e){return Object.values(e).sort((n,t)=>n.index-t.index)}o(A,"sortedSwimlanesArray");function j(e,n){const t=n,i=_(t.frame,e.swimlanes);let a;i.index in e.swimlanes?a=e.swimlanes[i.index]:a={index:i.index,label:i.label,r:0,y:i.index*s.swimlaneMinHeight+s.swimlaneGap,height:s.swimlaneMinHeight,maxHeight:s.swimlaneMinHeight};const r=e.boxes.length>0?e.boxes[e.boxes.length-1]:void 0,d=e.previousSwimlaneNumber!==void 0?e.swimlanes[e.previousSwimlaneNumber]:void 0,l={width:Math.max(s.boxMinWidth,Math.min(s.boxMaxWidth,t.dimension.width))+2*s.boxPadding,height:Math.max(s.boxMinHeight,Math.min(s.boxMaxHeight,t.dimension.height))+2*s.boxPadding},c=X(a,d,r),m=c+l.width+s.boxPadding,x=Y(Object.values(e.swimlanes),m);a.r=c+l.width,a.maxHeight=Math.max(a.maxHeight,l.height),a.height=Math.max(s.swimlaneMinHeight,a.maxHeight)+2*s.swimlanePadding;const u={x:c,y:s.swimlanePadding+a.y,r:m,dimension:l,leftSibling:!1,swimlane:a,visual:t.visual,text:t.textProps.content,frame:t.frame,index:t.index},h={...e,boxes:[...e.boxes,u],swimlanes:{...e.swimlanes,[`${a.index}`]:a},previousSwimlaneNumber:i.index,previousFrame:t.frame,maxR:x},f=A(h.swimlanes);f.length>0&&(f[0].y=0);for(let p=1;p<f.length;p++){const y=f[p],$=f[p-1];y.y=$.y+$.height+s.swimlaneGap}return h}o(j,"evolveFramePositioned");function z(e,n){return e===0&&n.sourceFrames.length===0}o(z,"isFirstFrame");function K(e){return e.sourceFrames!==void 0&&e.sourceFrames!==null&&e.sourceFrames.length>0}o(K,"hasSourceFrame");function F(e,n){if(n!=null)return e.find(t=>t.frame.name===n.name)}o(F,"findBoxByFrame");function q(e,n,t){if(!(t<0))for(let i=t;i>=0;i--){const a=e[i];if(a.swimlane.index!==n)return a}}o(q,"findBoxByLineIndex");function Z(e,n){const t=n;if(z(t.index,t.frame))return[];const i=F(e.boxes,t.frame);if(i===void 0)throw new Error(`Target box not found for frame ${t.frame.name}`);let a;if(t.sourceFrame)a=F(e.boxes,t.sourceFrame);else{if(ve(t.frame))return[];a=q(e.boxes,i.swimlane.index,t.index-1)}return a===void 0?[]:[{$kind:T,frame:t.frame,index:t.index,sourceBox:a,targetBox:i}]}o(Z,"decidePositionRelation");function J(e,n){const t=n,i={visual:{fill:"none",stroke:"#000"},source:{x:t.sourceBox.x,y:t.sourceBox.y},target:{x:t.targetBox.x,y:t.targetBox.y},sourceBox:t.sourceBox,targetBox:t.targetBox};return{...e,relations:[...e.relations,i]}}o(J,"evolveRelationPositioned");var Me={[D]:G,[k]:Z},Be={[N]:j,[T]:J};function Q(e,n){const t=Me[n.$kind];if(t==null)return[];const i=t(e,n);return g.debug("decided events",i),i}o(Q,"decide");function ee(e,n){const t=n.reduce((i,a)=>{const r=Be[a.$kind];return r==null?i:r(i,a)},e);return g.debug("evolve events",{state:e,newState:t,events:n}),t}o(ee,"evolve");function v(e,n){const t=Q(e,n);return ee(e,t)}o(v,"dispatch");var M={getConfig:ke,preserveCommentsWhenParsing:!0,setOptions:we,getOptions:ye,clear:Pe,setAccTitle:me,getAccTitle:ce,getAccDescription:le,setAccDescription:de,setDiagramTitle:se,getDiagramTitle:oe,setAst:W,getDiagramProps:E,getState:O},Ee={parse:o(async e=>{const n=await be("eventmodeling",e);g.debug(n),M.setAst(n),re(n,M)},"parse")},Ae=R(),$e=Ae?.eventmodeling;function te(e,n){return t=>{const i=t.swimlane.y+n.swimlanePadding,a=e.append("g").attr("class","em-box");a.append("rect").attr("x",t.x).attr("y",i).attr("rx","3").attr("width",t.dimension.width).attr("height",t.dimension.height).attr("stroke",t.visual.stroke).attr("fill",t.visual.fill),a.append("foreignObject").attr("x",t.x+n.boxPadding).attr("y",i+10).attr("width",t.dimension.width-2*n.boxPadding).attr("height",t.dimension.height-2*n.boxPadding).append("xhtml:div").style("display","table").style("height","100%").style("width","100%").append("span").style("display","table-cell").style("text-align","center").style("vertical-align","middle").html(t.text)}}o(te,"renderD3Box");function ne(e,n){return e>n}o(ne,"dirUpwards");function ie(e,n,t,i){return a=>{const r=a.sourceBox.swimlane.y+n.swimlanePadding,d=a.targetBox.swimlane.y+n.swimlanePadding,l=ne(r,d),c=a.sourceBox.x+a.sourceBox.dimension.width*2/3,m=a.targetBox.x+a.targetBox.dimension.width/3;let x,u;g.debug(`rendering relation up=${l} for `,{sourceBox:a.sourceBox,targetBox:a.targetBox}),l?(x=r,u=d+a.targetBox.dimension.height):(x=r+a.sourceBox.dimension.height,u=d);const h=i.emRelationStroke??a.visual.stroke;e.append("path").attr("class","em-relation").attr("fill",a.visual.fill).attr("stroke",h).attr("stroke-width","1").attr("marker-end",`url(#${t})`).attr("d",`M${c} ${x} L${m} ${u}`)}}o(ie,"renderD3Relation");function ae(e,n,t,i){return a=>{const r=e.append("g").attr("class","em-swimlane"),d=i.emSwimlaneBackgroundOdd??"rgb(250,250,250)",l=i.emSwimlaneBackgroundStroke??"rgb(240,240,240)";r.append("rect").attr("x",0).attr("y",a.y).attr("rx","3").attr("width",n+t.swimlanePadding).attr("height",a.height).attr("fill",d).attr("stroke",l),r.append("text").attr("font-weight",t.swimlaneTextFontWeight).attr("x",30).attr("y",a.y+30).text(a.label)}}o(ae,"renderD3Swimlane");var Re=o(function(e,n,t,i){if(g.debug("in eventmodeling renderer",e+`
|
|
3
3
|
`,"id:",n,t),!$e)throw new Error("EventModeling config not found");const a=i.db,{themeVariables:r,eventmodeling:d}=R(),l=ue(`[id="${n}"]`),c=a.getDiagramProps(),m=a.getState(),x=`em-arrowhead-${n}`,u=r.emArrowhead??"#000000";m.sortedSwimlanesArray.forEach(ae(l,m.maxR,c,r)),m.boxes.forEach(te(l,c)),m.relations.forEach(ie(l,c,x,r)),l.append("defs").append("marker").attr("id",x).attr("markerWidth","10").attr("markerHeight","7").attr("refX","10").attr("refY","3.5").attr("orient","auto").append("polygon").attr("points","0 0, 10 3.5, 0 7").attr("fill",u),xe(void 0,l,d?.padding??30,d?.useMaxWidth)},"draw"),De={draw:Re},Ne=o(e=>"","getStyles"),Te=Ne,Ie={parser:Ee,db:M,renderer:De,styles:Te};export{Ie as diagram};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{g as o,r as l,d as t}from"./
|
|
1
|
+
import{g as o,r as l,d as t}from"./aCDFJfWo.js";import{p as m}from"./DAwOD17b.js";import{b as n,ay as s}from"./C9otdzZM.js";import{M as p,d as u}from"./CfNfee-Y.js";var d=u().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),y=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),g={parse:n(e=>{t.clear(),s.debug("[Railroad Parser] Starting Langium parse");const r=d.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const i=r.value;s.debug("[Railroad Parser] Parsed rules:",i.rules.length),y(i),s.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},h={parser:g,db:t,renderer:l,styles:o};export{h as diagram};
|
|
@@ -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"./fUWZZKuh.js";import{b_ as Le,c_ as le,cq as ue,cp as ve}from"./C7Y9ew7Z.js";import{IX as p,BG as we,bD as be,e as Fe,L0 as de,ie as me,bP as ke,DB as z,C3 as Ge,fc as Pe,A9 as xe,dZ as Ee,f8 as fe,dY as _e,AE as Ve,KG as Ue,wd as Be}from"./BkzMrEqG.js";import{aC as Ae,dH as he,A as H,P as ge,ay as K}from"./BEyxbMng.js";import{h as $e}from"./jhNNYE0v.js";import{c as W}from"./ChTqQfQN.js";import{a as Xe}from"./BdWqymET.js";import{k as Q}from"./DbaZdUr0.js";import"./CJxGDkBm.js";import{bm as n}from"./AeC4KVgG.js";import"./DrHJ7oPv.js";import"./Dp2nUoTL.js";import"./BNODdf6r.js";import{R as Re}from"./B5aYN90J.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,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(o);d(k)},g)})}),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=Re.DEFAULT_ATTEMPTS,retryDelay:a=Re.BASE_DELAY,exponentialBackoff:l=!0,notify:c=!1,notifyOnRetry:E=!1,context:f={},onError:u,onRetry:o,shouldRetry:R=this.defaultShouldRetry}=t;let g=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(g=h,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:f}),u?.(g,d),d<=r&&R(g)){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"}: ${g?.message}`,P=J(g?.message||n.agent_errorBoundary_generic_error()),N=g?.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:g?.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(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")c.push(R.value);else{const d=R.reason;if(E.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],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 R=c.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:c.message});break}if(R.includes("no available models")||R.includes("all models exhausted")||R.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 g=Math.random()*.2*E,d=Math.min(E+g,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,R,g=!1)=>{l&&A(Be(l.scope,l.id,o,Date.now(),R,g))};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 g=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)g.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)g.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?.[ge],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[ge]:k}:{}},N={id:me(le()),appMessageId:d,role:"user",contentBlocks:g,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"./D0VMf2Fp.js";import{b_ as Le,c_ as le,cq as ue,cp as ve}from"./B0JbhmMb.js";import{IX as p,BG as we,bD as be,e as Fe,L0 as de,ie as me,bP as ke,DB as z,C3 as Ge,fc as Pe,A9 as xe,dZ as Ee,f8 as fe,dY as _e,AE as Ve,KG as Ue,wd as Be}from"./BkzMrEqG.js";import{aC as Ae,dH as he,A as H,P as ge,ay as K}from"./BEyxbMng.js";import{h as $e}from"./jhNNYE0v.js";import{c as W}from"./ChTqQfQN.js";import{a as Xe}from"./BdWqymET.js";import{m as Q}from"./BbV7MtxC.js";import"./CJxGDkBm.js";import{bm as n}from"./AeC4KVgG.js";import"./DrHJ7oPv.js";import"./Dp2nUoTL.js";import"./BNODdf6r.js";import{R as Re}from"./B5aYN90J.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,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(o);d(k)},g)})}),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=Re.DEFAULT_ATTEMPTS,retryDelay:a=Re.BASE_DELAY,exponentialBackoff:l=!0,notify:c=!1,notifyOnRetry:E=!1,context:f={},onError:u,onRetry:o,shouldRetry:R=this.defaultShouldRetry}=t;let g=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(g=h,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:f}),u?.(g,d),d<=r&&R(g)){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"}: ${g?.message}`,P=J(g?.message||n.agent_errorBoundary_generic_error()),N=g?.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:g?.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(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")c.push(R.value);else{const d=R.reason;if(E.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],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 R=c.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:c.message});break}if(R.includes("no available models")||R.includes("all models exhausted")||R.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 g=Math.random()*.2*E,d=Math.min(E+g,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,R,g=!1)=>{l&&A(Be(l.scope,l.id,o,Date.now(),R,g))};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 g=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)g.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)g.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?.[ge],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[ge]:k}:{}},N={id:me(le()),appMessageId:d,role:"user",contentBlocks:g,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 +1 @@
|
|
|
1
|
-
import{n as i}from"./
|
|
1
|
+
import{n as i}from"./96DwTK9j.js";import{o as n}from"./D1FSU9Gk.js";import{i as o,IX as a,DT as s,v7 as r,uJ as f}from"./BkzMrEqG.js";async function m(t,e){if(!(!t||!e)){if(t===o){await i("/"),a.dispatch(s(e)),a.dispatch(r("chief"));return}await n(t)&&a.dispatch(f(t,{agentId:e}))}}export{m as n};
|