@intent-hq/web 2.383.0 → 2.383.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/{BP4Hm_tD.js → -wH-MzHg.js} +2 -2
- package/web/app/immutable/chunks/{W2WLehNu.js → 03HQb6Nz.js} +1 -1
- package/web/app/immutable/chunks/{1mf839wD.js → 1eGVa7uN.js} +1 -1
- package/web/app/immutable/chunks/{DliHiH6M.js → 1pbfqlmC.js} +4 -4
- package/web/app/immutable/chunks/{B5M0SkuR.js → 46R-6bwp.js} +1 -1
- package/web/app/immutable/chunks/{Dqdvt4Zr.js → 4lxKnD4E.js} +1 -1
- package/web/app/immutable/chunks/{hb4NYXGo.js → 5Ya2tobY.js} +1 -1
- package/web/app/immutable/chunks/{D5xMHmv3.js → B-HvfCLM.js} +1 -1
- package/web/app/immutable/chunks/{D9XKwVJX.js → B54vxPSC.js} +3 -3
- package/web/app/immutable/chunks/{BWGnuS1v.js → B6Ea_mQK.js} +1 -1
- package/web/app/immutable/chunks/{DY0qeQe8.js → B73pME8S.js} +1 -1
- package/web/app/immutable/chunks/{DE7dSDHO.js → B8eFCa5E.js} +1 -1
- package/web/app/immutable/chunks/{lVh2oAeQ.js → BALrIQ13.js} +1 -1
- package/web/app/immutable/chunks/{D3O8Vtuw.js → BBLmHF-x.js} +1 -1
- package/web/app/immutable/chunks/{eQVXRlbn.js → BCEIpZAe.js} +1 -1
- package/web/app/immutable/chunks/{DSbNJBwA.js → BDU9DorN.js} +1 -1
- package/web/app/immutable/chunks/{CE7VCun2.js → BFnrc2L0.js} +3 -3
- package/web/app/immutable/chunks/{CMrw-y4l.js → BGOOya_A.js} +13 -13
- package/web/app/immutable/chunks/{BtTA7CNV.js → BI4Gr7El.js} +1 -1
- package/web/app/immutable/chunks/{pYQh_Bw_.js → BK3I1582.js} +1 -1
- package/web/app/immutable/chunks/{puJFvQs5.js → BL78xDnE.js} +1 -1
- package/web/app/immutable/chunks/{Bu7LYnzn.js → BNsReuZq.js} +1 -1
- package/web/app/immutable/chunks/{CRs9zG2A.js → BPlFpIis.js} +1 -1
- package/web/app/immutable/chunks/{BlDljC9y.js → BQpH3OoI.js} +1 -1
- package/web/app/immutable/chunks/{DF2_1gr9.js → BTLLdzM2.js} +1 -1
- package/web/app/immutable/chunks/{0HRWclfL.js → BUAZt4k8.js} +1 -1
- package/web/app/immutable/chunks/{wIMcEpgB.js → BUtMbPHc.js} +1 -1
- package/web/app/immutable/chunks/{duDdSCAT.js → BVGxYq00.js} +1 -1
- package/web/app/immutable/chunks/{CuewocoW.js → BYf4P-Xv.js} +1 -1
- package/web/app/immutable/chunks/{lwlI9u_5.js → BYtUt_7N.js} +1 -1
- package/web/app/immutable/chunks/{BsN2abqQ.js → BaJk_Nxp.js} +1 -1
- package/web/app/immutable/chunks/{M5Dwuu-X.js → Bk0JLGzR.js} +1 -1
- package/web/app/immutable/chunks/{PO_5m99x.js → Bm_BMJ5S.js} +1 -1
- package/web/app/immutable/chunks/{nXfD7jHz.js → BnOThusB.js} +2 -2
- package/web/app/immutable/chunks/{pwJelZzH.js → BnaqhxMa.js} +1 -1
- package/web/app/immutable/chunks/{DIG1mTAN.js → Bnurq_Pf.js} +2 -2
- package/web/app/immutable/chunks/{DOEI9gYY.js → BsLGFv7V.js} +1 -1
- package/web/app/immutable/chunks/{Bn880vDO.js → BvYSMLN-.js} +1 -1
- package/web/app/immutable/chunks/{cebxNJuC.js → Bw02Klel.js} +4 -4
- package/web/app/immutable/chunks/{DWiU4388.js → BxKrk2Xm.js} +1 -1
- package/web/app/immutable/chunks/{8r75D0ru.js → C2UQ69-V.js} +1 -1
- package/web/app/immutable/chunks/{DMDFfHqn.js → C4oBHTC7.js} +3 -3
- package/web/app/immutable/chunks/{S8ugWfAx.js → C5E04JHB.js} +1 -1
- package/web/app/immutable/chunks/{B_LcgbLl.js → C5wdJ-5g.js} +1 -1
- package/web/app/immutable/chunks/{DdXBqrnq.js → C68E7oEN.js} +1 -1
- package/web/app/immutable/chunks/{BAOaoX22.js → C6aFracI.js} +1 -1
- package/web/app/immutable/chunks/{wUSGg9l9.js → C9nDXeDI.js} +1 -1
- package/web/app/immutable/chunks/{CXS2Ba3S.js → CBvXBpaM.js} +1 -1
- package/web/app/immutable/chunks/{COhRCR9P.js → CCMszM-p.js} +2 -2
- package/web/app/immutable/chunks/{B2kb4xeF.js → CCNu9Rxf.js} +1 -1
- package/web/app/immutable/chunks/{DVROSXw1.js → CCOwocDi.js} +1 -1
- package/web/app/immutable/chunks/{BURZJh0r.js → CCsFilO2.js} +1 -1
- package/web/app/immutable/chunks/{k0JmlCVk.js → CDTDaiWd.js} +1 -1
- package/web/app/immutable/chunks/{DWWC1JsA.js → CERS_x_a.js} +1 -1
- package/web/app/immutable/chunks/{AlEhxd2n.js → CHJf6CKw.js} +1 -1
- package/web/app/immutable/chunks/{Ct_q9q1G.js → CKjDn57H.js} +1 -1
- package/web/app/immutable/chunks/{DO19lrhU.js → CMW1kPYq.js} +1 -1
- package/web/app/immutable/chunks/{3xK9OOJy.js → COs0nq_h.js} +1 -1
- package/web/app/immutable/chunks/{BeNn_MBw.js → CPfM5J_u.js} +1 -1
- package/web/app/immutable/chunks/{Db3Wob9h.js → CRmihGrZ.js} +1 -1
- package/web/app/immutable/chunks/{DlJZrxef.js → CTKRrTvZ.js} +2 -2
- package/web/app/immutable/chunks/{DLbcryNV.js → CU2vyfYu.js} +1 -1
- package/web/app/immutable/chunks/{CxOmNieJ.js → CaOXszWh.js} +1 -1
- package/web/app/immutable/chunks/{C0I_aIej.js → CecaUouy.js} +2 -2
- package/web/app/immutable/chunks/{DIFhl0he.js → CfqtYdKm.js} +1 -1
- package/web/app/immutable/chunks/{C_78iNNC.js → Ci6sHn75.js} +1 -1
- package/web/app/immutable/chunks/{L4HdMFBq.js → CjoAn_VO.js} +1 -1
- package/web/app/immutable/chunks/{DeHvIzqj.js → CkJj_XU1.js} +2 -2
- package/web/app/immutable/chunks/{C5yhcKTW.js → ClJH5EDU.js} +1 -1
- package/web/app/immutable/chunks/{DGa13zF2.js → Cq8vwNeW.js} +1 -1
- package/web/app/immutable/chunks/{DvSURWC2.js → CqaNT709.js} +3 -3
- package/web/app/immutable/chunks/{DMQmPhTl.js → CtxKEpQR.js} +1 -1
- package/web/app/immutable/chunks/{baWz1QxB.js → Cv4Nh90j.js} +1 -1
- package/web/app/immutable/chunks/{DlliJA4a.js → D3326bvN.js} +3 -3
- package/web/app/immutable/chunks/{BX-LCSle.js → D7OzCs6b.js} +1 -1
- package/web/app/immutable/chunks/{B2f9w8eB.js → D89oEjt1.js} +1 -1
- package/web/app/immutable/chunks/{Cmq0pZIQ.js → D9PsslUR.js} +2 -2
- package/web/app/immutable/chunks/{Ba8ctcpl.js → DBUDGVnq.js} +1 -1
- package/web/app/immutable/chunks/{CYtPXqgK.js → DF4N7xKD.js} +1 -1
- package/web/app/immutable/chunks/{68Tuqjp3.js → DJ7NuUn9.js} +1 -1
- package/web/app/immutable/chunks/{Cs2lHsyA.js → DKAEb0Nq.js} +1 -1
- package/web/app/immutable/chunks/{BJ_CKcUH.js → DKN2oFQh.js} +1 -1
- package/web/app/immutable/chunks/{jcl0zObl.js → DMis7v6J.js} +2 -2
- package/web/app/immutable/chunks/{BG9tvqwj.js → DOBbyUSI.js} +1 -1
- package/web/app/immutable/chunks/{CPTZJWC9.js → DOTkiVAt.js} +1 -1
- package/web/app/immutable/chunks/{BJWt3PU_.js → DPTJGt-4.js} +1 -1
- package/web/app/immutable/chunks/{p9X2tUBM.js → DQK1MQRy.js} +1 -1
- package/web/app/immutable/chunks/{BA-rwlhs.js → DRJrqXOC.js} +1 -1
- package/web/app/immutable/chunks/{C8HkqBCb.js → DTKdf69M.js} +1 -1
- package/web/app/immutable/chunks/{BFIcslMA.js → DU6GzJo7.js} +1 -1
- package/web/app/immutable/chunks/{BO_DS0RP.js → DUrqr-_9.js} +1 -1
- package/web/app/immutable/chunks/{Bir0Y4gf.js → DWKRk5qT.js} +1 -1
- package/web/app/immutable/chunks/{CuW3cq2w.js → DYAwS63B.js} +1 -1
- package/web/app/immutable/chunks/{DEVX5wOm.js → DYw-jZnX.js} +2 -2
- package/web/app/immutable/chunks/{Bs2WE18g.js → DaA4cwB7.js} +1 -1
- package/web/app/immutable/chunks/{CPQ-kfy2.js → DbhHGGnX.js} +1 -1
- package/web/app/immutable/chunks/{UhL0ohiG.js → Dc-K8gB4.js} +1 -1
- package/web/app/immutable/chunks/{CAgnBDaV.js → DgKxSqnb.js} +3 -3
- package/web/app/immutable/chunks/{DPA45OJk.js → DhFCW7ui.js} +1 -1
- package/web/app/immutable/chunks/{DUIwUF5m.js → Doz22Fw6.js} +1 -1
- package/web/app/immutable/chunks/{D_ovLyyd.js → DqVxq9qz.js} +1 -1
- package/web/app/immutable/chunks/{Csc9ETIC.js → DqnZckLn.js} +1 -1
- package/web/app/immutable/chunks/{U_OQY9n3.js → DtEcb9Kl.js} +1 -1
- package/web/app/immutable/chunks/{jn4zbMQy.js → DynK7LpZ.js} +1 -1
- package/web/app/immutable/chunks/{DpHn84BV.js → HnXWs0wn.js} +1 -1
- package/web/app/immutable/chunks/{9bukzQMK.js → ML4TWB19.js} +1 -1
- package/web/app/immutable/chunks/{DpyfxjgC.js → MpqcTAsG.js} +1 -1
- package/web/app/immutable/chunks/{Bz7R1ahj.js → NV_vO3Eg.js} +4 -4
- package/web/app/immutable/chunks/{BETzmOvF.js → OKklWV7_.js} +1 -1
- package/web/app/immutable/chunks/{9gSjzhYc.js → SQ1JAgBB.js} +1 -1
- package/web/app/immutable/chunks/{CFvBUo4R.js → TLXVPYri.js} +3 -3
- package/web/app/immutable/chunks/{CEgeN2ws.js → TkG8RZHk.js} +1 -1
- package/web/app/immutable/chunks/{BwG2vfja.js → VQuhn_Lt.js} +1 -1
- package/web/app/immutable/chunks/{BUQUek8g.js → YJiBWTwd.js} +1 -1
- package/web/app/immutable/chunks/{CtNkh9GR.js → _Yaq9uZY.js} +1 -1
- package/web/app/immutable/chunks/{ChTVnFH2.js → aR25fz44.js} +1 -1
- package/web/app/immutable/chunks/{IQ13JH5A.js → dbsKZB4V.js} +1 -1
- package/web/app/immutable/chunks/{DjxLojU4.js → g9tUAsNS.js} +1 -1
- package/web/app/immutable/chunks/{BmUPAQa9.js → gMS62uii.js} +1 -1
- package/web/app/immutable/chunks/{CrkMZYjb.js → g_W_KtW7.js} +1 -1
- package/web/app/immutable/chunks/{BfvZe-kN.js → hSGzq1Th.js} +6 -6
- package/web/app/immutable/chunks/{DK-ttWlY.js → kLtCLkab.js} +1 -1
- package/web/app/immutable/chunks/mEP1tNc7.js +10 -0
- package/web/app/immutable/chunks/{eTsHzcIE.js → pWMJoQQd.js} +3 -3
- package/web/app/immutable/chunks/{BSKf8bnG.js → sSkm7u9g.js} +1 -1
- package/web/app/immutable/chunks/{sdV4t8T0.js → t_AdNc5B.js} +1 -1
- package/web/app/immutable/chunks/{DFcppVBl.js → yOorim_l.js} +1 -1
- package/web/app/immutable/entry/{app.PfV9Bd5g.js → app.D9Jtjo9u.js} +2 -2
- package/web/app/immutable/entry/start.CkN6A8cF.js +1 -0
- package/web/app/immutable/nodes/{0.N3QFhxpx.js → 0.D7G8zYtJ.js} +1 -1
- package/web/app/immutable/nodes/{1.Cuki-Q-c.js → 1.CeP6l7to.js} +1 -1
- package/web/app/immutable/nodes/{10.CzZBTiyD.js → 10.B0HUYmSO.js} +4 -4
- package/web/app/immutable/nodes/{11.Cc53X5P2.js → 11.DK72_yYq.js} +1 -1
- package/web/app/immutable/nodes/{15.D2GMHiSb.js → 15.u_u2o_gG.js} +1 -1
- package/web/app/immutable/nodes/{19.DvFJngD4.js → 19.Ckyt7QSw.js} +2 -2
- package/web/app/immutable/nodes/{2.B94-26jU.js → 2.B6dSCynl.js} +4 -4
- package/web/app/immutable/nodes/{3.D7lbuuWp.js → 3.BYMfscY7.js} +1 -1
- package/web/app/immutable/nodes/{4.YSZzuDIT.js → 4.BbNp4BGO.js} +1 -1
- package/web/app/immutable/nodes/{5.ymicNL_Y.js → 5.BY-7-cOX.js} +1 -1
- package/web/app/immutable/nodes/{6.CtS0PFqR.js → 6.CgyQkAW2.js} +1 -1
- package/web/app/immutable/nodes/{7.BVAyauMB.js → 7.573udsYL.js} +1 -1
- package/web/app/immutable/nodes/{8.CHlBOO6u.js → 8.CRV-jSmC.js} +1 -1
- package/web/app/immutable/nodes/{9.CNAqB0x1.js → 9.BWV1lf5B.js} +4 -4
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/chunks/4BrIaRe_.js +0 -10
- package/web/app/immutable/entry/start.kviRYMjm.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{g as ae}from"./
|
|
1
|
+
import{g as ae}from"./BALrIQ13.js";import{s as ce}from"./4lxKnD4E.js";import{b as l,ay as C,a1 as le,aP as he,W as de,O as G,X as B,aV as F,a8 as ge,an as ue,au as pe,H as fe}from"./Bw02Klel.js";var Y=(function(){var n=l(function(x,s,i,o){for(i=i||{},o=x.length;o--;i[x[o]]=s);return i},"o"),e=[1,4],a=[1,13],d=[1,12],t=[1,15],h=[1,16],u=[1,20],m=[1,19],E=[6,7,8],_=[1,26],D=[1,24],w=[1,25],g=[6,7,11],R=[1,6,13,15,16,19,22],q=[1,33],J=[1,34],A=[1,6,7,11,13,15,16,19,22],j={trace:l(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mindMap:4,spaceLines:5,SPACELINE:6,NL:7,MINDMAP:8,document:9,stop:10,EOF:11,statement:12,SPACELIST:13,node:14,ICON:15,CLASS:16,nodeWithId:17,nodeWithoutId:18,NODE_DSTART:19,NODE_DESCR:20,NODE_DEND:21,NODE_ID:22,$accept:0,$end:1},terminals_:{2:"error",6:"SPACELINE",7:"NL",8:"MINDMAP",11:"EOF",13:"SPACELIST",15:"ICON",16:"CLASS",19:"NODE_DSTART",20:"NODE_DESCR",21:"NODE_DEND",22:"NODE_ID"},productions_:[0,[3,1],[3,2],[5,1],[5,2],[5,2],[4,2],[4,3],[10,1],[10,1],[10,1],[10,2],[10,2],[9,3],[9,2],[12,2],[12,2],[12,2],[12,1],[12,1],[12,1],[12,1],[12,1],[14,1],[14,1],[18,3],[17,1],[17,4]],performAction:l(function(s,i,o,c,f,r,$){var p=r.length-1;switch(f){case 6:case 7:return c;case 8:c.getLogger().trace("Stop NL ");break;case 9:c.getLogger().trace("Stop EOF ");break;case 11:c.getLogger().trace("Stop NL2 ");break;case 12:c.getLogger().trace("Stop EOF2 ");break;case 15:c.getLogger().info("Node: ",r[p].id),c.addNode(r[p-1].length,r[p].id,r[p].descr,r[p].type);break;case 16:c.getLogger().trace("Icon: ",r[p]),c.decorateNode({icon:r[p]});break;case 17:case 21:c.decorateNode({class:r[p]});break;case 18:c.getLogger().trace("SPACELIST");break;case 19:c.getLogger().trace("Node: ",r[p].id),c.addNode(0,r[p].id,r[p].descr,r[p].type);break;case 20:c.decorateNode({icon:r[p]});break;case 25:c.getLogger().trace("node found ..",r[p-2]),this.$={id:r[p-1],descr:r[p-1],type:c.getType(r[p-2],r[p])};break;case 26:this.$={id:r[p],descr:r[p],type:c.nodeType.DEFAULT};break;case 27:c.getLogger().trace("node found ..",r[p-3]),this.$={id:r[p-3],descr:r[p-1],type:c.getType(r[p-2],r[p])};break}},"anonymous"),table:[{3:1,4:2,5:3,6:[1,5],8:e},{1:[3]},{1:[2,1]},{4:6,6:[1,7],7:[1,8],8:e},{6:a,7:[1,10],9:9,12:11,13:d,14:14,15:t,16:h,17:17,18:18,19:u,22:m},n(E,[2,3]),{1:[2,2]},n(E,[2,4]),n(E,[2,5]),{1:[2,6],6:a,12:21,13:d,14:14,15:t,16:h,17:17,18:18,19:u,22:m},{6:a,9:22,12:11,13:d,14:14,15:t,16:h,17:17,18:18,19:u,22:m},{6:_,7:D,10:23,11:w},n(g,[2,22],{17:17,18:18,14:27,15:[1,28],16:[1,29],19:u,22:m}),n(g,[2,18]),n(g,[2,19]),n(g,[2,20]),n(g,[2,21]),n(g,[2,23]),n(g,[2,24]),n(g,[2,26],{19:[1,30]}),{20:[1,31]},{6:_,7:D,10:32,11:w},{1:[2,7],6:a,12:21,13:d,14:14,15:t,16:h,17:17,18:18,19:u,22:m},n(R,[2,14],{7:q,11:J}),n(A,[2,8]),n(A,[2,9]),n(A,[2,10]),n(g,[2,15]),n(g,[2,16]),n(g,[2,17]),{20:[1,35]},{21:[1,36]},n(R,[2,13],{7:q,11:J}),n(A,[2,11]),n(A,[2,12]),{21:[1,37]},n(g,[2,25]),n(g,[2,27])],defaultActions:{2:[2,1],6:[2,2]},parseError:l(function(s,i){if(i.recoverable)this.trace(s);else{var o=new Error(s);throw o.hash=i,o}},"parseError"),parse:l(function(s){var i=this,o=[0],c=[],f=[null],r=[],$=this.table,p="",M=0,K=0,ie=2,Q=1,se=r.slice.call(arguments,1),y=Object.create(this.lexer),v={yy:{}};for(var H in this.yy)Object.prototype.hasOwnProperty.call(this.yy,H)&&(v.yy[H]=this.yy[H]);y.setInput(s,v.yy),v.yy.lexer=y,v.yy.parser=this,typeof y.yylloc>"u"&&(y.yylloc={});var W=y.yylloc;r.push(W);var re=y.options&&y.options.ranges;typeof v.yy.parseError=="function"?this.parseError=v.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function oe(b){o.length=o.length-2*b,f.length=f.length-b,r.length=r.length-b}l(oe,"popStack");function Z(){var b;return b=c.pop()||y.lex()||Q,typeof b!="number"&&(b instanceof Array&&(c=b,b=c.pop()),b=i.symbols_[b]||b),b}l(Z,"lex");for(var k,T,S,X,O={},U,N,ee,V;;){if(T=o[o.length-1],this.defaultActions[T]?S=this.defaultActions[T]:((k===null||typeof k>"u")&&(k=Z()),S=$[T]&&$[T][k]),typeof S>"u"||!S.length||!S[0]){var z="";V=[];for(U in $[T])this.terminals_[U]&&U>ie&&V.push("'"+this.terminals_[U]+"'");y.showPosition?z="Parse error on line "+(M+1)+`:
|
|
2
2
|
`+y.showPosition()+`
|
|
3
3
|
Expecting `+V.join(", ")+", got '"+(this.terminals_[k]||k)+"'":z="Parse error on line "+(M+1)+": Unexpected "+(k==Q?"end of input":"'"+(this.terminals_[k]||k)+"'"),this.parseError(z,{text:y.match,token:this.terminals_[k]||k,line:y.yylineno,loc:W,expected:V})}if(S[0]instanceof Array&&S.length>1)throw new Error("Parse Error: multiple actions possible at state: "+T+", token: "+k);switch(S[0]){case 1:o.push(k),f.push(y.yytext),r.push(y.yylloc),o.push(S[1]),k=null,K=y.yyleng,p=y.yytext,M=y.yylineno,W=y.yylloc;break;case 2:if(N=this.productions_[S[1]][1],O.$=f[f.length-N],O._$={first_line:r[r.length-(N||1)].first_line,last_line:r[r.length-1].last_line,first_column:r[r.length-(N||1)].first_column,last_column:r[r.length-1].last_column},re&&(O._$.range=[r[r.length-(N||1)].range[0],r[r.length-1].range[1]]),X=this.performAction.apply(O,[p,K,M,v.yy,S[1],f,r].concat(se)),typeof X<"u")return X;N&&(o=o.slice(0,-1*N*2),f=f.slice(0,-1*N),r=r.slice(0,-1*N)),o.push(this.productions_[S[1]][0]),f.push(O.$),r.push(O._$),ee=$[o[o.length-2]][o[o.length-1]],o.push(ee);break;case 3:return!0}}return!0},"parse")},ne=(function(){var x={EOF:1,parseError:l(function(i,o){if(this.yy.parser)this.yy.parser.parseError(i,o);else throw new Error(i)},"parseError"),setInput:l(function(s,i){return this.yy=i||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:l(function(){var s=this._input[0];this.yytext+=s,this.yyleng++,this.offset++,this.match+=s,this.matched+=s;var i=s.match(/(?:\r\n?|\n).*/g);return i?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),s},"input"),unput:l(function(s){var i=s.length,o=s.split(/(?:\r\n?|\n)/g);this._input=s+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-i),this.offset-=i;var c=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),o.length-1&&(this.yylineno-=o.length-1);var f=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:o?(o.length===c.length?this.yylloc.first_column:0)+c[c.length-o.length].length-o[0].length:this.yylloc.first_column-i},this.options.ranges&&(this.yylloc.range=[f[0],f[0]+this.yyleng-i]),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(s){this.unput(this.match.slice(s))},"less"),pastInput:l(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:l(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:l(function(){var s=this.pastInput(),i=new Array(s.length+1).join("-");return s+this.upcomingInput()+`
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/
|
|
2
|
-
var em=Object.defineProperty;var Kl=n=>{throw TypeError(n)};var tm=(n,e,t)=>e in n?em(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var tt=(n,e,t)=>tm(n,typeof e!="symbol"?e+"":e,t),nm=(n,e,t)=>e.has(n)||Kl("Cannot "+t);var Fn=(n,e,t)=>(nm(n,e,"read from private field"),t?t.call(n):e.get(n)),$i=(n,e,t)=>e.has(n)?Kl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t);import{t as Wt,bo as L,bw as jt,b as Kt,bp as rm,bm as se,bq as im,bs as sm,_ as Hi}from"./C0QTy0Sy.js";import{bs as Ut,b_ as ie,W as K,bn as qt,aA as P,aC as Zu,br as la,bb as Zr,c3 as wn,aG as om,bk as ed,a7 as wr,ay as Bt,c0 as td,a5 as ye,aD as p,bA as ue,bS as oe,aw as am,bH as me,c9 as $,bV as qe,aB as te,ai as io,ca as bt,aj as Kn,bl as Me,bO as ge,bo as Ka,bj as nd,be as rd,b$ as id,bf as lm,c5 as vn}from"./3SdAC2_C.js";import{c as Lo}from"./CUkDMZwP.js";import{s as St,f as pn,c as ca,b as cm,g as hi,e as um}from"./7UPrdiE9.js";import{b as Er}from"./Dn334wJv.js";import{i as dm}from"./BAKPnd3w.js";import{d2 as fm,aF as hm,aT as Ul}from"./DVROSXw1.js";import{a as pm}from"./CC7to1B5.js";import{aT as mm,aB as gm,ao as ym,aw as bm,ab as vm,f as nn,ae as sd,a1 as km}from"./FzlZUztb.js";import{i as Se}from"./bhKPSdq4.js";import{F as tn,bb as xm,bv as Ua,bh as od,v as wm,bE as Sm,d3 as Cm,aI as ql,bg as vr,bn as Sr,cZ as ad,cW as Mm,cn as ld,cK as cd,ak as Em,av as ud,ay as Jl,ap as Tm,aj as Am,as as Nm,cX as Om,aZ as Im,aN as Po,co as Rm,bx as Dm,cb as Lm,cy as Gl,Y as Pm,cH as _m,at as Bm,bU as zm,aq as $m,c7 as Hm,bN as Fm,c_ as Vm,al as Wm,bl as jm,bF as Km,a$ as Um,d2 as qm,am as Jm,bS as Gm,aT as Xm,b0 as Ym,c1 as Qm,bd as Zm,cx as eg,cD as tg,bR as ng,bo as rg,bi as Xl}from"./U9jJmfYa.js";import{t as ig}from"./CrD0jtXE.js";import{e as sg}from"./BFEzojY2.js";import{b as og,V as Yl,c as ag,p as lg,m as cg,s as ug}from"./Ba8ctcpl.js";import{h as dg}from"./DCRuihKm.js";import{g as kr,i as fg}from"./B6S6VNu7.js";import{L as hg,S as pg,T as dd}from"./BeOwB_6G.js";import{n as mg,l as ps}from"./CE7dsja4.js";import{h as gg}from"./DIG1mTAN.js";import{bq as yg}from"./tr-2J8Mf.js";import{g as bg}from"./OFhgRaUm.js";import{c as qa,l as pe}from"./ChTqQfQN.js";import{n as Ql,l as vg,c as kg}from"./DLwWVKiF.js";import{$ as fd,a0 as xg,p as ua,aO as wg,am as Sg,a1 as Cg,e9 as Mg,a9 as Eg}from"./BaujsV9k.js";import{i as cn,M as Tg,D as Ag,s as _o,a as Ng,p as lr}from"./BP4Hm_tD.js";import{A as Og,b as Ig}from"./BYq9VtBF.js";import{P as Rg}from"./ujhgjK1k.js";import{a as hd}from"./QeBH-DWE.js";import{g as Zl}from"./yFcbscNn.js";import{H as Dg}from"./Bqd7fdCF.js";import{q as Lg}from"./fiz8N_zQ.js";import{b as Pg,P as _g}from"./BP5uGGO_.js";var Bg=Zu('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"></path></svg>');function pd(n,e){if(new.target)return Wt({component:pd,...n});Ut(e,!0);let t=L(e,"size",7,16),r=L(e,"class",7,"");var i={get size(){return t()},set size(o=16){t(o),P()},get class(){return r()},set class(o=""){r(o),P()},$set:jt,$on:(o,a)=>Kt(e,o,a)},s=Bg();return ie(()=>{St(s,"width",t()),St(s,"height",t()),pn(s,0,ca(r()))}),K(n,s),qt(i)}var ec=Object.defineProperty,zg=(n,e)=>{let t={};for(var r in n)ec(t,r,{get:n[r],enumerable:!0});return ec(t,Symbol.toStringTag,{value:"Module"}),t};function vt(n){this.content=n}vt.prototype={constructor:vt,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),s=r.content.slice();return i==-1?s.push(t||n,e):(s[i+1]=e,t&&(s[i]=t)),new vt(s)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new vt(t)},addToStart:function(n,e){return new vt([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new vt(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),s=r.find(n);return i.splice(s==-1?i.length:s,0,e,t),new vt(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=vt.from(n),n.size?new vt(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=vt.from(n),n.size?new vt(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=vt.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};vt.from=function(n){if(n instanceof vt)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new vt(e)};function md(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),s=e.child(r);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){let o=i.text,a=s.text,l=0;for(;o[l]==a[l];l++)t++;return l&&l<o.length&&l<a.length&&bd(o.charCodeAt(l-1))&&yd(o.charCodeAt(l))&&t--,t}if(i.content.size||s.content.size){let o=md(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function gd(n,e,t,r){for(let i=n.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:r};let o=n.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){t-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:t,b:r};if(o.isText&&o.text!=a.text){let c=o.text,u=a.text,d=c.length,f=u.length;for(;d>0&&f>0&&c[d-1]==u[f-1];)d--,f--,t--,r--;return d&&f&&d<c.length&&bd(c.charCodeAt(d-1))&&yd(c.charCodeAt(d))&&(t++,r++),{a:t,b:r}}if(o.content.size||a.content.size){let c=gd(o.content,a.content,t-1,r-1);if(c)return c}t-=l,r-=l}}function yd(n){return n>=56320&&n<57344}function bd(n){return n>=55296&&n<56320}class M{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,s){for(let o=0,a=0;a<t;o++){let l=this.content[o],c=a+l.nodeSize;if(c>e&&r(l,i+a,s||null,o)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,t-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let s="",o=!0;return this.nodesBetween(e,t,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new M(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let s=0,o=0;o<t;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>t)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,t-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,t-o-1))),r.push(a),i+=a.nodeSize),o=l}return new M(r,i)}cutByIndex(e,t){return e==t?M.empty:e==0&&t==this.content.length?this:new M(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new M(i,s)}addToStart(e){return new M([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new M(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return md(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return gd(this,e,t,r)}findIndex(e){if(e==0)return Fi(0,e);if(e==this.size)return Fi(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let i=this.child(t),s=r+i.nodeSize;if(s>=e)return s==e?Fi(t+1,s):Fi(t,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return M.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return M.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return M.empty;let t,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new M(t||e,r)}static from(e){if(!e)return M.empty;if(e instanceof M)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new M([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}M.empty=new M([],0);const Bo={index:0,offset:0};function Fi(n,e){return Bo.index=n,Bo.offset=e,Bo}function ms(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!ms(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!ms(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Le=class da{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(s)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ms(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return da.none;if(e instanceof da)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Le.none=[];class pi extends Error{}class W{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=kd(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return r&&new W(r,this.openStart,this.openEnd)}removeBetween(e,t){return new W(vd(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return W.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new W(M.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new W(e,r,i)}}W.empty=new W(M.empty,0,0);function vd(n,e,t){let{index:r,offset:i}=n.findIndex(e),s=n.maybeChild(r),{index:o,offset:a}=n.findIndex(t);if(i==e||s.isText){if(a!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,s.copy(vd(s.content,e-i-1,t-i-1)))}function kd(n,e,t,r,i,s){let{index:o,offset:a}=n.findIndex(e),l=n.maybeChild(o);if(a==e||l.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let c=kd(l.content,e-a-1,t,o==0?r-1:0,o==n.childCount-1?i-1:0,l);return c&&n.replaceChild(o,l.copy(c))}function $g(n,e,t){if(t.openStart>n.depth)throw new pi("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new pi("Inconsistent open depths");return xd(n,e,t,0)}function xd(n,e,t,r){let i=n.index(r),s=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let o=xd(n,e,t,r+1);return s.copy(s.content.replaceChild(i,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,a=o.content;return Yn(o,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=Hg(t,n);return Yn(s,Sd(n,o,a,e,r))}else return Yn(s,gs(n,e,r))}function wd(n,e){if(!e.type.compatibleContent(n.type))throw new pi("Cannot join "+e.type.name+" onto "+n.type.name)}function fa(n,e,t){let r=n.node(t);return wd(r,e.node(t)),r}function Xn(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function ei(n,e,t,r){let i=(e||n).node(t),s=0,o=e?e.index(t):i.childCount;n&&(s=n.index(t),n.depth>t?s++:n.textOffset&&(Xn(n.nodeAfter,r),s++));for(let a=s;a<o;a++)Xn(i.child(a),r);e&&e.depth==t&&e.textOffset&&Xn(e.nodeBefore,r)}function Yn(n,e){if(!n.type.validContent(e))throw new pi("Invalid content for node "+n.type.name);return n.copy(e)}function Sd(n,e,t,r,i){let s=n.depth>i&&fa(n,e,i+1),o=r.depth>i&&fa(t,r,i+1),a=[];return ei(null,n,i,a),s&&o&&e.index(i)==t.index(i)?(wd(s,o),Xn(Yn(s,Sd(n,e,t,r,i+1)),a)):(s&&Xn(Yn(s,gs(n,e,i+1)),a),ei(e,t,i,a),o&&Xn(Yn(o,gs(t,r,i+1)),a)),ei(r,null,i,a),new M(a)}function gs(n,e,t){let r=[];if(ei(null,n,t,r),n.depth>t){let i=fa(n,e,t+1);Xn(Yn(i,gs(n,e,t+1)),r)}return ei(e,null,t,r),new M(r)}function Hg(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(M.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class mi{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Le.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let a=r;r=i,i=a}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new ys(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,s=t;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),c=s-l;if(r.push(o,a,i+l),!c||(o=o.child(a),o.isText))break;s=c-1,i+=l+1}return new mi(t,r,s)}static resolveCached(e,t){let r=tc.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==t)return o}else tc.set(e,r=new Fg);let i=r.elts[r.i]=mi.resolve(e,t);return r.i=(r.i+1)%Vg,i}}class Fg{constructor(){this.elts=[],this.i=0}}const Vg=12,tc=new WeakMap;class ys{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Wg=Object.create(null);let In=class ha{constructor(e,t,r,i=Le.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||M.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&ms(this.attrs,t||e.defaultAttrs||Wg)&&Le.sameSet(this.marks,r||Le.none)}copy(e=null){return e==this.content?this:new ha(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ha(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return W.empty;let i=this.resolve(e),s=this.resolve(t),o=r?0:i.sharedDepth(t),a=i.start(o),c=i.node(o).content.cut(i.pos-a,s.pos-a);return new W(c,i.depth-o,s.depth-o)}replace(e,t,r){return $g(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return mi.resolveCached(this,e)}resolveNoCache(e){return mi.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Cd(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=M.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),rc(this.type.attrs,this.attrs,"node",this.type.name);let e=Le.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];rc(r.type.attrs,r.attrs,"mark",r.type.name),e=r.addToSet(e)}if(!Le.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=M.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};In.prototype.text=void 0;const nc=(()=>{let{stack:n}=new Error("/");if(!n||!/\n\s*at\s/.test(n))return t=>t;let e=Object.create(null);return t=>(e[t],t)})();class bs extends In{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Cd(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return nc(this.text.slice(e,t))}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new bs(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new bs(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(nc(this.text.slice(e,t)))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Cd(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}function rc(n,e,t,r){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${r}`);for(let i in n)n[i].validate&&n[i].validate(e[i])}class er{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new jg(e,t);if(r.next==null)return er.empty;let i=Md(r);r.next&&r.err("Unexpected trailing text");let s=Yg(Xg(i));return Qg(s,r),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let s=t;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function s(o,a){let l=o.matchFragment(e,r);if(l&&(!t||l.validEnd))return M.from(a.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let f=s(d,a.concat(u));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/CkJj_XU1.js","/app/immutable/chunks/C0QTy0Sy.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/BmTMWrby.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/bhKPSdq4.js","/app/immutable/chunks/7UPrdiE9.js","/app/immutable/chunks/CrD0jtXE.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/FzlZUztb.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/B6S6VNu7.js","/app/immutable/chunks/DCRuihKm.js","/app/immutable/chunks/C7LIHk5_.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/CUkDMZwP.js","/app/immutable/chunks/-K3ARgq0.js","/app/immutable/chunks/CE7dsja4.js","/app/immutable/chunks/B4SiDSWP.js","/app/immutable/chunks/tr-2J8Mf.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/DX-Wrapd.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/U9jJmfYa.js","/app/immutable/chunks/DLwWVKiF.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/BaujsV9k.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/L_tYoUCb.js","/app/immutable/chunks/S845NCb3.js","/app/immutable/chunks/DwL1A1su.js","/app/immutable/chunks/B8eFCa5E.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/hSGzq1Th.js","/app/immutable/chunks/B6Ea_mQK.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/CCMszM-p.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/DOTkiVAt.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var em=Object.defineProperty;var Kl=n=>{throw TypeError(n)};var tm=(n,e,t)=>e in n?em(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var tt=(n,e,t)=>tm(n,typeof e!="symbol"?e+"":e,t),nm=(n,e,t)=>e.has(n)||Kl("Cannot "+t);var Fn=(n,e,t)=>(nm(n,e,"read from private field"),t?t.call(n):e.get(n)),$i=(n,e,t)=>e.has(n)?Kl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t);import{t as Wt,bo as L,bw as jt,b as Kt,bp as rm,bm as se,bq as im,bs as sm,_ as Hi}from"./C0QTy0Sy.js";import{bs as Ut,b_ as ie,W as K,bn as qt,aA as P,aC as Zu,br as la,bb as Zr,c3 as wn,aG as om,bk as ed,a7 as wr,ay as Bt,c0 as td,a5 as ye,aD as p,bA as ue,bS as oe,aw as am,bH as me,c9 as $,bV as qe,aB as te,ai as io,ca as bt,aj as Kn,bl as Me,bO as ge,bo as Ka,bj as nd,be as rd,b$ as id,bf as lm,c5 as vn}from"./3SdAC2_C.js";import{c as Lo}from"./CUkDMZwP.js";import{s as St,f as pn,c as ca,b as cm,g as hi,e as um}from"./7UPrdiE9.js";import{b as Er}from"./Dn334wJv.js";import{i as dm}from"./BAKPnd3w.js";import{d2 as fm,aF as hm,aT as Ul}from"./CCOwocDi.js";import{a as pm}from"./CC7to1B5.js";import{aT as mm,aB as gm,ao as ym,aw as bm,ab as vm,f as nn,ae as sd,a1 as km}from"./FzlZUztb.js";import{i as Se}from"./bhKPSdq4.js";import{F as tn,bb as xm,bv as Ua,bh as od,v as wm,bE as Sm,d3 as Cm,aI as ql,bg as vr,bn as Sr,cZ as ad,cW as Mm,cn as ld,cK as cd,ak as Em,av as ud,ay as Jl,ap as Tm,aj as Am,as as Nm,cX as Om,aZ as Im,aN as Po,co as Rm,bx as Dm,cb as Lm,cy as Gl,Y as Pm,cH as _m,at as Bm,bU as zm,aq as $m,c7 as Hm,bN as Fm,c_ as Vm,al as Wm,bl as jm,bF as Km,a$ as Um,d2 as qm,am as Jm,bS as Gm,aT as Xm,b0 as Ym,c1 as Qm,bd as Zm,cx as eg,cD as tg,bR as ng,bo as rg,bi as Xl}from"./U9jJmfYa.js";import{t as ig}from"./CrD0jtXE.js";import{e as sg}from"./BFEzojY2.js";import{b as og,V as Yl,c as ag,p as lg,m as cg,s as ug}from"./DBUDGVnq.js";import{h as dg}from"./DCRuihKm.js";import{g as kr,i as fg}from"./B6S6VNu7.js";import{L as hg,S as pg,T as dd}from"./BeOwB_6G.js";import{n as mg,l as ps}from"./CE7dsja4.js";import{h as gg}from"./Bnurq_Pf.js";import{bq as yg}from"./tr-2J8Mf.js";import{g as bg}from"./OFhgRaUm.js";import{c as qa,l as pe}from"./ChTqQfQN.js";import{n as Ql,l as vg,c as kg}from"./DLwWVKiF.js";import{$ as fd,a0 as xg,p as ua,aO as wg,am as Sg,a1 as Cg,e9 as Mg,a9 as Eg}from"./BaujsV9k.js";import{i as cn,M as Tg,D as Ag,s as _o,a as Ng,p as lr}from"./-wH-MzHg.js";import{A as Og,b as Ig}from"./BYq9VtBF.js";import{P as Rg}from"./ujhgjK1k.js";import{a as hd}from"./QeBH-DWE.js";import{g as Zl}from"./yFcbscNn.js";import{H as Dg}from"./Bqd7fdCF.js";import{q as Lg}from"./fiz8N_zQ.js";import{b as Pg,P as _g}from"./BP5uGGO_.js";var Bg=Zu('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0024 12c0-6.63-5.37-12-12-12z"></path></svg>');function pd(n,e){if(new.target)return Wt({component:pd,...n});Ut(e,!0);let t=L(e,"size",7,16),r=L(e,"class",7,"");var i={get size(){return t()},set size(o=16){t(o),P()},get class(){return r()},set class(o=""){r(o),P()},$set:jt,$on:(o,a)=>Kt(e,o,a)},s=Bg();return ie(()=>{St(s,"width",t()),St(s,"height",t()),pn(s,0,ca(r()))}),K(n,s),qt(i)}var ec=Object.defineProperty,zg=(n,e)=>{let t={};for(var r in n)ec(t,r,{get:n[r],enumerable:!0});return ec(t,Symbol.toStringTag,{value:"Module"}),t};function vt(n){this.content=n}vt.prototype={constructor:vt,find:function(n){for(var e=0;e<this.content.length;e+=2)if(this.content[e]===n)return e;return-1},get:function(n){var e=this.find(n);return e==-1?void 0:this.content[e+1]},update:function(n,e,t){var r=t&&t!=n?this.remove(t):this,i=r.find(n),s=r.content.slice();return i==-1?s.push(t||n,e):(s[i+1]=e,t&&(s[i]=t)),new vt(s)},remove:function(n){var e=this.find(n);if(e==-1)return this;var t=this.content.slice();return t.splice(e,2),new vt(t)},addToStart:function(n,e){return new vt([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new vt(t)},addBefore:function(n,e,t){var r=this.remove(e),i=r.content.slice(),s=r.find(n);return i.splice(s==-1?i.length:s,0,e,t),new vt(i)},forEach:function(n){for(var e=0;e<this.content.length;e+=2)n(this.content[e],this.content[e+1])},prepend:function(n){return n=vt.from(n),n.size?new vt(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=vt.from(n),n.size?new vt(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=vt.from(n);for(var t=0;t<n.content.length;t+=2)e=e.remove(n.content[t]);return e},toObject:function(){var n={};return this.forEach(function(e,t){n[e]=t}),n},get size(){return this.content.length>>1}};vt.from=function(n){if(n instanceof vt)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new vt(e)};function md(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),s=e.child(r);if(i==s){t+=i.nodeSize;continue}if(!i.sameMarkup(s))return t;if(i.isText&&i.text!=s.text){let o=i.text,a=s.text,l=0;for(;o[l]==a[l];l++)t++;return l&&l<o.length&&l<a.length&&bd(o.charCodeAt(l-1))&&yd(o.charCodeAt(l))&&t--,t}if(i.content.size||s.content.size){let o=md(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function gd(n,e,t,r){for(let i=n.childCount,s=e.childCount;;){if(i==0||s==0)return i==s?null:{a:t,b:r};let o=n.child(--i),a=e.child(--s),l=o.nodeSize;if(o==a){t-=l,r-=l;continue}if(!o.sameMarkup(a))return{a:t,b:r};if(o.isText&&o.text!=a.text){let c=o.text,u=a.text,d=c.length,f=u.length;for(;d>0&&f>0&&c[d-1]==u[f-1];)d--,f--,t--,r--;return d&&f&&d<c.length&&bd(c.charCodeAt(d-1))&&yd(c.charCodeAt(d))&&(t++,r++),{a:t,b:r}}if(o.content.size||a.content.size){let c=gd(o.content,a.content,t-1,r-1);if(c)return c}t-=l,r-=l}}function yd(n){return n>=56320&&n<57344}function bd(n){return n>=55296&&n<56320}class M{constructor(e,t){if(this.content=e,this.size=t||0,t==null)for(let r=0;r<e.length;r++)this.size+=e[r].nodeSize}nodesBetween(e,t,r,i=0,s){for(let o=0,a=0;a<t;o++){let l=this.content[o],c=a+l.nodeSize;if(c>e&&r(l,i+a,s||null,o)!==!1&&l.content.size){let u=a+1;l.nodesBetween(Math.max(0,e-u),Math.min(l.content.size,t-u),r,i+u)}a=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let s="",o=!0;return this.nodesBetween(e,t,(a,l)=>{let c=a.isText?a.text.slice(Math.max(e,l)-l,t-l):a.isLeaf?i?typeof i=="function"?i(a):i:a.type.spec.leafText?a.type.spec.leafText(a):"":"";a.isBlock&&(a.isLeaf&&c||a.isTextblock)&&r&&(o?o=!1:s+=r),s+=c},0),s}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),s=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),s=1);s<e.content.length;s++)i.push(e.content[s]);return new M(i,this.size+e.size)}cut(e,t=this.size){if(e==0&&t==this.size)return this;let r=[],i=0;if(t>e)for(let s=0,o=0;o<t;s++){let a=this.content[s],l=o+a.nodeSize;l>e&&((o<e||l>t)&&(a.isText?a=a.cut(Math.max(0,e-o),Math.min(a.text.length,t-o)):a=a.cut(Math.max(0,e-o-1),Math.min(a.content.size,t-o-1))),r.push(a),i+=a.nodeSize),o=l}return new M(r,i)}cutByIndex(e,t){return e==t?M.empty:e==0&&t==this.content.length?this:new M(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),s=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new M(i,s)}addToStart(e){return new M([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new M(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;t<this.content.length;t++)if(!this.content[t].eq(e.content[t]))return!1;return!0}get firstChild(){return this.content.length?this.content[0]:null}get lastChild(){return this.content.length?this.content[this.content.length-1]:null}get childCount(){return this.content.length}child(e){let t=this.content[e];if(!t)throw new RangeError("Index "+e+" out of range for "+this);return t}maybeChild(e){return this.content[e]||null}forEach(e){for(let t=0,r=0;t<this.content.length;t++){let i=this.content[t];e(i,r,t),r+=i.nodeSize}}findDiffStart(e,t=0){return md(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return gd(this,e,t,r)}findIndex(e){if(e==0)return Fi(0,e);if(e==this.size)return Fi(this.content.length,e);if(e>this.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let t=0,r=0;;t++){let i=this.child(t),s=r+i.nodeSize;if(s>=e)return s==e?Fi(t+1,s):Fi(t,r);r=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return M.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return M.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return M.empty;let t,r=0;for(let i=0;i<e.length;i++){let s=e[i];r+=s.nodeSize,i&&s.isText&&e[i-1].sameMarkup(s)?(t||(t=e.slice(0,i)),t[t.length-1]=s.withText(t[t.length-1].text+s.text)):t&&t.push(s)}return new M(t||e,r)}static from(e){if(!e)return M.empty;if(e instanceof M)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new M([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}M.empty=new M([],0);const Bo={index:0,offset:0};function Fi(n,e){return Bo.index=n,Bo.offset=e,Bo}function ms(n,e){if(n===e)return!0;if(!(n&&typeof n=="object")||!(e&&typeof e=="object"))return!1;let t=Array.isArray(n);if(Array.isArray(e)!=t)return!1;if(t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!ms(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!ms(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Le=class da{constructor(e,t){this.type=e,this.attrs=t}addToSet(e){let t,r=!1;for(let i=0;i<e.length;i++){let s=e[i];if(this.eq(s))return e;if(this.type.excludes(s.type))t||(t=e.slice(0,i));else{if(s.type.excludes(this.type))return e;!r&&s.type.rank>this.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(s)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return e.slice(0,t).concat(e.slice(t+1));return e}isInSet(e){for(let t=0;t<e.length;t++)if(this.eq(e[t]))return!0;return!1}eq(e){return this==e||this.type==e.type&&ms(this.attrs,e.attrs)}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Mark.fromJSON");let r=e.marks[t.type];if(!r)throw new RangeError(`There is no mark type ${t.type} in this schema`);return r.create(t.attrs)}static sameSet(e,t){if(e==t)return!0;if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++)if(!e[r].eq(t[r]))return!1;return!0}static setFrom(e){if(!e||Array.isArray(e)&&e.length==0)return da.none;if(e instanceof da)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Le.none=[];class pi extends Error{}class W{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=kd(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return r&&new W(r,this.openStart,this.openEnd)}removeBetween(e,t){return new W(vd(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return W.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new W(M.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let s=e.firstChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.firstChild)r++;for(let s=e.lastChild;s&&!s.isLeaf&&(t||!s.type.spec.isolating);s=s.lastChild)i++;return new W(e,r,i)}}W.empty=new W(M.empty,0,0);function vd(n,e,t){let{index:r,offset:i}=n.findIndex(e),s=n.maybeChild(r),{index:o,offset:a}=n.findIndex(t);if(i==e||s.isText){if(a!=t&&!n.child(o).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=o)throw new RangeError("Removing non-flat range");return n.replaceChild(r,s.copy(vd(s.content,e-i-1,t-i-1)))}function kd(n,e,t,r,i,s){let{index:o,offset:a}=n.findIndex(e),l=n.maybeChild(o);if(a==e||l.isText)return s&&r<=0&&i<=0&&!s.canReplace(o,o,t)?null:n.cut(0,e).append(t).append(n.cut(e));let c=kd(l.content,e-a-1,t,o==0?r-1:0,o==n.childCount-1?i-1:0,l);return c&&n.replaceChild(o,l.copy(c))}function $g(n,e,t){if(t.openStart>n.depth)throw new pi("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new pi("Inconsistent open depths");return xd(n,e,t,0)}function xd(n,e,t,r){let i=n.index(r),s=n.node(r);if(i==e.index(r)&&r<n.depth-t.openStart){let o=xd(n,e,t,r+1);return s.copy(s.content.replaceChild(i,o))}else if(t.content.size)if(!t.openStart&&!t.openEnd&&n.depth==r&&e.depth==r){let o=n.parent,a=o.content;return Yn(o,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=Hg(t,n);return Yn(s,Sd(n,o,a,e,r))}else return Yn(s,gs(n,e,r))}function wd(n,e){if(!e.type.compatibleContent(n.type))throw new pi("Cannot join "+e.type.name+" onto "+n.type.name)}function fa(n,e,t){let r=n.node(t);return wd(r,e.node(t)),r}function Xn(n,e){let t=e.length-1;t>=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function ei(n,e,t,r){let i=(e||n).node(t),s=0,o=e?e.index(t):i.childCount;n&&(s=n.index(t),n.depth>t?s++:n.textOffset&&(Xn(n.nodeAfter,r),s++));for(let a=s;a<o;a++)Xn(i.child(a),r);e&&e.depth==t&&e.textOffset&&Xn(e.nodeBefore,r)}function Yn(n,e){if(!n.type.validContent(e))throw new pi("Invalid content for node "+n.type.name);return n.copy(e)}function Sd(n,e,t,r,i){let s=n.depth>i&&fa(n,e,i+1),o=r.depth>i&&fa(t,r,i+1),a=[];return ei(null,n,i,a),s&&o&&e.index(i)==t.index(i)?(wd(s,o),Xn(Yn(s,Sd(n,e,t,r,i+1)),a)):(s&&Xn(Yn(s,gs(n,e,i+1)),a),ei(e,t,i,a),o&&Xn(Yn(o,gs(t,r,i+1)),a)),ei(r,null,i,a),new M(a)}function gs(n,e,t){let r=[];if(ei(null,n,t,r),n.depth>t){let i=fa(n,e,t+1);Xn(Yn(i,gs(n,e,t+1)),r)}return ei(e,null,t,r),new M(r)}function Hg(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let s=t-1;s>=0;s--)i=e.node(s).copy(M.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class mi{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let s=0;s<e;s++)i+=r.child(s).nodeSize;return i}marks(){let e=this.parent,t=this.index();if(e.content.size==0)return Le.none;if(this.textOffset)return e.child(t).marks;let r=e.maybeChild(t-1),i=e.maybeChild(t);if(!r){let a=r;r=i,i=a}let s=r.marks;for(var o=0;o<s.length;o++)s[o].type.spec.inclusive===!1&&(!i||!s[o].isInSet(i.marks))&&(s=s[o--].removeFromSet(s));return s}marksAcross(e){let t=this.parent.maybeChild(this.index());if(!t||!t.isInline)return null;let r=t.marks,i=e.parent.maybeChild(e.index());for(var s=0;s<r.length;s++)r[s].type.spec.inclusive===!1&&(!i||!r[s].isInSet(i.marks))&&(r=r[s--].removeFromSet(r));return r}sharedDepth(e){for(let t=this.depth;t>0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos<this.pos)return e.blockRange(this);for(let r=this.depth-(this.parent.inlineContent||this.pos==e.pos?1:0);r>=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new ys(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos<this.pos?e:this}toString(){let e="";for(let t=1;t<=this.depth;t++)e+=(e?"/":"")+this.node(t).type.name+"_"+this.index(t-1);return e+":"+this.parentOffset}static resolve(e,t){if(!(t>=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,s=t;for(let o=e;;){let{index:a,offset:l}=o.content.findIndex(s),c=s-l;if(r.push(o,a,i+l),!c||(o=o.child(a),o.isText))break;s=c-1,i+=l+1}return new mi(t,r,s)}static resolveCached(e,t){let r=tc.get(e);if(r)for(let s=0;s<r.elts.length;s++){let o=r.elts[s];if(o.pos==t)return o}else tc.set(e,r=new Fg);let i=r.elts[r.i]=mi.resolve(e,t);return r.i=(r.i+1)%Vg,i}}class Fg{constructor(){this.elts=[],this.i=0}}const Vg=12,tc=new WeakMap;class ys{constructor(e,t,r){this.$from=e,this.$to=t,this.depth=r}get start(){return this.$from.before(this.depth+1)}get end(){return this.$to.after(this.depth+1)}get parent(){return this.$from.node(this.depth)}get startIndex(){return this.$from.index(this.depth)}get endIndex(){return this.$to.indexAfter(this.depth)}}const Wg=Object.create(null);let In=class ha{constructor(e,t,r,i=Le.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||M.empty}get children(){return this.content.content}get nodeSize(){return this.isLeaf?1:2+this.content.size}get childCount(){return this.content.childCount}child(e){return this.content.child(e)}maybeChild(e){return this.content.maybeChild(e)}forEach(e){this.content.forEach(e)}nodesBetween(e,t,r,i=0){this.content.nodesBetween(e,t,r,i,this)}descendants(e){this.nodesBetween(0,this.content.size,e)}get textContent(){return this.isLeaf&&this.type.spec.leafText?this.type.spec.leafText(this):this.textBetween(0,this.content.size,"")}textBetween(e,t,r,i){return this.content.textBetween(e,t,r,i)}get firstChild(){return this.content.firstChild}get lastChild(){return this.content.lastChild}eq(e){return this==e||this.sameMarkup(e)&&this.content.eq(e.content)}sameMarkup(e){return this.hasMarkup(e.type,e.attrs,e.marks)}hasMarkup(e,t,r){return this.type==e&&ms(this.attrs,t||e.defaultAttrs||Wg)&&Le.sameSet(this.marks,r||Le.none)}copy(e=null){return e==this.content?this:new ha(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new ha(this.type,this.attrs,this.content,e)}cut(e,t=this.content.size){return e==0&&t==this.content.size?this:this.copy(this.content.cut(e,t))}slice(e,t=this.content.size,r=!1){if(e==t)return W.empty;let i=this.resolve(e),s=this.resolve(t),o=r?0:i.sharedDepth(t),a=i.start(o),c=i.node(o).content.cut(i.pos-a,s.pos-a);return new W(c,i.depth-o,s.depth-o)}replace(e,t,r){return $g(this.resolve(e),this.resolve(t),r)}nodeAt(e){for(let t=this;;){let{index:r,offset:i}=t.content.findIndex(e);if(t=t.maybeChild(r),!t)return null;if(i==e||t.isText)return t;e-=i+1}}childAfter(e){let{index:t,offset:r}=this.content.findIndex(e);return{node:this.content.maybeChild(t),index:t,offset:r}}childBefore(e){if(e==0)return{node:null,index:0,offset:0};let{index:t,offset:r}=this.content.findIndex(e);if(r<e)return{node:this.content.child(t),index:t,offset:r};let i=this.content.child(t-1);return{node:i,index:t-1,offset:r-i.nodeSize}}resolve(e){return mi.resolveCached(this,e)}resolveNoCache(e){return mi.resolve(this,e)}rangeHasMark(e,t,r){let i=!1;return t>e&&this.nodesBetween(e,t,s=>(r.isInSet(s.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Cd(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=M.empty,i=0,s=r.childCount){let o=this.contentMatchAt(e).matchFragment(r,i,s),a=o&&o.matchFragment(this.content,t);if(!a||!a.validEnd)return!1;for(let l=i;l<s;l++)if(!this.type.allowsMarks(r.child(l).marks))return!1;return!0}canReplaceWith(e,t,r,i){if(i&&!this.type.allowsMarks(i))return!1;let s=this.contentMatchAt(e).matchType(r),o=s&&s.matchFragment(this.content,t);return o?o.validEnd:!1}canAppend(e){return e.content.size?this.canReplace(this.childCount,this.childCount,e.content):this.type.compatibleContent(e.type)}check(){this.type.checkContent(this.content),rc(this.type.attrs,this.attrs,"node",this.type.name);let e=Le.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];rc(r.type.attrs,r.attrs,"mark",r.type.name),e=r.addToSet(e)}if(!Le.sameSet(e,this.marks))throw new RangeError(`Invalid collection of marks for node ${this.type.name}: ${this.marks.map(t=>t.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=M.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};In.prototype.text=void 0;const nc=(()=>{let{stack:n}=new Error("/");if(!n||!/\n\s*at\s/.test(n))return t=>t;let e=Object.create(null);return t=>(e[t],t)})();class bs extends In{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Cd(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return nc(this.text.slice(e,t))}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new bs(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new bs(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(nc(this.text.slice(e,t)))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}}function Cd(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}function rc(n,e,t,r){for(let i in e)if(!(i in n))throw new RangeError(`Unsupported attribute ${i} for ${t} of type ${r}`);for(let i in n)n[i].validate&&n[i].validate(e[i])}class er{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new jg(e,t);if(r.next==null)return er.empty;let i=Md(r);r.next&&r.err("Unexpected trailing text");let s=Yg(Xg(i));return Qg(s,r),s}matchType(e){for(let t=0;t<this.next.length;t++)if(this.next[t].type==e)return this.next[t].next;return null}matchFragment(e,t=0,r=e.childCount){let i=this;for(let s=t;i&&s<r;s++)i=i.matchType(e.child(s).type);return i}get inlineContent(){return this.next.length!=0&&this.next[0].type.isInline}get defaultType(){for(let e=0;e<this.next.length;e++){let{type:t}=this.next[e];if(!(t.isText||t.hasRequiredAttrs()))return t}return null}compatible(e){for(let t=0;t<this.next.length;t++)for(let r=0;r<e.next.length;r++)if(this.next[t].type==e.next[r].type)return!0;return!1}fillBefore(e,t=!1,r=0){let i=[this];function s(o,a){let l=o.matchFragment(e,r);if(l&&(!t||l.validEnd))return M.from(a.map(c=>c.createAndFill()));for(let c=0;c<o.next.length;c++){let{type:u,next:d}=o.next[c];if(!(u.isText||u.hasRequiredAttrs())&&i.indexOf(d)==-1){i.push(d);let f=s(d,a.concat(u));if(f)return f}}return null}return s(this,[])}findWrapping(e){for(let r=0;r<this.wrapCache.length;r+=2)if(this.wrapCache[r]==e)return this.wrapCache[r+1];let t=this.computeWrapping(e);return this.wrapCache.push(e,t),t}computeWrapping(e){let t=Object.create(null),r=[{match:this,type:null,via:null}];for(;r.length;){let i=r.shift(),s=i.match;if(s.matchType(e)){let o=[];for(let a=i;a.type;a=a.via)o.push(a.type);return o.reverse()}for(let o=0;o<s.next.length;o++){let{type:a,next:l}=s.next[o];!a.isLeaf&&!a.hasRequiredAttrs()&&!(a.name in t)&&(!i.type||l.validEnd)&&(r.push({match:a.contentMatch,type:a,via:i}),t[a.name]=!0)}}return null}get edgeCount(){return this.next.length}edge(e){if(e>=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i<r.next.length;i++)e.indexOf(r.next[i].next)==-1&&t(r.next[i].next)}return t(this),e.map((r,i)=>{let s=i+(r.validEnd?"*":" ")+" ";for(let o=0;o<r.next.length;o++)s+=(o?", ":"")+r.next[o].type.name+"->"+e.indexOf(r.next[o].next);return s}).join(`
|
|
3
3
|
`)}}er.empty=new er(!0);class jg{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}}function Md(n){let e=[];do e.push(Kg(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Kg(n){let e=[];do e.push(Ug(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Ug(n){let e=Gg(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=qg(n,e);else break;return e}function ic(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function qg(n,e){let t=ic(n),r=t;return n.eat(",")&&(n.next!="}"?r=ic(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Jg(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let s in t){let o=t[s];o.isInGroup(e)&&i.push(o)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function Gg(n){if(n.eat("(")){let e=Md(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=Jg(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Xg(n){let e=[[]];return i(s(n,0),t()),e;function t(){return e.push([])-1}function r(o,a,l){let c={term:l,to:a};return e[o].push(c),c}function i(o,a){o.forEach(l=>l.to=a)}function s(o,a){if(o.type=="choice")return o.exprs.reduce((l,c)=>l.concat(s(c,a)),[]);if(o.type=="seq")for(let l=0;;l++){let c=s(o.exprs[l],a);if(l==o.exprs.length-1)return c;i(c,a=t())}else if(o.type=="star"){let l=t();return r(a,l),i(s(o.expr,l),l),[r(l)]}else if(o.type=="plus"){let l=t();return i(s(o.expr,a),l),i(s(o.expr,l),l),[r(l)]}else{if(o.type=="opt")return[r(a)].concat(s(o.expr,a));if(o.type=="range"){let l=a;for(let c=0;c<o.min;c++){let u=t();i(s(o.expr,l),u),l=u}if(o.max==-1)i(s(o.expr,l),l);else for(let c=o.min;c<o.max;c++){let u=t();r(l,u),i(s(o.expr,l),u),l=u}return[r(l)]}else{if(o.type=="name")return[r(a,void 0,o.value)];throw new Error("Unknown expr type")}}}}function Ed(n,e){return e-n}function sc(n,e){let t=[];return r(e),t.sort(Ed);function r(i){let s=n[i];if(s.length==1&&!s[0].term)return r(s[0].to);t.push(i);for(let o=0;o<s.length;o++){let{term:a,to:l}=s[o];!a&&t.indexOf(l)==-1&&r(l)}}}function Yg(n){let e=Object.create(null);return t(sc(n,0));function t(r){let i=[];r.forEach(o=>{n[o].forEach(({term:a,to:l})=>{if(!a)return;let c;for(let u=0;u<i.length;u++)i[u][0]==a&&(c=i[u][1]);sc(n,l).forEach(u=>{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[r.join(",")]=new er(r.indexOf(n.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(Ed);s.next.push({type:i[o][0],next:e[a.join(",")]||t(a)})}return s}}function Qg(n,e){for(let t=0,r=[n];t<r.length;t++){let i=r[t],s=!i.validEnd,o=[];for(let a=0;a<i.next.length;a++){let{type:l,next:c}=i.next[a];o.push(l.name),s&&!(l.isText||l.hasRequiredAttrs())&&(s=!1),r.indexOf(c)==-1&&r.push(c)}s&&e.err("Only non-generatable nodes ("+o.join(", ")+") in a required position (see https://prosemirror.net/docs/guide/#generatable)")}}function Td(n){let e=Object.create(null);for(let t in n){let r=n[t];if(!r.hasDefault)return null;e[t]=r.default}return e}function Ad(n,e){let t=Object.create(null);for(let r in n){let i=n[r],s=e&&e[r];if(s===void 0)if(i.hasDefault)s=i.default;else throw new RangeError("No value supplied for attribute "+r);else i.validate&&i.validate(s);t[r]=s}return t}function Nd(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new ey(n,r,e[r]);return t}let pa=class Od{constructor(e,t,r){this.name=e,this.schema=t,this.spec=r,this.markSet=null,this.groups=r.group?r.group.split(" "):[],this.attrs=Nd(e,r.attrs),this.defaultAttrs=Td(this.attrs),this.contentMatch=null,this.inlineContent=null,this.isBlock=!(r.inline||e=="text"),this.isText=e=="text"}get isInline(){return!this.isBlock}get isTextblock(){return this.isBlock&&this.inlineContent}get isLeaf(){return this.contentMatch==er.empty}get isAtom(){return this.isLeaf||!!this.spec.atom}isInGroup(e){return this.groups.indexOf(e)>-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Ad(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new In(this,this.computeAttrs(e),M.from(t),Le.setFrom(r))}createChecked(e=null,t,r){return t=M.from(t),this.checkContent(t),new In(this,this.computeAttrs(e),t,Le.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=M.from(t),t.size){let o=this.contentMatch.fillBefore(t);if(!o)return null;t=o.append(t)}let i=this.contentMatch.matchFragment(t),s=i&&i.fillBefore(M.empty,!0);return s?new In(this,e,t.append(s),Le.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r<e.childCount;r++)if(!this.allowsMarks(e.child(r).marks))return!1;return!0}checkContent(e){if(!this.validContent(e))throw new RangeError(`Invalid content for node ${this.name}: ${e.toString().slice(0,50)}`)}checkAttrs(e){}allowsMarkType(e){return this.markSet==null||this.markSet.indexOf(e)>-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;t<e.length;t++)if(!this.allowsMarkType(e[t].type))return!1;return!0}allowedMarks(e){if(this.markSet==null)return e;let t;for(let r=0;r<e.length;r++)this.allowsMarkType(e[r].type)?t&&t.push(e[r]):t||(t=e.slice(0,r));return t?t.length?t:Le.none:e}static compile(e,t){let r=Object.create(null);e.forEach((s,o)=>r[s]=new Od(s,t,o));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let s in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Zg(n,e,t){let r=t.split("|");return i=>{let s=i===null?"null":typeof i;if(r.indexOf(s)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${s}`)}}class ey{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Zg(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}}class so{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Nd(e,i.attrs),this.excluded=null;let s=Td(this.attrs);this.instance=s?new Le(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Le(this,Ad(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((s,o)=>r[s]=new so(s,i++,t,o)),r}removeFromSet(e){for(var t=0;t<e.length;t++)e[t].type==this&&(e=e.slice(0,t).concat(e.slice(t+1)),t--);return e}isInSet(e){for(let t=0;t<e.length;t++)if(e[t].type==this)return e[t]}excludes(e){return this.excluded.indexOf(e)>-1}}class ss{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=vt.from(e.nodes),t.marks=vt.from(e.marks||{}),this.nodes=pa.compile(this.spec.nodes,this),this.marks=so.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let s=this.nodes[i],o=s.spec.content||"",a=s.spec.marks;if(s.contentMatch=r[o]||(r[o]=er.parse(o,this.nodes)),s.inlineContent=s.contentMatch.inlineContent,s.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!s.isInline||!s.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=s}s.markSet=a=="_"?null:a?oc(this,a.split(" ")):a==""||!s.inlineContent?[]:null}for(let i in this.marks){let s=this.marks[i],o=s.spec.excludes;s.excluded=o==null?[s]:o==""?[]:oc(this,o.split(" "))}this.nodeFromJSON=i=>In.fromJSON(this,i),this.markFromJSON=i=>Le.fromJSON(this,i),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof pa){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new bs(r,r.defaultAttrs,e,Le.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}}function oc(n,e){let t=[];for(let r=0;r<e.length;r++){let i=e[r],s=n.marks[i],o=s;if(s)t.push(s);else for(let a in n.marks){let l=n.marks[a];(i=="_"||l.spec.group&&l.spec.group.split(" ").indexOf(i)>-1)&&t.push(o=l)}if(!o)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function ty(n){return n.tag!=null}function ny(n){return n.style!=null}let ti=class ma{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(ty(i))this.tags.push(i);else if(ny(i)){let s=/[^=]*/.exec(i.style)[0];r.indexOf(s)<0&&r.push(s),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let s=e.nodes[i.node];return s.contentMatch.matchType(s)})}parse(e,t={}){let r=new lc(this,t,!1);return r.addAll(e,Le.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new lc(this,t,!0);return r.addAll(e,Le.none,t.from,t.to),W.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;i<this.tags.length;i++){let s=this.tags[i];if(sy(e,s.tag)&&(s.namespace===void 0||e.namespaceURI==s.namespace)&&(!s.context||t.matchesContext(s.context))){if(s.getAttrs){let o=s.getAttrs(e);if(o===!1)continue;s.attrs=o||void 0}return s}}}matchStyle(e,t,r,i){for(let s=i?this.styles.indexOf(i)+1:0;s<this.styles.length;s++){let o=this.styles[s],a=o.style;if(!(a.indexOf(e)!=0||o.context&&!r.matchesContext(o.context)||a.length>e.length&&(a.charCodeAt(e.length)!=61||a.slice(e.length+1)!=t))){if(o.getAttrs){let l=o.getAttrs(t);if(l===!1)continue;o.attrs=l||void 0}return o}}}static schemaRules(e){let t=[];function r(i){let s=i.priority==null?50:i.priority,o=0;for(;o<t.length;o++){let a=t[o];if((a.priority==null?50:a.priority)<s)break}t.splice(o,0,i)}for(let i in e.marks){let s=e.marks[i].spec.parseDOM;s&&s.forEach(o=>{r(o=cc(o)),o.mark||o.ignore||o.clearMark||(o.mark=i)})}for(let i in e.nodes){let s=e.nodes[i].spec.parseDOM;s&&s.forEach(o=>{r(o=cc(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new ma(e,ma.schemaRules(e)))}};const Id={address:!0,article:!0,aside:!0,blockquote:!0,body:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},ry={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Rd={ol:!0,ul:!0},gi=1,ga=2,ni=4;function ac(n,e,t){return e!=null?(e?gi:0)|(e==="full"?ga:0):n&&n.whitespace=="pre"?gi|ga:t&~ni}class Vi{constructor(e,t,r,i,s,o){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=o,this.content=[],this.activeMarks=Le.none,this.match=s||(o&ni?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(M.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&gi)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let s=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=s.withText(s.text.slice(0,s.text.length-i[0].length))}}let t=M.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(M.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Id.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class lc{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=t.topNode,s,o=ac(null,t.preserveWhitespace,0)|(r?ni:0);i?s=new Vi(i.type,i.attrs,Le.none,!0,t.topMatch||i.type.contentMatch,o):r?s=new Vi(null,null,Le.none,!0,null,o):s=new Vi(e.schema.topNodeType,null,Le.none,!0,null,o),this.nodes=[s],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,i=this.top,s=i.options&ga?"full":this.localPreserveWS||(i.options&gi)>0,{schema:o}=this.parser;if(s==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(s)if(s==="full")r=r.replace(/\r\n?/g,`
|
|
4
4
|
`);else if(o.linebreakReplacement&&/[\r\n]/.test(r)&&this.top.findWrapping(o.linebreakReplacement.create())){let a=r.split(/\r?\n|\r/);for(let l=0;l<a.length;l++)l&&this.insertNode(o.linebreakReplacement.create(),t,!0),a[l]&&this.insertNode(o.text(a[l]),t,!/\S/.test(a[l]));r=""}else r=r.replace(/\r?\n|\r/g," ");else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let a=i.content[i.content.length-1],l=e.previousSibling;(!a||l&&l.nodeName=="BR"||a.isText&&/[ \t\r\n\u000c]$/.test(a.text))&&(r=r.slice(1))}r&&this.insertNode(o.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let i=this.localPreserveWS,s=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let o=e.nodeName.toLowerCase(),a;Rd.hasOwnProperty(o)&&this.parser.normalizeLists&&iy(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:ry.hasOwnProperty(o))this.findInside(e),this.ignoreFallback(e,t);else if(!l||l.skip||l.closeParent){l&&l.closeParent?this.open=Math.max(0,this.open-1):l&&l.skip.nodeType&&(e=l.skip);let c,u=this.needsBlock;if(Id.hasOwnProperty(o))s.content.length&&s.content[0].isInline&&this.open&&(this.open--,s=this.top),c=!0,s.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let d=l&&l.skip?t:this.readStyles(e,t);d&&this.addAll(e,d),c&&this.sync(s),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,l,c,l.consuming===!1?a:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(`
|
|
5
5
|
`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let i=0;i<this.parser.matchedStyles.length;i++){let s=this.parser.matchedStyles[i],o=r.getPropertyValue(s);if(o)for(let a=void 0;;){let l=this.parser.matchStyle(s,o,this,a);if(!l)break;if(l.ignore)return null;if(l.clearMark?t=t.filter(c=>!l.clearMark(c)):t=t.concat(this.parser.schema.marks[l.mark].create(l.attrs)),l.consuming===!1)a=l;else break}}return t}addElementByRule(e,t,r,i){let s,o;if(t.node)if(o=this.parser.schema.nodes[t.node],o.isLeaf)this.insertNode(o.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let l=this.enter(o,t.attrs||null,r,t.preserveWhitespace);l&&(s=!0,r=l)}else{let l=this.parser.schema.marks[t.mark];r=r.concat(l.create(t.attrs))}let a=this.top;if(o&&o.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(l=>this.insertNode(l,r,!1));else{let l=e;typeof t.contentElement=="string"?l=e.querySelector(t.contentElement):typeof t.contentElement=="function"?l=t.contentElement(e):t.contentElement&&(l=t.contentElement),this.findAround(e,l,!0),this.addAll(l,r),this.findAround(e,l,!1)}s&&this.sync(a)&&this.open--}addAll(e,t,r,i){let s=r||0;for(let o=r?e.childNodes[r]:e.firstChild,a=i==null?null:e.childNodes[i];o!=a;o=o.nextSibling,++s)this.findAtPoint(e,s),this.addDOM(o,t);this.findAtPoint(e,s)}findPlace(e,t,r){let i,s;for(let o=this.open,a=0;o>=0;o--){let l=this.nodes[o],c=l.findWrapping(e);if(c&&(!i||i.length>c.length+a)&&(i=c,s=l,!c.length))break;if(l.solid){if(r)break;a+=2}}if(!i)return null;this.sync(s);for(let o=0;o<i.length;o++)t=this.enterInner(i[o],null,t,!1);return t}insertNode(e,t,r){if(e.isInline&&this.needsBlock&&!this.top.type){let s=this.textblockFromContext();s&&(t=this.enterInner(s,null,t))}let i=this.findPlace(e,t,r);if(i){this.closeExtra();let s=this.top;s.match&&(s.match=s.match.matchType(e.type));let o=Le.none;for(let a of i.concat(e.marks))(s.type?s.type.allowsMarkType(a.type):uc(a.type,e.type))&&(o=a.addToSet(o));return s.content.push(e.mark(o)),!0}return!1}enter(e,t,r,i){let s=this.findPlace(e.create(t),r,!1);return s&&(s=this.enterInner(e,t,r,!0,i)),s}enterInner(e,t,r,i=!1,s){this.closeExtra();let o=this.top;o.match=o.match&&o.match.matchType(e);let a=ac(e,s,o.options);o.options&ni&&o.content.length==0&&(a|=ni);let l=Le.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):uc(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new Vi(e,t,l,i,null,a)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=gi)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r<this.find.length;r++)this.find[r].node==e&&this.find[r].offset==t&&(this.find[r].pos=this.currentPos)}findInside(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].pos==null&&e.nodeType==1&&e.contains(this.find[t].node)&&(this.find[t].pos=this.currentPos)}findAround(e,t,r){if(e!=t&&this.find)for(let i=0;i<this.find.length;i++)this.find[i].pos==null&&e.nodeType==1&&e.contains(this.find[i].node)&&t.compareDocumentPosition(this.find[i].node)&(r?2:4)&&(this.find[i].pos=this.currentPos)}findInText(e){if(this.find)for(let t=0;t<this.find.length;t++)this.find[t].node==e&&(this.find[t].pos=this.currentPos-(e.nodeValue.length-this.find[t].offset))}matchesContext(e){if(e.indexOf("|")>-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),s=-(r?r.depth+1:0)+(i?0:1),o=(a,l)=>{for(;a>=0;a--){let c=t[a];if(c==""){if(a==t.length-1||a==0)continue;for(;l>=s;l--)if(o(a-1,l))return!0;return!1}else{let u=l>0||l==0&&i?this.nodes[l].type:r&&l>=s?r.node(l-s).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;l--}}return!0};return o(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}}function iy(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Rd.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function sy(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function cc(n){let e={};for(let t in n)e[t]=n[t];return e}function uc(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let s=[],o=a=>{s.push(a);for(let l=0;l<a.edgeCount;l++){let{type:c,next:u}=a.edge(l);if(c==e||s.indexOf(u)<0&&o(u))return!0}};if(o(i.contentMatch))return!0}}class or{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Wi(t).createDocumentFragment());let i=r,s=[];return e.forEach(o=>{if(s.length||o.marks.length){let a=0,l=0;for(;a<s.length&&l<o.marks.length;){let c=o.marks[l];if(!this.marks[c.type.name]){l++;continue}if(!c.eq(s[a][0])||c.type.spec.spanning===!1)break;a++,l++}for(;a<s.length;)i=s.pop()[1];for(;l<o.marks.length;){let c=o.marks[l++],u=this.serializeMark(c,o.isInline,t);u&&(s.push([c,i]),i.appendChild(u.dom),i=u.contentDOM||u.dom)}}i.appendChild(this.serializeNodeInner(o,t))}),r}serializeNodeInner(e,t){if(e.isText)return Wi(t).createTextNode(e.text);let{dom:r,contentDOM:i}=as(Wi(t),this.nodes[e.type.name](e),null,e.attrs);if(i){if(e.isLeaf)throw new RangeError("Content hole not allowed in a leaf node spec");this.serializeFragment(e.content,t,i)}return r}serializeNode(e,t={}){let r=this.serializeNodeInner(e,t);for(let i=e.marks.length-1;i>=0;i--){let s=this.serializeMark(e.marks[i],e.isInline,t);s&&((s.contentDOM||s.dom).appendChild(r),r=s.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&as(Wi(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return typeof t=="string"?{dom:e.createTextNode(t)}:as(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new or(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=dc(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return dc(e.marks)}}function dc(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Wi(n){return n.document||window.document}const fc=new WeakMap;function oy(n){let e=fc.get(n);return e===void 0&&fc.set(n,e=ay(n)),e}function ay(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i<r.length;i++)t(r[i]);else for(let i in r)t(r[i])}return t(n),e}function as(n,e,t,r){if(e.nodeType==1)return{dom:e};if(e.dom&&e.dom.nodeType==1)return e;let i=e[0],s;if(typeof i!="string")throw new RangeError("Invalid array passed to renderSpec");if(r&&(s=oy(r))&&s.indexOf(e)>-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let o=i.indexOf(" ");o>0&&(t=i.slice(0,o),i=i.slice(o+1));let a,l=t?n.createElementNS(t,i):n.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let d in c)if(c[d]!=null){let f=d.indexOf(" ");f>0?l.setAttributeNS(d.slice(0,f),d.slice(f+1),c[d]):d=="style"&&l.style?l.style.cssText=c[d]:l.setAttribute(d,c[d])}}for(let d=u;d<e.length;d++){let f=e[d];if(f===0){if(d<e.length-1||d>u)throw new RangeError("Content hole must be the only child of its parent node");return{dom:l,contentDOM:l}}else if(typeof f=="string")l.appendChild(n.createTextNode(f));else{let{dom:h,contentDOM:m}=as(n,f,t,r);if(l.appendChild(h),m){if(a)throw new RangeError("Multiple content holes");a=m}}}return{dom:l,contentDOM:a}}const Dd=65535,Ld=Math.pow(2,16);function ly(n,e){return n+e*Ld}function hc(n){return n&Dd}function cy(n){return(n-(n&Dd))/Ld}const Pd=1,_d=2,ls=4,Bd=8;class ya{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Bd)>0}get deletedBefore(){return(this.delInfo&(Pd|ls))>0}get deletedAfter(){return(this.delInfo&(_d|ls))>0}get deletedAcross(){return(this.delInfo&ls)>0}}class _t{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&_t.empty)return _t.empty}recover(e){let t=0,r=hc(e);if(!this.inverted)for(let i=0;i<r;i++)t+=this.ranges[i*3+2]-this.ranges[i*3+1];return this.ranges[r*3]+t+cy(e)}mapResult(e,t=1){return this._map(e,t,!1)}map(e,t=1){return this._map(e,t,!0)}_map(e,t,r){let i=0,s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?i:0);if(l>e)break;let c=this.ranges[a+s],u=this.ranges[a+o],d=l+c;if(e<=d){let f=c?e==l?-1:e==d?1:t:t,h=l+i+(f<0?0:u);if(r)return h;let m=e==(t<0?l:d)?null:ly(a/3,e-l),g=0;return c&&(g|=e==l?_d:e==d?Pd:ls,(t<0?e!=l:e!=d)&&(g|=Bd)),new ya(h,g,m)}i+=u-c}return r?e+i:new ya(e+i,0,null)}touches(e,t){let r=0,i=hc(t),s=this.inverted?2:1,o=this.inverted?1:2;for(let a=0;a<this.ranges.length;a+=3){let l=this.ranges[a]-(this.inverted?r:0);if(l>e)break;let c=this.ranges[a+s],u=l+c;if(e<=u&&a==i*3)return!0;r+=this.ranges[a+o]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,s=0;i<this.ranges.length;i+=3){let o=this.ranges[i],a=o-(this.inverted?s:0),l=o+(this.inverted?0:s),c=this.ranges[i+t],u=this.ranges[i+r];e(a,a+c,l,l+u),s+=u-c}}invert(){return new _t(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?_t.empty:new _t(e<0?[0,-e,0]:[0,0,e])}}_t.empty=new _t([]);class yi{constructor(e,t,r=0,i=e?e.length:0){this.mirror=t,this.from=r,this.to=i,this._maps=e||[],this.ownData=!(e||t)}get maps(){return this._maps}slice(e=0,t=this.maps.length){return new yi(this._maps,this.mirror,e,t)}appendMap(e,t){this.ownData||(this._maps=this._maps.slice(),this.mirror=this.mirror&&this.mirror.slice(),this.ownData=!0),this.to=this._maps.push(e),t!=null&&this.setMirror(this._maps.length-1,t)}appendMapping(e){for(let t=e.from,r=this._maps.length;t<e.to;t++){let i=e.getMirror(t);i!=null&&(i=i<t&&i>=e.from?r+(i-e.from):void 0),this.appendMap(e._maps[t],i)}}getMirror(e){if(this.mirror){for(let t=0;t<this.mirror.length;t++)if(this.mirror[t]==e)return this.mirror[t+(t%2?-1:1)]}}setMirror(e,t){this.mirror||(this.mirror=[]),this.mirror.push(e,t)}appendMappingInverted(e){for(let t=e.to-1,r=this._maps.length+e._maps.length;t>=e.from;t--){let i=e.getMirror(t);i!=null&&(i=i>t&&i<e.to?r-(i-e.from)-1:void 0),this.appendMap(e._maps[t].invert(),i)}}invert(){let e=new yi;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;r<this.to;r++)e=this._maps[r].map(e,t);return e}mapResult(e,t=1){return this._map(e,t,!1)}_map(e,t,r){let i=0;for(let s=this.from;s<this.to;s++){let o=this._maps[s],a=o.mapResult(e,t);if(a.recover!=null){let l=this.getMirror(s);if(l!=null&&l>s&&l<this.to){s=l,e=this._maps[l].recover(a.recover);continue}}i|=a.delInfo,e=a.pos}return r?e:new ya(e,i,null)}}const zo=Object.create(null);class ht{getMap(){return _t.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=zo[t.stepType];if(!r)throw new RangeError(`No step type ${t.stepType} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in zo)throw new RangeError("Duplicate use of step JSON ID "+e);return zo[e]=t,t.prototype.jsonID=e,t}}class nt{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new nt(e,null)}static fail(e){return new nt(null,e)}static fromReplace(e,t,r,i){try{return nt.ok(e.replace(t,r,i))}catch(s){if(s instanceof pi)return nt.fail(s.message);throw s}}}function Ja(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let s=n.child(i);s.content.size&&(s=s.copy(Ja(s.content,e,s))),s.isInline&&(s=e(s,t,i)),r.push(s)}return M.fromArray(r)}class en extends ht{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=e.resolve(this.from),i=r.node(r.sharedDepth(this.to)),s=new W(Ja(t.content,(o,a)=>!o.isAtom||!a.type.allowsMarkType(this.mark.type)?o:o.mark(this.mark.addToSet(o.marks)),i),t.openStart,t.openEnd);return nt.fromReplace(e,this.from,this.to,s)}invert(e){let t=[];return e.nodesBetween(this.from,this.to,(r,i)=>{if(r.isInline&&r.isAtom){let s=this.mark.addToSet(r.marks);if(!Le.sameSet(s,r.marks)){let o=Math.max(this.from,i),a=Math.min(this.to,i+r.nodeSize);vs(Gt,o,a,this.mark,t);for(let l of r.marks)l.isInSet(s)||vs(en,o,a,l,t)}}}),t.length==1?t[0]:new Qn(t)}map(e){let t=e.map(this.from,1),r=e.map(this.to,-1);return t>=r?null:new en(t,r,this.mark)}merge(e){return e instanceof en&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new en(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new en(t.from,t.to,e.markFromJSON(t.mark))}}ht.jsonID("addMark",en);class Gt extends ht{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new W(Ja(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return nt.fromReplace(e,this.from,this.to,r)}invert(e){let t=[];return e.nodesBetween(this.from,this.to,(r,i)=>{r.isInline&&r.isAtom&&this.mark.isInSet(r.marks)&&vs(en,Math.max(this.from,i),Math.min(this.to,i+r.nodeSize),this.mark,t)}),t.length==1?t[0]:new Qn(t)}map(e){let t=e.map(this.from,1),r=e.map(this.to,-1);return t>=r?null:new Gt(t,r,this.mark)}merge(e){return e instanceof Gt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Gt(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new Gt(t.from,t.to,e.markFromJSON(t.mark))}}ht.jsonID("removeMark",Gt);function vs(n,e,t,r,i){let s=i.length?i[i.length-1]:null;s&&s instanceof n&&s.to==e&&s.mark.eq(r)?i[i.length-1]=new n(s.from,t,r):i.push(new n(e,t,r))}class Qn extends ht{constructor(e){super(),this.steps=e}apply(e){for(let t of this.steps){let r=t.apply(e);if(!r.doc)return r;e=r.doc}return new nt(e,null)}invert(e){return new Qn(this.steps.map(t=>t.invert(e)))}map(e){let t=[];for(let r of this.steps){let i=r.map(e);i&&t.push(i)}return t.length?new Qn(t):null}toJSON(){return{stepType:"markSet",steps:this.steps.map(e=>e.toJSON())}}static fromJSON(e,t){if(!Array.isArray(t.steps)||!t.steps.every(r=>r.stepType=="addMark"||r.stepType=="removeMark"))throw new RangeError("Invalid JSON for MarkSetStep");return new Qn(t.steps.map(r=>ht.fromJSON(e,r)))}}ht.jsonID("markSet",Qn);class Nn extends ht{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return nt.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return nt.fromReplace(e,this.pos,this.pos+1,new W(M.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;i<t.marks.length;i++)if(!t.marks[i].isInSet(r))return new Nn(this.pos,t.marks[i]);return new Nn(this.pos,this.mark)}}return new tr(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Nn(t.pos,this.mark)}toJSON(){return{stepType:"addNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for AddNodeMarkStep.fromJSON");return new Nn(t.pos,e.markFromJSON(t.mark))}}ht.jsonID("addNodeMark",Nn);class tr extends ht{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return nt.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return nt.fromReplace(e,this.pos,this.pos+1,new W(M.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Nn(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new tr(t.pos,this.mark)}toJSON(){return{stepType:"removeNodeMark",pos:this.pos,mark:this.mark.toJSON()}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for RemoveNodeMarkStep.fromJSON");return new tr(t.pos,e.markFromJSON(t.mark))}}ht.jsonID("removeNodeMark",tr);class Qe extends ht{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&ba(e,this.from,this.to)?nt.fail("Structure replace would overwrite content"):nt.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new _t([this.from,this.to-this.from,this.slice.size])}invert(e){return new Qe(this.from,this.from+this.slice.size,e.slice(this.from,this.to))}map(e){let t=e.mapResult(this.to,-1),r=this.from==this.to&&Qe.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new Qe(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof Qe)||e.structure||this.structure)return null;if(this.from+this.slice.size==e.from&&!this.slice.openEnd&&!e.slice.openStart){let t=this.slice.size+e.slice.size==0?W.empty:new W(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new Qe(this.from,this.to+(e.to-e.from),t,this.structure)}else if(e.to==this.from&&!this.slice.openStart&&!e.slice.openEnd){let t=this.slice.size+e.slice.size==0?W.empty:new W(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new Qe(e.from,this.to,t,this.structure)}else return null}toJSON(){let e={stepType:"replace",from:this.from,to:this.to};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for ReplaceStep.fromJSON");return new Qe(t.from,t.to,W.fromJSON(e,t.slice),!!t.structure)}}Qe.MAP_BIAS=1;ht.jsonID("replace",Qe);class gt extends ht{constructor(e,t,r,i,s,o,a=!1){super(),this.from=e,this.to=t,this.gapFrom=r,this.gapTo=i,this.slice=s,this.insert=o,this.structure=a}apply(e){if(this.structure&&(ba(e,this.from,this.gapFrom)||ba(e,this.gapTo,this.to)))return nt.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return nt.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?nt.fromReplace(e,this.from,this.to,r):nt.fail("Content does not fit in gap")}getMap(){return new _t([this.from,this.gapFrom-this.from,this.insert,this.gapTo,this.to-this.gapTo,this.slice.size-this.insert])}invert(e){let t=this.gapTo-this.gapFrom;return new gt(this.from,this.from+this.slice.size+t,this.from+this.insert,this.from+this.insert+t,e.slice(this.from,this.to).removeBetween(this.gapFrom-this.from,this.gapTo-this.from),this.gapFrom-this.from,this.structure)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1),i=this.from==this.gapFrom?t.pos:e.map(this.gapFrom,-1),s=this.to==this.gapTo?r.pos:e.map(this.gapTo,1);return t.deletedAcross&&r.deletedAcross||i<t.pos||s>r.pos||i>s?null:new gt(t.pos,r.pos,i,s,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new gt(t.from,t.to,t.gapFrom,t.gapTo,W.fromJSON(e,t.slice),t.insert,!!t.structure)}}ht.jsonID("replaceAround",gt);function ba(n,e,t){let r=n.resolve(e),i=t-e,s=r.depth;for(;i>0&&s>0&&r.indexAfter(s)==r.node(s).childCount;)s--,i--;if(i>0){let o=r.node(s).maybeChild(r.indexAfter(s));for(;i>0;){if(!o||o.isLeaf)return!0;o=o.firstChild,i--}}return!1}function uy(n,e,t,r){let i=[];n.doc.nodesBetween(e,t,(s,o,a)=>{if(!s.isInline)return;let l=s.marks;if(!r.isInSet(l)&&a.type.allowsMarkType(r.type)){let c=Math.max(o,e),u=Math.min(o+s.nodeSize,t);vs(en,c,u,r,i)}}),i.forEach(s=>n.step(s))}function dy(n,e,t,r){let i=[],s=0;n.doc.nodesBetween(e,t,(o,a)=>{if(!o.isInline||!o.isAtom)return;s++;let l=null;if(r instanceof so){let c=o.marks,u;for(;u=r.isInSet(c);)(l||(l=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(o.marks)&&(l=[r]):l=o.marks;if(l&&l.length){let c=Math.min(a+o.nodeSize,t);for(let u=0;u<l.length;u++){let d=l[u],f;for(let h=0;h<i.length;h++){let m=i[h];m.step==s-1&&d.eq(i[h].style)&&(f=m)}f?(f.to=c,f.step=s):i.push({style:d,from:Math.max(a,e),to:c,step:s})}}}),i.forEach(o=>n.step(new Gt(o.from,o.to,o.style)))}function Ga(n,e,t,r=t.contentMatch,i=!0){let s=n.doc.nodeAt(e),o=[],a=e+1;for(let l=0;l<s.childCount;l++){let c=s.child(l),u=a+c.nodeSize,d=r.matchType(c.type);if(!d)o.push(new Qe(a,u,W.empty));else{r=d;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new Gt(a,u,c.marks[f]));if(i&&c.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,m;for(;f=h.exec(c.text);)m||(m=new W(M.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new Qe(a+f.index,a+f.index+f[0].length,m))}}a=u}if(!r.validEnd){let l=r.fillBefore(M.empty,!0);n.replace(a,a,new W(l,0,0))}for(let l=o.length-1;l>=0;l--)n.step(o[l])}function fy(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Br(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth,i=0,s=0;;--r){let o=n.$from.node(r),a=n.$from.index(r)+i,l=n.$to.indexAfter(r)-s;if(r<n.depth&&o.canReplace(a,l,t))return r;if(r==0||o.type.spec.isolating||!fy(o,a,l))break;a&&(i=1),l<o.childCount&&(s=1)}return null}function hy(n,e,t){let{$from:r,$to:i,depth:s}=e,o=r.before(s+1),a=i.after(s+1),l=o,c=a,u=M.empty,d=0;for(let m=s,g=!1;m>t;m--)g||r.index(m)>0?(g=!0,u=M.from(r.node(m).copy(u)),d++):l--;let f=M.empty,h=0;for(let m=s,g=!1;m>t;m--)g||i.after(m+1)<i.end(m)?(g=!0,f=M.from(i.node(m).copy(f)),h++):c++;n.step(new gt(l,c,o,a,new W(u.append(f),d,h),u.size-d,!0))}function Xa(n,e,t=null,r=n){let i=py(n,e),s=i&&my(r,e);return s?i.map(pc).concat({type:e,attrs:t}).concat(s.map(pc)):null}function pc(n){return{type:n,attrs:null}}function py(n,e){let{parent:t,startIndex:r,endIndex:i}=n,s=t.contentMatchAt(r).findWrapping(e);if(!s)return null;let o=s.length?s[0]:e;return t.canReplaceWith(r,i,o)?s:null}function my(n,e){let{parent:t,startIndex:r,endIndex:i}=n,s=t.child(r),o=e.contentMatch.findWrapping(s.type);if(!o)return null;let l=(o.length?o[o.length-1]:e).contentMatch;for(let c=r;l&&c<i;c++)l=l.matchType(t.child(c).type);return!l||!l.validEnd?null:o}function gy(n,e,t){let r=M.empty;for(let o=t.length-1;o>=0;o--){if(r.size){let a=t[o].type.contentMatch.matchFragment(r);if(!a||!a.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=M.from(t[o].type.create(t[o].attrs,r))}let i=e.start,s=e.end;n.step(new gt(i,s,i,s,new W(r,0,0),t.length,!0))}function yy(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let s=n.steps.length;n.doc.nodesBetween(e,t,(o,a)=>{let l=typeof i=="function"?i(o):i;if(o.isTextblock&&!o.hasMarkup(r,l)&&by(n.doc,n.mapping.slice(s).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",m=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!m?c=!1:!h&&m&&(c=!0)}c===!1&&$d(n,o,a,s),Ga(n,n.mapping.slice(s).map(a,1),r,void 0,c===null);let u=n.mapping.slice(s),d=u.map(a,1),f=u.map(a+o.nodeSize,1);return n.step(new gt(d,f,d+1,f-1,new W(M.from(r.create(l,null,o.marks)),0,0),1,!0)),c===!0&&zd(n,o,a,s),!1}})}function zd(n,e,t,r){e.forEach((i,s)=>{if(i.isText){let o,a=/\r?\n|\r/g;for(;o=a.exec(i.text);){let l=n.mapping.slice(r).map(t+1+s+o.index);n.replaceWith(l,l+1,e.type.schema.linebreakReplacement.create())}}})}function $d(n,e,t,r){e.forEach((i,s)=>{if(i.type==i.type.schema.linebreakReplacement){let o=n.mapping.slice(r).map(t+1+s);n.replaceWith(o,o+1,e.type.schema.text(`
|
|
@@ -172,4 +172,4 @@ ${t}
|
|
|
172
172
|
`,pasteChip:()=>" "}}function Pl(b,C){return gl(b.state.doc,{from:0,to:C},{blockSeparator:`
|
|
173
173
|
|
|
174
174
|
`,textSerializers:Eo(b)}).replace(/\u00A0/g," ")}function To(b){return Pl(b,b.state.doc.content.size)}function Ao(b){return Pl(b,b.state.selection.from)}function Bi(b,C){const I=To(b),Q=FM(I,Ao(b).length);(!Q||Q.from!==p(re)?.from)&&(me(Et,null),me(Tt,null)),me(Pe,I,!0),me(re,Q,!0),Q&&C?.dismissNewContext&&me(Et,p(Re),!0)}function zi(){me(Tt,p(re)?.from??null,!0)}function _l(b){b.preventDefault()}function Np(b){if(!p(S)||!p(re))return;const C=To(p(S)),I=Ao(p(S)).length,Q={from:p(S).state.selection.from-p(re).query.length-1,to:p(S).state.selection.from+p(re).to-I},z=p(re).to===C.length||!/^\s/u.test(C.slice(p(re).to)),E=[{type:"skillCommand",attrs:{name:b.name}},...z?[{type:"text",text:" "}]:[]];p(S).chain().focus().insertContentAt(Q,E).setTextSelection(Q.from+2).run()}function Op(b){if(!p(S)||!p(re))return;const C=To(p(S)),I=Ao(p(S)).length,Q={from:p(S).state.selection.from-p(re).query.length-1,to:p(S).state.selection.from+p(re).to-I},z=p(re).to===C.length||!/^\s/u.test(C.slice(p(re).to)),E=`/${b.name}`;p(S).chain().focus().insertContentAt(Q,{type:"text",text:z?`${E} `:E}).setTextSelection(Q.from+E.length+1).run()}function zr(b){const C=fM(b,B().map(I=>I.name));return Y()?mC(C,Y()):C}const $r=new _M({readSnapshot:()=>{const b=p(S);return!b||b.isDestroyed||!F()||!p(Ue)||!p(we)?null:{text:Wn(b),caretAtEnd:Ti(b.state),composing:p(Mt)||b.view.composing,menuOpen:p(mt)||Hr.pluginKey.getState(b.state)?.active===!0}},readContext:()=>F()?.()??"",request:HM,showGhost:b=>{p(S)&&!p(S).isDestroyed&&sa(p(S).view,b)}});function Bl(){$r.cancel(),p(S)&&!p(S).isDestroyed&&Ai(p(S).state)&&sa(p(S).view,null)}function Ip(b,C){C||Ai(b.state)?$r.cancel():$r.schedule()}bt(()=>{(!F()||!p(Ue))&&vn(Bl)});function Rp(b){$r.cancel(),p(S)&&!p(S).isDestroyed&&sa(p(S).view,b)}function Dp(b){if(!p(mt)||!p(Dt))return!1;const C=!b.shiftKey&&!b.metaKey&&!b.ctrlKey&&!b.altKey&&["ArrowUp","ArrowDown","Enter"].includes(b.key);return b.key!=="Escape"&&!C?!1:p(Dt).onKeyDown({event:b})?!0:b.key==="Enter"?(b.preventDefault(),!0):!1}function Lp(){p(S)&&p(S).view&&p(S).chain().focus().insertContent("@").run()}function Pp(b){return p(S)&&p(S).view?(p(S).chain().focus().insertContent(b).run(),!0):!1}function _p(b){if(f()||!p(S)?.view)return!1;const{state:C,dispatch:I}=p(S).view,Q=Ju(C.schema,b);return Q.length===0?!1:(I(C.tr.replaceSelection(new W(M.from(Q),1,1)).scrollIntoView()),p(S).view.focus(),!0)}function Bp(){if(f())return!1;if(p(S)&&p(S).view)try{if(p(S).view.hasFocus())return!0;const b=p(S),C=document.activeElement;return requestAnimationFrame(()=>{if(p(S)!==b||b.isDestroyed||f()||b.view.hasFocus())return;const I=document.activeElement;I!==C&&I instanceof HTMLElement&&pm(I)&&!b.view.dom.contains(I)||(b.view.focus(),b.commands.scrollIntoView())}),typeof p(S).view.hasFocus=="function"?p(S).view.hasFocus():!0}catch(b){i.debug("[TipTapEditor] Editor not ready for focus:",b)}return!1}function zp(){if(f())return!1;if(p(S)&&p(S).view)try{return p(S).chain().focus("end").run(),!0}catch(b){i.debug("[TipTapEditor] Editor not ready for focusEnd:",b)}return!1}function $p(){if(f())return!1;if(p(S)&&p(S).view)try{return p(S).chain().focus().selectAll().run(),!0}catch(b){i.debug("[TipTapEditor] Editor not ready for focusAndSelectAll:",b)}return!1}function Hp(){try{return p(S)?.getHTML?.()??""}catch(b){return i.error("[TipTapEditor] Error getting HTML:",b),p(S)?.getText?.()??""}}function Fp(){p(S)&&(ve=!0,p(S).commands.clearContent(!0),ve=!1)}async function Vp(b){if(!p(S))return;const C=zr(b||"");As(C,p(S).schema).eq(p(S).state.doc)||p(S).chain().command(({tr:I})=>(I.setMeta("external-update",!0),!0)).setContent(C).run()}function Wp(b,C){p(S)&&p(S).view&&p(S).chain().focus().setImage({src:b,alt:C||""}).createParagraphNear().focus().run()}function jp(){if(!p(S))return i.warn("TipTapEditor: getInlineImages called but editor is not initialized"),[];const b=[];return p(S).state.doc.descendants(C=>{if(C.type.name==="image"){const I=C.attrs.src;I&&I.startsWith("data:")&&b.push({src:I,alt:C.attrs.alt||void 0})}return!0}),i.debug("TipTapEditor: Extracted inline images",{imageCount:b.length,imageSources:b.map(C=>({alt:C.alt,srcLength:C.src?.length||0}))}),b}function Kp(){return Wn(p(S))}function Up(b){if(i.debug("TipTapEditor: insertContextMention called",{hasEditor:!!p(S),hasEditorView:!!p(S)?.view,attrs:{itemType:b.itemType,identifier:b.identifier,title:b.title}}),p(S)&&p(S).view){const C=p(S).chain().focus().insertContextMention(b).run();return i.debug("TipTapEditor: insertContextMention result",{result:C}),C}return i.warn("TipTapEditor: insertContextMention failed - no editor"),!1}function qp(b){if(!p(S)||!p(S).view)return i.warn("TipTapEditor: insertMention called but editor is not initialized"),!1;try{return p(S).chain().focus().insertContent({type:"mention",attrs:{id:b.id,label:b.label,type:b.type,uri:b.uri,meta:b.meta||{}}}).insertContent(" ").run(),!0}catch(C){return i.error("TipTapEditor: insertMention failed",C),!1}}function Jp(){if(!p(S))return i.warn("TipTapEditor: getMentions called but editor is not initialized"),[];const b=[];return p(S).state.doc.descendants(C=>(C.type.name==="mention"&&b.push({id:C.attrs.id,label:C.attrs.label,type:C.attrs.type||"file",uri:C.attrs.uri||"",meta:C.attrs.meta||{}}),!0)),i.debug("TipTapEditor: Extracted mentions",{mentionCount:b.length,types:b.map(C=>C.type)}),b}function Gp(){if(!p(S))return i.warn("TipTapEditor: getContextMentions called but editor is not initialized"),[];const b=[];return p(S).state.doc.descendants(C=>{if(C.type.name==="contextMention"){const I=C.attrs;b.push({itemType:I.itemType,provider:I.provider,title:I.title,url:I.url,identifier:I.identifier,contextId:I.contextId,description:I.description,metadata:I.metadata})}return!0}),i.debug("TipTapEditor: Extracted context mentions",{mentionCount:b.length}),b}const Hr={char:"@",pluginKey:new Ve("mention"),items:async({query:b})=>{if(i.debug("Mention query:",b),D()?.(b),!g()&&y()){i.debug("No workspace but repoPath available, using async search:",y());const I={workspaceId:void 0,repoPath:y(),currentFile:void 0,currentNote:void 0,recentFiles:[]};try{const Q=await s.search(b,I);return i.debug("Mention search results from repoPath:",Q.length),Q}catch(Q){i.error("Failed to search mentions with repoPath:",Q);const z=s.searchSync(b,I);return i.debug("Fallback sync search results:",z.length),z}}if(!g())return i.debug("No workspace and no repoPath - returning empty results"),[];const C={workspaceId:g().id,currentFile:void 0,currentNote:void 0,recentFiles:[]};try{const I=await s.search(b,C);return i.debug("Mention search results:",I.length),I}catch(I){return i.error("Failed to search mentions:",I),[]}},render:()=>KC(ze),command:({editor:b,range:C,props:I})=>{const Q={id:I.id,label:I.label,type:I.type,uri:I.uri,meta:I.meta||{}};b.view&&b.chain().focus().deleteRange(C).insertContent({type:"mention",attrs:Q}).run(),V()?.(I)}};ed(()=>{let b=!1;return(async()=>{const C=zr(o()||"");if(b)return;const I=p($e);if(!I)return;me(S,new jx({element:I,extensions:[...Y()?[hC.configure({references:()=>Y()??[]}),pC]:[],mS.configure({heading:!1,codeBlock:!1,horizontalRule:!1,link:!1,bulletList:!1,orderedList:!1,listItem:!1,code:!1,bold:!1,italic:!1,strike:!1,blockquote:!1,dropcursor:!1}),Mp({openOnClick:!1,linkOnPaste:!0,shouldAutoLink:z=>/^https?:\/\//.test(z)||z.startsWith("intent://"),HTMLAttributes:{class:"text-primary-ink underline"}}),gS.configure({placeholder:c()?({editor:z})=>An.getState(z.state)?.parts.length?"":l():l(),emptyEditorClass:"is-editor-empty text-subtle",showOnlyWhenEditable:!1}),BS.configure({inline:!1,allowBase64:!0,HTMLAttributes:{class:"chat-inline-image"}}),KS.configure({workspaceId:g()?.id}),r.configure({HTMLAttributes:{class:"mention-chip"},suggestion:Hr,renderHTML({node:z}){const E=cg(z.attrs,g()?.id,ug);return["span",{"data-mention":"true","data-type":z.attrs.type||"file","data-uri":z.attrs.uri||"","data-meta":JSON.stringify(z.attrs.meta||{}),"data-id":z.attrs.id,"data-label":z.attrs.label,class:"mention-chip",tabindex:"0"},E]},renderText:({node:z})=>{const E=z.attrs||{};try{return Mg({type:E.type,id:E.id,label:E.label,meta:E.meta})}catch{return`@${E?.meta?.fullPath||E?.meta?.path||E?.label||E?.id||"item"}`}}}),lC.extend({renderText:({node:z})=>{const E=z.attrs||{},Oe=JSON.stringify({provider:E.provider||"browser",identifier:E.identifier||"",title:E.title||"",url:E.url||"",description:E.description||"",metadata:E.metadata||"",itemType:E.itemType||""});return`@context[${btoa(unescape(encodeURIComponent(Oe)))}]`}}),fC,kC,vM,RM],content:C,editable:p(Ue),enableCoreExtensions:{delete:!1},onCreate:({editor:z})=>{Bi(z),v()&&requestAnimationFrame(()=>{if(z.isDestroyed)return;z.view.dom?.focus({preventScroll:!0})})},onTransaction:({transaction:z})=>{z.docChanged&&He&&xe&&(wn(He),it?.(),it=void 0,xe.remove(),He=null,xe=null)},onUpdate:({editor:z,transaction:E})=>{if(E.getMeta("external-update")||E.getMeta(Ll)||ve)return;const Oe=de()?vC(E):null;Oe&&de()?.(Oe);const Ge=Wn(z);Bi(z,{dismissNewContext:E.getMeta("uiEvent")==="paste"}),E.getMeta(Mo)?x()?.(Ge,{programmatic:!0}):x()?.(Ge),Ip(z,E.getMeta(Tp)===!0)},onSelectionUpdate:({editor:z,transaction:E})=>{Bi(z,{dismissNewContext:E.getMeta("uiEvent")==="paste"});const{from:Oe,to:Ge,empty:J}=z.state.selection;if(J)_()?.(null);else{const De=z.state.doc.textBetween(Oe,Ge," ");_()?.(De.trim()||null)}},onFocus:({editor:z})=>{vn(()=>{me(we,!0),Bi(z)})},onBlur:()=>{vn(()=>{me(we,!1)}),Bl()},editorProps:{handleDOMEvents:{compositionstart:()=>(vn(()=>{me(Mt,!0)}),T()?.(!0),!1),compositionend:()=>(queueMicrotask(()=>{queueMicrotask(()=>{!p(S)||p(S).isDestroyed||(vn(()=>{me(Mt,!1)}),T()?.(!1),bn())})}),!1),beforeinput:()=>(U()?.(),!1)},attributes:{class:`tiptap-editor ${m()}`,role:"textbox","aria-multiline":"true","aria-label":a(),autocomplete:"off",spellcheck:"false",autocorrect:"off",autocapitalize:"off"},handlePaste:(z,E)=>{if(wC(E))return!0;const Oe=E.clipboardData?.getData("text/plain");if(Oe){const Ge=Oe.split(`
|
|
175
|
-
`);if(Ge.length>=5){const{state:De,dispatch:ut}=z,Xe=De.schema.nodes.pasteChip.create({content:Oe,lineCount:Ge.length}),$t=De.tr.replaceSelectionWith(Xe).setMeta("uiEvent","paste");return ut($t),!0}const J=E.clipboardData?.getData("text/html");if(J&&pM(J,Oe))return z.dispatch(z.state.tr.insertText(Oe).scrollIntoView().setMeta("uiEvent","paste")),!0;if(/\r|\n/.test(Oe)){const{state:De,dispatch:ut}=z,Xe=Ju(De.schema,Oe);if(Xe.length>0){const $t=new W(M.from(Xe),1,1);return ut(De.tr.replaceSelection($t).scrollIntoView().setMeta("uiEvent","paste")),!0}}}return!1},handleDrop:(z,E)=>xC(E),handleKeyDown:(z,E)=>{if(z.composing||E.isComposing||E.keyCode===229)return!1;if(Ap(z,E)||Dp(E))return!0;if(E.key==="Escape"&&H())return E.preventDefault(),H()(),!0;const Oe=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC"),Ge=J=>Dg(E,Zl(J),Oe);if(Ge("chat.mention-context")&&Zl("chat.mention-context")!=="@")return E.preventDefault(),p(S)?.chain().focus().insertContent("@").run(),!0;if(Oe&&E.ctrlKey&&!E.metaKey){if(E.key==="a"){E.preventDefault();const{state:J,dispatch:De}=z,Xe=J.selection.$head.start();return De(J.tr.setSelection(j.create(J.doc,Xe))),!0}if(E.key==="e"){E.preventDefault();const{state:J,dispatch:De}=z,Xe=J.selection.$head.end();return De(J.tr.setSelection(j.create(J.doc,Xe))),!0}if(E.key==="k"){E.preventDefault();const{state:J,dispatch:De}=z,ut=J.selection.$head,Xe=ut.pos,$t=ut.end();return Xe<$t&&De(J.tr.delete(Xe,$t)),!0}if(E.key==="p"){E.preventDefault();const J=window.getSelection();return J&&J.rangeCount>0&&J.modify("move","backward","line"),!0}if(E.key==="n"){E.preventDefault();const J=window.getSelection();return J&&J.rangeCount>0&&J.modify("move","forward","line"),!0}if(E.key==="f"){E.preventDefault();const J=window.getSelection();return J&&J.rangeCount>0&&J.modify("move","forward","character"),!0}if(E.key==="b"){E.preventDefault();const J=window.getSelection();return J&&J.rangeCount>0&&J.modify("move","backward","character"),!0}}if(E.metaKey&&!E.ctrlKey&&!E.altKey){if(E.key==="ArrowLeft"){E.preventDefault();const J=window.getSelection();return J&&J.rangeCount>0&&J.modify(E.shiftKey?"extend":"move","backward","lineboundary"),!0}if(E.key==="ArrowRight"){E.preventDefault();const J=window.getSelection();return J&&J.rangeCount>0&&J.modify(E.shiftKey?"extend":"move","forward","lineboundary"),!0}if(E.key==="ArrowUp"){E.preventDefault();const{state:J,dispatch:De}=z,ut=1;if(E.shiftKey){const{from:Xe}=J.selection;De(J.tr.setSelection(j.create(J.doc,ut,Xe)))}else De(J.tr.setSelection(j.create(J.doc,ut)));return!0}if(E.key==="ArrowDown"){E.preventDefault();const{state:J,dispatch:De}=z,ut=J.doc.content.size-1;if(E.shiftKey){const{to:Xe}=J.selection;De(J.tr.setSelection(j.create(J.doc,Xe,ut)))}else De(J.tr.setSelection(j.create(J.doc,ut)));return!0}}if(Ge("chat.force-send"))return E.preventDefault(),k()?.(),!0;if(Ge("chat.new-line"))return E.preventDefault(),p(S)?.chain().setHardBreak().scrollIntoView().run(),!0;if(E.key==="ArrowUp"&&O()&&!E.shiftKey&&!E.metaKey&&!E.ctrlKey){if(Hr.pluginKey.getState(z.state)?.active)return!1;const{state:De}=z,{from:ut}=De.selection,Xe=ut<=1,$t=De.doc.textContent.length===0;if(Xe||$t){const Hn=O()();if(Hn!==null)return E.preventDefault(),p(S)?.chain().setContent(zr(Hn)).focus("end").run(),x()?.(Hn),!0}}if(E.key==="ArrowDown"&&R()&&!E.shiftKey&&!E.metaKey&&!E.ctrlKey){if(Hr.pluginKey.getState(z.state)?.active)return!1;const{state:De}=z,{to:ut}=De.selection,Xe=De.doc.content.size-1,$t=ut>=Xe,Hn=De.doc.textContent.length===0;if($t||Hn){const Fr=R()();if(Fr!==null)return E.preventDefault(),p(S)?.chain().setContent(zr(Fr)).focus("end").run(),x()?.(Fr),!0}}return Ge("chat.send")?Hr.pluginKey.getState(z.state)?.active?!1:w()?(E.preventDefault(),w()(),!0):!1:!1}}}),!0),I.addEventListener("mouseover",zl),I.addEventListener("mouseout",$l),I.addEventListener("click",Fl),p(S).view.dom.addEventListener("keydown",Vl)})(),()=>{b=!0}});function zl(b){const C=b.target,I=Ul(C);if(I){const Q=C.getBoundingClientRect();if(!xe){xe=document.createElement("div"),(ze?.target()??document.body).appendChild(xe);const z=I.type||"file",E=I.label||C.textContent||"",Oe={file:"📄",folder:"📁",note:"📝",rule:"⚙️",personality:"🎭",command:"⌘",terminal:"💻",member:"👤"};He=Zr(xp,{target:xe,props:{mention:{id:I.id,type:z,label:E,uri:I.uri,meta:I.meta,icon:Oe[z]||"📄"},position:{x:Q.left,y:Q.bottom+5},onClose:()=>{He&&xe&&(wn(He),it?.(),it=void 0,xe.remove(),He=null,xe=null)}}});const Ge=xe.firstElementChild;Ge instanceof HTMLElement&&(it=ze?.register(Ge,$n)),xe.addEventListener("mouseout",Hl)}}}function $l(b){const C=b.target;b.relatedTarget?.closest(".mention-hover-preview")||C.hasAttribute("data-mention")&&He&&xe&&(wn(He),it?.(),it=void 0,xe.remove(),He=null,xe=null)}function Hl(b){b.relatedTarget?.closest("[data-mention]")||He&&xe&&(wn(He),it?.(),it=void 0,xe.remove(),He=null,xe=null)}async function Fl(b){const C=Ul(b.target);if(C&&C.type!=="member"){if(C.intentUrl){b.preventDefault(),b.stopPropagation();const{handleIntentLink:I}=await Hi(async()=>{const{handleIntentLink:Q}=await import("./DeHvIzqj.js");return{handleIntentLink:Q}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]),import.meta.url);await I(C.intentUrl);return}if(C.type==="note"&&C.note){if(b.preventDefault(),b.stopPropagation(),C.note.workspaceId){const{handleIntentLink:I}=await Hi(async()=>{const{handleIntentLink:Q}=await import("./DeHvIzqj.js");return{handleIntentLink:Q}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]),import.meta.url);await I(Eg(C.note.id,C.note.workspaceId))}else{const{navigateToNote:I}=await Hi(async()=>{const{navigateToNote:Q}=await import("./DE7dSDHO.js").then(z=>z.h);return{navigateToNote:Q}},__vite__mapDeps([37,38,2,39,40,41,32,15,5,1,21,22,23,24,8,25,4,27,17,6,7,9,12,33,13,14,16,34,19,36,42,43,44]),import.meta.url);await I(C.note.id)}return}if(C.type==="file"&&C.filePath){b.preventDefault(),b.stopPropagation();const{navigateToFile:I}=await Hi(async()=>{const{navigateToFile:Q}=await import("./DE7dSDHO.js").then(z=>z.h);return{navigateToFile:Q}},__vite__mapDeps([37,38,2,39,40,41,32,15,5,1,21,22,23,24,8,25,4,27,17,6,7,9,12,33,13,14,16,34,19,36,42,43,44]),import.meta.url);await I(C.filePath);return}}}function Vl(b){if(!b.metaKey||b.ctrlKey||b.altKey||!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(b.key)||!p(S))return;const{state:C,dispatch:I}=p(S).view;if(b.key==="ArrowLeft"){b.preventDefault(),b.stopPropagation();const Q=window.getSelection();Q&&Q.rangeCount>0&&Q.modify(b.shiftKey?"extend":"move","backward","lineboundary")}else if(b.key==="ArrowRight"){b.preventDefault(),b.stopPropagation();const Q=window.getSelection();Q&&Q.rangeCount>0&&Q.modify(b.shiftKey?"extend":"move","forward","lineboundary")}else if(b.key==="ArrowUp"){b.preventDefault(),b.stopPropagation();const Q=1;if(b.shiftKey){const{from:z}=C.selection;I(C.tr.setSelection(j.create(C.doc,Q,z)).scrollIntoView())}else I(C.tr.setSelection(j.create(C.doc,Q)).scrollIntoView())}else if(b.key==="ArrowDown"){b.preventDefault(),b.stopPropagation();const Q=C.doc.content.size-1;if(b.shiftKey){const{to:z}=C.selection;I(C.tr.setSelection(j.create(C.doc,z,Q)).scrollIntoView())}else I(C.tr.setSelection(j.create(C.doc,Q)).scrollIntoView())}}nd(()=>{$r.dispose(),p(S)&&(p(S).view.dom.removeEventListener("keydown",Vl),p(S).destroy()),p($e)&&(p($e).removeEventListener("mouseover",zl),p($e).removeEventListener("mouseout",$l),p($e).removeEventListener("click",Fl)),xe&&xe.removeEventListener("mouseout",Hl),He&&xe&&(wn(He),it?.(),it=void 0,xe.remove())});let No=0;bt(()=>{if(!p(S))return;const b=Wn(p(S));if(o()===b)return;if(p(S).view.hasFocus()){No+=1;return}const C=p(S).view.hasFocus(),{from:I}=p(S).state.selection,Q=++No;(async()=>{const z=zr(o()||"");!p(S)||Q!==No||Wn(p(S))===b&&p(S).chain().command(({tr:E})=>(E.setMeta("external-update",!0),!0)).setContent(z).command(({tr:E,state:Oe})=>{if(C)try{const Ge=Oe.doc.content.size,J=Math.min(I,Ge);E.setSelection(j.create(Oe.doc,J,J))}catch{}return!0}).run()})()}),bt(()=>{p(S)&&p(S).setEditable(p(Ue),!1)}),bt(()=>{!p(S)||p(S).isDestroyed||p(S).view.dispatch(p(S).state.tr.setMeta(Qr,ke()))}),bt(()=>{const b=p(S)?.view.dom;b&&(b.setAttribute("aria-haspopup","listbox"),p(mt)&&p(st)?(b.setAttribute("aria-controls",We),b.setAttribute("aria-activedescendant",p(st))):(b.removeAttribute("aria-controls"),b.removeAttribute("aria-activedescendant")))});var Xp={flushScreenEvidence:bn,showAutocompleteSuggestion:Rp,insertAtSymbol:Lp,insertText:Pp,insertPlainText:_p,focus:Bp,focusEnd:zp,focusAndSelectAll:$p,getHTML:Hp,clear:Fp,setContent:Vp,insertImage:Wp,getInlineImages:jp,getTextContent:Kp,insertContextMention:Up,insertMention:qp,getMentions:Jp,getContextMentions:Gp,get value(){return o()},set value(b=""){o(b),P()},get ariaLabel(){return a()},set ariaLabel(b=se.chat_richInput_editor_ariaLabel()){a(b),P()},get placeholder(){return l()},set placeholder(b=se.chat_richInput_askAnything_placeholder()){l(b),P()},get reactivePlaceholder(){return c()},set reactivePlaceholder(b=!1){c(b),P()},get disabled(){return u()},set disabled(b=!1){u(b),P()},get editableWhileDisabled(){return d()},set editableWhileDisabled(b=!1){d(b),P()},get inputLocked(){return f()},set inputLocked(b=!1){f(b),P()},get class(){return h()},set class(b=""){h(b),P()},get editorClassName(){return m()},set editorClassName(b=""){m(b),P()},get workspace(){return g()},set workspace(b){g(b),P()},get repoPath(){return y()},set repoPath(b){y(b),P()},get autoFocus(){return v()},set autoFocus(b=!1){v(b),P()},get onUpdate(){return x()},set onUpdate(b){x(b),P()},get onSubmit(){return w()},set onSubmit(b){w(b),P()},get onForceSubmit(){return k()},set onForceSubmit(b){k(b),P()},get onEscape(){return H()},set onEscape(b){H(b),P()},get onHistoryPrev(){return O()},set onHistoryPrev(b){O(b),P()},get onHistoryNext(){return R()},set onHistoryNext(b){R(b),P()},get onMentionStart(){return D()},set onMentionStart(b){D(b),P()},get onMentionSelect(){return V()},set onMentionSelect(b){V(b),P()},get onSelectionChange(){return _()},set onSelectionChange(b){_(b),P()},get contextItems(){return be()},set contextItems(b=[]){be(b),P()},get trailingHint(){return ke()},set trailingHint(b=null){ke(b),P()},get autocompleteContext(){return F()},set autocompleteContext(b=null){F(b),P()},get skills(){return B()},set skills(b=[]){B(b),P()},get skillsLoading(){return Z()},set skillsLoading(b=!1){Z(b),P()},get skillsError(){return ne()},set skillsError(b=null){ne(b),P()},get onSkillsRetry(){return _e()},set onSkillsRetry(b){_e(b),P()},get slashCommands(){return et()},set slashCommands(b=[]){et(b),P()},get slashEmptyLabel(){return at()},set slashEmptyLabel(b){at(b),P()},get slashNotice(){return lt()},set slashNotice(b){lt(b),P()},get unavailableSkillTitle(){return N()},set unavailableSkillTitle(b){N(b),P()},get screenReferences(){return Y()},set screenReferences(b){Y(b),P()},get screenInsertions(){return le()},set screenInsertions(b=[]){le(b),P()},get screenInterim(){return q()},set screenInterim(b=[]){q(b),P()},get screenSpeechActive(){return Be()},set screenSpeechActive(b=!1){Be(b),P()},get onScreenInsertionApplied(){return Ae()},set onScreenInsertionApplied(b){Ae(b),P()},get onCompositionChange(){return T()},set onCompositionChange(b){T(b),P()},get onUserTextInput(){return U()},set onUserTextInput(b){U(b),P()},get onScreenReferencesEdited(){return de()},set onScreenReferencesEdited(b){de(b),P()},get minHeight(){return Ne()},set minHeight(b=80){Ne(b),P()},get maxHeight(){return Ce()},set maxHeight(b=300){Ce(b),P()},$set:jt,$on:(b,C)=>Kt(e,b,C)},Oo=UM(),Wl=ye(Oo),Yp=()=>p(mt),Qp=b=>!b&&zi();Lo(Wl,()=>_g,(b,C)=>{C(b,{get open(){return Yp()},set open(I){Qp(I)},children:(I,Q)=>{var z=wr(),E=Bt(z);{let Oe=$(()=>ze?.target());Lo(E,()=>km,(Ge,J)=>{J(Ge,{get to(){return p(Oe)},children:(De,ut)=>{var Xe=wr(),$t=Bt(Xe);{let Hn=$(()=>p($e)??null);Lo($t,()=>Pg,(Fr,Zp)=>{Zp(Fr,{get customAnchor(){return p(Hn)},side:"top",align:"start",sideOffset:4,trapFocus:!1,onOpenAutoFocus:_l,onCloseAutoFocus:_l,class:"z-(--layer-popover) w-72 max-w-full","data-testid":"slash-skill-menu",get ref(){return p(rt)},set ref(Ro){me(rt,Ro,!0)},children:(Ro,JM)=>{Er(Ep(Ro,{get listboxId(){return We},get commands(){return p(Fe)},get items(){return p(fe)},get loading(){return Z()},get error(){return ne()},get emptyLabel(){return at()},get notice(){return lt()},get onRetry(){return _e()},onSelect:Np,onSelectCommand:Op,onDismiss:zi,onActiveOptionChange:Do=>me(st,Do,!0)}),Do=>me(Dt,Do,!0),()=>p(Dt))},$$slots:{default:!0}})})}K(De,Xe)},$$slots:{default:!0}})})}K(I,z)},$$slots:{default:!0}})});var Io=oe(Wl,2);let jl;return Er(Io,b=>me($e,b),()=>p($e)),ue(Oo),ie(()=>{jl=pn(Io,1,`tiptap-container ${h()??""}`,"svelte-bv9i3d",jl,{"placeholder-suppressed":p(ct)}),hi(Io,`--tt-min-height:${Ne()}px;--tt-max-height:${Ce()}px`)}),K(n,Oo),qt(Xp)}export{nM as A,rr as B,o1 as C,or as D,jx as E,M as F,gp as G,gl as H,_i as I,yl as J,xC as K,NE as L,ar as M,pp as N,Jf as O,Ie as P,Te as Q,BS as R,ae as S,Lw as T,LS as U,mS as V,gS as W,_r as X,c1 as a,lC as b,ja as c,ft as d,he as e,Ke as f,pd as g,ot as h,G as i,qx as j,Co as k,KS as l,Ve as m,Oy as n,W as o,Dl as p,Pw as q,j as r,qM as s,Ya as t,Ee as u,KC as v,IE as w,AE as x,Uv as y,X as z};
|
|
175
|
+
`);if(Ge.length>=5){const{state:De,dispatch:ut}=z,Xe=De.schema.nodes.pasteChip.create({content:Oe,lineCount:Ge.length}),$t=De.tr.replaceSelectionWith(Xe).setMeta("uiEvent","paste");return ut($t),!0}const J=E.clipboardData?.getData("text/html");if(J&&pM(J,Oe))return z.dispatch(z.state.tr.insertText(Oe).scrollIntoView().setMeta("uiEvent","paste")),!0;if(/\r|\n/.test(Oe)){const{state:De,dispatch:ut}=z,Xe=Ju(De.schema,Oe);if(Xe.length>0){const $t=new W(M.from(Xe),1,1);return ut(De.tr.replaceSelection($t).scrollIntoView().setMeta("uiEvent","paste")),!0}}}return!1},handleDrop:(z,E)=>xC(E),handleKeyDown:(z,E)=>{if(z.composing||E.isComposing||E.keyCode===229)return!1;if(Ap(z,E)||Dp(E))return!0;if(E.key==="Escape"&&H())return E.preventDefault(),H()(),!0;const Oe=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC"),Ge=J=>Dg(E,Zl(J),Oe);if(Ge("chat.mention-context")&&Zl("chat.mention-context")!=="@")return E.preventDefault(),p(S)?.chain().focus().insertContent("@").run(),!0;if(Oe&&E.ctrlKey&&!E.metaKey){if(E.key==="a"){E.preventDefault();const{state:J,dispatch:De}=z,Xe=J.selection.$head.start();return De(J.tr.setSelection(j.create(J.doc,Xe))),!0}if(E.key==="e"){E.preventDefault();const{state:J,dispatch:De}=z,Xe=J.selection.$head.end();return De(J.tr.setSelection(j.create(J.doc,Xe))),!0}if(E.key==="k"){E.preventDefault();const{state:J,dispatch:De}=z,ut=J.selection.$head,Xe=ut.pos,$t=ut.end();return Xe<$t&&De(J.tr.delete(Xe,$t)),!0}if(E.key==="p"){E.preventDefault();const J=window.getSelection();return J&&J.rangeCount>0&&J.modify("move","backward","line"),!0}if(E.key==="n"){E.preventDefault();const J=window.getSelection();return J&&J.rangeCount>0&&J.modify("move","forward","line"),!0}if(E.key==="f"){E.preventDefault();const J=window.getSelection();return J&&J.rangeCount>0&&J.modify("move","forward","character"),!0}if(E.key==="b"){E.preventDefault();const J=window.getSelection();return J&&J.rangeCount>0&&J.modify("move","backward","character"),!0}}if(E.metaKey&&!E.ctrlKey&&!E.altKey){if(E.key==="ArrowLeft"){E.preventDefault();const J=window.getSelection();return J&&J.rangeCount>0&&J.modify(E.shiftKey?"extend":"move","backward","lineboundary"),!0}if(E.key==="ArrowRight"){E.preventDefault();const J=window.getSelection();return J&&J.rangeCount>0&&J.modify(E.shiftKey?"extend":"move","forward","lineboundary"),!0}if(E.key==="ArrowUp"){E.preventDefault();const{state:J,dispatch:De}=z,ut=1;if(E.shiftKey){const{from:Xe}=J.selection;De(J.tr.setSelection(j.create(J.doc,ut,Xe)))}else De(J.tr.setSelection(j.create(J.doc,ut)));return!0}if(E.key==="ArrowDown"){E.preventDefault();const{state:J,dispatch:De}=z,ut=J.doc.content.size-1;if(E.shiftKey){const{to:Xe}=J.selection;De(J.tr.setSelection(j.create(J.doc,Xe,ut)))}else De(J.tr.setSelection(j.create(J.doc,ut)));return!0}}if(Ge("chat.force-send"))return E.preventDefault(),k()?.(),!0;if(Ge("chat.new-line"))return E.preventDefault(),p(S)?.chain().setHardBreak().scrollIntoView().run(),!0;if(E.key==="ArrowUp"&&O()&&!E.shiftKey&&!E.metaKey&&!E.ctrlKey){if(Hr.pluginKey.getState(z.state)?.active)return!1;const{state:De}=z,{from:ut}=De.selection,Xe=ut<=1,$t=De.doc.textContent.length===0;if(Xe||$t){const Hn=O()();if(Hn!==null)return E.preventDefault(),p(S)?.chain().setContent(zr(Hn)).focus("end").run(),x()?.(Hn),!0}}if(E.key==="ArrowDown"&&R()&&!E.shiftKey&&!E.metaKey&&!E.ctrlKey){if(Hr.pluginKey.getState(z.state)?.active)return!1;const{state:De}=z,{to:ut}=De.selection,Xe=De.doc.content.size-1,$t=ut>=Xe,Hn=De.doc.textContent.length===0;if($t||Hn){const Fr=R()();if(Fr!==null)return E.preventDefault(),p(S)?.chain().setContent(zr(Fr)).focus("end").run(),x()?.(Fr),!0}}return Ge("chat.send")?Hr.pluginKey.getState(z.state)?.active?!1:w()?(E.preventDefault(),w()(),!0):!1:!1}}}),!0),I.addEventListener("mouseover",zl),I.addEventListener("mouseout",$l),I.addEventListener("click",Fl),p(S).view.dom.addEventListener("keydown",Vl)})(),()=>{b=!0}});function zl(b){const C=b.target,I=Ul(C);if(I){const Q=C.getBoundingClientRect();if(!xe){xe=document.createElement("div"),(ze?.target()??document.body).appendChild(xe);const z=I.type||"file",E=I.label||C.textContent||"",Oe={file:"📄",folder:"📁",note:"📝",rule:"⚙️",personality:"🎭",command:"⌘",terminal:"💻",member:"👤"};He=Zr(xp,{target:xe,props:{mention:{id:I.id,type:z,label:E,uri:I.uri,meta:I.meta,icon:Oe[z]||"📄"},position:{x:Q.left,y:Q.bottom+5},onClose:()=>{He&&xe&&(wn(He),it?.(),it=void 0,xe.remove(),He=null,xe=null)}}});const Ge=xe.firstElementChild;Ge instanceof HTMLElement&&(it=ze?.register(Ge,$n)),xe.addEventListener("mouseout",Hl)}}}function $l(b){const C=b.target;b.relatedTarget?.closest(".mention-hover-preview")||C.hasAttribute("data-mention")&&He&&xe&&(wn(He),it?.(),it=void 0,xe.remove(),He=null,xe=null)}function Hl(b){b.relatedTarget?.closest("[data-mention]")||He&&xe&&(wn(He),it?.(),it=void 0,xe.remove(),He=null,xe=null)}async function Fl(b){const C=Ul(b.target);if(C&&C.type!=="member"){if(C.intentUrl){b.preventDefault(),b.stopPropagation();const{handleIntentLink:I}=await Hi(async()=>{const{handleIntentLink:Q}=await import("./CkJj_XU1.js");return{handleIntentLink:Q}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]),import.meta.url);await I(C.intentUrl);return}if(C.type==="note"&&C.note){if(b.preventDefault(),b.stopPropagation(),C.note.workspaceId){const{handleIntentLink:I}=await Hi(async()=>{const{handleIntentLink:Q}=await import("./CkJj_XU1.js");return{handleIntentLink:Q}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36]),import.meta.url);await I(Eg(C.note.id,C.note.workspaceId))}else{const{navigateToNote:I}=await Hi(async()=>{const{navigateToNote:Q}=await import("./B8eFCa5E.js").then(z=>z.h);return{navigateToNote:Q}},__vite__mapDeps([37,38,2,39,40,41,32,15,5,1,21,22,23,24,8,25,4,27,17,6,7,9,12,33,13,14,16,34,19,36,42,43,44]),import.meta.url);await I(C.note.id)}return}if(C.type==="file"&&C.filePath){b.preventDefault(),b.stopPropagation();const{navigateToFile:I}=await Hi(async()=>{const{navigateToFile:Q}=await import("./B8eFCa5E.js").then(z=>z.h);return{navigateToFile:Q}},__vite__mapDeps([37,38,2,39,40,41,32,15,5,1,21,22,23,24,8,25,4,27,17,6,7,9,12,33,13,14,16,34,19,36,42,43,44]),import.meta.url);await I(C.filePath);return}}}function Vl(b){if(!b.metaKey||b.ctrlKey||b.altKey||!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(b.key)||!p(S))return;const{state:C,dispatch:I}=p(S).view;if(b.key==="ArrowLeft"){b.preventDefault(),b.stopPropagation();const Q=window.getSelection();Q&&Q.rangeCount>0&&Q.modify(b.shiftKey?"extend":"move","backward","lineboundary")}else if(b.key==="ArrowRight"){b.preventDefault(),b.stopPropagation();const Q=window.getSelection();Q&&Q.rangeCount>0&&Q.modify(b.shiftKey?"extend":"move","forward","lineboundary")}else if(b.key==="ArrowUp"){b.preventDefault(),b.stopPropagation();const Q=1;if(b.shiftKey){const{from:z}=C.selection;I(C.tr.setSelection(j.create(C.doc,Q,z)).scrollIntoView())}else I(C.tr.setSelection(j.create(C.doc,Q)).scrollIntoView())}else if(b.key==="ArrowDown"){b.preventDefault(),b.stopPropagation();const Q=C.doc.content.size-1;if(b.shiftKey){const{to:z}=C.selection;I(C.tr.setSelection(j.create(C.doc,z,Q)).scrollIntoView())}else I(C.tr.setSelection(j.create(C.doc,Q)).scrollIntoView())}}nd(()=>{$r.dispose(),p(S)&&(p(S).view.dom.removeEventListener("keydown",Vl),p(S).destroy()),p($e)&&(p($e).removeEventListener("mouseover",zl),p($e).removeEventListener("mouseout",$l),p($e).removeEventListener("click",Fl)),xe&&xe.removeEventListener("mouseout",Hl),He&&xe&&(wn(He),it?.(),it=void 0,xe.remove())});let No=0;bt(()=>{if(!p(S))return;const b=Wn(p(S));if(o()===b)return;if(p(S).view.hasFocus()){No+=1;return}const C=p(S).view.hasFocus(),{from:I}=p(S).state.selection,Q=++No;(async()=>{const z=zr(o()||"");!p(S)||Q!==No||Wn(p(S))===b&&p(S).chain().command(({tr:E})=>(E.setMeta("external-update",!0),!0)).setContent(z).command(({tr:E,state:Oe})=>{if(C)try{const Ge=Oe.doc.content.size,J=Math.min(I,Ge);E.setSelection(j.create(Oe.doc,J,J))}catch{}return!0}).run()})()}),bt(()=>{p(S)&&p(S).setEditable(p(Ue),!1)}),bt(()=>{!p(S)||p(S).isDestroyed||p(S).view.dispatch(p(S).state.tr.setMeta(Qr,ke()))}),bt(()=>{const b=p(S)?.view.dom;b&&(b.setAttribute("aria-haspopup","listbox"),p(mt)&&p(st)?(b.setAttribute("aria-controls",We),b.setAttribute("aria-activedescendant",p(st))):(b.removeAttribute("aria-controls"),b.removeAttribute("aria-activedescendant")))});var Xp={flushScreenEvidence:bn,showAutocompleteSuggestion:Rp,insertAtSymbol:Lp,insertText:Pp,insertPlainText:_p,focus:Bp,focusEnd:zp,focusAndSelectAll:$p,getHTML:Hp,clear:Fp,setContent:Vp,insertImage:Wp,getInlineImages:jp,getTextContent:Kp,insertContextMention:Up,insertMention:qp,getMentions:Jp,getContextMentions:Gp,get value(){return o()},set value(b=""){o(b),P()},get ariaLabel(){return a()},set ariaLabel(b=se.chat_richInput_editor_ariaLabel()){a(b),P()},get placeholder(){return l()},set placeholder(b=se.chat_richInput_askAnything_placeholder()){l(b),P()},get reactivePlaceholder(){return c()},set reactivePlaceholder(b=!1){c(b),P()},get disabled(){return u()},set disabled(b=!1){u(b),P()},get editableWhileDisabled(){return d()},set editableWhileDisabled(b=!1){d(b),P()},get inputLocked(){return f()},set inputLocked(b=!1){f(b),P()},get class(){return h()},set class(b=""){h(b),P()},get editorClassName(){return m()},set editorClassName(b=""){m(b),P()},get workspace(){return g()},set workspace(b){g(b),P()},get repoPath(){return y()},set repoPath(b){y(b),P()},get autoFocus(){return v()},set autoFocus(b=!1){v(b),P()},get onUpdate(){return x()},set onUpdate(b){x(b),P()},get onSubmit(){return w()},set onSubmit(b){w(b),P()},get onForceSubmit(){return k()},set onForceSubmit(b){k(b),P()},get onEscape(){return H()},set onEscape(b){H(b),P()},get onHistoryPrev(){return O()},set onHistoryPrev(b){O(b),P()},get onHistoryNext(){return R()},set onHistoryNext(b){R(b),P()},get onMentionStart(){return D()},set onMentionStart(b){D(b),P()},get onMentionSelect(){return V()},set onMentionSelect(b){V(b),P()},get onSelectionChange(){return _()},set onSelectionChange(b){_(b),P()},get contextItems(){return be()},set contextItems(b=[]){be(b),P()},get trailingHint(){return ke()},set trailingHint(b=null){ke(b),P()},get autocompleteContext(){return F()},set autocompleteContext(b=null){F(b),P()},get skills(){return B()},set skills(b=[]){B(b),P()},get skillsLoading(){return Z()},set skillsLoading(b=!1){Z(b),P()},get skillsError(){return ne()},set skillsError(b=null){ne(b),P()},get onSkillsRetry(){return _e()},set onSkillsRetry(b){_e(b),P()},get slashCommands(){return et()},set slashCommands(b=[]){et(b),P()},get slashEmptyLabel(){return at()},set slashEmptyLabel(b){at(b),P()},get slashNotice(){return lt()},set slashNotice(b){lt(b),P()},get unavailableSkillTitle(){return N()},set unavailableSkillTitle(b){N(b),P()},get screenReferences(){return Y()},set screenReferences(b){Y(b),P()},get screenInsertions(){return le()},set screenInsertions(b=[]){le(b),P()},get screenInterim(){return q()},set screenInterim(b=[]){q(b),P()},get screenSpeechActive(){return Be()},set screenSpeechActive(b=!1){Be(b),P()},get onScreenInsertionApplied(){return Ae()},set onScreenInsertionApplied(b){Ae(b),P()},get onCompositionChange(){return T()},set onCompositionChange(b){T(b),P()},get onUserTextInput(){return U()},set onUserTextInput(b){U(b),P()},get onScreenReferencesEdited(){return de()},set onScreenReferencesEdited(b){de(b),P()},get minHeight(){return Ne()},set minHeight(b=80){Ne(b),P()},get maxHeight(){return Ce()},set maxHeight(b=300){Ce(b),P()},$set:jt,$on:(b,C)=>Kt(e,b,C)},Oo=UM(),Wl=ye(Oo),Yp=()=>p(mt),Qp=b=>!b&&zi();Lo(Wl,()=>_g,(b,C)=>{C(b,{get open(){return Yp()},set open(I){Qp(I)},children:(I,Q)=>{var z=wr(),E=Bt(z);{let Oe=$(()=>ze?.target());Lo(E,()=>km,(Ge,J)=>{J(Ge,{get to(){return p(Oe)},children:(De,ut)=>{var Xe=wr(),$t=Bt(Xe);{let Hn=$(()=>p($e)??null);Lo($t,()=>Pg,(Fr,Zp)=>{Zp(Fr,{get customAnchor(){return p(Hn)},side:"top",align:"start",sideOffset:4,trapFocus:!1,onOpenAutoFocus:_l,onCloseAutoFocus:_l,class:"z-(--layer-popover) w-72 max-w-full","data-testid":"slash-skill-menu",get ref(){return p(rt)},set ref(Ro){me(rt,Ro,!0)},children:(Ro,JM)=>{Er(Ep(Ro,{get listboxId(){return We},get commands(){return p(Fe)},get items(){return p(fe)},get loading(){return Z()},get error(){return ne()},get emptyLabel(){return at()},get notice(){return lt()},get onRetry(){return _e()},onSelect:Np,onSelectCommand:Op,onDismiss:zi,onActiveOptionChange:Do=>me(st,Do,!0)}),Do=>me(Dt,Do,!0),()=>p(Dt))},$$slots:{default:!0}})})}K(De,Xe)},$$slots:{default:!0}})})}K(I,z)},$$slots:{default:!0}})});var Io=oe(Wl,2);let jl;return Er(Io,b=>me($e,b),()=>p($e)),ue(Oo),ie(()=>{jl=pn(Io,1,`tiptap-container ${h()??""}`,"svelte-bv9i3d",jl,{"placeholder-suppressed":p(ct)}),hi(Io,`--tt-min-height:${Ne()}px;--tt-max-height:${Ce()}px`)}),K(n,Oo),qt(Xp)}export{nM as A,rr as B,o1 as C,or as D,jx as E,M as F,gp as G,gl as H,_i as I,yl as J,xC as K,NE as L,ar as M,pp as N,Jf as O,Ie as P,Te as Q,BS as R,ae as S,Lw as T,LS as U,mS as V,gS as W,_r as X,c1 as a,lC as b,ja as c,ft as d,he as e,Ke as f,pd as g,ot as h,G as i,qx as j,Co as k,KS as l,Ve as m,Oy as n,W as o,Dl as p,Pw as q,j as r,qM as s,Ya as t,Ee as u,KC as v,IE as w,AE as x,Uv as y,X as z};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{C as M}from"./B5aYN90J.js";import{a as v}from"./BdWqymET.js";import{f as D}from"./C6mS8uZB.js";import{Jv as o,Eq as E,DN as _,m as A,vp as O,u$ as C,ga as H,D3 as L,Dl as P,Fq as R,D7 as q}from"./tr-2J8Mf.js";import{ba as p}from"./BaujsV9k.js";import{d as x}from"./B0Z-1lwJ.js";import{n as F}from"./
|
|
1
|
+
import{C as M}from"./B5aYN90J.js";import{a as v}from"./BdWqymET.js";import{f as D}from"./C6mS8uZB.js";import{Jv as o,Eq as E,DN as _,m as A,vp as O,u$ as C,ga as H,D3 as L,Dl as P,Fq as R,D7 as q}from"./tr-2J8Mf.js";import{ba as p}from"./BaujsV9k.js";import{d as x}from"./B0Z-1lwJ.js";import{n as F}from"./CCMszM-p.js";import{o as B,e as N}from"./DOTkiVAt.js";const u=new v("OpenMessage"),S=150,y=15e3,W=2,G=[150,400,800,1500,3e3],Y=M;let g;function k(e){return new Promise(t=>setTimeout(t,e))}function m(e,t){const s=o.state,n=s.agentSessions?.byAgentId[e]?.messages,a=s.agentSessions?.historySegmentsByAgentId?.[e]?.messages;return!!(n?.some(r=>r.id===t)||a?.some(r=>r.id===t))}function T(e,t){const s=o.state,n=s.agentSessions?.historySegmentsByAgentId?.[e];n?.detachedFromTail!==!0||n.messages.some(r=>r.id===t)||!s.agentSessions?.byAgentId[e]?.messages?.some(r=>r.id===t)||o.dispatch(H(e))}function $(e){return o.state.chatState?.byAgentId[e]?.transcriptHydration}async function K(e,t,s){const n=Date.now()+y;let a=0;for(;Date.now()<n;){if(s.aborted)return!1;if(m(e,t))return!0;if(a>=W&&$(e)==="settled"&&!p.select(o.state,e).initialHistoryPending)return!1;a++,await k(S)}return!s.aborted&&m(e,t)}async function I(e,t,s,n){const a=Date.now()+y;for(;p.select(o.state,e).initialHistoryPending;){if(n?.aborted||Date.now()>=a)return!1;await k(S)}const r=o.state.agentSessions?.byAgentId[e];if(!r||n?.aborted)return!1;if(m(e,t))return T(e,t),!0;s??=r.workspaceId;const l=p.select(o.state,e);let c={nextToken:l.scrollbackOlderToken,prevToken:l.scrollbackGapToken,olderAnchorId:l.scrollbackOlderTokenAnchorId};o.dispatch(L(e,"seek"));const d=p.select(o.state,e).scrollbackDiscardEpoch,f=()=>!!o.state.agentSessions?.byAgentId[e]&&p.select(o.state,e).scrollbackDiscardEpoch===d;try{const i=await D.agents.getConversation(e,Y,void 0,t,void 0,s);return n?.aborted||!f()||!i.messages.some(h=>h.id===t)?!1:(o.dispatch(P(e,i.messages,i.messages[0]?.seq)),i.nextToken===null&&o.dispatch(R(e)),c={nextToken:i.nextToken,prevToken:i.prevToken,olderAnchorId:i.messages[0]?.id??null},m(e,t))}catch(i){return u.warn("[seekConversationToMessage] Seek fetch failed (message may no longer exist)",{agentId:e,messageId:t,error:i}),!1}finally{f()&&o.dispatch(q(e,c))}}async function ee(e){if(e.signal?.aborted)return;g?.abort(),g=new AbortController;const t=e.signal?AbortSignal.any([g.signal,e.signal]):g.signal,{workspaceId:s,agentId:n,messageId:a,query:r,targetTabId:l}=e;u.info("[openMessage] Deep-opening conversation at message",{workspaceId:s,agentId:n,messageId:a});const c=s===A;c&&!e.contentAlreadyOpen&&(o.dispatch(E(n)),o.dispatch(_(A,n)),o.dispatch(O("chief")));const d=c?"/":N(s);if(!e.contentAlreadyOpen&&typeof window<"u"&&window.location.pathname!==d){try{c?await F(d):await B(s)}catch(w){u.warn("[openMessage] Workspace navigation failed",{workspaceId:s,error:w});return}if(t.aborted)return;if(window.location.pathname!==d){u.warn("[openMessage] Workspace navigation was not confirmed",{workspaceId:s});return}}!e.contentAlreadyOpen&&!c&&o.dispatch(C(s,{agentId:n}));const f=await K(n,a,t);f&&T(n,a);const i=f||await I(n,a,s,t);if(t.aborted)return;if(!i){u.warn("[openMessage] Message not found; conversation opened at tail",{agentId:n,messageId:a});return}const h=`open-message-${Date.now()}-${Math.random().toString(36).slice(2)}`,b={agentId:n,messageId:a,query:r,targetTabId:l,requestId:h,signal:t};for(const w of G)setTimeout(()=>{t.aborted||x("chat:open-message",b)},w)}export{ee as openMessage,I as seekConversationToMessage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{Jv as l,s0 as u,J8 as v}from"./tr-2J8Mf.js";import{at as b}from"./DKHY8q_S.js";import{bJ as m}from"./BaujsV9k.js";import{be as S,ba as P}from"./
|
|
1
|
+
import{Jv as l,s0 as u,J8 as v}from"./tr-2J8Mf.js";import{at as b}from"./DKHY8q_S.js";import{bJ as m}from"./BaujsV9k.js";import{be as S,ba as P}from"./DQK1MQRy.js";import{K as M}from"./DCK8dPAL.js";import{bm as s}from"./C0QTy0Sy.js";import{l as E}from"./CE7dsja4.js";const D=l.createSelector(t=>t.backgroundAgentSettings.defaultModel),O=l.createSelector(t=>t.backgroundAgentSettings.typeOverrides),j=l.createSelector(t=>t.backgroundAgentSettings.defaultReasoningEffort),H=l.createSelector(t=>t.backgroundAgentSettings.typeReasoningEffortOverrides),w=l.createSelector(t=>t.backgroundAgentSettings),A=l.createSelector(t=>{const a=new Map,o=(e,i)=>{const n=a.get(e)??new Set;n.add(i),a.set(e,n)},f=m.select(t),d=M.select(t),g=b.select(t)[d];g&&d&&o(d,s.settings_providers_inUseDefaultModel_label({model:g})),u(d)&&!g&&o(d,s.settings_providers_inUseDefaultProvider_label());const p=t.backgroundAgentSettings?.providerId;p&&u(p)&&o(p,s.settings_providers_inUseQuickActions_label());for(const e of S.select(t)){const i=P.select(t,e.id),n=e.source?{project:s.settings_providers_pinSourceProject_label(),user:s.settings_providers_pinSourceUser_label(),bundled:s.settings_providers_pinSourceBundled_label(),builtin:s.settings_providers_pinSourceBuiltin_label(),"electron-store":s.settings_providers_pinSourceLegacy_label()}[e.source]:void 0,c=r=>n&&i?s.settings_providers_inUseSourcePath_label({reason:r,source:n,path:i}):n?s.settings_providers_inUseSource_label({reason:r,source:n}):i?s.settings_providers_inUsePath_label({reason:r,path:i}):r;if(e.codingAgent&&o(e.codingAgent,c(s.settings_providers_inUseSpecialistAgent_label({name:e.name}))),e.modelOptions?.forEach((r,_)=>{r.provider&&u(r.provider)&&o(r.provider,c(s.settings_providers_inUseSpecialistModelOption_label({name:e.name,position:E(_+1)})))}),e.defaultModel)if(e.defaultModel.includes(":")){const r=v(e.defaultModel).providerId??f;o(r,c(s.settings_providers_inUseSpecialistModel_label({name:e.name,model:e.defaultModel})))}else e.codingAgent||o(f,c(s.settings_providers_inUseSpecialistModel_label({name:e.name,model:e.defaultModel})))}return Object.fromEntries([...a].map(([e,i])=>[e,[...i].join(`
|
|
2
2
|
`)]))});l.createSelector((t,a)=>A.select(t)[a]??null);const h=[{id:"dracula",label:"Dracula"},{id:"nord",label:"Nord"},{id:"rose-pine",label:"Rosé Pine"},{id:"tokyo-night",label:"Tokyo Night"},{id:"solarized",label:"Solarized"},{id:"github",label:"GitHub"},{id:"high-contrast",label:"High Contrast"}],J=h.map(({id:t})=>t);export{J as T,h as a,j as b,w as c,O as d,H as e,A as f,D as s};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{t as Ke,bo as k,bm as Ce,bw as Ve,b as Je,q as ur,n as vr,r as gr,o as fr,p as hr,s as mr,bs as ht,bq as pr,f as _r,l as xr,g as br,e as wr,d as kr,m as yr,j as $r,i as Sr,h as Cr,k as Nr}from"./C0QTy0Sy.js";import{bs as Ue,ca as Xe,aD as e,ay as be,a5 as o,bH as L,bS as n,a7 as Pt,W as i,be as st,b$ as et,b_ as M,bO as C,bA as s,bl as O,bn as qe,bV as we,aA as y,c9 as _,aB as x,br as mt}from"./3SdAC2_C.js";import{nZ as Rr,Jv as ct,n4 as Tt,em as Mr,eJ as Pr,eK as Lr}from"./tr-2J8Mf.js";import{i as H}from"./bhKPSdq4.js";import{n as We,j as Oe,h as at}from"./DLwWVKiF.js";import{dH as Ir,bt as Ar}from"./BaujsV9k.js";import{a9 as jt}from"./
|
|
1
|
+
import{t as Ke,bo as k,bm as Ce,bw as Ve,b as Je,q as ur,n as vr,r as gr,o as fr,p as hr,s as mr,bs as ht,bq as pr,f as _r,l as xr,g as br,e as wr,d as kr,m as yr,j as $r,i as Sr,h as Cr,k as Nr}from"./C0QTy0Sy.js";import{bs as Ue,ca as Xe,aD as e,ay as be,a5 as o,bH as L,bS as n,a7 as Pt,W as i,be as st,b$ as et,b_ as M,bO as C,bA as s,bl as O,bn as qe,bV as we,aA as y,c9 as _,aB as x,br as mt}from"./3SdAC2_C.js";import{nZ as Rr,Jv as ct,n4 as Tt,em as Mr,eJ as Pr,eK as Lr}from"./tr-2J8Mf.js";import{i as H}from"./bhKPSdq4.js";import{n as We,j as Oe,h as at}from"./DLwWVKiF.js";import{dH as Ir,bt as Ar}from"./BaujsV9k.js";import{a9 as jt}from"./BFnrc2L0.js";import{I as it,g as Ge,i as Lt}from"./B6S6VNu7.js";import{f as xe}from"./FzlZUztb.js";import"./DCRuihKm.js";import{f as He,s as Er}from"./7UPrdiE9.js";import"./CrD0jtXE.js";import{F as fe,a2 as Hr,cR as zr,aw as ot,ax as pt,c2 as Wr,aV as Dr,bN as Tr,bH as jr,b9 as Fr,cW as Br,cn as Gr,b6 as St,c$ as Rt,cr as _t,bo as Or,cF as Kr,au as Vr}from"./U9jJmfYa.js";import{i as Jr}from"./BGOOya_A.js";import{h as Ft}from"./BKD7o1lQ.js";import{H as Bt}from"./CcNhqKh5.js";import{I as Jt}from"./BAKPnd3w.js";import"./A9niI_uA.js";import{q as Ur}from"./CE7dsja4.js";import{M as Mt}from"./D3326bvN.js";import{B as qr}from"./B8-Q1tED.js";import{S as Ct}from"./fiz8N_zQ.js";const Qr=[/^diff --git /,/^index\s/,/^---\s/,/^\+\+\+\s/,/^\/];function Yr($){const r=[];if(!$)return r;const d=$.split(`
|
|
2
2
|
`);let m=null,b=0,u=0;const T=P=>{const h=P.match(/@@ -(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))? @@/),U=h?parseInt(h[1],10):0,K=h&&h[2]?parseInt(h[2],10):null,pe=h?parseInt(h[3],10):0,q=h&&h[4]?parseInt(h[4],10):null;m={header:P,oldStart:U,oldLines:K,newStart:pe,newLines:q,lines:[]},r.push(m),b=U,u=pe};for(const P of d){if(P.startsWith("@@")){T(P);continue}if(!m)continue;const h=m;P.startsWith("+")?h.lines.push({type:"addition",content:P.slice(1),oldNum:null,newNum:u++,raw:P}):P.startsWith("-")?h.lines.push({type:"deletion",content:P.slice(1),oldNum:b++,newNum:null,raw:P}):P.startsWith(" ")?h.lines.push({type:"context",content:P.slice(1),oldNum:b++,newNum:u++,raw:P}):Qr.some(U=>U.test(P))||P.trim()===""&&h.lines.push({type:"context",content:"",oldNum:b++,newNum:u++,raw:P})}return r}var Zr=x('<div><!> <!> <!></div> <p class="text-ui text-subtle mt-1"> </p>',1);function Ut($,r){if(new.target)return Ke({component:Ut,...$});Ue(r,!0);let d=k(r,"lineNumber",7,0),m=k(r,"fileName",7,""),b=k(r,"onSend",7),u=k(r,"onClose",7),T=k(r,"isSending",7,!1),P=k(r,"class",7,""),h=we(""),U=we(null);Xe(()=>{e(U)&&e(U).focus()});function K(){!e(h).trim()||T()||(b()?.(e(h).trim(),d(),m()),L(h,""))}function pe(I){I.key==="Enter"&&!I.shiftKey&&(I.preventDefault(),K()),I.key==="Escape"&&u()?.()}var q={get lineNumber(){return d()},set lineNumber(I=0){d(I),y()},get fileName(){return m()},set fileName(I=""){m(I),y()},get onSend(){return b()},set onSend(I){b(I),y()},get onClose(){return u()},set onClose(I){u(I),y()},get isSending(){return T()},set isSending(I=!1){T(I),y()},get class(){return P()},set class(I=""){P(I),y()},$set:Ve,$on:(I,he)=>Je(r,I,he)},w=Zr(),z=be(w),de=o(z);{let I=_(()=>Ce.codeReview_inlineComment_askLine_placeholder());Jt(de,{onkeydown:pe,get placeholder(){return e(I)},get disabled(){return T()},class:"flex-1 h-8 rounded-md border border-border bg-background px-3 text-sm placeholder:text-muted-foreground disabled:opacity-50",get ref(){return e(U)},set ref(he){L(U,he,!0)},get value(){return e(h)},set value(he){L(h,he,!0)}})}var ce=n(de,2);{let I=_(()=>!e(h).trim()||T());xe(ce,{type:"button",variant:"primary",onclick:K,get disabled(){return e(I)},class:"h-8 w-8 p-0",children:(he,Ne)=>{var _e=Pt(),S=be(_e);{var E=me=>{it(me,{size:14})},Ie=me=>{fe(me,{get icon(){return Hr},class:"h-3.5 w-3.5"})};H(S,me=>{T()?me(E):me(Ie,-1)})}i(he,_e)},$$slots:{default:!0}})}var ae=n(ce,2);xe(ae,{type:"button",variant:"ghost",onclick:()=>u()?.(),class:"h-8 px-2 text-xs text-muted-foreground hover:text-foreground transition-colors",children:(I,he)=>{st();var Ne=et();M(_e=>C(Ne,_e),[()=>Ce.codeReview_inlineComment_cancel_label()]),i(I,Ne)},$$slots:{default:!0}}),s(z);var te=n(z,2),ke=O(te,!0);return M(I=>{He(z,1,`walkthrough-inline-comment flex items-center gap-2 ${P()??""}`),C(ke,I)},[()=>Ce.codeReview_inlineComment_inputHint_label()]),i($,w),qe(q)}var Xr=x('<div class="text-xs text-slate-400 dark:text-slate-500 mt-1"> </div>'),en=x('<span class="font-medium"> </span> <!>',1),tn=x('<div class="flex items-start gap-3 py-2"><div><!></div> <div class="flex-1 min-w-0"><div class="text-sm leading-relaxed text-slate-700 dark:text-slate-300"><!></div></div></div>'),rn=x('<div class="px-4 pb-3 divide-y divide-border"></div>'),nn=x('<div class="border-t border-border"><!> <!></div>'),an=x('<div class="flex items-center gap-2 px-4 py-2 text-xs text-slate-500 dark:text-slate-400 border-t border-border"><!> <span> </span></div>'),sn=x('<div class="flex items-center gap-2"><!> <!> <!></div> <p class="text-ui text-slate-400 dark:text-slate-500 mt-1"> </p>',1),on=x("<!> <span> </span>",1),ln=x('<div><div class="flex items-start gap-3 px-4 py-3"><div class="shrink-0 mt-0.5"><!></div> <div class="flex-1 min-w-0"><div class="text-sm text-slate-800 dark:text-slate-200 leading-relaxed"><!></div> <!></div> <!></div> <!> <!> <div class="border-t border-border px-4 py-2"><!></div></div>');function qt($,r){if(new.target)return Ke({component:qt,...$});Ue(r,!0);let d=k(r,"annotation",7),m=k(r,"lineNumber",7),b=k(r,"fileName",7),u=k(r,"messages",23,()=>[]),T=k(r,"onSendMessage",7),P=k(r,"onClose",7),h=k(r,"isSending",7,!1),U=k(r,"isAgentResponding",7,!1),K=k(r,"timestamp",7),pe=k(r,"class",7,""),q=we(""),w=we(!1),z=we(!1),de=we(null);Xe(()=>{e(w)&&e(de)&&e(de).focus()});function ce(){!e(q).trim()||h()||(T()?.(e(q).trim(),m(),b()),L(q,""))}function ae(a){a.key==="Enter"&&!a.shiftKey&&(a.preventDefault(),ce()),a.key==="Escape"&&(e(q)?L(q,""):L(w,!1))}function te(a){switch(a){case"highlight":return Fr;case"context":return jr;case"explanation":default:return Tr}}function ke(a){switch(a){case"highlight":return"text-orange-500";case"context":return"text-blue-500";case"explanation":default:return"text-warning-ink"}}function I(a){return a?Ur(a):""}const he=_(()=>u().length>0);var Ne={get annotation(){return d()},set annotation(a){d(a),y()},get lineNumber(){return m()},set lineNumber(a){m(a),y()},get fileName(){return b()},set fileName(a){b(a),y()},get messages(){return u()},set messages(a=[]){u(a),y()},get onSendMessage(){return T()},set onSendMessage(a){T(a),y()},get onClose(){return P()},set onClose(a){P(a),y()},get isSending(){return h()},set isSending(a=!1){h(a),y()},get isAgentResponding(){return U()},set isAgentResponding(a=!1){U(a),y()},get timestamp(){return K()},set timestamp(a){K(a),y()},get class(){return pe()},set class(a=""){pe(a),y()},$set:Ve,$on:(a,D)=>Je(r,a,D)},_e=ln(),S=o(_e),E=o(S),Ie=o(E);{let a=_(()=>te(d().type)),D=_(()=>ke(d().type));fe(Ie,{get icon(){return e(a)},get class(){return`h-4 w-4 ${e(D)??""}`}})}s(E);var me=n(E,2),v=o(me),R=o(v);Mt(R,{get content(){return d().message},className:"[&>*:first-child]:mt-0 [&>*:last-child]:mb-0"}),s(v);var A=n(v,2);{var Z=a=>{var D=Xr(),X=O(D,!0);M(ee=>C(X,ee),[()=>I(K())]),i(a,D)};H(A,a=>{K()&&a(Z)})}s(me);var ie=n(me,2);{var $e=a=>{{let D=_(()=>Ce.codeReview_commentThread_dismiss_tooltip());xe(a,{type:"button",variant:"ghost",size:"icon-compact",iconOnly:!0,get onclick(){return P()},class:"shrink-0 text-slate-400 hover:text-slate-600 dark:text-slate-500 dark:hover:text-slate-300 transition-colors",get title(){return e(D)},children:(X,ee)=>{fe(X,{get icon(){return zr}})},$$slots:{default:!0}})}};H(ie,a=>{P()&&a($e)})}s(S);var Se=n(S,2);{var ye=a=>{var D=nn(),X=o(D);xe(X,{type:"button",variant:"ghost",onclick:()=>L(z,!e(z)),class:"w-full flex items-center justify-between px-4 py-2 text-sm text-slate-600 dark:text-slate-400 hover:bg-slate-50 dark:hover:bg-slate-800/50 transition-colors",children:(Q,se)=>{var Y=en(),c=be(Y),p=O(c,!0),B=n(c,2);{let ue=_(()=>e(z)?ot:pt);fe(B,{get icon(){return e(ue)},class:"h-3 w-3"})}M(ue=>C(p,ue),[()=>Ce.codeReview_commentThread_suggestedChanges_label()]),i(Q,Y)},$$slots:{default:!0}});var ee=n(X,2);{var re=Q=>{var se=rn();Ge(se,21,u,Y=>Y.id,(Y,c)=>{var p=tn(),B=o(p),ue=o(B);{let g=_(()=>e(c).type==="user"?Br:Gr),N=_(()=>e(c).type==="user"?"text-blue-600 dark:text-blue-400":"text-purple-600 dark:text-purple-400");fe(ue,{get icon(){return e(g)},get class(){return`h-2.5 w-2.5 ${e(N)??""}`}})}s(B);var Re=n(B,2),t=o(Re),l=o(t);Mt(l,{get content(){return e(c).content},className:"[&>*:first-child]:mt-0 [&>*:last-child]:mb-0"}),s(t),s(Re),s(p),M(()=>He(B,1,`shrink-0 flex h-5 w-5 items-center justify-center rounded-full ${e(c).type==="user"?"bg-blue-100 dark:bg-blue-900/50":"bg-purple-100 dark:bg-purple-900/50"}`)),We(3,p,()=>at,()=>({axis:"y",distance:4,tier:"moderate"})),i(Y,p)}),s(se),We(3,se,()=>Oe,()=>({tier:"moderate"})),i(Q,se)};H(ee,Q=>{e(z)&&Q(re)})}s(D),i(a,D)};H(Se,a=>{e(he)&&a(ye)})}var V=n(Se,2);{var j=a=>{var D=an(),X=o(D);it(X,{size:12});var ee=n(X,2),re=O(ee,!0);s(D),M(Q=>C(re,Q),[()=>Ce.codeReview_commentThread_agentResponding_label()]),i(a,D)};H(V,a=>{U()&&a(j)})}var f=n(V,2),W=o(f);{var F=a=>{var D=sn(),X=be(D),ee=o(X);{let c=_(()=>Ce.codeReview_commentThread_followUp_placeholder());Jt(ee,{onkeydown:ae,get placeholder(){return e(c)},get disabled(){return h()},class:"flex-1 h-8 rounded-md border border-border bg-white dark:bg-slate-800 px-3 text-sm placeholder:text-slate-400 disabled:opacity-50",get ref(){return e(de)},set ref(p){L(de,p,!0)},get value(){return e(q)},set value(p){L(q,p,!0)}})}var re=n(ee,2);{let c=_(()=>!e(q).trim()||h());xe(re,{type:"button",variant:"primary",onclick:ce,get disabled(){return e(c)},class:"h-8 w-8 p-0",children:(p,B)=>{var ue=Pt(),Re=be(ue);{var t=g=>{it(g,{size:14})},l=g=>{fe(g,{get icon(){return Wr},class:"h-3 w-3"})};H(Re,g=>{h()?g(t):g(l,-1)})}i(p,ue)},$$slots:{default:!0}})}var Q=n(re,2);xe(Q,{type:"button",variant:"ghost",onclick:()=>{L(w,!1),L(q,"")},class:"h-8 px-2 text-xs text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200 transition-colors",children:(c,p)=>{st();var B=et();M(ue=>C(B,ue),[()=>Ce.codeReview_commentThread_cancel_label()]),i(c,B)},$$slots:{default:!0}}),s(X);var se=n(X,2),Y=O(se,!0);M(c=>C(Y,c),[()=>Ce.codeReview_commentThread_inputHint_label()]),We(3,X,()=>Oe,()=>({tier:"fast"})),i(a,D)},le=a=>{xe(a,{type:"button",variant:"ghost",onclick:()=>L(w,!0),class:"flex items-center gap-1.5 text-xs text-emerald-600 dark:text-emerald-400 hover:text-emerald-700 dark:hover:text-emerald-300 transition-colors",children:(D,X)=>{var ee=on(),re=be(ee);fe(re,{get icon(){return Dr},class:"h-3 w-3"});var Q=n(re,2),se=O(Q,!0);M(Y=>C(se,Y),[()=>Ce.codeReview_commentThread_askQuestion_label()]),i(D,ee)},$$slots:{default:!0}})};H(W,a=>{e(w)?a(F):a(le,-1)})}return s(f),s(_e),M(()=>He(_e,1,`walkthrough-comment-thread relative flex w-full flex-col bg-white shadow-sm dark:bg-slate-900 ${pe()??""}`)),We(3,_e,()=>Oe,()=>({tier:"moderate"})),i($,_e),qe(Ne)}var dn=x('<span class="text-emerald-600 dark:text-emerald-400 font-medium"> </span>'),cn=x('<!> <svg class="h-4 w-4 text-ghost shrink-0" viewBox="0 0 16 16" fill="currentColor"><path d="M3.5 1.5A1.5 1.5 0 0 1 5 0h6a1.5 1.5 0 0 1 1.5 1.5v12A1.5 1.5 0 0 1 11 15H5a1.5 1.5 0 0 1-1.5-1.5v-12zm2 0v12h6v-12H5.5z"></path></svg> <div class="flex items-baseline gap-2 flex-1 min-w-0"><span class="text-sm font-medium text-foreground truncate"> </span> <span class="text-xs text-subtle truncate hidden sm:inline"> </span></div> <div class="flex items-center gap-1 text-xs shrink-0"><!></div>',1),un=x('<div class="px-4 pb-3 -mt-1"><p class="text-sm text-subtle"> </p></div>'),vn=x('<div><div><span class="w-12 px-2 text-right text-ui text-subtle tabular-nums"> </span></div> <span> </span> <pre class="flex-1 px-1 whitespace-pre overflow-hidden text-ellipsis"><code class="hljs"></code></pre></div>'),gn=x('<div class="border-t border-border"><div class="font-mono text-xs leading-relaxed text-muted-foreground"><!> <!></div></div>'),fn=x('<span class="text-subtle">·</span> <!>',1),hn=x('<div class="flex items-center justify-end gap-2 px-3 py-1.5 bg-muted/20 border-b border-border text-xs"><!> <!></div>'),Gt=x("<!> <span> </span> <!>",1),mn=x('<div class="ml-20"><!></div>'),pn=x('<div class="ml-20 border-l-2 border-primary-ink/50 bg-muted/20"><div class="p-3"><!></div></div>'),_n=x('<div><div><span class="w-10 px-2 text-right text-ui text-subtle tabular-nums"> </span> <span class="w-10 px-2 text-right text-ui text-subtle tabular-nums"> </span></div> <span> </span> <div class="flex-1 flex items-center min-w-0 pr-2"><pre class="flex-1 px-1 whitespace-pre overflow-x-auto"><code class="hljs"></code></pre> <!></div></div> <!> <!> <!>',1),xn=x("<!> <!>",1),bn=x('<div class="relative"><!> <div class="overflow-x-auto"><div class="font-mono text-xs leading-relaxed min-w-full"></div></div></div>'),wn=x('<div><div class="flex flex-col border-b border-border"><!> <!></div> <!> <!></div>');function It($,r){if(new.target)return Ke({component:It,...$});Ue(r,!0);let d=k(r,"fileName",7),m=k(r,"patch",7),b=k(r,"annotations",23,()=>[]),u=k(r,"initialCollapsed",7,!1),T=k(r,"contextLines",7,3),P=k(r,"onSendMessage",7),h=k(r,"isSending",7,!1),U=k(r,"additions",7,0),K=k(r,"deletions",7,0),pe=k(r,"fileDescription",7,""),q=k(r,"class",7,"");const w=_(()=>Yr(m())),z=_(()=>Rr(d())),de=_(()=>{const t=new Map;return!e(z)||e(z)==="text"||e(z)==="plaintext"||!Bt.getLanguage(e(z))||e(w).forEach(l=>{const g=[];if(l.lines.forEach(N=>{const G=N.content||"",J=`${N.oldNum}-${N.newNum}`;g.push({content:G,key:J})}),g.length!==0)try{const N=g.map(ne=>ne.content).join(`
|
|
3
3
|
`),J=Bt.highlight(N,{language:e(z)}).value.split(`
|
|
4
4
|
`);g.forEach((ne,oe)=>{oe<J.length&&t.set(ne.key,J[oe])})}catch(N){console.warn("Failed to highlight hunk:",N)}}),t});let ce=we(mt(u())),ae=we(mt(new Set)),te=we(null);const ke=_(()=>{const t=new Map;for(const l of b()){const g=t.get(l.line)||[];g.push(l),t.set(l.line,g)}return t}),I=_(()=>new Set(b().map(t=>t.line)));function he(t){if(t.type==="deletion")return[];const l=t.newNum;return l==null?[]:e(ke).get(l)||[]}function Ne(t,l,g){if(g.type==="addition"||g.type==="deletion")return!0;const N=g.newNum??g.oldNum;if(N!==null&&e(I).has(N))return!0;const G=e(w)[t];if(!G)return!1;for(let J=Math.max(0,l-T());J<=Math.min(G.lines.length-1,l+T());J++){const ne=G.lines[J];if(ne.type==="addition"||ne.type==="deletion")return!0;const oe=ne.newNum??ne.oldNum;if(oe!==null&&e(I).has(oe))return!0}for(const J of e(ae)){const[ne,oe,ve]=J.split("-").map(Number);if(ne===t&&l>=oe&&l<=ve)return!0}return!1}function _e(t){const l=e(w)[t];if(!l)return[];const g=[];let N=null;for(let G=0;G<l.lines.length;G++){const J=Ne(t,G,l.lines[G]);!J&&N===null?N=G:J&&N!==null&&(g.push({startIndex:N,endIndex:G-1,count:G-N}),N=null)}return N!==null&&g.push({startIndex:N,endIndex:l.lines.length-1,count:l.lines.length-N}),g}function S(t,l,g){const N=`${t}-${l}-${g}`;e(ae).add(N),L(ae,new Set(e(ae)),!0)}function E(){for(let t=0;t<e(w).length;t++){const l=e(w)[t];S(t,0,l.lines.length-1)}}function Ie(){L(ae,new Set,!0)}function me(t){const l=`${t.oldNum}-${t.newNum}`,g=e(de).get(l);return g!==void 0?g:v(t.content||"")}function v(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function R(t){switch(t.type){case"addition":return"bg-emerald-500/5 dark:bg-emerald-500/10";case"deletion":return"bg-red-500/5 dark:bg-red-500/10";default:return""}}function A(t){switch(t.type){case"addition":return"text-emerald-600 dark:text-emerald-400 font-medium";case"deletion":return"text-red-600 dark:text-red-400 font-medium";default:return"text-transparent"}}function Z(t){switch(t.type){case"addition":return"+";case"deletion":return"-";default:return" "}}function ie(t){switch(t.type){case"addition":return"bg-emerald-500/10 dark:bg-emerald-500/15";case"deletion":return"bg-red-500/10 dark:bg-red-500/15";default:return"bg-muted/30"}}function $e(){L(ce,!e(ce))}function Se(t){L(te,t,!0)}function ye(){L(te,null)}function V(t,l,g){P()?.(t,l,g),L(te,null)}const j=_(()=>()=>{const t=d().split("/");return t[t.length-1]}),f=_(()=>()=>{const t=d().split("/");return t.length<=1?"":t.slice(0,-1).join("/")}),W=_(()=>{for(let t=0;t<e(w).length;t++)if(_e(t).length>0)return!0;return!1}),F=_(()=>{const l=[];for(let g=0;g<e(w).length&&l.length<3;g++){const N=e(w)[g];for(let G=0;G<N.lines.length&&l.length<3;G++){const J=N.lines[G];(J.type==="addition"||J.type==="deletion")&&l.push({line:J,hunkIndex:g,lineIndex:G})}}return l}),le=_(()=>{let t=0;for(const l of e(w))for(const g of l.lines)(g.type==="addition"||g.type==="deletion")&&t++;return t});let a=we(mt(new Map));function D(t){return`${t.file}:${t.line}:${t.type}`}function X(t){return e(a).get(D(t))||[]}var ee={get fileName(){return d()},set fileName(t){d(t),y()},get patch(){return m()},set patch(t){m(t),y()},get annotations(){return b()},set annotations(t=[]){b(t),y()},get initialCollapsed(){return u()},set initialCollapsed(t=!1){u(t),y()},get contextLines(){return T()},set contextLines(t=3){T(t),y()},get onSendMessage(){return P()},set onSendMessage(t){P(t),y()},get isSending(){return h()},set isSending(t=!1){h(t),y()},get additions(){return U()},set additions(t=0){U(t),y()},get deletions(){return K()},set deletions(t=0){K(t),y()},get fileDescription(){return pe()},set fileDescription(t=""){pe(t),y()},get class(){return q()},set class(t=""){q(t),y()},$set:Ve,$on:(t,l)=>Je(r,t,l)},re=wn(),Q=o(re),se=o(Q);xe(se,{type:"button",variant:"ghost",class:"w-full flex items-center gap-2 px-4 py-3 hover:bg-muted/30 transition-colors text-left group",onclick:$e,children:(t,l)=>{var g=cn(),N=be(g);{let Le=_(()=>e(ce)?pt:ot);fe(N,{get icon(){return e(Le)},class:"h-3 w-3 text-ghost shrink-0"})}var G=n(N,4),J=o(G),ne=O(J,!0),oe=n(J,2),ve=O(oe,!0);s(G);var Me=n(G,2),Ae=o(Me);{var De=Le=>{var Ee=dn(),Fe=O(Ee);M(()=>C(Fe,`+${U()+K()}`)),i(Le,Ee)};H(Ae,Le=>{(U()>0||K()>0)&&Le(De)})}s(Me),M((Le,Ee)=>{C(ne,Le),C(ve,Ee)},[()=>e(j)(),()=>e(f)()]),i(t,g)},$$slots:{default:!0}});var Y=n(se,2);{var c=t=>{var l=un(),g=o(l),N=O(g,!0);s(l),M(()=>C(N,pe())),i(t,l)};H(Y,t=>{pe()&&t(c)})}s(Q);var p=n(Q,2);{var B=t=>{var l=gn(),g=o(l),N=o(g);Ge(N,17,()=>e(F),({line:ne,hunkIndex:oe,lineIndex:ve})=>`preview-${oe}-${ve}`,(ne,oe)=>{let ve=()=>e(oe).line;var Me=vn(),Ae=o(Me),De=o(Ae),Le=O(De,!0);s(Ae);var Ee=n(Ae,2),Fe=O(Ee,!0),Te=n(Ee,2),ge=o(Te);Ft(ge,()=>me(ve()),!0),s(ge),s(Te),s(Me),M((Qe,Ye,Ze,tt)=>{He(Me,1,`flex ${Qe??""}`),He(Ae,1,`w-12 shrink-0 flex select-none ${Ye??""} border-r border-border`),C(Le,ve().newNum??ve().oldNum??""),He(Ee,1,`w-5 shrink-0 text-center select-none ${Ze??""}`),C(Fe,tt)},[()=>R(ve()),()=>ie(ve()),()=>A(ve()),()=>Z(ve())]),i(ne,Me)});var G=n(N,2);{var J=ne=>{xe(ne,{type:"button",variant:"ghost",class:"w-full py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors text-center",onclick:$e,children:(oe,ve)=>{st();var Me=et();M(Ae=>C(Me,Ae),[()=>Ce.codeReview_fileDiff_moreLines_label({count:e(le)-e(F).length})]),i(oe,Me)},$$slots:{default:!0}})};H(G,ne=>{e(le)>e(F).length&&ne(J)})}s(g),s(l),We(3,l,()=>Oe,()=>({tier:"moderate"})),i(t,l)};H(p,t=>{e(ce)&&e(F).length>0&&t(B)})}var ue=n(p,2);{var Re=t=>{var l=bn(),g=o(l);{var N=ne=>{var oe=hn(),ve=o(oe);xe(ve,{type:"button",variant:"ghost",class:"text-muted-foreground hover:text-foreground transition-colors",onclick:E,children:(De,Le)=>{st();var Ee=et();M(Fe=>C(Ee,Fe),[()=>Ce.codeReview_fileDiff_expandAll_label()]),i(De,Ee)},$$slots:{default:!0}});var Me=n(ve,2);{var Ae=De=>{var Le=fn(),Ee=n(be(Le),2);xe(Ee,{type:"button",variant:"ghost",class:"text-muted-foreground hover:text-foreground transition-colors",onclick:Ie,children:(Fe,Te)=>{st();var ge=et();M(Qe=>C(ge,Qe),[()=>Ce.codeReview_fileDiff_collapse_label()]),i(Fe,ge)},$$slots:{default:!0}}),i(De,Le)};H(Me,De=>{e(ae).size>0&&De(Ae)})}s(oe),i(ne,oe)};H(g,ne=>{e(W)&&ne(N)})}var G=n(g,2),J=o(G);Ge(J,21,()=>e(w),Lt,(ne,oe,ve)=>{const Me=_(()=>_e(ve)),Ae=_(()=>e(Me).find(Te=>Te.startIndex===0));var De=xn(),Le=be(De);{var Ee=Te=>{xe(Te,{type:"button",variant:"ghost",class:"w-full flex items-center justify-center gap-2 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors border-b border-border",onclick:()=>S(ve,e(Ae).startIndex,e(Ae).endIndex),children:(ge,Qe)=>{var Ye=Gt(),Ze=be(Ye);fe(Ze,{get icon(){return ot},class:"h-2.5 w-2.5"});var tt=n(Ze,2),xt=O(tt,!0),rt=n(tt,2);fe(rt,{get icon(){return ot},class:"h-2.5 w-2.5"}),M(ut=>C(xt,ut),[()=>Ce.codeReview_fileDiff_showHidden_label({count:e(Ae).count})]),i(ge,Ye)},$$slots:{default:!0}})};H(Le,Te=>{e(Ae)&&Te(Ee)})}var Fe=n(Le,2);Ge(Fe,19,()=>e(oe).lines,(Te,ge)=>`${ve}-${ge}`,(Te,ge,Qe)=>{const Ye=_(()=>`${e(ge).oldNum}-${e(ge).newNum}`),Ze=_(()=>he(e(ge))),tt=_(()=>e(te)===e(Ye)),xt=_(()=>Ne(ve,e(Qe),e(ge))),rt=_(()=>e(Me).find(lt=>lt.startIndex===e(Qe)+1));var ut=Pt(),er=be(ut);{var tr=lt=>{var At=_n(),vt=be(At),gt=o(vt),Et=o(gt),rr=O(Et,!0),nr=n(Et,2),ar=O(nr,!0);s(gt);var bt=n(gt,2),sr=O(bt,!0),Ht=n(bt,2),wt=o(Ht),zt=o(wt);Ft(zt,()=>me(e(ge)),!0),s(zt),s(wt);var or=n(wt,2);{var ir=Pe=>{{let ze=_(()=>Ce.codeReview_fileDiff_askLine_tooltip());xe(Pe,{type:"button",variant:"ghost",size:"icon-compact",iconOnly:!0,class:"size-5 opacity-0 group-hover:opacity-100 text-muted-foreground hover:text-primary-ink transition-all shrink-0",onclick:()=>Se(e(Ye)),get title(){return e(ze)},children:(je,Be)=>{fe(je,{get icon(){return St}})},$$slots:{default:!0}})}};H(or,Pe=>{P()&&Pe(ir)})}s(Ht),s(vt);var Wt=n(vt,2);Ge(Wt,19,()=>e(Ze),(Pe,ze)=>`${Pe.line}-${ze}`,(Pe,ze)=>{var je=mn(),Be=o(je);{let nt=_(()=>e(ge).newNum??e(ge).oldNum??0),ft=_(()=>X(e(ze)));qt(Be,{get annotation(){return e(ze)},get lineNumber(){return e(nt)},get fileName(){return d()},get messages(){return e(ft)},onSendMessage:(kt,yt,$t)=>V(kt,yt,$t),get isSending(){return h()}})}s(je),We(3,je,()=>Oe,()=>({tier:"moderate"})),i(Pe,je)});var Dt=n(Wt,2);{var lr=Pe=>{var ze=pn(),je=o(ze),Be=o(je);{let nt=_(()=>e(ge).newNum??e(ge).oldNum??0);Ut(Be,{get lineNumber(){return e(nt)},get fileName(){return d()},onSend:V,onClose:ye,get isSending(){return h()}})}s(je),s(ze),i(Pe,ze)};H(Dt,Pe=>{e(tt)&&e(Ze).length===0&&Pe(lr)})}var dr=n(Dt,2);{var cr=Pe=>{xe(Pe,{type:"button",variant:"ghost",class:"w-full flex items-center justify-center gap-2 py-1.5 text-xs text-muted-foreground hover:text-foreground hover:bg-muted/30 transition-colors border-y border-border bg-muted/10",onclick:()=>S(ve,e(rt).startIndex,e(rt).endIndex),children:(ze,je)=>{var Be=Gt(),nt=be(Be);fe(nt,{get icon(){return St},class:"h-2.5 w-2.5"});var ft=n(nt,2),kt=O(ft,!0),yt=n(ft,2);fe(yt,{get icon(){return St},class:"h-2.5 w-2.5"}),M($t=>C(kt,$t),[()=>Ce.codeReview_fileDiff_showHidden_label({count:e(rt).count})]),i(ze,Be)},$$slots:{default:!0}})};H(dr,Pe=>{e(rt)&&Pe(cr)})}M((Pe,ze,je,Be)=>{He(vt,1,`group flex ${Pe??""} hover:bg-accent/30 transition-colors`),He(gt,1,`w-20 shrink-0 flex select-none ${ze??""} border-r border-border`),C(rr,e(ge).oldNum??""),C(ar,e(ge).newNum??""),He(bt,1,`w-5 shrink-0 text-center select-none ${je??""}`),C(sr,Be)},[()=>R(e(ge)),()=>ie(e(ge)),()=>A(e(ge)),()=>Z(e(ge))]),i(lt,At)};H(er,lt=>{e(xt)&<(tr)})}i(Te,ut)}),i(ne,De)}),s(J),s(G),s(l),We(3,l,()=>Oe,()=>({tier:"moderate"})),i(t,l)};H(ue,t=>{e(ce)||t(Re)})}return s(re),M(()=>He(re,1,`walkthrough-file-diff overflow-hidden bg-card ${q()??""}`)),i($,re),qe(ee)}var kn=x('<div class="flex items-start gap-3"><div class="shrink-0 mt-0.5"><svg viewBox="0 0 20 20" fill="currentColor"><path fill-rule="evenodd" d="M2 6a2 2 0 012-2h4l2 2h4a2 2 0 012 2v1H8a3 3 0 00-3 3v1.5a1.5 1.5 0 01-3 0V6z" clip-rule="evenodd"></path><path d="M6 12a2 2 0 012-2h8a2 2 0 012 2v2a2 2 0 01-2 2H2h2a2 2 0 002-2v-2z"></path></svg></div> <div class="flex-1 min-w-0"><h4 class="text-sm font-medium text-foreground line-clamp-2"> </h4> <p class="text-xs text-subtle mt-1 line-clamp-2"> </p> <div class="flex items-center gap-1 mt-2 text-xs text-subtle"><svg class="h-3.5 w-3.5" viewBox="0 0 16 16" fill="currentColor"><path d="M3.5 1.5A1.5 1.5 0 0 1 5 0h6a1.5 1.5 0 0 1 1.5 1.5v12A1.5 1.5 0 0 1 11 15H5a1.5 1.5 0 0 1-1.5-1.5v-12z"></path></svg> <span> </span></div></div></div>'),yn=x('<div><div class="mb-4"><h3 class="text-sm font-medium text-subtle"> </h3></div> <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3"></div></div>');function Qt($,r){if(new.target)return Ke({component:Qt,...$});Ue(r,!0);let d=k(r,"categories",7),m=k(r,"onCategoryClick",7),b=k(r,"class",7,"");function u(w){const z=["bg-blue-500/10 border-blue-500/30 hover:border-blue-500/50","bg-purple-500/10 border-purple-500/30 hover:border-purple-500/50","bg-emerald-500/10 border-emerald-500/30 hover:border-emerald-500/50","bg-warning/10 border-warning/30 hover:border-warning/30","bg-rose-500/10 border-rose-500/30 hover:border-rose-500/50","bg-cyan-500/10 border-cyan-500/30 hover:border-cyan-500/50"];return z[w%z.length]}function T(w){const z=["text-blue-500","text-purple-500","text-emerald-500","text-warning-ink","text-rose-500","text-cyan-500"];return z[w%z.length]}var P={get categories(){return d()},set categories(w){d(w),y()},get onCategoryClick(){return m()},set onCategoryClick(w){m(w),y()},get class(){return b()},set class(w=""){b(w),y()},$set:Ve,$on:(w,z)=>Je(r,w,z)},h=yn(),U=o(h),K=o(U),pe=O(K,!0);s(U);var q=n(U,2);return Ge(q,21,d,Lt,(w,z,de)=>{{let ce=_(()=>u(de));xe(w,{type:"button",variant:"ghost",get class(){return`text-left p-4 rounded-lg border transition-all duration-spring-moderate ease-spring-moderate motion-reduce:transition-none ${e(ce)??""}`},onclick:()=>m()?.(de),children:(ae,te)=>{var ke=kn(),I=o(ke),he=O(I),Ne=n(I,2),_e=o(Ne),S=O(_e,!0),E=n(_e,2),Ie=O(E,!0),me=n(E,2),v=n(o(me),2),R=O(v,!0);s(me),s(Ne),s(ke),M((A,Z)=>{He(he,0,`h-5 w-5 ${A??""}`),C(S,e(z).title),C(Ie,e(z).description),C(R,Z)},[()=>T(de),()=>e(z).files.length===1?Ce.codeReview_categoriesGrid_fileCount_one({count:e(z).files.length}):Ce.codeReview_categoriesGrid_fileCount_many({count:e(z).files.length})]),i(ae,ke)},$$slots:{default:!0}})}}),s(q),s(h),M(w=>{He(h,1,`walkthrough-categories-grid ${b()??""}`),C(pe,w)},[()=>Ce.codeReview_categoriesGrid_whatChanged_title()]),i($,h),qe(P)}var $n=x('<div class="w-0.5 flex-1 bg-border min-h-5"></div>'),Sn=x('<p class="text-sm text-subtle mt-2"> </p>'),Cn=x('<div class="rounded-lg border border-border bg-card p-4"><div class="flex items-center gap-2"><svg class="h-4 w-4 text-ghost" viewBox="0 0 16 16" fill="currentColor"><path d="M3.5 1.5A1.5 1.5 0 0 1 5 0h6a1.5 1.5 0 0 1 1.5 1.5v12A1.5 1.5 0 0 1 11 15H5a1.5 1.5 0 0 1-1.5-1.5v-12z"></path></svg> <span class="text-sm font-medium text-foreground"> </span></div> <!></div>'),Nn=x('<div class="flex gap-4"><div class="relative flex flex-col items-center w-3"><div></div> <div class="absolute top-4 w-2 h-2 rounded-full bg-muted-foreground/30 ring-2 ring-background"></div></div> <div class="flex-1 min-w-0 pb-4"><!></div></div>'),Rn=x('<div><div class="flex items-start gap-4 mb-4"><div class="relative flex flex-col items-center"><div></div> <!></div> <div class="flex-1 min-w-0 -mt-0.5"><h3 class="text-base font-semibold text-foreground"> </h3> <p class="text-sm text-subtle mt-1"> </p></div></div> <div class="relative"></div></div>');function Yt($,r){if(new.target)return Ke({component:Yt,...$});Ue(r,!0);let d=k(r,"category",7),m=k(r,"categoryIndex",7),b=k(r,"filePatchMap",7),u=k(r,"isLast",7,!1),T=k(r,"onSendMessage",7),P=k(r,"isSending",7,!1),h=k(r,"class",7,"");function U(S){const E=["bg-blue-500","bg-purple-500","bg-emerald-500","bg-warning","bg-rose-500","bg-cyan-500"];return E[S%E.length]}const K=_(()=>d().files.map(S=>{const E=b().get(S.path);return{...S,patch:E?.patch,additions:E?.additions??0,deletions:E?.deletions??0}}));var pe={get category(){return d()},set category(S){d(S),y()},get categoryIndex(){return m()},set categoryIndex(S){m(S),y()},get filePatchMap(){return b()},set filePatchMap(S){b(S),y()},get isLast(){return u()},set isLast(S=!1){u(S),y()},get onSendMessage(){return T()},set onSendMessage(S){T(S),y()},get isSending(){return P()},set isSending(S=!1){P(S),y()},get class(){return h()},set class(S=""){h(S),y()},$set:Ve,$on:(S,E)=>Je(r,S,E)},q=Rn(),w=o(q),z=o(w),de=o(z),ce=n(de,2);{var ae=S=>{var E=$n();i(S,E)};H(ce,S=>{(!u()||e(K).length>0)&&S(ae)})}s(z);var te=n(z,2),ke=o(te),I=O(ke,!0),he=n(ke,2),Ne=O(he,!0);s(te),s(w);var _e=n(w,2);return Ge(_e,23,()=>e(K),(S,E)=>`${m()}-${E}`,(S,E,Ie)=>{var me=Nn(),v=o(me),R=o(v);st(2),s(v);var A=n(v,2),Z=o(A);{var ie=Se=>{It(Se,{get fileName(){return e(E).path},get patch(){return e(E).patch},get annotations(){return e(E).annotations},get additions(){return e(E).additions},get deletions(){return e(E).deletions},get fileDescription(){return e(E).summary},get onSendMessage(){return T()},get isSending(){return P()},class:"rounded-lg border border-border overflow-hidden"})},$e=Se=>{var ye=Cn(),V=o(ye),j=n(o(V),2),f=O(j,!0);s(V);var W=n(V,2);{var F=le=>{var a=Sn(),D=O(a,!0);M(()=>C(D,e(E).summary)),i(le,a)};H(W,le=>{e(E).summary&&le(F)})}s(ye),M(()=>C(f,e(E).path)),i(Se,ye)};H(Z,Se=>{e(E).patch?Se(ie):Se($e,-1)})}s(A),s(me),M(()=>He(R,1,`w-0.5 flex-1 bg-border ${e(Ie)===e(K).length-1&&u()?"h-1/2":""}`)),i(S,me)}),s(_e),s(q),M(S=>{He(q,1,`walkthrough-category-section ${h()??""}`),Er(q,"id",`category-${m()??""}`),He(de,1,`w-3 h-3 rounded-full ${S??""} ring-4 ring-background shrink-0`),C(I,d().title),C(Ne,d().description)},[()=>U(m())]),i($,q),qe(pe)}var Mn=x('<!> <!> <span class="text-sm font-medium"> </span> <!>',1),Pn=x('<div class="flex items-center gap-2 text-sm text-subtle py-2"><!> <span> </span></div>'),Ot=x("<!> ",1),Ln=x('<div class="rounded-lg bg-danger-background/10 border border-danger/20 p-4"><p class="text-sm text-danger"> </p> <!></div>'),In=x('<h2 class="text-lg font-semibold text-foreground"> </h2>'),An=x('<p class="text-sm text-subtle italic"> </p>'),Kt=x("<div><!></div>"),En=x('<div class="space-y-8 pt-4"></div>'),Hn=x('<!> <!> <span class="text-sm font-medium text-subtle"> </span>',1),zn=x('<div class="space-y-3 pt-2"></div>'),Wn=x('<div class="pt-4 border-t border-border"><!> <!></div>'),Dn=x('<div class="flex justify-end pt-2"><!></div>'),Tn=x('<div class="space-y-6"><!> <!> <!> <!> <!> <!></div>'),jn=x('<div class="px-4 pb-4"><!> <!> <!></div>'),Fn=x('<div class="border-t border-border"><!> <!></div>');function Zt($,r){if(new.target)return Ke({component:Zt,...$});Ue(r,!0);let d=k(r,"walkthrough",7),m=k(r,"status",7),b=k(r,"workspaceId",7),u=k(r,"error",7,""),T=k(r,"workspacePath",7),P=k(r,"changes",23,()=>[]),h=k(r,"onSendMessage",7),U=k(r,"isSending",7,!1),K=k(r,"onRegenerate",7),pe=k(r,"showCategoriesGrid",7,!0);const q=_(()=>m()==="running"),w=_(()=>m()==="complete"),z=_(()=>!!u());let de=we(!0),ce=we(!1),ae=we(mt(new Map));const te=_(()=>{if(d()?.categories&&d().categories.length>0)return d().categories;if(d()?.annotations&&d().annotations.length>0){const v=new Map;for(const R of d().annotations){const A=v.get(R.file)||[];A.push(R),v.set(R.file,A)}return[{title:d().title,description:d().overview,files:Array.from(v.entries()).map(([R,A])=>({path:R,annotations:A.sort((Z,ie)=>Z.line-ie.line)}))}]}return[]}),ke=_(()=>{if(!d()?.annotations)return new Map;const v=new Map;for(const R of d().annotations){const A=v.get(R.file)||[];A.push(R),v.set(R.file,A)}for(const[R,A]of v)v.set(R,A.sort((Z,ie)=>Z.line-ie.line));return v}),I=_(()=>{const v=new Set;for(const R of e(te))for(const A of R.files)v.add(A.path);for(const R of e(ke).keys())v.add(R);return v}),he=_(()=>P().filter(v=>!e(I).has(v.relativePath)));Xe(()=>{if(!d()||!T())return;const v=new Set([...e(I),...e(he).map(R=>R.relativePath)]);for(const R of v)e(ae).has(R)||Jr(b(),!0,R).then(A=>{if(A&&A.oldContent!==void 0&&A.newContent!==void 0){const Z=Ne(R,A.oldContent,A.newContent);if(Z){const ie=P().find($e=>$e.relativePath===R);e(ae).set(R,{patch:Z,additions:ie?.stats?.additions??0,deletions:ie?.stats?.deletions??0}),L(ae,new Map(e(ae)),!0)}}}).catch(A=>{console.warn(`Failed to load diff for ${R}:`,A)})});function Ne(v,R,A){const Z=R.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{Jv as s,ii as a,ml as S,nX as f,my as m}from"./tr-2J8Mf.js";import{v as O}from"./
|
|
1
|
+
import{Jv as s,ii as a,ml as S,nX as f,my as m}from"./tr-2J8Mf.js";import{v as O}from"./DQK1MQRy.js";import{dO as d,b5 as v,dW as b}from"./BaujsV9k.js";const k=s.createSelector((t,e)=>{if(v.select(t,e)&&b.select(t,e))return!1;const r=t.principal?.snapshot;return r?.capabilities.workspaceGuestRoles===!0&&(r.capabilities.hostMembership?r.principal.hostRole==="guest":!r.principal.isAdministrator)}),h=s.createSelector(t=>t.principal?.snapshot?.capabilities.remoteScripts===1),l=s.createSelector((t,e,r)=>!k.select(t,e)||!!d.select(t,e)&&r?.purpose==="saved");function o(t,e,r){return!!e&&!!r&&l.select(t,e,r)}function i(t,e){return e?t.scripts.byWorkspaceId[e]??m:m}const j=s.createSelector((t,e)=>i(t,e).initialized),W=s.createSelector((t,e)=>{const r=i(t,e);return r.activeScriptIds?r.activeScriptIds.flatMap(c=>o(t,e,r.scripts[c])?[r.scripts[c]]:[]):Object.values(r.scripts).filter(c=>!c.archivedAt&&o(t,e,c))}),C=s.createSelector((t,e)=>W.select(t,e).filter(r=>O((r.runtime??a()).status))),u=s.createSelector((t,e,r)=>{const c=i(t,e);return o(t,e,c.scripts[r])?c.scripts[r]:null}),x=s.createSelector((t,e,r)=>u.select(t,e,r)?.runtime??a()),E=s.createSelector((t,e,r)=>{const c=i(t,e);return l.select(t,e??"",c.scripts[r])?c.outputBuffers[r]??S:S}),M=s.createSelector((t,e,r,c)=>{const n=i(t,e).retainedOutputs?.[c];return n?.scriptId===r&&l.select(t,e,i(t,e).scripts[r])?n:void 0}),z=s.createSelector(t=>Object.entries(t.scripts?.byWorkspaceId??{}).filter(([,e])=>Object.keys(e.retainedOutputs??{}).length>0).map(([e])=>e).sort()),A=s.createSelector((t,e)=>!!t.scripts?.byWorkspaceId[e]?.outputStreamReady),D=s.createSelector((t,e)=>i(t,e).initialized),B=s.createSelector((t,e)=>{const r=i(t,e);return r.activeScriptIds?r.activeScriptIds.flatMap(c=>o(t,e,r.scripts[c])?[r.scripts[c]]:[]):Object.values(r.scripts).filter(c=>!c.archivedAt&&o(t,e,c))}),G=s.createSelector((t,e)=>{const r=i(t,e);return r.detectionOperation?.pending?{...r.operations,...Object.fromEntries(Object.keys(r.scripts).map(c=>[c,r.detectionOperation]))}:r.operations}),J=s.createSelector((t,e)=>i(t,e).detectionOperation),L=s.createSelector((t,e,r,c)=>{const n=i(t,r).workflowOutcomes,p=n?f(n,e):void 0;return p?.workspaceId===r&&p.resourceId===c?p:void 0}),P=s.createSelector((t,e,r)=>u.select(t,e,r)?.runtime??a()),U=s.createSelector((t,e)=>Object.values(i(t,e).scripts).filter(r=>o(t,e,r))),V=s.createSelector((t,e,r)=>i(t,e).pendingReads?.[r]),X=s.createSelector((t,e,r)=>!!u.select(t,e,r)&&!i(t,e).detectionOperation?.pending&&!i(t,e).operations[r]?.pending),q=s.createSelector((t,e)=>({nextCursor:i(t,e).nextCursor,loading:i(t,e).loading,error:i(t,e).loadError}));export{U as selectAllWorkspaceScriptEntries,X as selectCanDeleteScript,l as selectCanReadScriptDefinition,h as selectRemoteScriptsSupported,C as selectRunningScripts,u as selectScriptById,J as selectScriptDetectionOperation,W as selectScriptEntries,q as selectScriptListPageState,E as selectScriptOutput,A as selectScriptOutputStreamReady,z as selectScriptOutputViewerWorkspaceIds,V as selectScriptReadJournal,M as selectScriptRetainedOutput,x as selectScriptRuntime,L as selectScriptWorkflowOutcome,j as selectScriptsInitialized,k as selectUsesGuestScriptScope,B as selectWorkspaceScriptEntries,G as selectWorkspaceScriptOperations,P as selectWorkspaceScriptRuntime,D as selectWorkspaceScriptsInitialized};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as bt,bo as x,bw as wt,bq as Rt,b as It,bs as g}from"./C0QTy0Sy.js";import{bs as Pt,ca as I,aD as t,c9 as s,bn as kt,bH as E,bV as M,aA as F}from"./3SdAC2_C.js";import{b as vt}from"./Dn334wJv.js";import{Jv as l,eJ as Ut,eK as At,t4 as Bt,on as xt,oo as Ft,K3 as Tt,Ki as _t,K8 as Dt,os as T}from"./tr-2J8Mf.js";import{t as Lt}from"./C-BsEdGZ.js";import{g as Wt}from"./DWGXN6Nr.js";import{dH as Gt,bO as Nt,bQ as Et,bN as Mt,bS as Vt,dd as Ht,m as Kt}from"./BaujsV9k.js";import{C as zt}from"./
|
|
1
|
+
import{t as bt,bo as x,bw as wt,bq as Rt,b as It,bs as g}from"./C0QTy0Sy.js";import{bs as Pt,ca as I,aD as t,c9 as s,bn as kt,bH as E,bV as M,aA as F}from"./3SdAC2_C.js";import{b as vt}from"./Dn334wJv.js";import{Jv as l,eJ as Ut,eK as At,t4 as Bt,on as xt,oo as Ft,K3 as Tt,Ki as _t,K8 as Dt,os as T}from"./tr-2J8Mf.js";import{t as Lt}from"./C-BsEdGZ.js";import{g as Wt}from"./DWGXN6Nr.js";import{dH as Gt,bO as Nt,bQ as Et,bN as Mt,bS as Vt,dd as Ht,m as Kt}from"./BaujsV9k.js";import{C as zt}from"./g9tUAsNS.js";import{V as qt}from"./CqcqWJoa.js";import{bT as Jt,bN as Ot,b8 as Qt}from"./CCOwocDi.js";import{i as _,n as V}from"./H2jLkRRS.js";import{af as jt}from"./BFnrc2L0.js";function Xt(D,$){if(new.target)return bt({component:Xt,...D});Pt($,!0);const H=()=>g(at,"$gitRoots$",c),y=()=>g(ot,"$workspace",c),K=()=>g(nt,"$ftCommits$",c),z=()=>g(lt,"$rootGitRoots$",c),S=()=>g(st,"$ftChanges$",c),q=()=>g(tt,"$foldUnchanged",c),J=()=>g(Z,"$lineWrapping",c),O=()=>g(et,"$diffSideBySide",c),Q=()=>g(rt,"$ftLoading$",c),j=()=>g(it,"$ftBoundarySha$",c),[c,X]=Rt(),Y=o=>{qt(o,{embedded:!0,showExpand:!0,get expanded(){return t(w)},onToggleExpand:()=>{E(w,!t(w)),t(w)?t(R)?.expandAll():t(R)?.collapseAll()},get foldEnabled(){return q()},onToggleFold:()=>l.dispatch(Dt()),get wrapEnabled(){return J()},onToggleWrap:()=>l.dispatch(_t()),get splitEnabled(){return O()},onToggleSplit:()=>l.dispatch(Tt())})},Z=Jt(),tt=Ot(),et=Qt();let P=x($,"tab",7),m=x($,"workspaceId",7),C=x($,"isActive",7);const L=Wt(),p=Lt(()=>m()),ot=Gt(p);I(()=>{const o=m();if(!(!C()||!o||t(n)))return l.dispatch(Ut(o,"all")),()=>l.dispatch(At(o,"all"))});const n=s(()=>P().data?.gitRootId||""),at=jt(p),b=s(()=>H().find(o=>o.id===t(n))),h=s(()=>y()?.worktreePath||y()?.repositoryPath||""),k=s(()=>t(b)?.path||t(h)),st=Nt(p),nt=Et(p),it=Mt(p),rt=Vt(p),dt=s(()=>K()||[]),lt=Ht(p),f=s(()=>z()[t(n)]??Kt),ct=s(()=>t(f).status),gt=s(()=>t(f).loading),mt=s(()=>t(f).commitFiles),ut=s(()=>{const o=t(b)?.registeredCommitSha,i=o?t(f).commits.findIndex(e=>e.hash===o):-1;return i>=0?t(f).commits.slice(0,i):t(f).commits});I(()=>{const o=m(),i=t(n);o&&i&&l.dispatch(Bt(o,i,t(b)?.registeredCommitSha,100))});let w=M(!0),R=M(null);const pt=s(()=>{if(t(n))return[...(t(ct)?.files??[]).map(e=>({filePath:`${t(k)}/${e.path}`,action:"modify",additions:e.additions??0,deletions:e.deletions??0,toolName:"local",toolCallId:`root-${t(n)}-${e.staged}-${e.path}`,staged:e.staged,category:e.staged?"staged":"unstaged"})),...t(ut).flatMap(e=>(t(mt)[e.hash]??[]).map(a=>({filePath:`${t(k)}/${a.path}`,action:"modify",additions:a.additions??0,deletions:a.deletions??0,toolName:"local",toolCallId:`root-commit-${e.hash}-${a.path}`,staged:!1,category:"committed",commitHash:e.hash,commitMessage:e.message})))];const o=S().filter(e=>e.stage==="unstaged"),i=S().filter(e=>e.stage==="staged");return[...o.map(e=>{const a=e.file||e.relativePath,r=a&&_(a)?a:`${t(h)}/${a}`;return{filePath:r,action:"modify",additions:e.stats?.additions||0,deletions:e.stats?.deletions||0,toolName:"local",toolCallId:`local-unstaged-${r}`,staged:!1,category:"unstaged",oldContent:e.content?.oldContent,newContent:e.content?.newContent,gitlink:e.gitlink}}),...i.map(e=>{const a=e.file||e.relativePath,r=a&&_(a)?a:`${t(h)}/${a}`;return{filePath:r,action:"modify",additions:e.stats?.additions||0,deletions:e.stats?.deletions||0,toolName:"local",toolCallId:`local-staged-${r}`,staged:!0,category:"staged",oldContent:e.content?.oldContent,newContent:e.content?.newContent,gitlink:e.gitlink}}),...t(dt).flatMap(e=>(e.files||[]).map(a=>{const r=typeof a=="string"?a:a.path||"",U=r&&_(r)?r:`${t(h)}/${r}`,A=typeof a=="string"?0:a.additions||0,B=typeof a=="string"?0:a.deletions||0;return{filePath:U,action:"modify",additions:A,deletions:B,toolName:"local",toolCallId:`commit-${e.hash}-${r}`,staged:!1,category:"committed",commitHash:e.hash,commitMessage:e.message}}))]});function v(o){if(!t(h))return o;const i=V(o),e=V(t(h));return i.startsWith(`${e}/`)?i.slice(e.length+1):o}function W(o){l.dispatch(T(m(),crypto.randomUUID(),{kind:"stage",paths:o.map(v),source:"localChanges"}))}function G(o){l.dispatch(T(m(),crypto.randomUUID(),{kind:"unstage",paths:o.map(v),source:"localChanges"}))}function ht(o){l.dispatch(T(m(),crypto.randomUUID(),{kind:"discard",paths:o.map(v),source:"localChanges"}))}I(()=>{!L||!C()||L.registerActions({display:Y})});const N=crypto.randomUUID();I(()=>{const o=m();if(!(!(C()&&t(n))||!o))return l.dispatch(xt(o,N)),()=>l.dispatch(Ft(o,N))});var ft={get tab(){return P()},set tab(o){P(o),F()},get workspaceId(){return m()},set workspaceId(o){m(o),F()},get isActive(){return C()},set isActive(o){C(o),F()},$set:wt,$on:(o,i)=>It($,o,i)};{let o=s(()=>t(n)?t(gt):Q()),i=s(()=>t(n)||void 0),e=s(()=>t(n)?t(k):void 0),a=s(()=>y()?.baseRef??null),r=s(()=>t(n)?t(b)?.registeredCommitSha||null:j()||y()?.baseCommitSha||null),U=s(()=>!t(n)),A=s(()=>t(n)?void 0:d=>void W([d])),B=s(()=>t(n)?void 0:d=>void G([d])),Ct=s(()=>t(n)?void 0:d=>void ht([d])),yt=s(()=>t(n)?void 0:()=>{const d=S().filter(u=>u.stage==="unstaged");W(d.map(u=>u.relativePath||u.file))}),St=s(()=>t(n)?void 0:()=>{const d=S().filter(u=>u.stage==="staged");G(d.map(u=>u.relativePath||u.file))});vt(zt(D,{get isLoading(){return t(o)},get changes(){return t(pt)},get gitRootId(){return t(i)},get gitRootPath(){return t(e)},get branchBaseRef(){return t(a)},get branchBaseCommitSha(){return t(r)},get showStagingControls(){return t(U)},showCategoryFilter:!0,get onStage(){return t(A)},get onUnstage(){return t(B)},get onRevert(){return t(Ct)},get onStageAll(){return t(yt)},get onUnstageAll(){return t(St)}}),d=>E(R,d,!0),()=>t(R))}var $t=kt(ft);return X(),$t}export{Xt as default};
|