@intent-hq/web 2.372.2 → 2.372.4
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/{CYyfRGPT.js → -JM4IO5s.js} +1 -1
- package/web/app/immutable/chunks/{O-dTT9_6.js → 0x9fwj6X.js} +1 -1
- package/web/app/immutable/chunks/{DqfSttpc.js → 1cfvZqIL.js} +1 -1
- package/web/app/immutable/chunks/{OfToEAub.js → 4V5RPZv7.js} +1 -1
- package/web/app/immutable/chunks/{D-usBtmP.js → 6s1pPvLx.js} +4 -4
- package/web/app/immutable/chunks/{CAG8YIXN.js → 8kN6wMYA.js} +1 -1
- package/web/app/immutable/chunks/{2XoFwLeT.js → B0rlWqYd.js} +1 -1
- package/web/app/immutable/chunks/{CajUAX8N.js → B62l45Uf.js} +2 -2
- package/web/app/immutable/chunks/{BApUcPKR.js → B7-7bZi9.js} +1 -1
- package/web/app/immutable/chunks/{vQ3XSTvm.js → B70PGGIw.js} +1 -1
- package/web/app/immutable/chunks/{BOD8_Ffh.js → BBFSGGQF.js} +1 -1
- package/web/app/immutable/chunks/{1mJrE3jk.js → BDARQpEZ.js} +1 -1
- package/web/app/immutable/chunks/{f50N8hQo.js → BEUFwM79.js} +1 -1
- package/web/app/immutable/chunks/{D0xQDzbV.js → BGPjhZRB.js} +1 -1
- package/web/app/immutable/chunks/{DHpb0iQY.js → BGTJWNfe.js} +1 -1
- package/web/app/immutable/chunks/{BpSBXUuJ.js → BGdVu4MB.js} +2 -2
- package/web/app/immutable/chunks/{DsFpAZo7.js → BHINa8Ry.js} +2 -2
- package/web/app/immutable/chunks/{Z4Jzxw8B.js → BIHiol8V.js} +1 -1
- package/web/app/immutable/chunks/{DE_K0DMt.js → BIoeY2kf.js} +3 -3
- package/web/app/immutable/chunks/{CQy8trug.js → BJyEBl3g.js} +1 -1
- package/web/app/immutable/chunks/{m11ohSMf.js → BO2BotXa.js} +1 -1
- package/web/app/immutable/chunks/{ZJOyleCJ.js → BPE9rssu.js} +3 -3
- package/web/app/immutable/chunks/{BuQN2T0g.js → BTTV-GiU.js} +2 -2
- package/web/app/immutable/chunks/{CQR1o7um.js → BTtsrh4I.js} +2 -2
- package/web/app/immutable/chunks/{NPKMdhKA.js → BTwXmxv4.js} +2 -2
- package/web/app/immutable/chunks/{BesmUwoU.js → Ba0RqSDe.js} +1 -1
- package/web/app/immutable/chunks/{RwJyhbRN.js → BcI2Qs88.js} +1 -1
- package/web/app/immutable/chunks/{DFQ6yCR1.js → BlCrzIC_.js} +13 -13
- package/web/app/immutable/chunks/{DadrYnVI.js → BlEjgaTq.js} +1 -1
- package/web/app/immutable/chunks/{B89v0U4a.js → BlT-PlLX.js} +3 -3
- package/web/app/immutable/chunks/{CsleiD5D.js → BmpDBFC8.js} +1 -1
- package/web/app/immutable/chunks/{DC0oh9YH.js → Bng2Wjmd.js} +1 -1
- package/web/app/immutable/chunks/{CrL6DZCQ.js → BoVvYfWW.js} +1 -1
- package/web/app/immutable/chunks/{BehvUfjM.js → BoqgKStq.js} +1 -1
- package/web/app/immutable/chunks/{BZQZwdGm.js → BqwlUVV2.js} +1 -1
- package/web/app/immutable/chunks/{CtZeiR9i.js → BtmPL5YS.js} +1 -1
- package/web/app/immutable/chunks/{eGqXrC9g.js → BuJuLth3.js} +1 -1
- package/web/app/immutable/chunks/{Ds6NYQhM.js → BukcKDm8.js} +1 -1
- package/web/app/immutable/chunks/{BrFkQr4z.js → Byis73mI.js} +1 -1
- package/web/app/immutable/chunks/{BIkmNkpw.js → C0QlGAGX.js} +1 -1
- package/web/app/immutable/chunks/{CnzZSXm6.js → C0pO6HUL.js} +1 -1
- package/web/app/immutable/chunks/{vlM04DTZ.js → C8EZa-xD.js} +1 -1
- package/web/app/immutable/chunks/{CBHdapAk.js → CACF-3uP.js} +1 -1
- package/web/app/immutable/chunks/{ulO2uazy.js → CDypb-9r.js} +1 -1
- package/web/app/immutable/chunks/{CMAV3UUk.js → CE4gPfvG.js} +1 -1
- package/web/app/immutable/chunks/{BPwzpRKZ.js → CEEa3RhU.js} +1 -1
- package/web/app/immutable/chunks/{Di4F3rxF.js → CEwqW-JV.js} +1 -1
- package/web/app/immutable/chunks/{DY06SZsl.js → CGn7nYWV.js} +1 -1
- package/web/app/immutable/chunks/{BDThAQjj.js → CHpIe7_H.js} +1 -1
- package/web/app/immutable/chunks/{BHtMcien.js → CIZP3oBY.js} +1 -1
- package/web/app/immutable/chunks/{B6l-Kttu.js → CJ-lCrFi.js} +1 -1
- package/web/app/immutable/chunks/{CjYF1At4.js → CMFcg3RE.js} +1 -1
- package/web/app/immutable/chunks/{DdJj628K.js → CNefgEA2.js} +1 -1
- package/web/app/immutable/chunks/{Qh1eK2X9.js → CRHarGqr.js} +1 -1
- package/web/app/immutable/chunks/{D82C3bhe.js → CSfWCx1k.js} +1 -1
- package/web/app/immutable/chunks/{DCO02E6M.js → CSr8o6qm.js} +1 -1
- package/web/app/immutable/chunks/{BTi_uPkP.js → CVnLEltT.js} +2 -2
- package/web/app/immutable/chunks/{DyaBo2y6.js → CWm_YxN-.js} +1 -1
- package/web/app/immutable/chunks/{ftVcR4tQ.js → CYUq_fja.js} +1 -1
- package/web/app/immutable/chunks/{vE2E6sS8.js → CZ7G19nC.js} +1 -1
- package/web/app/immutable/chunks/{BoefNJ5Q.js → CbbK8WaD.js} +1 -1
- package/web/app/immutable/chunks/{BbobBw8S.js → Cd2ZM5fn.js} +1 -1
- package/web/app/immutable/chunks/{B0kpU9fA.js → ChADavMb.js} +2 -2
- package/web/app/immutable/chunks/{Cv2q5gkL.js → CjJYMl8M.js} +1 -1
- package/web/app/immutable/chunks/{CL1PbmdJ.js → CjoZjg16.js} +1 -1
- package/web/app/immutable/chunks/Ck2JBj0W.js +3 -0
- package/web/app/immutable/chunks/{CtKyfVB_.js → CnjuQpEd.js} +1 -1
- package/web/app/immutable/chunks/{C79sRXBG.js → CpGAJSr-.js} +1 -1
- package/web/app/immutable/chunks/{CIJY2gxU.js → Cqsgf1DM.js} +1 -1
- package/web/app/immutable/chunks/{DLmLA9DN.js → CrrouvLD.js} +1 -1
- package/web/app/immutable/chunks/{9DRLCqFH.js → Csqgcuja.js} +1 -1
- package/web/app/immutable/chunks/{Dkvzw9dt.js → Cub6NZJQ.js} +1 -1
- package/web/app/immutable/chunks/{DSIsc1Ss.js → Cuij5UQt.js} +1 -1
- package/web/app/immutable/chunks/{A-qdlPO9.js → CvPNqaI1.js} +1 -1
- package/web/app/immutable/chunks/{BWDjljS8.js → CxNWBXR-.js} +3 -3
- package/web/app/immutable/chunks/{5Z6V3HtS.js → D0Rl0jWy.js} +3 -3
- package/web/app/immutable/chunks/{BQNpzQlP.js → D1B_DGCd.js} +1 -1
- package/web/app/immutable/chunks/{B2NZzPt-.js → D1gQR6EA.js} +1 -1
- package/web/app/immutable/chunks/{CrBBYf3_.js → D2akGP2t.js} +1 -1
- package/web/app/immutable/chunks/{wDPUZWBZ.js → D69enMvZ.js} +1 -1
- package/web/app/immutable/chunks/{Dge5ZGj2.js → D6nqIgl8.js} +1 -1
- package/web/app/immutable/chunks/{Df3mQZLv.js → D72FFXC3.js} +3 -3
- package/web/app/immutable/chunks/{BEWjMMmw.js → D9N7PGtO.js} +3 -3
- package/web/app/immutable/chunks/{DOOplL0N.js → DA_CqgBx.js} +2 -2
- package/web/app/immutable/chunks/{fth1noPu.js → DB4YPFuG.js} +1 -1
- package/web/app/immutable/chunks/{CZDluI6H.js → DCdZE6Zv.js} +1 -1
- package/web/app/immutable/chunks/{D1wNvwqn.js → DE0oDk53.js} +1 -1
- package/web/app/immutable/chunks/{Bpb7JDWq.js → DE9J1g7V.js} +1 -1
- package/web/app/immutable/chunks/{R-aBLidW.js → DEsEAjIo.js} +3 -3
- package/web/app/immutable/chunks/{DCzChru-.js → DJbcK1vm.js} +1 -1
- package/web/app/immutable/chunks/{Oweeyv1v.js → DL9oF9R-.js} +1 -1
- package/web/app/immutable/chunks/{DQewNXDh.js → DOOWwNKc.js} +1 -1
- package/web/app/immutable/chunks/{CKK0Gz-a.js → DRX7fFc0.js} +2 -2
- package/web/app/immutable/chunks/{lCSqh71Z.js → DYb2Jx_H.js} +1 -1
- package/web/app/immutable/chunks/{yLWVsiXj.js → DZXtm4_Y.js} +1 -1
- package/web/app/immutable/chunks/{zROLTv2m.js → DcPlD4Yk.js} +1 -1
- package/web/app/immutable/chunks/{Bxb8LI6C.js → DfC089Aj.js} +1 -1
- package/web/app/immutable/chunks/{Ixhw1ROs.js → DfybFhnX.js} +1 -1
- package/web/app/immutable/chunks/{B5PU_SZw.js → Dl1bhT5L.js} +1 -1
- package/web/app/immutable/chunks/{lFTk8wpi.js → Dp1LDv4x.js} +1 -1
- package/web/app/immutable/chunks/{55NQjm3t.js → DskDJYfd.js} +1 -1
- package/web/app/immutable/chunks/{B418rdhJ.js → DtDGJeDZ.js} +1 -1
- package/web/app/immutable/chunks/{CNsgRr0G.js → DthXaxFc.js} +1 -1
- package/web/app/immutable/chunks/{OusZ11tk.js → DwIiGflF.js} +1 -1
- package/web/app/immutable/chunks/{B9STQthu.js → DyZwlsjA.js} +1 -1
- package/web/app/immutable/chunks/{CPj4SFCC.js → EYYp06eB.js} +1 -1
- package/web/app/immutable/chunks/{oaGKgX0i.js → Fg5V-_KH.js} +1 -1
- package/web/app/immutable/chunks/{BPW7kjsh.js → Id9rbUde.js} +1 -1
- package/web/app/immutable/chunks/{BpWCMu3u.js → JHEpx9qH.js} +1 -1
- package/web/app/immutable/chunks/{B9Y57c7j.js → NDFzzX6j.js} +6 -6
- package/web/app/immutable/chunks/{BTcBtO7l.js → OKyJRSao.js} +1 -1
- package/web/app/immutable/chunks/{ahq3r4Wz.js → PAnofhoS.js} +1 -1
- package/web/app/immutable/chunks/{LbiCax8N.js → RLm3umLY.js} +1 -1
- package/web/app/immutable/chunks/{EwMtkE4R.js → RNLMbZ9C.js} +4 -4
- package/web/app/immutable/chunks/{BIn5egRU.js → TWIpzPb0.js} +1 -1
- package/web/app/immutable/chunks/{C-y2Lv4J.js → ZVjzo5B6.js} +1 -1
- package/web/app/immutable/chunks/{DsnmJyUD.js → _q3XqkyK.js} +1 -1
- package/web/app/immutable/chunks/{CR5ZxoLH.js → b2N6VSvj.js} +1 -1
- package/web/app/immutable/chunks/{CwB9Am9z.js → f_7_jVTC.js} +3 -3
- package/web/app/immutable/chunks/{D9-KwDth.js → gprpeC7D.js} +1 -1
- package/web/app/immutable/chunks/{xs1C7KnJ.js → p9pVDf-Y.js} +1 -1
- package/web/app/immutable/chunks/{B0lZCUS6.js → pjjCtVad.js} +1 -1
- package/web/app/immutable/chunks/{uA3ZM6fH.js → pnLCy_6A.js} +1 -1
- package/web/app/immutable/chunks/{CRBVaIXN.js → qc5YRWua.js} +1 -1
- package/web/app/immutable/chunks/{2YKrLT6f.js → xHTS7_DQ.js} +1 -1
- package/web/app/immutable/entry/{app.-hRXZvoO.js → app.Bn2XrulZ.js} +2 -2
- package/web/app/immutable/entry/start.DdzwOLyS.js +1 -0
- package/web/app/immutable/nodes/{0.Bf92A2SS.js → 0.BCyk8Eor.js} +1 -1
- package/web/app/immutable/nodes/{1.BWS1uOkH.js → 1.D2GMUxe6.js} +1 -1
- package/web/app/immutable/nodes/{10.xvB45P-Z.js → 10.CqLjvueR.js} +4 -4
- package/web/app/immutable/nodes/{11.CWt_UL31.js → 11.DjHiLQV_.js} +1 -1
- package/web/app/immutable/nodes/{15.BFkam5BT.js → 15.DBgLfjTo.js} +1 -1
- package/web/app/immutable/nodes/{19.DASGyMmu.js → 19.C65aoXG7.js} +2 -2
- package/web/app/immutable/nodes/{2.BLp65UB0.js → 2.DyILpfUv.js} +4 -4
- package/web/app/immutable/nodes/{3.sLYNU_z5.js → 3.BUXW6SHm.js} +1 -1
- package/web/app/immutable/nodes/{4.CYsqPvqR.js → 4.IOdsbvEy.js} +1 -1
- package/web/app/immutable/nodes/{5.BDPUNvGt.js → 5.CdjllGpy.js} +1 -1
- package/web/app/immutable/nodes/{6.Cmp_rej6.js → 6.B9bgqfmM.js} +1 -1
- package/web/app/immutable/nodes/{7.BeJ_Zasr.js → 7.CJeEPi1x.js} +1 -1
- package/web/app/immutable/nodes/{8.CTerGGp8.js → 8.CoXwlNYv.js} +1 -1
- package/web/app/immutable/nodes/{9.D8TUAlXi.js → 9.B7TZvLdB.js} +4 -4
- package/web/app/version.json +1 -1
- package/web/index.html +9 -9
- package/web/app/immutable/chunks/Qqd9dQHZ.js +0 -3
- package/web/app/immutable/entry/start.C3r7ji-v.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/
|
|
2
|
-
var Jp=Object.defineProperty;var Vl=n=>{throw TypeError(n)};var Gp=(n,e,t)=>e in n?Jp(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var it=(n,e,t)=>Gp(n,typeof e!="symbol"?e+"":e,t),Xp=(n,e,t)=>e.has(n)||Vl("Cannot "+t);var Kn=(n,e,t)=>(Xp(n,e,"read from private field"),t?t.call(n):e.get(n)),Fi=(n,e,t)=>e.has(n)?Vl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t);import{t as jt,bo as L,bw as Kt,b as Ut,bp as Yp,bm as re,bq as Qp,bs as Zp,_ as Vi}from"./ClpAEjbe.js";import{bs as qt,b_ as ne,W as U,bn as Jt,aA as P,aC as Ju,br as oa,bb as ni,c3 as En,aG as em,bk as Gu,a7 as Tr,ay as Rt,c0 as Xu,a5 as me,aD as m,bA as le,bS as ie,aw as tm,bH as pe,c9 as H,bV as Ge,aB as ee,ai as io,ca as pt,aj as Gn,bl as Se,bO as he,bo as Wa,bj as Yu,be as Qu,b$ as Zu,bf as nm,c5 as Sn}from"./CJxGDkBm.js";import{c as Do}from"./DSqSJXGX.js";import{s as xt,f as yn,c as aa,b as rm,g as yi,e as im}from"./CnGVh7I3.js";import{b as Dr}from"./NtFyWdpR.js";import{i as sm}from"./MZe3NxQe.js";import{d1 as om,aF as am,aT as Wl}from"./Bxb8LI6C.js";import{a as lm}from"./CC7to1B5.js";import{aT as cm,aB as um,ao as dm,aw as fm,ab as hm,f as rn,ae as ed,a1 as pm}from"./BVi5KkOP.js";import{i as xe}from"./wmcYjLAa.js";import{F as nn,bb as mm,bv as ja,bh as td,v as gm,bE as ym,d3 as bm,aI as jl,bg as Mr,bn as Ar,cZ as nd,cW as vm,cn as rd,cK as id,ak as km,av as sd,ay as Kl,ap as xm,aj as wm,as as Sm,cX as Cm,aZ as Mm,aN as Io,co as Em,bx as Tm,cb as Am,cy as Ul,Y as Nm,cH as Om,at as Dm,bU as Im,aq as Rm,c7 as Lm,bN as Pm,c_ as _m,al as zm,bl as $m,bF as Bm,a$ as Hm,d2 as Fm,am as Vm,bS as Wm,aT as jm,b0 as Km,c1 as Um,bd as qm,cx as Jm,cD as Gm,bR as Xm,bo as Ym,bi as ql}from"./CtJxHvGv.js";import{s as Qm}from"./WSVFXKpL.js";import{e as Zm}from"./CARsKzUN.js";import{b as eg,V as Jl,c as tg,p as ng,m as rg,s as ig}from"./DyaBo2y6.js";import{h as sg}from"./CPDV_dyu.js";import{g as Er,i as og}from"./BwASeArv.js";import{L as ag,S as lg,T as od}from"./ClEpfV0K.js";import{n as cg,l as ms}from"./By588DV1.js";import{h as ug}from"./CQR1o7um.js";import{bq as dg}from"./CpP1PKzF.js";import{g as fg}from"./G-nrQJwO.js";import{c as Ka,l as de}from"./ChTqQfQN.js";import{n as Gl,l as hg,c as pg}from"./oXpJ1LFx.js";import{$ as ad,a0 as mg,p as la,aN as gg,am as yg,a1 as bg,e5 as vg,a9 as kg}from"./D9Ykl3eH.js";import{i as dn,M as xg,D as wg,s as Ro,a as Sg,p as mr}from"./NPKMdhKA.js";import{A as Cg,b as Mg}from"./Dd5ei__B.js";import{P as Eg}from"./uD6eQoK5.js";import{a as ld}from"./B5wwCKYG.js";import{g as Xl}from"./CsFPvReh.js";import{H as Tg}from"./Bqd7fdCF.js";import{q as Ag}from"./B06RKBOm.js";import{b as Ng,P as Og}from"./DM2Efanx.js";var Dg=Ju('<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 cd(n,e){if(new.target)return jt({component:cd,...n});qt(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:Kt,$on:(o,a)=>Ut(e,o,a)},s=Dg();return ne(()=>{xt(s,"width",t()),xt(s,"height",t()),yn(s,0,aa(r()))}),U(n,s),Jt(i)}var Yl=Object.defineProperty,Ig=(n,e)=>{let t={};for(var r in n)Yl(t,r,{get:n[r],enumerable:!0});return Yl(t,Symbol.toStringTag,{value:"Module"}),t};function mt(n){this.content=n}mt.prototype={constructor:mt,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 mt(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 mt(t)},addToStart:function(n,e){return new mt([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new mt(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 mt(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=mt.from(n),n.size?new mt(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=mt.from(n),n.size?new mt(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=mt.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}};mt.from=function(n){if(n instanceof mt)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new mt(e)};function ud(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&&hd(o.charCodeAt(l-1))&&fd(o.charCodeAt(l))&&t--,t}if(i.content.size||s.content.size){let o=ud(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function dd(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&&hd(c.charCodeAt(d-1))&&fd(c.charCodeAt(d))&&(t++,r++),{a:t,b:r}}if(o.content.size||a.content.size){let c=dd(o.content,a.content,t-1,r-1);if(c)return c}t-=l,r-=l}}function fd(n){return n>=56320&&n<57344}function hd(n){return n>=55296&&n<56320}class T{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 T(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 T(r,i)}cutByIndex(e,t){return e==t?T.empty:e==0&&t==this.content.length?this:new T(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 T(i,s)}addToStart(e){return new T([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new T(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 ud(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return dd(this,e,t,r)}findIndex(e){if(e==0)return Wi(0,e);if(e==this.size)return Wi(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?Wi(t+1,s):Wi(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 T.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return T.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return T.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 T(t||e,r)}static from(e){if(!e)return T.empty;if(e instanceof T)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new T([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}T.empty=new T([],0);const Lo={index:0,offset:0};function Wi(n,e){return Lo.index=n,Lo.offset=e,Lo}function gs(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(!gs(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!gs(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Re=class ca{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&&gs(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 ca.none;if(e instanceof ca)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Re.none=[];class bi extends Error{}class B{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=md(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return r&&new B(r,this.openStart,this.openEnd)}removeBetween(e,t){return new B(pd(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 B.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 B(T.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 B(e,r,i)}}B.empty=new B(T.empty,0,0);function pd(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(pd(s.content,e-i-1,t-i-1)))}function md(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=md(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 Rg(n,e,t){if(t.openStart>n.depth)throw new bi("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new bi("Inconsistent open depths");return gd(n,e,t,0)}function gd(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=gd(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 nr(o,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=Lg(t,n);return nr(s,bd(n,o,a,e,r))}else return nr(s,ys(n,e,r))}function yd(n,e){if(!e.type.compatibleContent(n.type))throw new bi("Cannot join "+e.type.name+" onto "+n.type.name)}function ua(n,e,t){let r=n.node(t);return yd(r,e.node(t)),r}function tr(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 ri(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&&(tr(n.nodeAfter,r),s++));for(let a=s;a<o;a++)tr(i.child(a),r);e&&e.depth==t&&e.textOffset&&tr(e.nodeBefore,r)}function nr(n,e){if(!n.type.validContent(e))throw new bi("Invalid content for node "+n.type.name);return n.copy(e)}function bd(n,e,t,r,i){let s=n.depth>i&&ua(n,e,i+1),o=r.depth>i&&ua(t,r,i+1),a=[];return ri(null,n,i,a),s&&o&&e.index(i)==t.index(i)?(yd(s,o),tr(nr(s,bd(n,e,t,r,i+1)),a)):(s&&tr(nr(s,ys(n,e,i+1)),a),ri(e,t,i,a),o&&tr(nr(o,ys(t,r,i+1)),a)),ri(r,null,i,a),new T(a)}function ys(n,e,t){let r=[];if(ri(null,n,t,r),n.depth>t){let i=ua(n,e,t+1);tr(nr(i,ys(n,e,t+1)),r)}return ri(e,null,t,r),new T(r)}function Lg(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(T.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class vi{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 Re.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 bs(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 vi(t,r,s)}static resolveCached(e,t){let r=Ql.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 Ql.set(e,r=new Pg);let i=r.elts[r.i]=vi.resolve(e,t);return r.i=(r.i+1)%_g,i}}class Pg{constructor(){this.elts=[],this.i=0}}const _g=12,Ql=new WeakMap;class bs{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 zg=Object.create(null);let Ln=class da{constructor(e,t,r,i=Re.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||T.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&&gs(this.attrs,t||e.defaultAttrs||zg)&&Re.sameSet(this.marks,r||Re.none)}copy(e=null){return e==this.content?this:new da(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new da(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 B.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 B(c,i.depth-o,s.depth-o)}replace(e,t,r){return Rg(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 vi.resolveCached(this,e)}resolveNoCache(e){return vi.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()+")"),vd(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=T.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),Zl(this.type.attrs,this.attrs,"node",this.type.name);let e=Re.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];Zl(r.type.attrs,r.attrs,"mark",r.type.name),e=r.addToSet(e)}if(!Re.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=T.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};Ln.prototype.text=void 0;class vs extends Ln{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):vd(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new vs(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new vs(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(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 vd(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}function Zl(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 sr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new $g(e,t);if(r.next==null)return sr.empty;let i=kd(r);r.next&&r.err("Unexpected trailing text");let s=Kg(jg(i));return Ug(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 T.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/B62l45Uf.js","/app/immutable/chunks/ClpAEjbe.js","/app/immutable/chunks/CJxGDkBm.js","/app/immutable/chunks/C1zxTHwk.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/wmcYjLAa.js","/app/immutable/chunks/CnGVh7I3.js","/app/immutable/chunks/WSVFXKpL.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/BVi5KkOP.js","/app/immutable/chunks/NtFyWdpR.js","/app/immutable/chunks/BwASeArv.js","/app/immutable/chunks/CPDV_dyu.js","/app/immutable/chunks/BejTxFyR.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/DSqSJXGX.js","/app/immutable/chunks/Xh71Wbuh.js","/app/immutable/chunks/By588DV1.js","/app/immutable/chunks/BeYVt6Wg.js","/app/immutable/chunks/CpP1PKzF.js","/app/immutable/chunks/PVXvIyE8.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/CgBcONKs.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/DJfJ5NWH.js","/app/immutable/chunks/CtJxHvGv.js","/app/immutable/chunks/oXpJ1LFx.js","/app/immutable/chunks/BoIfXiRv.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/D9Ykl3eH.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/CTV49dzf.js","/app/immutable/chunks/DujUyPvo.js","/app/immutable/chunks/ByoP16rr.js","/app/immutable/chunks/Fg5V-_KH.js","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/NDFzzX6j.js","/app/immutable/chunks/B0rlWqYd.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/BHINa8Ry.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/1cfvZqIL.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Jp=Object.defineProperty;var Vl=n=>{throw TypeError(n)};var Gp=(n,e,t)=>e in n?Jp(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var it=(n,e,t)=>Gp(n,typeof e!="symbol"?e+"":e,t),Xp=(n,e,t)=>e.has(n)||Vl("Cannot "+t);var Kn=(n,e,t)=>(Xp(n,e,"read from private field"),t?t.call(n):e.get(n)),Fi=(n,e,t)=>e.has(n)?Vl("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t);import{t as jt,bo as L,bw as Kt,b as Ut,bp as Yp,bm as re,bq as Qp,bs as Zp,_ as Vi}from"./ClpAEjbe.js";import{bs as qt,b_ as ne,W as U,bn as Jt,aA as P,aC as Ju,br as oa,bb as ni,c3 as En,aG as em,bk as Gu,a7 as Tr,ay as Rt,c0 as Xu,a5 as me,aD as m,bA as le,bS as ie,aw as tm,bH as pe,c9 as H,bV as Ge,aB as ee,ai as io,ca as pt,aj as Gn,bl as Se,bO as he,bo as Wa,bj as Yu,be as Qu,b$ as Zu,bf as nm,c5 as Sn}from"./CJxGDkBm.js";import{c as Do}from"./DSqSJXGX.js";import{s as xt,f as yn,c as aa,b as rm,g as yi,e as im}from"./CnGVh7I3.js";import{b as Dr}from"./NtFyWdpR.js";import{i as sm}from"./MZe3NxQe.js";import{d1 as om,aF as am,aT as Wl}from"./DfC089Aj.js";import{a as lm}from"./CC7to1B5.js";import{aT as cm,aB as um,ao as dm,aw as fm,ab as hm,f as rn,ae as ed,a1 as pm}from"./BVi5KkOP.js";import{i as xe}from"./wmcYjLAa.js";import{F as nn,bb as mm,bv as ja,bh as td,v as gm,bE as ym,d3 as bm,aI as jl,bg as Mr,bn as Ar,cZ as nd,cW as vm,cn as rd,cK as id,ak as km,av as sd,ay as Kl,ap as xm,aj as wm,as as Sm,cX as Cm,aZ as Mm,aN as Io,co as Em,bx as Tm,cb as Am,cy as Ul,Y as Nm,cH as Om,at as Dm,bU as Im,aq as Rm,c7 as Lm,bN as Pm,c_ as _m,al as zm,bl as $m,bF as Bm,a$ as Hm,d2 as Fm,am as Vm,bS as Wm,aT as jm,b0 as Km,c1 as Um,bd as qm,cx as Jm,cD as Gm,bR as Xm,bo as Ym,bi as ql}from"./CtJxHvGv.js";import{s as Qm}from"./WSVFXKpL.js";import{e as Zm}from"./CARsKzUN.js";import{b as eg,V as Jl,c as tg,p as ng,m as rg,s as ig}from"./CWm_YxN-.js";import{h as sg}from"./CPDV_dyu.js";import{g as Er,i as og}from"./BwASeArv.js";import{L as ag,S as lg,T as od}from"./ClEpfV0K.js";import{n as cg,l as ms}from"./By588DV1.js";import{h as ug}from"./BTtsrh4I.js";import{bq as dg}from"./CpP1PKzF.js";import{g as fg}from"./G-nrQJwO.js";import{c as Ka,l as de}from"./ChTqQfQN.js";import{n as Gl,l as hg,c as pg}from"./oXpJ1LFx.js";import{$ as ad,a0 as mg,p as la,aN as gg,am as yg,a1 as bg,e5 as vg,a9 as kg}from"./D9Ykl3eH.js";import{i as dn,M as xg,D as wg,s as Ro,a as Sg,p as mr}from"./BTwXmxv4.js";import{A as Cg,b as Mg}from"./Dd5ei__B.js";import{P as Eg}from"./uD6eQoK5.js";import{a as ld}from"./B5wwCKYG.js";import{g as Xl}from"./CsFPvReh.js";import{H as Tg}from"./Bqd7fdCF.js";import{q as Ag}from"./B06RKBOm.js";import{b as Ng,P as Og}from"./DM2Efanx.js";var Dg=Ju('<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 cd(n,e){if(new.target)return jt({component:cd,...n});qt(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:Kt,$on:(o,a)=>Ut(e,o,a)},s=Dg();return ne(()=>{xt(s,"width",t()),xt(s,"height",t()),yn(s,0,aa(r()))}),U(n,s),Jt(i)}var Yl=Object.defineProperty,Ig=(n,e)=>{let t={};for(var r in n)Yl(t,r,{get:n[r],enumerable:!0});return Yl(t,Symbol.toStringTag,{value:"Module"}),t};function mt(n){this.content=n}mt.prototype={constructor:mt,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 mt(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 mt(t)},addToStart:function(n,e){return new mt([n,e].concat(this.remove(n).content))},addToEnd:function(n,e){var t=this.remove(n).content.slice();return t.push(n,e),new mt(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 mt(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=mt.from(n),n.size?new mt(n.content.concat(this.subtract(n).content)):this},append:function(n){return n=mt.from(n),n.size?new mt(this.subtract(n).content.concat(n.content)):this},subtract:function(n){var e=this;n=mt.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}};mt.from=function(n){if(n instanceof mt)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new mt(e)};function ud(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&&hd(o.charCodeAt(l-1))&&fd(o.charCodeAt(l))&&t--,t}if(i.content.size||s.content.size){let o=ud(i.content,s.content,t+1);if(o!=null)return o}t+=i.nodeSize}}function dd(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&&hd(c.charCodeAt(d-1))&&fd(c.charCodeAt(d))&&(t++,r++),{a:t,b:r}}if(o.content.size||a.content.size){let c=dd(o.content,a.content,t-1,r-1);if(c)return c}t-=l,r-=l}}function fd(n){return n>=56320&&n<57344}function hd(n){return n>=55296&&n<56320}class T{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 T(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 T(r,i)}cutByIndex(e,t){return e==t?T.empty:e==0&&t==this.content.length?this:new T(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 T(i,s)}addToStart(e){return new T([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new T(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 ud(this,e,t)}findDiffEnd(e,t=this.size,r=e.size){return dd(this,e,t,r)}findIndex(e){if(e==0)return Wi(0,e);if(e==this.size)return Wi(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?Wi(t+1,s):Wi(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 T.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return T.fromArray(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return T.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 T(t||e,r)}static from(e){if(!e)return T.empty;if(e instanceof T)return e;if(Array.isArray(e))return this.fromArray(e);if(e.attrs)return new T([e],e.nodeSize);throw new RangeError("Can not convert "+e+" to a Fragment"+(e.nodesBetween?" (looks like multiple versions of prosemirror-model were loaded)":""))}}T.empty=new T([],0);const Lo={index:0,offset:0};function Wi(n,e){return Lo.index=n,Lo.offset=e,Lo}function gs(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(!gs(n[r],e[r]))return!1}else{for(let r in n)if(!(r in e)||!gs(n[r],e[r]))return!1;for(let r in e)if(!(r in n))return!1}return!0}let Re=class ca{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&&gs(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 ca.none;if(e instanceof ca)return[e];let t=e.slice();return t.sort((r,i)=>r.type.rank-i.type.rank),t}};Re.none=[];class bi extends Error{}class B{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=md(this.content,e+this.openStart,t,this.openStart+1,this.openEnd+1);return r&&new B(r,this.openStart,this.openEnd)}removeBetween(e,t){return new B(pd(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 B.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 B(T.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 B(e,r,i)}}B.empty=new B(T.empty,0,0);function pd(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(pd(s.content,e-i-1,t-i-1)))}function md(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=md(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 Rg(n,e,t){if(t.openStart>n.depth)throw new bi("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new bi("Inconsistent open depths");return gd(n,e,t,0)}function gd(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=gd(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 nr(o,a.cut(0,n.parentOffset).append(t.content).append(a.cut(e.parentOffset)))}else{let{start:o,end:a}=Lg(t,n);return nr(s,bd(n,o,a,e,r))}else return nr(s,ys(n,e,r))}function yd(n,e){if(!e.type.compatibleContent(n.type))throw new bi("Cannot join "+e.type.name+" onto "+n.type.name)}function ua(n,e,t){let r=n.node(t);return yd(r,e.node(t)),r}function tr(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 ri(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&&(tr(n.nodeAfter,r),s++));for(let a=s;a<o;a++)tr(i.child(a),r);e&&e.depth==t&&e.textOffset&&tr(e.nodeBefore,r)}function nr(n,e){if(!n.type.validContent(e))throw new bi("Invalid content for node "+n.type.name);return n.copy(e)}function bd(n,e,t,r,i){let s=n.depth>i&&ua(n,e,i+1),o=r.depth>i&&ua(t,r,i+1),a=[];return ri(null,n,i,a),s&&o&&e.index(i)==t.index(i)?(yd(s,o),tr(nr(s,bd(n,e,t,r,i+1)),a)):(s&&tr(nr(s,ys(n,e,i+1)),a),ri(e,t,i,a),o&&tr(nr(o,ys(t,r,i+1)),a)),ri(r,null,i,a),new T(a)}function ys(n,e,t){let r=[];if(ri(null,n,t,r),n.depth>t){let i=ua(n,e,t+1);tr(nr(i,ys(n,e,t+1)),r)}return ri(e,null,t,r),new T(r)}function Lg(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(T.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}class vi{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 Re.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 bs(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 vi(t,r,s)}static resolveCached(e,t){let r=Ql.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 Ql.set(e,r=new Pg);let i=r.elts[r.i]=vi.resolve(e,t);return r.i=(r.i+1)%_g,i}}class Pg{constructor(){this.elts=[],this.i=0}}const _g=12,Ql=new WeakMap;class bs{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 zg=Object.create(null);let Ln=class da{constructor(e,t,r,i=Re.none){this.type=e,this.attrs=t,this.marks=i,this.content=r||T.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&&gs(this.attrs,t||e.defaultAttrs||zg)&&Re.sameSet(this.marks,r||Re.none)}copy(e=null){return e==this.content?this:new da(this.type,this.attrs,e,this.marks)}mark(e){return e==this.marks?this:new da(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 B.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 B(c,i.depth-o,s.depth-o)}replace(e,t,r){return Rg(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 vi.resolveCached(this,e)}resolveNoCache(e){return vi.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()+")"),vd(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=T.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),Zl(this.type.attrs,this.attrs,"node",this.type.name);let e=Re.none;for(let t=0;t<this.marks.length;t++){let r=this.marks[t];Zl(r.type.attrs,r.attrs,"mark",r.type.name),e=r.addToSet(e)}if(!Re.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=T.fromJSON(e,t.content);return e.nodeType(t.type).create(t.attrs,i,r)}};Ln.prototype.text=void 0;class vs extends Ln{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):vd(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new vs(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new vs(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(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 vd(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}function Zl(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 sr{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new $g(e,t);if(r.next==null)return sr.empty;let i=kd(r);r.next&&r.err("Unexpected trailing text");let s=Kg(jg(i));return Ug(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 T.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
|
`)}}sr.empty=new sr(!0);class $g{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 kd(n){let e=[];do e.push(Bg(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Bg(n){let e=[];do e.push(Hg(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Hg(n){let e=Wg(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=Fg(n,e);else break;return e}function ec(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Fg(n,e){let t=ec(n),r=t;return n.eat(",")&&(n.next!="}"?r=ec(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Vg(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 Wg(n){if(n.eat("(")){let e=kd(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=Vg(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 jg(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 xd(n,e){return e-n}function tc(n,e){let t=[];return r(e),t.sort(xd);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 Kg(n){let e=Object.create(null);return t(tc(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]);tc(n,l).forEach(u=>{c||i.push([a,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let s=e[r.join(",")]=new sr(r.indexOf(n.length-1)>-1);for(let o=0;o<i.length;o++){let a=i[o][1].sort(xd);s.next.push({type:i[o][0],next:e[a.join(",")]||t(a)})}return s}}function Ug(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 wd(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 Sd(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 Cd(n,e){let t=Object.create(null);if(e)for(let r in e)t[r]=new Jg(n,r,e[r]);return t}let nc=class Md{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=Cd(e,r.attrs),this.defaultAttrs=wd(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==sr.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:Sd(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new Ln(this,this.computeAttrs(e),T.from(t),Re.setFrom(r))}createChecked(e=null,t,r){return t=T.from(t),this.checkContent(t),new Ln(this,this.computeAttrs(e),t,Re.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=T.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(T.empty,!0);return s?new Ln(this,e,t.append(s),Re.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:Re.none:e}static compile(e,t){let r=Object.create(null);e.forEach((s,o)=>r[s]=new Md(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 qg(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 Jg{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?qg(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=Cd(e,i.attrs),this.excluded=null;let s=wd(this.attrs);this.instance=s?new Re(this,s):null}create(e=null){return!e&&this.instance?this.instance:new Re(this,Sd(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 ls{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=mt.from(e.nodes),t.marks=mt.from(e.marks||{}),this.nodes=nc.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]=sr.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?rc(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==""?[]:rc(this,o.split(" "))}this.nodeFromJSON=i=>Ln.fromJSON(this,i),this.markFromJSON=i=>Re.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 nc){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 vs(r,r.defaultAttrs,e,Re.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 rc(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 Gg(n){return n.tag!=null}function Xg(n){return n.style!=null}let ii=class fa{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(Gg(i))this.tags.push(i);else if(Xg(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 sc(this,t,!1);return r.addAll(e,Re.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new sc(this,t,!0);return r.addAll(e,Re.none,t.from,t.to),B.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(Zg(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=oc(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=oc(o)),o.node||o.ignore||o.mark||(o.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new fa(e,fa.schemaRules(e)))}};const Ed={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},Yg={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Td={ol:!0,ul:!0},ki=1,ha=2,si=4;function ic(n,e,t){return e!=null?(e?ki:0)|(e==="full"?ha:0):n&&n.whitespace=="pre"?ki|ha:t&~si}class ji{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=Re.none,this.match=s||(o&si?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(T.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&ki)){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=T.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(T.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&&!Ed.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}}class sc{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=ic(null,t.preserveWhitespace,0)|(r?si:0);i?s=new ji(i.type,i.attrs,Re.none,!0,t.topMatch||i.type.contentMatch,o):r?s=new ji(null,null,Re.none,!0,null,o):s=new ji(e.schema.topNodeType,null,Re.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&ha?"full":this.localPreserveWS||(i.options&ki)>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;Td.hasOwnProperty(o)&&this.parser.normalizeLists&&Qg(e);let l=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(a=this.parser.matchTag(e,this,r));e:if(l?l.ignore:Yg.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(Ed.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=Re.none;for(let a of i.concat(e.marks))(s.type?s.type.allowsMarkType(a.type):ac(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=ic(e,s,o.options);o.options&si&&o.content.length==0&&(a|=si);let l=Re.none;return r=r.filter(c=>(o.type?o.type.allowsMarkType(c.type):ac(c.type,e))?(l=c.addToSet(l),!1):!0),this.nodes.push(new ji(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|=ki)}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 Qg(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Td.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function Zg(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function oc(n){let e={};for(let t in n)e[t]=n[t];return e}function ac(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 fr{constructor(e,t){this.nodes=e,this.marks=t}serializeFragment(e,t={},r){r||(r=Ki(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 Ki(t).createTextNode(e.text);let{dom:r,contentDOM:i}=cs(Ki(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&&cs(Ki(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return typeof t=="string"?{dom:e.createTextNode(t)}:cs(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new fr(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=lc(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return lc(e.marks)}}function lc(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Ki(n){return n.document||window.document}const cc=new WeakMap;function ey(n){let e=cc.get(n);return e===void 0&&cc.set(n,e=ty(n)),e}function ty(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 cs(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=ey(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:p}=cs(n,f,t,r);if(l.appendChild(h),p){if(a)throw new RangeError("Multiple content holes");a=p}}}return{dom:l,contentDOM:a}}const Ad=65535,Nd=Math.pow(2,16);function ny(n,e){return n+e*Nd}function uc(n){return n&Ad}function ry(n){return(n-(n&Ad))/Nd}const Od=1,Dd=2,us=4,Id=8;class pa{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Id)>0}get deletedBefore(){return(this.delInfo&(Od|us))>0}get deletedAfter(){return(this.delInfo&(Dd|us))>0}get deletedAcross(){return(this.delInfo&us)>0}}class Pt{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&Pt.empty)return Pt.empty}recover(e){let t=0,r=uc(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+ry(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 p=e==(t<0?l:d)?null:ny(a/3,e-l),g=0;return c&&(g|=e==l?Dd:e==d?Od:us,(t<0?e!=l:e!=d)&&(g|=Id)),new pa(h,g,p)}i+=u-c}return r?e+i:new pa(e+i,0,null)}touches(e,t){let r=0,i=uc(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 Pt(this.ranges,!this.inverted)}toString(){return(this.inverted?"-":"")+JSON.stringify(this.ranges)}static offset(e){return e==0?Pt.empty:new Pt(e<0?[0,-e,0]:[0,0,e])}}Pt.empty=new Pt([]);class xi{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 xi(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=0,r=this._maps.length;t<e._maps.length;t++){let i=e.getMirror(t);this.appendMap(e._maps[t],i!=null&&i<t?r+i:void 0)}}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.maps.length-1,r=this._maps.length+e._maps.length;t>=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new xi;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 pa(e,i,null)}}const Po=Object.create(null);class Ct{getMap(){return Pt.empty}merge(e){return null}static fromJSON(e,t){if(!t||!t.stepType)throw new RangeError("Invalid input for Step.fromJSON");let r=Po[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 Po)throw new RangeError("Duplicate use of step JSON ID "+e);return Po[e]=t,t.prototype.jsonID=e,t}}class st{constructor(e,t){this.doc=e,this.failed=t}static ok(e){return new st(e,null)}static fail(e){return new st(null,e)}static fromReplace(e,t,r,i){try{return st.ok(e.replace(t,r,i))}catch(s){if(s instanceof bi)return st.fail(s.message);throw s}}}function Ua(n,e,t){let r=[];for(let i=0;i<n.childCount;i++){let s=n.child(i);s.content.size&&(s=s.copy(Ua(s.content,e,s))),s.isInline&&(s=e(s,t,i)),r.push(s)}return T.fromArray(r)}class In extends Ct{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 B(Ua(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 st.fromReplace(e,this.from,this.to,s)}invert(){return new Yt(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new In(t.pos,r.pos,this.mark)}merge(e){return e instanceof In&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new In(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 In(t.from,t.to,e.markFromJSON(t.mark))}}Ct.jsonID("addMark",In);class Yt extends Ct{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 B(Ua(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return st.fromReplace(e,this.from,this.to,r)}invert(){return new In(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new Yt(t.pos,r.pos,this.mark)}merge(e){return e instanceof Yt&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new Yt(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 Yt(t.from,t.to,e.markFromJSON(t.mark))}}Ct.jsonID("removeMark",Yt);class Rn extends Ct{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return st.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return st.fromReplace(e,this.pos,this.pos+1,new B(T.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 Rn(this.pos,t.marks[i]);return new Rn(this.pos,this.mark)}}return new or(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new Rn(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 Rn(t.pos,e.markFromJSON(t.mark))}}Ct.jsonID("addNodeMark",Rn);class or extends Ct{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return st.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.removeFromSet(t.marks));return st.fromReplace(e,this.pos,this.pos+1,new B(T.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);return!t||!this.mark.isInSet(t.marks)?this:new Rn(this.pos,this.mark)}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new or(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 or(t.pos,e.markFromJSON(t.mark))}}Ct.jsonID("removeNodeMark",or);class et extends Ct{constructor(e,t,r,i=!1){super(),this.from=e,this.to=t,this.slice=r,this.structure=i}apply(e){return this.structure&&ma(e,this.from,this.to)?st.fail("Structure replace would overwrite content"):st.fromReplace(e,this.from,this.to,this.slice)}getMap(){return new Pt([this.from,this.to-this.from,this.slice.size])}invert(e){return new et(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&&et.MAP_BIAS<0?t:e.mapResult(this.from,1);return r.deletedAcross&&t.deletedAcross?null:new et(r.pos,Math.max(r.pos,t.pos),this.slice,this.structure)}merge(e){if(!(e instanceof et)||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?B.empty:new B(this.slice.content.append(e.slice.content),this.slice.openStart,e.slice.openEnd);return new et(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?B.empty:new B(e.slice.content.append(this.slice.content),e.slice.openStart,this.slice.openEnd);return new et(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 et(t.from,t.to,B.fromJSON(e,t.slice),!!t.structure)}}et.MAP_BIAS=1;Ct.jsonID("replace",et);class ft extends Ct{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&&(ma(e,this.from,this.gapFrom)||ma(e,this.gapTo,this.to)))return st.fail("Structure gap-replace would overwrite content");let t=e.slice(this.gapFrom,this.gapTo);if(t.openStart||t.openEnd)return st.fail("Gap is not a flat range");let r=this.slice.insertAt(this.insert,t.content);return r?st.fromReplace(e,this.from,this.to,r):st.fail("Content does not fit in gap")}getMap(){return new Pt([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 ft(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?null:new ft(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 ft(t.from,t.to,t.gapFrom,t.gapTo,B.fromJSON(e,t.slice),t.insert,!!t.structure)}}Ct.jsonID("replaceAround",ft);function ma(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 iy(n,e,t,r){let i=[],s=[],o,a;n.doc.nodesBetween(e,t,(l,c,u)=>{if(!l.isInline)return;let d=l.marks;if(!r.isInSet(d)&&u.type.allowsMarkType(r.type)){let f=Math.max(c,e),h=Math.min(c+l.nodeSize,t),p=r.addToSet(d);for(let g=0;g<d.length;g++)d[g].isInSet(p)||(o&&o.to==f&&o.mark.eq(d[g])?o.to=h:i.push(o=new Yt(f,h,d[g])));a&&a.to==f?a.to=h:s.push(a=new In(f,h,r))}}),i.forEach(l=>n.step(l)),s.forEach(l=>n.step(l))}function sy(n,e,t,r){let i=[],s=0;n.doc.nodesBetween(e,t,(o,a)=>{if(!o.isInline)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 p=i[h];p.step==s-1&&d.eq(i[h].style)&&(f=p)}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 Yt(o.from,o.to,o.style)))}function qa(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 et(a,u,B.empty));else{r=d;for(let f=0;f<c.marks.length;f++)t.allowsMarkType(c.marks[f].type)||n.step(new Yt(a,u,c.marks[f]));if(i&&c.isText&&t.whitespace!="pre"){let f,h=/\r?\n|\r/g,p;for(;f=h.exec(c.text);)p||(p=new B(T.from(t.schema.text(" ",t.allowedMarks(c.marks))),0,0)),o.push(new et(a+f.index,a+f.index+f[0].length,p))}}a=u}if(!r.validEnd){let l=r.fillBefore(T.empty,!0);n.replace(a,a,new B(l,0,0))}for(let l=o.length-1;l>=0;l--)n.step(o[l])}function oy(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||!oy(o,a,l))break;a&&(i=1),l<o.childCount&&(s=1)}return null}function ay(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=T.empty,d=0;for(let p=s,g=!1;p>t;p--)g||r.index(p)>0?(g=!0,u=T.from(r.node(p).copy(u)),d++):l--;let f=T.empty,h=0;for(let p=s,g=!1;p>t;p--)g||i.after(p+1)<i.end(p)?(g=!0,f=T.from(i.node(p).copy(f)),h++):c++;n.step(new ft(l,c,o,a,new B(u.append(f),d,h),u.size-d,!0))}function Ja(n,e,t=null,r=n){let i=ly(n,e),s=i&&cy(r,e);return s?i.map(dc).concat({type:e,attrs:t}).concat(s.map(dc)):null}function dc(n){return{type:n,attrs:null}}function ly(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 cy(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 uy(n,e,t){let r=T.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=T.from(t[o].type.create(t[o].attrs,r))}let i=e.start,s=e.end;n.step(new ft(i,s,i,s,new B(r,0,0),t.length,!0))}function dy(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)&&fy(n.doc,n.mapping.slice(s).map(a),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&Ld(n,o,a,s),qa(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 ft(d,f,d+1,f-1,new B(T.from(r.create(l,null,o.marks)),0,0),1,!0)),c===!0&&Rd(n,o,a,s),!1}})}function Rd(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 Ld(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 ce(b,E){return pl(b.state.doc,{from:0,to:E},{blockSeparator:`
|
|
173
173
|
|
|
174
174
|
`,textSerializers:Fe(b)}).replace(/\u00A0/g," ")}function Oe(b){return ce(b,b.state.doc.content.size)}function Tt(b){return ce(b,b.state.selection.from)}function pr(b,E){const R=Oe(b),Q=RM(R,Tt(b).length);(!Q||Q.from!==m(te)?.from)&&(pe(He,null),pe(Et,null)),pe(te,Q,!0),Q&&E?.dismissNewContext&&pe(He,m(Ie),!0)}function Hi(){pe(Et,m(te)?.from??null,!0)}function Rl(b){b.preventDefault()}function Cp(b){if(!m(M)||!m(te))return;const E=Oe(m(M)),R=Tt(m(M)).length,Q={from:m(M).state.selection.from-m(te).query.length-1,to:m(M).state.selection.from+m(te).to-R},z=m(te).to===E.length||!/^\s/u.test(E.slice(m(te).to)),A=[{type:"skillCommand",attrs:{name:b.name}},...z?[{type:"text",text:" "}]:[]];m(M).chain().focus().insertContentAt(Q,A).setTextSelection(Q.from+2).run()}function Hr(b){const E=iM(b,N().map(R=>R.name));return be()?aC(E,be()):E}const Fr=new AM({readSnapshot:()=>{const b=m(M);return!b||b.isDestroyed||!w()||!m(rt)||!m(fe)?null:{text:qn(b),caretAtEnd:Ni(b.state),composing:m(Dt)||b.view.composing,menuOpen:m(_e)||Vr.pluginKey.getState(b.state)?.active===!0}},readContext:()=>w()?.()??"",request:IM,showGhost:b=>{m(M)&&!m(M).isDestroyed&&ra(m(M).view,b)}});function Ll(){Fr.cancel(),m(M)&&!m(M).isDestroyed&&Oi(m(M).state)&&ra(m(M).view,null)}function Mp(b,E){E||Oi(b.state)?Fr.cancel():Fr.schedule()}pt(()=>{(!w()||!m(rt))&&Sn(Ll)});function Ep(b){Fr.cancel(),m(M)&&!m(M).isDestroyed&&ra(m(M).view,b)}function Tp(b){if(!m(_e)||!m(vt))return!1;const E=!b.shiftKey&&!b.metaKey&&!b.ctrlKey&&!b.altKey&&["ArrowUp","ArrowDown","Enter"].includes(b.key);return b.key!=="Escape"&&!E?!1:m(vt).onKeyDown({event:b})?!0:b.key==="Enter"?(b.preventDefault(),!0):!1}function Ap(){m(M)&&m(M).view&&m(M).chain().focus().insertContent("@").run()}function Np(b){return m(M)&&m(M).view?(m(M).chain().focus().insertContent(b).run(),!0):!1}function Op(b){if(f()||!m(M)?.view)return!1;const{state:E,dispatch:R}=m(M).view,Q=Wu(E.schema,b);return Q.length===0?!1:(R(E.tr.replaceSelection(new B(T.from(Q),1,1)).scrollIntoView()),m(M).view.focus(),!0)}function Dp(){if(f())return!1;if(m(M)&&m(M).view)try{if(m(M).view.hasFocus())return!0;const b=m(M),E=document.activeElement;return requestAnimationFrame(()=>{if(m(M)!==b||b.isDestroyed||f()||b.view.hasFocus())return;const R=document.activeElement;R!==E&&R instanceof HTMLElement&&lm(R)&&!b.view.dom.contains(R)||(b.view.focus(),b.commands.scrollIntoView())}),typeof m(M).view.hasFocus=="function"?m(M).view.hasFocus():!0}catch(b){i.debug("[TipTapEditor] Editor not ready for focus:",b)}return!1}function Ip(){if(f())return!1;if(m(M)&&m(M).view)try{return m(M).chain().focus("end").run(),!0}catch(b){i.debug("[TipTapEditor] Editor not ready for focusEnd:",b)}return!1}function Rp(){if(f())return!1;if(m(M)&&m(M).view)try{return m(M).chain().focus().selectAll().run(),!0}catch(b){i.debug("[TipTapEditor] Editor not ready for focusAndSelectAll:",b)}return!1}function Lp(){try{return m(M)?.getHTML?.()??""}catch(b){return i.error("[TipTapEditor] Error getting HTML:",b),m(M)?.getText?.()??""}}function Pp(){m(M)&&(on=!0,m(M).commands.clearContent(!0),on=!1)}async function _p(b){if(!m(M))return;const E=Hr(b||"");Ts(E,m(M).schema).eq(m(M).state.doc)||m(M).chain().command(({tr:R})=>(R.setMeta("external-update",!0),!0)).setContent(E).run()}function zp(b,E){m(M)&&m(M).view&&m(M).chain().focus().setImage({src:b,alt:E||""}).createParagraphNear().focus().run()}function $p(){if(!m(M))return i.warn("TipTapEditor: getInlineImages called but editor is not initialized"),[];const b=[];return m(M).state.doc.descendants(E=>{if(E.type.name==="image"){const R=E.attrs.src;R&&R.startsWith("data:")&&b.push({src:R,alt:E.attrs.alt||void 0})}return!0}),i.debug("TipTapEditor: Extracted inline images",{imageCount:b.length,imageSources:b.map(E=>({alt:E.alt,srcLength:E.src?.length||0}))}),b}function Bp(){return qn(m(M))}function Hp(b){if(i.debug("TipTapEditor: insertContextMention called",{hasEditor:!!m(M),hasEditorView:!!m(M)?.view,attrs:{itemType:b.itemType,identifier:b.identifier,title:b.title}}),m(M)&&m(M).view){const E=m(M).chain().focus().insertContextMention(b).run();return i.debug("TipTapEditor: insertContextMention result",{result:E}),E}return i.warn("TipTapEditor: insertContextMention failed - no editor"),!1}function Fp(b){if(!m(M)||!m(M).view)return i.warn("TipTapEditor: insertMention called but editor is not initialized"),!1;try{return m(M).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(E){return i.error("TipTapEditor: insertMention failed",E),!1}}function Vp(){if(!m(M))return i.warn("TipTapEditor: getMentions called but editor is not initialized"),[];const b=[];return m(M).state.doc.descendants(E=>(E.type.name==="mention"&&b.push({id:E.attrs.id,label:E.attrs.label,type:E.attrs.type||"file",uri:E.attrs.uri||"",meta:E.attrs.meta||{}}),!0)),i.debug("TipTapEditor: Extracted mentions",{mentionCount:b.length,types:b.map(E=>E.type)}),b}function Wp(){if(!m(M))return i.warn("TipTapEditor: getContextMentions called but editor is not initialized"),[];const b=[];return m(M).state.doc.descendants(E=>{if(E.type.name==="contextMention"){const R=E.attrs;b.push({itemType:R.itemType,provider:R.provider,title:R.title,url:R.url,identifier:R.identifier,contextId:R.contextId,description:R.description,metadata:R.metadata})}return!0}),i.debug("TipTapEditor: Extracted context mentions",{mentionCount:b.length}),b}const Vr={char:"@",pluginKey:new ze("mention"),items:async({query:b})=>{if(i.debug("Mention query:",b),_()?.(b),!g()&&y()){i.debug("No workspace but repoPath available, using async search:",y());const R={workspaceId:void 0,repoPath:y(),currentFile:void 0,currentNote:void 0,recentFiles:[]};try{const Q=await s.search(b,R);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,R);return i.debug("Fallback sync search results:",z.length),z}}if(!g())return i.debug("No workspace and no repoPath - returning empty results"),[];const E={workspaceId:g().id,currentFile:void 0,currentNote:void 0,recentFiles:[]};try{const R=await s.search(b,E);return i.debug("Mention search results:",R.length),R}catch(R){return i.error("Failed to search mentions:",R),[]}},render:()=>zC(ke),command:({editor:b,range:E,props:R})=>{const Q={id:R.id,label:R.label,type:R.type,uri:R.uri,meta:R.meta||{}};b.view&&b.chain().focus().deleteRange(E).insertContent({type:"mention",attrs:Q}).run(),V()?.(R)}};Gu(()=>{let b=!1;return(async()=>{const E=Hr(o()||"");if(b)return;const R=m(Le);if(!R)return;pe(M,new _x({element:R,extensions:[...be()?[sC.configure({references:()=>be()??[]}),oC]:[],aS.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}),kp({openOnClick:!1,linkOnPaste:!0,shouldAutoLink:z=>/^https?:\/\//.test(z)||z.startsWith("intent://"),HTMLAttributes:{class:"text-primary-ink underline"}}),lS.configure({placeholder:c()?({editor:z})=>Dn.getState(z.state)?.parts.length?"":l():l(),emptyEditorClass:"is-editor-empty text-subtle",showOnlyWhenEditable:!1}),NS.configure({inline:!1,allowBase64:!0,HTMLAttributes:{class:"chat-inline-image"}}),zS.configure({workspaceId:g()?.id}),r.configure({HTMLAttributes:{class:"mention-chip"},suggestion:Vr,renderHTML({node:z}){const A=rg(z.attrs,g()?.id,ig);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"},A]},renderText:({node:z})=>{const A=z.attrs||{};try{return vg({type:A.type,id:A.id,label:A.label,meta:A.meta})}catch{return`@${A?.meta?.fullPath||A?.meta?.path||A?.label||A?.id||"item"}`}}}),eC.extend({renderText:({node:z})=>{const A=z.attrs||{},Ee=JSON.stringify({provider:A.provider||"browser",identifier:A.identifier||"",title:A.title||"",url:A.url||"",description:A.description||"",metadata:A.metadata||"",itemType:A.itemType||""});return`@context[${btoa(unescape(encodeURIComponent(Ee)))}]`}}),iC,fC,dM,CM],content:E,editable:m(rt),enableCoreExtensions:{delete:!1},onCreate:({editor:z})=>{pr(z),v()&&requestAnimationFrame(()=>{if(z.isDestroyed)return;z.view.dom?.focus({preventScroll:!0})})},onTransaction:({transaction:z})=>{z.docChanged&&qe&&we&&(En(qe),Ye?.(),Ye=void 0,we.remove(),qe=null,we=null)},onUpdate:({editor:z,transaction:A})=>{if(A.getMeta("external-update")||A.getMeta(Il)||on)return;const Ee=K()?dC(A):null;Ee&&K()?.(Ee);const Je=qn(z);pr(z,{dismissNewContext:A.getMeta("uiEvent")==="paste"}),A.getMeta(Mo)?x()?.(Je,{programmatic:!0}):x()?.(Je),Mp(z,A.getMeta(wp)===!0)},onSelectionUpdate:({editor:z,transaction:A})=>{pr(z,{dismissNewContext:A.getMeta("uiEvent")==="paste"});const{from:Ee,to:Je,empty:q}=z.state.selection;if(q)F()?.(null);else{const De=z.state.doc.textBetween(Ee,Je," ");F()?.(De.trim()||null)}},onFocus:({editor:z})=>{Sn(()=>{pe(fe,!0),pr(z)})},onBlur:()=>{Sn(()=>{pe(fe,!1)}),Ll()},editorProps:{handleDOMEvents:{compositionstart:()=>(Sn(()=>{pe(Dt,!0)}),nt()?.(!0),!1),compositionend:()=>(queueMicrotask(()=>{queueMicrotask(()=>{!m(M)||m(M).isDestroyed||(Sn(()=>{pe(Dt,!1)}),nt()?.(!1),Mt())})}),!1),beforeinput:()=>(O()?.(),!1)},attributes:{class:`tiptap-editor ${p()}`,role:"textbox","aria-multiline":"true","aria-label":a(),autocomplete:"off",spellcheck:"false",autocorrect:"off",autocapitalize:"off"},handlePaste:(z,A)=>{if(pC(A))return!0;const Ee=A.clipboardData?.getData("text/plain");if(Ee){const Je=Ee.split(`
|
|
175
|
-
`);if(Je.length>=5){const{state:De,dispatch:lt}=z,Qe=De.schema.nodes.pasteChip.create({content:Ee,lineCount:Je.length}),Bt=De.tr.replaceSelectionWith(Qe).setMeta("uiEvent","paste");return lt(Bt),!0}const q=A.clipboardData?.getData("text/html");if(q&&oM(q,Ee))return z.dispatch(z.state.tr.insertText(Ee).scrollIntoView().setMeta("uiEvent","paste")),!0;if(/\r|\n/.test(Ee)){const{state:De,dispatch:lt}=z,Qe=Wu(De.schema,Ee);if(Qe.length>0){const Bt=new B(T.from(Qe),1,1);return lt(De.tr.replaceSelection(Bt).scrollIntoView().setMeta("uiEvent","paste")),!0}}}return!1},handleDrop:(z,A)=>hC(A),handleKeyDown:(z,A)=>{if(z.composing||A.isComposing||A.keyCode===229)return!1;if(Sp(z,A)||Tp(A))return!0;if(A.key==="Escape"&&$())return A.preventDefault(),$()(),!0;const Ee=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC"),Je=q=>Tg(A,Xl(q),Ee);if(Je("chat.mention-context")&&Xl("chat.mention-context")!=="@")return A.preventDefault(),m(M)?.chain().focus().insertContent("@").run(),!0;if(Ee&&A.ctrlKey&&!A.metaKey){if(A.key==="a"){A.preventDefault();const{state:q,dispatch:De}=z,Qe=q.selection.$head.start();return De(q.tr.setSelection(j.create(q.doc,Qe))),!0}if(A.key==="e"){A.preventDefault();const{state:q,dispatch:De}=z,Qe=q.selection.$head.end();return De(q.tr.setSelection(j.create(q.doc,Qe))),!0}if(A.key==="k"){A.preventDefault();const{state:q,dispatch:De}=z,lt=q.selection.$head,Qe=lt.pos,Bt=lt.end();return Qe<Bt&&De(q.tr.delete(Qe,Bt)),!0}if(A.key==="p"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify("move","backward","line"),!0}if(A.key==="n"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify("move","forward","line"),!0}if(A.key==="f"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify("move","forward","character"),!0}if(A.key==="b"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify("move","backward","character"),!0}}if(A.metaKey&&!A.ctrlKey&&!A.altKey){if(A.key==="ArrowLeft"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify(A.shiftKey?"extend":"move","backward","lineboundary"),!0}if(A.key==="ArrowRight"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify(A.shiftKey?"extend":"move","forward","lineboundary"),!0}if(A.key==="ArrowUp"){A.preventDefault();const{state:q,dispatch:De}=z,lt=1;if(A.shiftKey){const{from:Qe}=q.selection;De(q.tr.setSelection(j.create(q.doc,lt,Qe)))}else De(q.tr.setSelection(j.create(q.doc,lt)));return!0}if(A.key==="ArrowDown"){A.preventDefault();const{state:q,dispatch:De}=z,lt=q.doc.content.size-1;if(A.shiftKey){const{to:Qe}=q.selection;De(q.tr.setSelection(j.create(q.doc,Qe,lt)))}else De(q.tr.setSelection(j.create(q.doc,lt)));return!0}}if(Je("chat.force-send"))return A.preventDefault(),k()?.(),!0;if(Je("chat.new-line"))return A.preventDefault(),m(M)?.chain().setHardBreak().scrollIntoView().run(),!0;if(A.key==="ArrowUp"&&I()&&!A.shiftKey&&!A.metaKey&&!A.ctrlKey){if(Vr.pluginKey.getState(z.state)?.active)return!1;const{state:De}=z,{from:lt}=De.selection,Qe=lt<=1,Bt=De.doc.textContent.length===0;if(Qe||Bt){const jn=I()();if(jn!==null)return A.preventDefault(),m(M)?.chain().setContent(Hr(jn)).focus("end").run(),x()?.(jn),!0}}if(A.key==="ArrowDown"&&C()&&!A.shiftKey&&!A.metaKey&&!A.ctrlKey){if(Vr.pluginKey.getState(z.state)?.active)return!1;const{state:De}=z,{to:lt}=De.selection,Qe=De.doc.content.size-1,Bt=lt>=Qe,jn=De.doc.textContent.length===0;if(Bt||jn){const Wr=C()();if(Wr!==null)return A.preventDefault(),m(M)?.chain().setContent(Hr(Wr)).focus("end").run(),x()?.(Wr),!0}}return Je("chat.send")?Vr.pluginKey.getState(z.state)?.active?!1:S()?(A.preventDefault(),S()(),!0):!1:!1}}}),!0),R.addEventListener("mouseover",Pl),R.addEventListener("mouseout",_l),R.addEventListener("click",$l),m(M).view.dom.addEventListener("keydown",Bl)})(),()=>{b=!0}});function Pl(b){const E=b.target,R=Wl(E);if(R){const Q=E.getBoundingClientRect();if(!we){we=document.createElement("div"),(ke?.target()??document.body).appendChild(we);const z=R.type||"file",A=R.label||E.textContent||"",Ee={file:"📄",folder:"📁",note:"📝",rule:"⚙️",personality:"🎭",command:"⌘",terminal:"💻",member:"👤"};qe=ni(gp,{target:we,props:{mention:{id:R.id,type:z,label:A,uri:R.uri,meta:R.meta,icon:Ee[z]||"📄"},position:{x:Q.left,y:Q.bottom+5},onClose:()=>{qe&&we&&(En(qe),Ye?.(),Ye=void 0,we.remove(),qe=null,we=null)}}});const Je=we.firstElementChild;Je instanceof HTMLElement&&(Ye=ke?.register(Je,wn)),we.addEventListener("mouseout",zl)}}}function _l(b){const E=b.target;b.relatedTarget?.closest(".mention-hover-preview")||E.hasAttribute("data-mention")&&qe&&we&&(En(qe),Ye?.(),Ye=void 0,we.remove(),qe=null,we=null)}function zl(b){b.relatedTarget?.closest("[data-mention]")||qe&&we&&(En(qe),Ye?.(),Ye=void 0,we.remove(),qe=null,we=null)}async function $l(b){const E=Wl(b.target);if(E&&E.type!=="member"){if(E.intentUrl){b.preventDefault(),b.stopPropagation();const{handleIntentLink:R}=await Vi(async()=>{const{handleIntentLink:Q}=await import("./CajUAX8N.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 R(E.intentUrl);return}if(E.type==="note"&&E.note){if(b.preventDefault(),b.stopPropagation(),E.note.workspaceId){const{handleIntentLink:R}=await Vi(async()=>{const{handleIntentLink:Q}=await import("./CajUAX8N.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 R(kg(E.note.id,E.note.workspaceId))}else{const{navigateToNote:R}=await Vi(async()=>{const{navigateToNote:Q}=await import("./oaGKgX0i.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 R(E.note.id)}return}if(E.type==="file"&&E.filePath){b.preventDefault(),b.stopPropagation();const{navigateToFile:R}=await Vi(async()=>{const{navigateToFile:Q}=await import("./oaGKgX0i.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 R(E.filePath);return}}}function Bl(b){if(!b.metaKey||b.ctrlKey||b.altKey||!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(b.key)||!m(M))return;const{state:E,dispatch:R}=m(M).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}=E.selection;R(E.tr.setSelection(j.create(E.doc,Q,z)).scrollIntoView())}else R(E.tr.setSelection(j.create(E.doc,Q)).scrollIntoView())}else if(b.key==="ArrowDown"){b.preventDefault(),b.stopPropagation();const Q=E.doc.content.size-1;if(b.shiftKey){const{to:z}=E.selection;R(E.tr.setSelection(j.create(E.doc,z,Q)).scrollIntoView())}else R(E.tr.setSelection(j.create(E.doc,Q)).scrollIntoView())}}Yu(()=>{Fr.dispose(),m(M)&&(m(M).view.dom.removeEventListener("keydown",Bl),m(M).destroy()),m(Le)&&(m(Le).removeEventListener("mouseover",Pl),m(Le).removeEventListener("mouseout",_l),m(Le).removeEventListener("click",$l)),we&&we.removeEventListener("mouseout",zl),qe&&we&&(En(qe),Ye?.(),Ye=void 0,we.remove())});let Eo=0;pt(()=>{if(!m(M))return;const b=qn(m(M));if(o()===b)return;if(m(M).view.hasFocus()){Eo+=1;return}const E=m(M).view.hasFocus(),{from:R}=m(M).state.selection,Q=++Eo;(async()=>{const z=Hr(o()||"");!m(M)||Q!==Eo||qn(m(M))===b&&m(M).chain().command(({tr:A})=>(A.setMeta("external-update",!0),!0)).setContent(z).command(({tr:A,state:Ee})=>{if(E)try{const Je=Ee.doc.content.size,q=Math.min(R,Je);A.setSelection(j.create(Ee.doc,q,q))}catch{}return!0}).run()})()}),pt(()=>{m(M)&&m(M).setEditable(m(rt),!1)}),pt(()=>{!m(M)||m(M).isDestroyed||m(M).view.dispatch(m(M).state.tr.setMeta(ti,ve()))}),pt(()=>{const b=m(M)?.view.dom;b&&(b.setAttribute("aria-haspopup","listbox"),m(_e)&&m(Pe)?(b.setAttribute("aria-controls",$t),b.setAttribute("aria-activedescendant",m(Pe))):(b.removeAttribute("aria-controls"),b.removeAttribute("aria-activedescendant")))});var jp={flushScreenEvidence:Mt,showAutocompleteSuggestion:Ep,insertAtSymbol:Ap,insertText:Np,insertPlainText:Op,focus:Dp,focusEnd:Ip,focusAndSelectAll:Rp,getHTML:Lp,clear:Pp,setContent:_p,insertImage:zp,getInlineImages:$p,getTextContent:Bp,insertContextMention:Hp,insertMention:Fp,getMentions:Vp,getContextMentions:Wp,get value(){return o()},set value(b=""){o(b),P()},get ariaLabel(){return a()},set ariaLabel(b=re.chat_richInput_editor_ariaLabel()){a(b),P()},get placeholder(){return l()},set placeholder(b=re.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 p()},set editorClassName(b=""){p(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 S()},set onSubmit(b){S(b),P()},get onForceSubmit(){return k()},set onForceSubmit(b){k(b),P()},get onEscape(){return $()},set onEscape(b){$(b),P()},get onHistoryPrev(){return I()},set onHistoryPrev(b){I(b),P()},get onHistoryNext(){return C()},set onHistoryNext(b){C(b),P()},get onMentionStart(){return _()},set onMentionStart(b){_(b),P()},get onMentionSelect(){return V()},set onMentionSelect(b){V(b),P()},get onSelectionChange(){return F()},set onSelectionChange(b){F(b),P()},get contextItems(){return ge()},set contextItems(b=[]){ge(b),P()},get trailingHint(){return ve()},set trailingHint(b=null){ve(b),P()},get autocompleteContext(){return w()},set autocompleteContext(b=null){w(b),P()},get skills(){return N()},set skills(b=[]){N(b),P()},get skillsLoading(){return W()},set skillsLoading(b=!1){W(b),P()},get skillsError(){return Y()},set skillsError(b=null){Y(b),P()},get onSkillsRetry(){return Ae()},set onSkillsRetry(b){Ae(b),P()},get slashEmptyLabel(){return oe()},set slashEmptyLabel(b){oe(b),P()},get slashNotice(){return Ne()},set slashNotice(b){Ne(b),P()},get unavailableSkillTitle(){return $e()},set unavailableSkillTitle(b){$e(b),P()},get screenReferences(){return be()},set screenReferences(b){be(b),P()},get screenInsertions(){return je()},set screenInsertions(b=[]){je(b),P()},get screenInterim(){return Ke()},set screenInterim(b=[]){Ke(b),P()},get screenSpeechActive(){return Z()},set screenSpeechActive(b=!1){Z(b),P()},get onScreenInsertionApplied(){return Ue()},set onScreenInsertionApplied(b){Ue(b),P()},get onCompositionChange(){return nt()},set onCompositionChange(b){nt(b),P()},get onUserTextInput(){return O()},set onUserTextInput(b){O(b),P()},get onScreenReferencesEdited(){return K()},set onScreenReferencesEdited(b){K(b),P()},get minHeight(){return ye()},set minHeight(b=80){ye(b),P()},get maxHeight(){return Be()},set maxHeight(b=300){Be(b),P()},$set:Kt,$on:(b,E)=>Ut(e,b,E)},To=_M(),Hl=me(To),Kp=()=>m(_e),Up=b=>!b&&Hi();Do(Hl,()=>Og,(b,E)=>{E(b,{get open(){return Kp()},set open(R){Up(R)},children:(R,Q)=>{var z=Tr(),A=Rt(z);{let Ee=H(()=>ke?.target());Do(A,()=>pm,(Je,q)=>{q(Je,{get to(){return m(Ee)},children:(De,lt)=>{var Qe=Tr(),Bt=Rt(Qe);{let jn=H(()=>m(Le)??null);Do(Bt,()=>Ng,(Wr,qp)=>{qp(Wr,{get customAnchor(){return m(jn)},side:"top",align:"start",sideOffset:4,trapFocus:!1,onOpenAutoFocus:Rl,onCloseAutoFocus:Rl,class:"z-(--layer-popover) w-72 max-w-full","data-testid":"slash-skill-menu",get ref(){return m(Xe)},set ref(No){pe(Xe,No,!0)},children:(No,$M)=>{Dr(xp(No,{get listboxId(){return $t},get items(){return m(at)},get loading(){return W()},get error(){return Y()},get emptyLabel(){return oe()},get notice(){return Ne()},get onRetry(){return Ae()},onSelect:Cp,onDismiss:Hi,onActiveOptionChange:Oo=>pe(Pe,Oo,!0)}),Oo=>pe(vt,Oo,!0),()=>m(vt))},$$slots:{default:!0}})})}U(De,Qe)},$$slots:{default:!0}})})}U(R,z)},$$slots:{default:!0}})});var Ao=ie(Hl,2);let Fl;return Dr(Ao,b=>pe(Le,b),()=>m(Le)),le(To),ne(()=>{Fl=yn(Ao,1,`tiptap-container ${h()??""}`,"svelte-bv9i3d",Fl,{"placeholder-suppressed":m(Ot)}),yi(Ao,`--tt-min-height:${ye()}px;--tt-max-height:${Be()}px`)}),U(n,To),Jt(jp)}export{JC as A,cr as B,Qx as C,fr as D,_x as E,T as F,dp as G,pl as H,Bi as I,ml as J,hC as K,vE as L,hr as M,cp as N,Wf as O,Te as P,Me as Q,NS as R,se as S,Ew as T,ES as U,aS as V,lS as W,$r as X,t1 as a,eC as b,Va as c,ut as d,ue as e,We as f,cd as g,ot as h,G as i,Bx as j,Co as k,zS as l,ze as m,Cy as n,B as o,Dl as p,Tw as q,j as r,zM as s,Fd as t,Ce as u,zC as v,xE as w,bE as x,Bv as y,J as z};
|
|
175
|
+
`);if(Je.length>=5){const{state:De,dispatch:lt}=z,Qe=De.schema.nodes.pasteChip.create({content:Ee,lineCount:Je.length}),Bt=De.tr.replaceSelectionWith(Qe).setMeta("uiEvent","paste");return lt(Bt),!0}const q=A.clipboardData?.getData("text/html");if(q&&oM(q,Ee))return z.dispatch(z.state.tr.insertText(Ee).scrollIntoView().setMeta("uiEvent","paste")),!0;if(/\r|\n/.test(Ee)){const{state:De,dispatch:lt}=z,Qe=Wu(De.schema,Ee);if(Qe.length>0){const Bt=new B(T.from(Qe),1,1);return lt(De.tr.replaceSelection(Bt).scrollIntoView().setMeta("uiEvent","paste")),!0}}}return!1},handleDrop:(z,A)=>hC(A),handleKeyDown:(z,A)=>{if(z.composing||A.isComposing||A.keyCode===229)return!1;if(Sp(z,A)||Tp(A))return!0;if(A.key==="Escape"&&$())return A.preventDefault(),$()(),!0;const Ee=typeof navigator<"u"&&navigator.platform.toUpperCase().includes("MAC"),Je=q=>Tg(A,Xl(q),Ee);if(Je("chat.mention-context")&&Xl("chat.mention-context")!=="@")return A.preventDefault(),m(M)?.chain().focus().insertContent("@").run(),!0;if(Ee&&A.ctrlKey&&!A.metaKey){if(A.key==="a"){A.preventDefault();const{state:q,dispatch:De}=z,Qe=q.selection.$head.start();return De(q.tr.setSelection(j.create(q.doc,Qe))),!0}if(A.key==="e"){A.preventDefault();const{state:q,dispatch:De}=z,Qe=q.selection.$head.end();return De(q.tr.setSelection(j.create(q.doc,Qe))),!0}if(A.key==="k"){A.preventDefault();const{state:q,dispatch:De}=z,lt=q.selection.$head,Qe=lt.pos,Bt=lt.end();return Qe<Bt&&De(q.tr.delete(Qe,Bt)),!0}if(A.key==="p"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify("move","backward","line"),!0}if(A.key==="n"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify("move","forward","line"),!0}if(A.key==="f"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify("move","forward","character"),!0}if(A.key==="b"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify("move","backward","character"),!0}}if(A.metaKey&&!A.ctrlKey&&!A.altKey){if(A.key==="ArrowLeft"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify(A.shiftKey?"extend":"move","backward","lineboundary"),!0}if(A.key==="ArrowRight"){A.preventDefault();const q=window.getSelection();return q&&q.rangeCount>0&&q.modify(A.shiftKey?"extend":"move","forward","lineboundary"),!0}if(A.key==="ArrowUp"){A.preventDefault();const{state:q,dispatch:De}=z,lt=1;if(A.shiftKey){const{from:Qe}=q.selection;De(q.tr.setSelection(j.create(q.doc,lt,Qe)))}else De(q.tr.setSelection(j.create(q.doc,lt)));return!0}if(A.key==="ArrowDown"){A.preventDefault();const{state:q,dispatch:De}=z,lt=q.doc.content.size-1;if(A.shiftKey){const{to:Qe}=q.selection;De(q.tr.setSelection(j.create(q.doc,Qe,lt)))}else De(q.tr.setSelection(j.create(q.doc,lt)));return!0}}if(Je("chat.force-send"))return A.preventDefault(),k()?.(),!0;if(Je("chat.new-line"))return A.preventDefault(),m(M)?.chain().setHardBreak().scrollIntoView().run(),!0;if(A.key==="ArrowUp"&&I()&&!A.shiftKey&&!A.metaKey&&!A.ctrlKey){if(Vr.pluginKey.getState(z.state)?.active)return!1;const{state:De}=z,{from:lt}=De.selection,Qe=lt<=1,Bt=De.doc.textContent.length===0;if(Qe||Bt){const jn=I()();if(jn!==null)return A.preventDefault(),m(M)?.chain().setContent(Hr(jn)).focus("end").run(),x()?.(jn),!0}}if(A.key==="ArrowDown"&&C()&&!A.shiftKey&&!A.metaKey&&!A.ctrlKey){if(Vr.pluginKey.getState(z.state)?.active)return!1;const{state:De}=z,{to:lt}=De.selection,Qe=De.doc.content.size-1,Bt=lt>=Qe,jn=De.doc.textContent.length===0;if(Bt||jn){const Wr=C()();if(Wr!==null)return A.preventDefault(),m(M)?.chain().setContent(Hr(Wr)).focus("end").run(),x()?.(Wr),!0}}return Je("chat.send")?Vr.pluginKey.getState(z.state)?.active?!1:S()?(A.preventDefault(),S()(),!0):!1:!1}}}),!0),R.addEventListener("mouseover",Pl),R.addEventListener("mouseout",_l),R.addEventListener("click",$l),m(M).view.dom.addEventListener("keydown",Bl)})(),()=>{b=!0}});function Pl(b){const E=b.target,R=Wl(E);if(R){const Q=E.getBoundingClientRect();if(!we){we=document.createElement("div"),(ke?.target()??document.body).appendChild(we);const z=R.type||"file",A=R.label||E.textContent||"",Ee={file:"📄",folder:"📁",note:"📝",rule:"⚙️",personality:"🎭",command:"⌘",terminal:"💻",member:"👤"};qe=ni(gp,{target:we,props:{mention:{id:R.id,type:z,label:A,uri:R.uri,meta:R.meta,icon:Ee[z]||"📄"},position:{x:Q.left,y:Q.bottom+5},onClose:()=>{qe&&we&&(En(qe),Ye?.(),Ye=void 0,we.remove(),qe=null,we=null)}}});const Je=we.firstElementChild;Je instanceof HTMLElement&&(Ye=ke?.register(Je,wn)),we.addEventListener("mouseout",zl)}}}function _l(b){const E=b.target;b.relatedTarget?.closest(".mention-hover-preview")||E.hasAttribute("data-mention")&&qe&&we&&(En(qe),Ye?.(),Ye=void 0,we.remove(),qe=null,we=null)}function zl(b){b.relatedTarget?.closest("[data-mention]")||qe&&we&&(En(qe),Ye?.(),Ye=void 0,we.remove(),qe=null,we=null)}async function $l(b){const E=Wl(b.target);if(E&&E.type!=="member"){if(E.intentUrl){b.preventDefault(),b.stopPropagation();const{handleIntentLink:R}=await Vi(async()=>{const{handleIntentLink:Q}=await import("./B62l45Uf.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 R(E.intentUrl);return}if(E.type==="note"&&E.note){if(b.preventDefault(),b.stopPropagation(),E.note.workspaceId){const{handleIntentLink:R}=await Vi(async()=>{const{handleIntentLink:Q}=await import("./B62l45Uf.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 R(kg(E.note.id,E.note.workspaceId))}else{const{navigateToNote:R}=await Vi(async()=>{const{navigateToNote:Q}=await import("./Fg5V-_KH.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 R(E.note.id)}return}if(E.type==="file"&&E.filePath){b.preventDefault(),b.stopPropagation();const{navigateToFile:R}=await Vi(async()=>{const{navigateToFile:Q}=await import("./Fg5V-_KH.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 R(E.filePath);return}}}function Bl(b){if(!b.metaKey||b.ctrlKey||b.altKey||!["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"].includes(b.key)||!m(M))return;const{state:E,dispatch:R}=m(M).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}=E.selection;R(E.tr.setSelection(j.create(E.doc,Q,z)).scrollIntoView())}else R(E.tr.setSelection(j.create(E.doc,Q)).scrollIntoView())}else if(b.key==="ArrowDown"){b.preventDefault(),b.stopPropagation();const Q=E.doc.content.size-1;if(b.shiftKey){const{to:z}=E.selection;R(E.tr.setSelection(j.create(E.doc,z,Q)).scrollIntoView())}else R(E.tr.setSelection(j.create(E.doc,Q)).scrollIntoView())}}Yu(()=>{Fr.dispose(),m(M)&&(m(M).view.dom.removeEventListener("keydown",Bl),m(M).destroy()),m(Le)&&(m(Le).removeEventListener("mouseover",Pl),m(Le).removeEventListener("mouseout",_l),m(Le).removeEventListener("click",$l)),we&&we.removeEventListener("mouseout",zl),qe&&we&&(En(qe),Ye?.(),Ye=void 0,we.remove())});let Eo=0;pt(()=>{if(!m(M))return;const b=qn(m(M));if(o()===b)return;if(m(M).view.hasFocus()){Eo+=1;return}const E=m(M).view.hasFocus(),{from:R}=m(M).state.selection,Q=++Eo;(async()=>{const z=Hr(o()||"");!m(M)||Q!==Eo||qn(m(M))===b&&m(M).chain().command(({tr:A})=>(A.setMeta("external-update",!0),!0)).setContent(z).command(({tr:A,state:Ee})=>{if(E)try{const Je=Ee.doc.content.size,q=Math.min(R,Je);A.setSelection(j.create(Ee.doc,q,q))}catch{}return!0}).run()})()}),pt(()=>{m(M)&&m(M).setEditable(m(rt),!1)}),pt(()=>{!m(M)||m(M).isDestroyed||m(M).view.dispatch(m(M).state.tr.setMeta(ti,ve()))}),pt(()=>{const b=m(M)?.view.dom;b&&(b.setAttribute("aria-haspopup","listbox"),m(_e)&&m(Pe)?(b.setAttribute("aria-controls",$t),b.setAttribute("aria-activedescendant",m(Pe))):(b.removeAttribute("aria-controls"),b.removeAttribute("aria-activedescendant")))});var jp={flushScreenEvidence:Mt,showAutocompleteSuggestion:Ep,insertAtSymbol:Ap,insertText:Np,insertPlainText:Op,focus:Dp,focusEnd:Ip,focusAndSelectAll:Rp,getHTML:Lp,clear:Pp,setContent:_p,insertImage:zp,getInlineImages:$p,getTextContent:Bp,insertContextMention:Hp,insertMention:Fp,getMentions:Vp,getContextMentions:Wp,get value(){return o()},set value(b=""){o(b),P()},get ariaLabel(){return a()},set ariaLabel(b=re.chat_richInput_editor_ariaLabel()){a(b),P()},get placeholder(){return l()},set placeholder(b=re.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 p()},set editorClassName(b=""){p(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 S()},set onSubmit(b){S(b),P()},get onForceSubmit(){return k()},set onForceSubmit(b){k(b),P()},get onEscape(){return $()},set onEscape(b){$(b),P()},get onHistoryPrev(){return I()},set onHistoryPrev(b){I(b),P()},get onHistoryNext(){return C()},set onHistoryNext(b){C(b),P()},get onMentionStart(){return _()},set onMentionStart(b){_(b),P()},get onMentionSelect(){return V()},set onMentionSelect(b){V(b),P()},get onSelectionChange(){return F()},set onSelectionChange(b){F(b),P()},get contextItems(){return ge()},set contextItems(b=[]){ge(b),P()},get trailingHint(){return ve()},set trailingHint(b=null){ve(b),P()},get autocompleteContext(){return w()},set autocompleteContext(b=null){w(b),P()},get skills(){return N()},set skills(b=[]){N(b),P()},get skillsLoading(){return W()},set skillsLoading(b=!1){W(b),P()},get skillsError(){return Y()},set skillsError(b=null){Y(b),P()},get onSkillsRetry(){return Ae()},set onSkillsRetry(b){Ae(b),P()},get slashEmptyLabel(){return oe()},set slashEmptyLabel(b){oe(b),P()},get slashNotice(){return Ne()},set slashNotice(b){Ne(b),P()},get unavailableSkillTitle(){return $e()},set unavailableSkillTitle(b){$e(b),P()},get screenReferences(){return be()},set screenReferences(b){be(b),P()},get screenInsertions(){return je()},set screenInsertions(b=[]){je(b),P()},get screenInterim(){return Ke()},set screenInterim(b=[]){Ke(b),P()},get screenSpeechActive(){return Z()},set screenSpeechActive(b=!1){Z(b),P()},get onScreenInsertionApplied(){return Ue()},set onScreenInsertionApplied(b){Ue(b),P()},get onCompositionChange(){return nt()},set onCompositionChange(b){nt(b),P()},get onUserTextInput(){return O()},set onUserTextInput(b){O(b),P()},get onScreenReferencesEdited(){return K()},set onScreenReferencesEdited(b){K(b),P()},get minHeight(){return ye()},set minHeight(b=80){ye(b),P()},get maxHeight(){return Be()},set maxHeight(b=300){Be(b),P()},$set:Kt,$on:(b,E)=>Ut(e,b,E)},To=_M(),Hl=me(To),Kp=()=>m(_e),Up=b=>!b&&Hi();Do(Hl,()=>Og,(b,E)=>{E(b,{get open(){return Kp()},set open(R){Up(R)},children:(R,Q)=>{var z=Tr(),A=Rt(z);{let Ee=H(()=>ke?.target());Do(A,()=>pm,(Je,q)=>{q(Je,{get to(){return m(Ee)},children:(De,lt)=>{var Qe=Tr(),Bt=Rt(Qe);{let jn=H(()=>m(Le)??null);Do(Bt,()=>Ng,(Wr,qp)=>{qp(Wr,{get customAnchor(){return m(jn)},side:"top",align:"start",sideOffset:4,trapFocus:!1,onOpenAutoFocus:Rl,onCloseAutoFocus:Rl,class:"z-(--layer-popover) w-72 max-w-full","data-testid":"slash-skill-menu",get ref(){return m(Xe)},set ref(No){pe(Xe,No,!0)},children:(No,$M)=>{Dr(xp(No,{get listboxId(){return $t},get items(){return m(at)},get loading(){return W()},get error(){return Y()},get emptyLabel(){return oe()},get notice(){return Ne()},get onRetry(){return Ae()},onSelect:Cp,onDismiss:Hi,onActiveOptionChange:Oo=>pe(Pe,Oo,!0)}),Oo=>pe(vt,Oo,!0),()=>m(vt))},$$slots:{default:!0}})})}U(De,Qe)},$$slots:{default:!0}})})}U(R,z)},$$slots:{default:!0}})});var Ao=ie(Hl,2);let Fl;return Dr(Ao,b=>pe(Le,b),()=>m(Le)),le(To),ne(()=>{Fl=yn(Ao,1,`tiptap-container ${h()??""}`,"svelte-bv9i3d",Fl,{"placeholder-suppressed":m(Ot)}),yi(Ao,`--tt-min-height:${ye()}px;--tt-max-height:${Be()}px`)}),U(n,To),Jt(jp)}export{JC as A,cr as B,Qx as C,fr as D,_x as E,T as F,dp as G,pl as H,Bi as I,ml as J,hC as K,vE as L,hr as M,cp as N,Wf as O,Te as P,Me as Q,NS as R,se as S,Ew as T,ES as U,aS as V,lS as W,$r as X,t1 as a,eC as b,Va as c,ut as d,ue as e,We as f,cd as g,ot as h,G as i,Bx as j,Co as k,zS as l,ze as m,Cy as n,B as o,Dl as p,Tw as q,j as r,zM as s,Fd as t,Ce as u,zC as v,xE as w,bE as x,Bv as y,J as z};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/
|
|
2
|
-
import{_ as ue,t as re,bo as v,bw as ne,b as se,bm as k}from"./ClpAEjbe.js";import{Jq as pe}from"./CpP1PKzF.js";import{bs as ie,a7 as le,ay as X,aD as n,W as f,bn as oe,c9 as A,aA as h,a5 as U,bA as G,b_ as S,aB as P,bl as q,bO as K,bS as T,ca as de,bH as fe,bV as _e,aC as H}from"./CJxGDkBm.js";import{i as L}from"./wmcYjLAa.js";import{c as ge,e as me,f as te,g as ce,s as M}from"./CnGVh7I3.js";import{m as ve}from"./By588DV1.js";import{e as he}from"./BwASeArv.js";import{t as Ce}from"./DAsc1V4f.js";import{F as we}from"./CtJxHvGv.js";import{M as ke}from"./CYwwgxGp.js";import{b as be}from"./D9Ykl3eH.js";import{aO as xe}from"./Bxb8LI6C.js";import{n as z,e as $,s as J}from"./oXpJ1LFx.js";import{f as Se}from"./BVi5KkOP.js";import"./CPDV_dyu.js";function ut(r,t,c){if(r.metaKey||r.ctrlKey||!(r.currentTarget instanceof Element)||!r.currentTarget.closest("[data-assistant-panels]"))return!1;const e=pe.state.agentSessions.byAgentId[c]?.workspaceId??t,i=r.currentTarget.closest("[data-assistant-layout-id]")?.dataset.assistantLayoutId;return ue(async()=>{const{showAssistantContent:o}=await import("./CKK0Gz-a.js");return{showAssistantContent:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]),import.meta.url).then(({showAssistantContent:o})=>o(`intent://local/${e}/agent/${c}`,{layoutId:i})),!0}var Te=P('<span class="text-subtle animate-pulse"> </span>'),ye=P('<span class="text-green-600 dark:text-green-400 flex items-center gap-0.5"><span class="opacity-70">+</span> <span> </span></span>'),Ee=P('<span class="text-red-600 dark:text-red-400 flex items-center gap-0.5"><span class="opacity-70">-</span> <span> </span></span>'),Ie=P('<span class="text-subtle"> </span>'),Me=P("<!> <!> <!>",1),Le=P("<div><!></div>");function Ae(r,t){if(new.target)return re({component:Ae,...r});ie(t,!0);let c=v(t,"additions",7,0),e=v(t,"deletions",7,0),i=v(t,"showZero",7,!1),o=v(t,"size",7,"sm"),g=v(t,"inline",7,!0),u=v(t,"loading",7,!1),d=v(t,"class",7,""),y=A(()=>i()||c()>0||e()>0||u()),R=A(()=>{switch(o()){case"xs":return"text-ui gap-1";case"sm":return"text-xs gap-1.5";case"md":return"text-sm gap-2";case"lg":return"text-base gap-2.5";default:return"text-xs gap-1.5"}});function B(a){return ve(a,{notation:"compact"})}var F={get additions(){return c()},set additions(a=0){c(a),h()},get deletions(){return e()},set deletions(a=0){e(a),h()},get showZero(){return i()},set showZero(a=!1){i(a),h()},get size(){return o()},set size(a="sm"){o(a),h()},get inline(){return g()},set inline(a=!0){g(a),h()},get loading(){return u()},set loading(a=!1){u(a),h()},get class(){return d()},set class(a=""){d(a),h()},$set:ne,$on:(a,w)=>se(t,a,w)},C=le(),D=X(C);{var p=a=>{var w=Le(),W=U(w);{var E=_=>{var m=Te(),N=q(m,!0);S(O=>K(N,O),[()=>k.shared_lineChangeStats_calculating_label()]),f(_,m)},V=_=>{var m=Me(),N=X(m);{var O=s=>{var l=ye(),b=T(U(l),2),I=q(b,!0);G(l),S(Y=>K(I,Y),[()=>B(c())]),f(s,l)};L(N,s=>{(c()>0||i())&&s(O)})}var Z=T(N,2);{var j=s=>{var l=Ee(),b=T(U(l),2),I=q(b,!0);G(l),S(Y=>K(I,Y),[()=>B(e())]),f(s,l)};L(Z,s=>{(e()>0||i())&&s(j)})}var x=T(Z,2);{var Q=s=>{var l=Ie(),b=q(l,!0);S(I=>K(b,I),[()=>k.shared_lineChangeStats_noChanges_label()]),f(s,l)};L(x,s=>{!c()&&!e()&&!i()&&s(Q)})}f(_,m)};L(W,_=>{u()?_(E):_(V,-1)})}G(w),S(_=>te(w,1,_),[()=>ge(me("whitespace-nowrap",g()?"inline-flex":"flex","items-center font-mono",n(R),d()))]),f(a,w)};L(D,a=>{n(y)&&a(p)})}return f(r,C),oe(F)}const Ne=new Map([["STRONG","strong"],["B","strong"],["EM","em"],["I","em"],["CODE","code"]]),Pe=new Set(["AUDIO","BUTTON","CANVAS","DETAILS","EMBED","HR","IFRAME","IMG","INPUT","OBJECT","PICTURE","PRE","SELECT","SVG","TABLE","TEXTAREA","VIDEO"]),Re=new Set(["ARTICLE","BLOCKQUOTE","DD","DIV","DT","FOOTER","H1","H2","H3","H4","H5","H6","HEADER","LI","P","SECTION"]);function De(r){return typeof Intl.Segmenter=="function"?Array.from(new Intl.Segmenter(void 0,{granularity:"grapheme"}).segment(r),({segment:t})=>t):Array.from(r)}function ee(r,t,c,e){for(const i of De(t.replace(/\s+/gu," "))){const o=i===" ";if(!(o&&(!e.hasText||e.lastWasSpace))){if(e.visibleLength>=c){if(o)return;e.truncated||r.append(document.createTextNode("…")),e.truncated=!0;return}r.append(document.createTextNode(i)),e.visibleLength+=1,e.hasText=!0,e.lastWasSpace=o}}}function ae(r,t,c,e){if(e.truncated)return;if(r.nodeType===Node.TEXT_NODE){ee(t,r.textContent??"",c,e);return}if(!(r instanceof HTMLElement)||Pe.has(r.tagName))return;if(r.tagName==="BR"){ee(t," ",c,e);return}const i=Ne.get(r.tagName);if(i){const o=document.createElement(i);t.append(o);for(const g of r.childNodes)ae(g,o,c,e);o.textContent||o.remove();return}Re.has(r.tagName)&&e.hasText&&ee(t," ",c,e);for(const o of r.childNodes)ae(o,t,c,e)}async function Oe(r,t=80){const c=await xe(r,{allowEmpty:!0,skipIfHTML:!1,preserveAnchors:!1,processPrimitives:!1,taskBlockRenderMode:"content"}),e=document.createElement("template");e.innerHTML=c;const i=document.createElement("span"),o={visibleLength:0,hasText:!1,lastWasSpace:!1,truncated:!1},g=Math.max(0,Math.floor(t));for(const u of e.content.childNodes)ae(u,i,g,o);return i.innerHTML.trim()}async function ze(r){const t=await Oe(r,Number.MAX_SAFE_INTEGER),c=document.createElement("span");return c.innerHTML=t,(c.textContent??"").replace(/<\/?[A-Za-z][^>]*>/gu,"").replace(/\s+/gu," ").trim()}var He=P('<span data-testid="agent-preview-tool-icon"><!></span>'),Be=P('<span><!> <span class="min-w-0 flex-1 truncate text-inherit opacity-[inherit]" data-testid="agent-preview-tool-text"> </span></span>');function Fe(r,t){if(new.target)return re({component:Fe,...r});ie(t,!0);const c=new Set(["figma","sentry","playwright","github","linear","slack","context7"]);let e=v(t,"toolUse",7),i=v(t,"animate",7,!1),o=v(t,"iconSize",7,12),g=v(t,"showIcon",7,!0),u=v(t,"class",7,"");const d=A(()=>be(e().name,e().input||{})),y=A(()=>[n(d).verb,n(d).subject,n(d).path].filter(Boolean).join(" ").trim()||n(d).verb||k.chat_previewToolLabel_tool_fallback());let R=_e("");de(()=>{const p=n(y);let a=!1;return ze(p).then(w=>{a||fe(R,w,!0)}),()=>{a=!0}});var B={get toolUse(){return e()},set toolUse(p){e(p),h()},get animate(){return i()},set animate(p=!1){i(p),h()},get iconSize(){return o()},set iconSize(p=12){o(p),h()},get showIcon(){return g()},set showIcon(p=!0){g(p),h()},get class(){return u()},set class(p=""){u(p),h()},$set:ne,$on:(p,a)=>se(t,p,a)},F=le(),C=X(F);{var D=p=>{var a=Be(),w=U(a);{var W=_=>{var m=He(),N=U(m);{var O=x=>{ke(x,{get iconName(){return n(d).mcpSource},get label(){return n(d).mcpSource},get size(){return o()}})},Z=A(()=>n(d).mcpSource&&c.has(n(d).mcpSource)),j=x=>{we(x,{get icon(){return n(d).icon},class:"h-full! w-full! text-inherit opacity-[inherit]"})};L(N,x=>{n(Z)?x(O):x(j,-1)})}G(m),S(()=>{te(m,1,`agent-preview-tool-icon inline-flex shrink-0 items-center justify-center text-inherit opacity-[inherit] ${i()?"animate-pulse":""}`,"svelte-115ywqs"),ce(m,`width: ${o()??""}px; height: ${o()??""}px;`)}),f(_,m)};L(w,_=>{g()&&_(W)})}var E=T(w,2),V=q(E,!0);he(E,(_,m)=>Ce?.(_,m),()=>n(R)),G(a),S(()=>{te(a,1,`type-body inline-flex w-full min-w-0 items-center font-normal ${g()?"gap-1.5":""} ${u()??""}`,"svelte-115ywqs"),K(V,n(R))}),f(p,a)};L(C,p=>{n(d).hidden||p(D)})}return f(r,F),oe(B)}var Ve=H('<circle cx="12" cy="12" r="10" stroke-width="2" fill="none"></circle>'),Ze=H('<path d="M7 12.5L10.5 16L17 9" stroke="white" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" fill="none"></path>'),qe=H('<path d="M5 19L19 5" stroke-width="2.5" stroke-linecap="round"></path>'),Ue=H('<path d="M13.1372 17.7135C13.1372 18.1682 12.9566 18.6042 12.6351 18.9257C12.3136 19.2472 11.8776 19.4278 11.4229 19.4278C10.9683 19.4278 10.5322 19.2472 10.2107 18.9257C9.88925 18.6042 9.70864 18.1682 9.70864 17.7135C9.70864 17.2589 9.88925 16.8228 10.2107 16.5014C10.5322 16.1799 10.9683 15.9993 11.4229 15.9993C11.8776 15.9993 12.3136 16.1799 12.6351 16.5014C12.9566 16.8228 13.1372 17.2589 13.1372 17.7135ZM10.2109 7.07297C10.3957 6.88872 10.6201 6.7491 10.8671 6.66473C11.114 6.58037 11.377 6.55349 11.6359 6.58615C11.8948 6.61881 12.1428 6.71015 12.361 6.8532C12.5793 6.99625 12.762 7.18724 12.8953 7.4116C13.0285 7.63597 13.1088 7.8878 13.1299 8.14789C13.1511 8.40799 13.1126 8.66948 13.0174 8.91244C12.9222 9.1554 12.7728 9.37342 12.5805 9.54988C12.3883 9.72634 12.1583 9.85659 11.9081 9.93068C11.1212 10.1604 10.1372 10.901 10.1372 12.1421V12.5707C10.1372 12.9117 10.2727 13.2387 10.5138 13.4798C10.7549 13.7209 11.0819 13.8564 11.4229 13.8564C11.7639 13.8564 12.0909 13.7209 12.3321 13.4798C12.5732 13.2387 12.7086 12.9117 12.7086 12.5707V12.3735C13.3281 12.1785 13.8952 11.8451 14.3669 11.3988C14.8387 10.9524 15.2029 10.4046 15.4319 9.79683C15.6609 9.18906 15.7487 8.53719 15.6888 7.89048C15.6289 7.24377 15.4228 6.61913 15.0861 6.06376C14.7494 5.50838 14.2908 5.03681 13.7451 4.68466C13.1994 4.33251 12.5808 4.10899 11.936 4.03101C11.2912 3.95302 10.6371 4.0226 10.0232 4.23449C9.40925 4.44638 8.8515 4.79503 8.39207 5.25411C8.26933 5.37277 8.17145 5.51469 8.10414 5.67158C8.03683 5.82848 8.00145 5.9972 8.00004 6.16792C7.99864 6.33864 8.03125 6.50792 8.09597 6.6659C8.16069 6.82388 8.25623 6.96739 8.37701 7.08805C8.49778 7.20871 8.64138 7.30411 8.79942 7.36868C8.95746 7.43326 9.12677 7.46571 9.29749 7.46414C9.4682 7.46258 9.6369 7.42703 9.79373 7.35958C9.95056 7.29212 10.0924 7.19411 10.2109 7.07125V7.07297Z" fill="white" class="origin-center"></path>'),Ge=H('<path d="M12 5.5V13.5" stroke="white" stroke-width="3" stroke-linecap="round"></path><circle cx="12" cy="17.5" r="1.6" fill="white" class="origin-center"></circle>',1),We=H('<path d="M11.6668 13.649C12.1044 13.649 12.5241 13.4751 12.8336 13.1656C13.1431 12.8562 13.3169 12.4365 13.3169 11.9988C13.3169 11.5611 13.1431 11.1414 12.8336 10.832C12.5241 10.5225 12.1044 10.3486 11.6668 10.3486C11.2291 10.3486 10.8094 10.5225 10.4999 10.832C10.1905 11.1414 10.0166 11.5611 10.0166 11.9988C10.0166 12.4365 10.1905 12.8562 10.4999 13.1656C10.8094 13.4751 11.2291 13.649 11.6668 13.649Z" fill="white" class="origin-center"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M4.38506 12.3064C4.31566 12.1046 4.31566 11.8855 4.38506 11.6837C4.90912 10.1693 5.89241 8.85596 7.198 7.92665C8.50359 6.99734 10.0665 6.4983 11.669 6.49902C13.2716 6.49975 14.834 7.00021 16.1388 7.9307C17.4435 8.8612 18.4256 10.1754 18.9483 11.6903C19.0177 11.8921 19.0177 12.1112 18.9483 12.313C18.4245 13.8278 17.4412 15.1416 16.1355 16.0712C14.8298 17.0008 13.2666 17.5 11.6638 17.4993C10.0609 17.4986 8.49824 16.9979 7.19336 16.0671C5.88848 15.1363 4.90641 13.8217 4.38396 12.3064H4.38506ZM14.9681 11.9984C14.9681 12.8737 14.6204 13.7131 14.0015 14.3321C13.3825 14.951 12.5431 15.2987 11.6678 15.2987C10.7925 15.2987 9.95304 14.951 9.33411 14.3321C8.71517 13.7131 8.36746 12.8737 8.36746 11.9984C8.36746 11.1231 8.71517 10.2836 9.33411 9.66468C9.95304 9.04575 10.7925 8.69803 11.6678 8.69803C12.5431 8.69803 13.3825 9.04575 14.0015 9.66468C14.6204 10.2836 14.9681 11.1231 14.9681 11.9984Z" fill="white" class="origin-center"></path>',1),je=H('<svg viewBox="0 0 24 24" fill="none"><defs><clipPath><rect x="48%" y="0" width="100%" height="100%"></rect></clipPath></defs><circle cx="50%" cy="50%" class="transition-all duration-spring-slow ease-spring-slow motion-reduce:transition-none origin-center"></circle><circle cx="50%" cy="50%" r="45%" stroke-width="2.5" fill="none" class="transition-all duration-spring-slow ease-spring-slow motion-reduce:transition-none"></circle><!></svg>');function Ke(r,t){if(new.target)return re({component:Ke,...r});ie(t,!0);const c=new Set(["not_started","waiting","discussion_needed","blocked","in_progress","review_required","complete","cancelled"]);let e=v(t,"status",7),i=v(t,"size",7,16),o=v(t,"onclick",7);const g=Math.random().toString(36).substring(2,9);let u=A(()=>e()==="todo"?"not_started":e()==="in-progress"?"in_progress":e()==="done"?"complete":typeof e()=="string"&&c.has(e())?e():"unknown");const d={not_started:{stroke:"#99999966",fill:"transparent",innerCircleRPercentage:0},waiting:{stroke:"#99999966",fill:"transparent",innerCircleRPercentage:0},discussion_needed:{stroke:"#f59e0b",fill:"#f59e0b",innerCircleRPercentage:100},blocked:{stroke:"#ef4444",fill:"#ef4444",innerCircleRPercentage:100},in_progress:{stroke:"#00BCFF",fill:"#00BCFF",innerCircleRPercentage:55},review_required:{stroke:"#3b82f6",fill:"#3b82f6",innerCircleRPercentage:100},complete:{stroke:"#22c55e",fill:"#00BD7D",innerCircleRPercentage:100},cancelled:{stroke:"#99999966",fill:"#99999966",innerCircleRPercentage:0},unknown:{stroke:"#99999966",fill:"transparent",innerCircleRPercentage:0}};let y=A(()=>d[n(u)]||d.not_started);const R={not_started:k.tiptap_taskStatus_notStarted_label,waiting:k.tiptap_taskStatus_waiting_label,discussion_needed:k.tiptap_taskStatus_discussionNeeded_label,blocked:k.tiptap_taskStatus_blocked_label,in_progress:k.tiptap_taskStatus_inProgress_label,review_required:k.tiptap_taskStatus_reviewRequired_label,complete:k.tiptap_taskStatus_complete_label,cancelled:k.tiptap_taskStatus_cancelled_label,unknown:k.tiptap_taskStatus_unknown_label};let B=A(()=>(R[n(u)]??k.tiptap_taskStatus_unknown_label)());var F={get status(){return e()},set status(C){e(C),h()},get size(){return i()},set size(C=16){i(C),h()},get onclick(){return o()},set onclick(C){o(C),h()},$set:ne,$on:(C,D)=>se(t,C,D)};{let C=A(()=>k.tiptap_taskStatus_status_tooltip({status:n(B)}));Se(r,{type:"button",variant:"ghost",size:"icon-compact",iconOnly:!0,class:"task-status-icon shrink-0 cursor-pointer bg-transparent border-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-primary-ink rounded-full",get style(){return`width: ${i()??""}px; height: ${i()??""}px;`},get onclick(){return o()},get title(){return n(C)},children:(D,p)=>{var a=je(),w=U(a),W=q(w),E=T(w),V=T(E),_=T(V);{var m=s=>{},N=s=>{var l=Ve();S(()=>M(l,"stroke",n(y).stroke)),f(s,l)},O=s=>{var l=Ze();z(3,l,()=>$,()=>({tier:"slow"})),f(s,l)},Z=s=>{var l=qe();S(()=>M(l,"stroke",n(y).stroke)),z(3,l,()=>$,()=>({tier:"slow"})),f(s,l)},j=s=>{var l=Ue();z(3,l,()=>J,()=>({tier:"slow"})),f(s,l)},x=s=>{var l=Ge(),b=X(l),I=T(b);z(3,b,()=>$,()=>({tier:"slow"})),z(3,I,()=>J,()=>({tier:"slow"})),f(s,l)},Q=s=>{var l=We(),b=X(l),I=T(b);z(3,b,()=>J,()=>({tier:"slow"})),z(3,I,()=>J,()=>({tier:"slow"})),f(s,l)};L(_,s=>{n(u)==="not_started"||n(u)==="waiting"?s(m):n(u)==="in_progress"?s(N,1):n(u)==="complete"?s(O,2):n(u)==="cancelled"?s(Z,3):n(u)==="discussion_needed"?s(j,4):n(u)==="blocked"?s(x,5):n(u)==="review_required"&&s(Q,6)})}G(a),S(()=>{M(a,"width",i()),M(a,"height",i()),ce(a,`width: ${i()??""}px; height: ${i()??""}px;`),M(W,"id",`half-clip-${g??""}`),M(E,"r",`${n(y).innerCircleRPercentage*.5}%`),M(E,"fill",n(y).fill),M(E,"clip-path",n(u)==="in_progress"?`url(#half-clip-${g})`:"none"),M(V,"stroke",n(y).stroke)}),f(D,a)},$$slots:{default:!0}})}return oe(F)}export{Fe as A,Ae as L,Ke as T,Oe as a,ut as o,ze as r};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/DRX7fFc0.js","/app/immutable/chunks/ClpAEjbe.js","/app/immutable/chunks/CJxGDkBm.js","/app/immutable/chunks/CpP1PKzF.js","/app/immutable/chunks/PVXvIyE8.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/CgBcONKs.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/WSVFXKpL.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/BxKppgO5.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/CPDV_dyu.js","/app/immutable/chunks/BejTxFyR.js","/app/immutable/chunks/CnGVh7I3.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/ByoP16rr.js","/app/immutable/chunks/B62l45Uf.js","/app/immutable/chunks/C1zxTHwk.js","/app/immutable/chunks/wmcYjLAa.js","/app/immutable/chunks/BVi5KkOP.js","/app/immutable/chunks/NtFyWdpR.js","/app/immutable/chunks/BwASeArv.js","/app/immutable/chunks/DSqSJXGX.js","/app/immutable/chunks/Xh71Wbuh.js","/app/immutable/chunks/By588DV1.js","/app/immutable/chunks/BeYVt6Wg.js","/app/immutable/chunks/DJfJ5NWH.js","/app/immutable/chunks/CtJxHvGv.js","/app/immutable/chunks/oXpJ1LFx.js","/app/immutable/chunks/BoIfXiRv.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/D9Ykl3eH.js","/app/immutable/chunks/CTV49dzf.js","/app/immutable/chunks/DujUyPvo.js","/app/immutable/chunks/C5TH9nNS.js","/app/immutable/chunks/Ck2JBj0W.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as ue,t as re,bo as v,bw as ne,b as se,bm as k}from"./ClpAEjbe.js";import{Jq as pe}from"./CpP1PKzF.js";import{bs as ie,a7 as le,ay as X,aD as n,W as f,bn as oe,c9 as A,aA as h,a5 as U,bA as G,b_ as S,aB as P,bl as q,bO as K,bS as T,ca as de,bH as fe,bV as _e,aC as H}from"./CJxGDkBm.js";import{i as L}from"./wmcYjLAa.js";import{c as ge,e as me,f as te,g as ce,s as M}from"./CnGVh7I3.js";import{m as ve}from"./By588DV1.js";import{e as he}from"./BwASeArv.js";import{t as Ce}from"./DAsc1V4f.js";import{F as we}from"./CtJxHvGv.js";import{M as ke}from"./CYwwgxGp.js";import{b as be}from"./D9Ykl3eH.js";import{aO as xe}from"./DfC089Aj.js";import{n as z,e as $,s as J}from"./oXpJ1LFx.js";import{f as Se}from"./BVi5KkOP.js";import"./CPDV_dyu.js";function ut(r,t,c){if(r.metaKey||r.ctrlKey||!(r.currentTarget instanceof Element)||!r.currentTarget.closest("[data-assistant-panels]"))return!1;const e=pe.state.agentSessions.byAgentId[c]?.workspaceId??t,i=r.currentTarget.closest("[data-assistant-layout-id]")?.dataset.assistantLayoutId;return ue(async()=>{const{showAssistantContent:o}=await import("./DRX7fFc0.js");return{showAssistantContent:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]),import.meta.url).then(({showAssistantContent:o})=>o(`intent://local/${e}/agent/${c}`,{layoutId:i})),!0}var Te=P('<span class="text-subtle animate-pulse"> </span>'),ye=P('<span class="text-green-600 dark:text-green-400 flex items-center gap-0.5"><span class="opacity-70">+</span> <span> </span></span>'),Ee=P('<span class="text-red-600 dark:text-red-400 flex items-center gap-0.5"><span class="opacity-70">-</span> <span> </span></span>'),Ie=P('<span class="text-subtle"> </span>'),Me=P("<!> <!> <!>",1),Le=P("<div><!></div>");function Ae(r,t){if(new.target)return re({component:Ae,...r});ie(t,!0);let c=v(t,"additions",7,0),e=v(t,"deletions",7,0),i=v(t,"showZero",7,!1),o=v(t,"size",7,"sm"),g=v(t,"inline",7,!0),u=v(t,"loading",7,!1),d=v(t,"class",7,""),y=A(()=>i()||c()>0||e()>0||u()),R=A(()=>{switch(o()){case"xs":return"text-ui gap-1";case"sm":return"text-xs gap-1.5";case"md":return"text-sm gap-2";case"lg":return"text-base gap-2.5";default:return"text-xs gap-1.5"}});function B(a){return ve(a,{notation:"compact"})}var F={get additions(){return c()},set additions(a=0){c(a),h()},get deletions(){return e()},set deletions(a=0){e(a),h()},get showZero(){return i()},set showZero(a=!1){i(a),h()},get size(){return o()},set size(a="sm"){o(a),h()},get inline(){return g()},set inline(a=!0){g(a),h()},get loading(){return u()},set loading(a=!1){u(a),h()},get class(){return d()},set class(a=""){d(a),h()},$set:ne,$on:(a,w)=>se(t,a,w)},C=le(),D=X(C);{var p=a=>{var w=Le(),W=U(w);{var E=_=>{var m=Te(),N=q(m,!0);S(O=>K(N,O),[()=>k.shared_lineChangeStats_calculating_label()]),f(_,m)},V=_=>{var m=Me(),N=X(m);{var O=s=>{var l=ye(),b=T(U(l),2),I=q(b,!0);G(l),S(Y=>K(I,Y),[()=>B(c())]),f(s,l)};L(N,s=>{(c()>0||i())&&s(O)})}var Z=T(N,2);{var j=s=>{var l=Ee(),b=T(U(l),2),I=q(b,!0);G(l),S(Y=>K(I,Y),[()=>B(e())]),f(s,l)};L(Z,s=>{(e()>0||i())&&s(j)})}var x=T(Z,2);{var Q=s=>{var l=Ie(),b=q(l,!0);S(I=>K(b,I),[()=>k.shared_lineChangeStats_noChanges_label()]),f(s,l)};L(x,s=>{!c()&&!e()&&!i()&&s(Q)})}f(_,m)};L(W,_=>{u()?_(E):_(V,-1)})}G(w),S(_=>te(w,1,_),[()=>ge(me("whitespace-nowrap",g()?"inline-flex":"flex","items-center font-mono",n(R),d()))]),f(a,w)};L(D,a=>{n(y)&&a(p)})}return f(r,C),oe(F)}const Ne=new Map([["STRONG","strong"],["B","strong"],["EM","em"],["I","em"],["CODE","code"]]),Pe=new Set(["AUDIO","BUTTON","CANVAS","DETAILS","EMBED","HR","IFRAME","IMG","INPUT","OBJECT","PICTURE","PRE","SELECT","SVG","TABLE","TEXTAREA","VIDEO"]),Re=new Set(["ARTICLE","BLOCKQUOTE","DD","DIV","DT","FOOTER","H1","H2","H3","H4","H5","H6","HEADER","LI","P","SECTION"]);function De(r){return typeof Intl.Segmenter=="function"?Array.from(new Intl.Segmenter(void 0,{granularity:"grapheme"}).segment(r),({segment:t})=>t):Array.from(r)}function ee(r,t,c,e){for(const i of De(t.replace(/\s+/gu," "))){const o=i===" ";if(!(o&&(!e.hasText||e.lastWasSpace))){if(e.visibleLength>=c){if(o)return;e.truncated||r.append(document.createTextNode("…")),e.truncated=!0;return}r.append(document.createTextNode(i)),e.visibleLength+=1,e.hasText=!0,e.lastWasSpace=o}}}function ae(r,t,c,e){if(e.truncated)return;if(r.nodeType===Node.TEXT_NODE){ee(t,r.textContent??"",c,e);return}if(!(r instanceof HTMLElement)||Pe.has(r.tagName))return;if(r.tagName==="BR"){ee(t," ",c,e);return}const i=Ne.get(r.tagName);if(i){const o=document.createElement(i);t.append(o);for(const g of r.childNodes)ae(g,o,c,e);o.textContent||o.remove();return}Re.has(r.tagName)&&e.hasText&&ee(t," ",c,e);for(const o of r.childNodes)ae(o,t,c,e)}async function Oe(r,t=80){const c=await xe(r,{allowEmpty:!0,skipIfHTML:!1,preserveAnchors:!1,processPrimitives:!1,taskBlockRenderMode:"content"}),e=document.createElement("template");e.innerHTML=c;const i=document.createElement("span"),o={visibleLength:0,hasText:!1,lastWasSpace:!1,truncated:!1},g=Math.max(0,Math.floor(t));for(const u of e.content.childNodes)ae(u,i,g,o);return i.innerHTML.trim()}async function ze(r){const t=await Oe(r,Number.MAX_SAFE_INTEGER),c=document.createElement("span");return c.innerHTML=t,(c.textContent??"").replace(/<\/?[A-Za-z][^>]*>/gu,"").replace(/\s+/gu," ").trim()}var He=P('<span data-testid="agent-preview-tool-icon"><!></span>'),Be=P('<span><!> <span class="min-w-0 flex-1 truncate text-inherit opacity-[inherit]" data-testid="agent-preview-tool-text"> </span></span>');function Fe(r,t){if(new.target)return re({component:Fe,...r});ie(t,!0);const c=new Set(["figma","sentry","playwright","github","linear","slack","context7"]);let e=v(t,"toolUse",7),i=v(t,"animate",7,!1),o=v(t,"iconSize",7,12),g=v(t,"showIcon",7,!0),u=v(t,"class",7,"");const d=A(()=>be(e().name,e().input||{})),y=A(()=>[n(d).verb,n(d).subject,n(d).path].filter(Boolean).join(" ").trim()||n(d).verb||k.chat_previewToolLabel_tool_fallback());let R=_e("");de(()=>{const p=n(y);let a=!1;return ze(p).then(w=>{a||fe(R,w,!0)}),()=>{a=!0}});var B={get toolUse(){return e()},set toolUse(p){e(p),h()},get animate(){return i()},set animate(p=!1){i(p),h()},get iconSize(){return o()},set iconSize(p=12){o(p),h()},get showIcon(){return g()},set showIcon(p=!0){g(p),h()},get class(){return u()},set class(p=""){u(p),h()},$set:ne,$on:(p,a)=>se(t,p,a)},F=le(),C=X(F);{var D=p=>{var a=Be(),w=U(a);{var W=_=>{var m=He(),N=U(m);{var O=x=>{ke(x,{get iconName(){return n(d).mcpSource},get label(){return n(d).mcpSource},get size(){return o()}})},Z=A(()=>n(d).mcpSource&&c.has(n(d).mcpSource)),j=x=>{we(x,{get icon(){return n(d).icon},class:"h-full! w-full! text-inherit opacity-[inherit]"})};L(N,x=>{n(Z)?x(O):x(j,-1)})}G(m),S(()=>{te(m,1,`agent-preview-tool-icon inline-flex shrink-0 items-center justify-center text-inherit opacity-[inherit] ${i()?"animate-pulse":""}`,"svelte-115ywqs"),ce(m,`width: ${o()??""}px; height: ${o()??""}px;`)}),f(_,m)};L(w,_=>{g()&&_(W)})}var E=T(w,2),V=q(E,!0);he(E,(_,m)=>Ce?.(_,m),()=>n(R)),G(a),S(()=>{te(a,1,`type-body inline-flex w-full min-w-0 items-center font-normal ${g()?"gap-1.5":""} ${u()??""}`,"svelte-115ywqs"),K(V,n(R))}),f(p,a)};L(C,p=>{n(d).hidden||p(D)})}return f(r,F),oe(B)}var Ve=H('<circle cx="12" cy="12" r="10" stroke-width="2" fill="none"></circle>'),Ze=H('<path d="M7 12.5L10.5 16L17 9" stroke="white" stroke-width="3.5" stroke-linecap="round" stroke-linejoin="round" fill="none"></path>'),qe=H('<path d="M5 19L19 5" stroke-width="2.5" stroke-linecap="round"></path>'),Ue=H('<path d="M13.1372 17.7135C13.1372 18.1682 12.9566 18.6042 12.6351 18.9257C12.3136 19.2472 11.8776 19.4278 11.4229 19.4278C10.9683 19.4278 10.5322 19.2472 10.2107 18.9257C9.88925 18.6042 9.70864 18.1682 9.70864 17.7135C9.70864 17.2589 9.88925 16.8228 10.2107 16.5014C10.5322 16.1799 10.9683 15.9993 11.4229 15.9993C11.8776 15.9993 12.3136 16.1799 12.6351 16.5014C12.9566 16.8228 13.1372 17.2589 13.1372 17.7135ZM10.2109 7.07297C10.3957 6.88872 10.6201 6.7491 10.8671 6.66473C11.114 6.58037 11.377 6.55349 11.6359 6.58615C11.8948 6.61881 12.1428 6.71015 12.361 6.8532C12.5793 6.99625 12.762 7.18724 12.8953 7.4116C13.0285 7.63597 13.1088 7.8878 13.1299 8.14789C13.1511 8.40799 13.1126 8.66948 13.0174 8.91244C12.9222 9.1554 12.7728 9.37342 12.5805 9.54988C12.3883 9.72634 12.1583 9.85659 11.9081 9.93068C11.1212 10.1604 10.1372 10.901 10.1372 12.1421V12.5707C10.1372 12.9117 10.2727 13.2387 10.5138 13.4798C10.7549 13.7209 11.0819 13.8564 11.4229 13.8564C11.7639 13.8564 12.0909 13.7209 12.3321 13.4798C12.5732 13.2387 12.7086 12.9117 12.7086 12.5707V12.3735C13.3281 12.1785 13.8952 11.8451 14.3669 11.3988C14.8387 10.9524 15.2029 10.4046 15.4319 9.79683C15.6609 9.18906 15.7487 8.53719 15.6888 7.89048C15.6289 7.24377 15.4228 6.61913 15.0861 6.06376C14.7494 5.50838 14.2908 5.03681 13.7451 4.68466C13.1994 4.33251 12.5808 4.10899 11.936 4.03101C11.2912 3.95302 10.6371 4.0226 10.0232 4.23449C9.40925 4.44638 8.8515 4.79503 8.39207 5.25411C8.26933 5.37277 8.17145 5.51469 8.10414 5.67158C8.03683 5.82848 8.00145 5.9972 8.00004 6.16792C7.99864 6.33864 8.03125 6.50792 8.09597 6.6659C8.16069 6.82388 8.25623 6.96739 8.37701 7.08805C8.49778 7.20871 8.64138 7.30411 8.79942 7.36868C8.95746 7.43326 9.12677 7.46571 9.29749 7.46414C9.4682 7.46258 9.6369 7.42703 9.79373 7.35958C9.95056 7.29212 10.0924 7.19411 10.2109 7.07125V7.07297Z" fill="white" class="origin-center"></path>'),Ge=H('<path d="M12 5.5V13.5" stroke="white" stroke-width="3" stroke-linecap="round"></path><circle cx="12" cy="17.5" r="1.6" fill="white" class="origin-center"></circle>',1),We=H('<path d="M11.6668 13.649C12.1044 13.649 12.5241 13.4751 12.8336 13.1656C13.1431 12.8562 13.3169 12.4365 13.3169 11.9988C13.3169 11.5611 13.1431 11.1414 12.8336 10.832C12.5241 10.5225 12.1044 10.3486 11.6668 10.3486C11.2291 10.3486 10.8094 10.5225 10.4999 10.832C10.1905 11.1414 10.0166 11.5611 10.0166 11.9988C10.0166 12.4365 10.1905 12.8562 10.4999 13.1656C10.8094 13.4751 11.2291 13.649 11.6668 13.649Z" fill="white" class="origin-center"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M4.38506 12.3064C4.31566 12.1046 4.31566 11.8855 4.38506 11.6837C4.90912 10.1693 5.89241 8.85596 7.198 7.92665C8.50359 6.99734 10.0665 6.4983 11.669 6.49902C13.2716 6.49975 14.834 7.00021 16.1388 7.9307C17.4435 8.8612 18.4256 10.1754 18.9483 11.6903C19.0177 11.8921 19.0177 12.1112 18.9483 12.313C18.4245 13.8278 17.4412 15.1416 16.1355 16.0712C14.8298 17.0008 13.2666 17.5 11.6638 17.4993C10.0609 17.4986 8.49824 16.9979 7.19336 16.0671C5.88848 15.1363 4.90641 13.8217 4.38396 12.3064H4.38506ZM14.9681 11.9984C14.9681 12.8737 14.6204 13.7131 14.0015 14.3321C13.3825 14.951 12.5431 15.2987 11.6678 15.2987C10.7925 15.2987 9.95304 14.951 9.33411 14.3321C8.71517 13.7131 8.36746 12.8737 8.36746 11.9984C8.36746 11.1231 8.71517 10.2836 9.33411 9.66468C9.95304 9.04575 10.7925 8.69803 11.6678 8.69803C12.5431 8.69803 13.3825 9.04575 14.0015 9.66468C14.6204 10.2836 14.9681 11.1231 14.9681 11.9984Z" fill="white" class="origin-center"></path>',1),je=H('<svg viewBox="0 0 24 24" fill="none"><defs><clipPath><rect x="48%" y="0" width="100%" height="100%"></rect></clipPath></defs><circle cx="50%" cy="50%" class="transition-all duration-spring-slow ease-spring-slow motion-reduce:transition-none origin-center"></circle><circle cx="50%" cy="50%" r="45%" stroke-width="2.5" fill="none" class="transition-all duration-spring-slow ease-spring-slow motion-reduce:transition-none"></circle><!></svg>');function Ke(r,t){if(new.target)return re({component:Ke,...r});ie(t,!0);const c=new Set(["not_started","waiting","discussion_needed","blocked","in_progress","review_required","complete","cancelled"]);let e=v(t,"status",7),i=v(t,"size",7,16),o=v(t,"onclick",7);const g=Math.random().toString(36).substring(2,9);let u=A(()=>e()==="todo"?"not_started":e()==="in-progress"?"in_progress":e()==="done"?"complete":typeof e()=="string"&&c.has(e())?e():"unknown");const d={not_started:{stroke:"#99999966",fill:"transparent",innerCircleRPercentage:0},waiting:{stroke:"#99999966",fill:"transparent",innerCircleRPercentage:0},discussion_needed:{stroke:"#f59e0b",fill:"#f59e0b",innerCircleRPercentage:100},blocked:{stroke:"#ef4444",fill:"#ef4444",innerCircleRPercentage:100},in_progress:{stroke:"#00BCFF",fill:"#00BCFF",innerCircleRPercentage:55},review_required:{stroke:"#3b82f6",fill:"#3b82f6",innerCircleRPercentage:100},complete:{stroke:"#22c55e",fill:"#00BD7D",innerCircleRPercentage:100},cancelled:{stroke:"#99999966",fill:"#99999966",innerCircleRPercentage:0},unknown:{stroke:"#99999966",fill:"transparent",innerCircleRPercentage:0}};let y=A(()=>d[n(u)]||d.not_started);const R={not_started:k.tiptap_taskStatus_notStarted_label,waiting:k.tiptap_taskStatus_waiting_label,discussion_needed:k.tiptap_taskStatus_discussionNeeded_label,blocked:k.tiptap_taskStatus_blocked_label,in_progress:k.tiptap_taskStatus_inProgress_label,review_required:k.tiptap_taskStatus_reviewRequired_label,complete:k.tiptap_taskStatus_complete_label,cancelled:k.tiptap_taskStatus_cancelled_label,unknown:k.tiptap_taskStatus_unknown_label};let B=A(()=>(R[n(u)]??k.tiptap_taskStatus_unknown_label)());var F={get status(){return e()},set status(C){e(C),h()},get size(){return i()},set size(C=16){i(C),h()},get onclick(){return o()},set onclick(C){o(C),h()},$set:ne,$on:(C,D)=>se(t,C,D)};{let C=A(()=>k.tiptap_taskStatus_status_tooltip({status:n(B)}));Se(r,{type:"button",variant:"ghost",size:"icon-compact",iconOnly:!0,class:"task-status-icon shrink-0 cursor-pointer bg-transparent border-0 focus:outline-none focus-visible:ring-2 focus-visible:ring-offset-1 focus-visible:ring-primary-ink rounded-full",get style(){return`width: ${i()??""}px; height: ${i()??""}px;`},get onclick(){return o()},get title(){return n(C)},children:(D,p)=>{var a=je(),w=U(a),W=q(w),E=T(w),V=T(E),_=T(V);{var m=s=>{},N=s=>{var l=Ve();S(()=>M(l,"stroke",n(y).stroke)),f(s,l)},O=s=>{var l=Ze();z(3,l,()=>$,()=>({tier:"slow"})),f(s,l)},Z=s=>{var l=qe();S(()=>M(l,"stroke",n(y).stroke)),z(3,l,()=>$,()=>({tier:"slow"})),f(s,l)},j=s=>{var l=Ue();z(3,l,()=>J,()=>({tier:"slow"})),f(s,l)},x=s=>{var l=Ge(),b=X(l),I=T(b);z(3,b,()=>$,()=>({tier:"slow"})),z(3,I,()=>J,()=>({tier:"slow"})),f(s,l)},Q=s=>{var l=We(),b=X(l),I=T(b);z(3,b,()=>J,()=>({tier:"slow"})),z(3,I,()=>J,()=>({tier:"slow"})),f(s,l)};L(_,s=>{n(u)==="not_started"||n(u)==="waiting"?s(m):n(u)==="in_progress"?s(N,1):n(u)==="complete"?s(O,2):n(u)==="cancelled"?s(Z,3):n(u)==="discussion_needed"?s(j,4):n(u)==="blocked"?s(x,5):n(u)==="review_required"&&s(Q,6)})}G(a),S(()=>{M(a,"width",i()),M(a,"height",i()),ce(a,`width: ${i()??""}px; height: ${i()??""}px;`),M(W,"id",`half-clip-${g??""}`),M(E,"r",`${n(y).innerCircleRPercentage*.5}%`),M(E,"fill",n(y).fill),M(E,"clip-path",n(u)==="in_progress"?`url(#half-clip-${g})`:"none"),M(V,"stroke",n(y).stroke)}),f(D,a)},$$slots:{default:!0}})}return oe(F)}export{Fe as A,Ae as L,Ke as T,Oe as a,ut as o,ze as r};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/
|
|
2
|
-
import{bm as v,_ as h}from"./ClpAEjbe.js";import{a as S}from"./BdWqymET.js";import{bq as A,Jq as k,m as T,HW as C,GW as D,vr as j,vp as B,vG as V,nC as z}from"./CpP1PKzF.js";import{bL as $}from"./D82C3bhe.js";import{m as R}from"./C1zxTHwk.js";import"./CJxGDkBm.js";import"./CnGVh7I3.js";import"./WSVFXKpL.js";import{R as N,F as g,E as G,Q as O}from"./CPDV_dyu.js";import"./ChTqQfQN.js";import"./BeYVt6Wg.js";import{o as q}from"./CTV49dzf.js";import{i as F}from"./BBWuirRW.js";const y=new WeakMap;function ye(e,t){const a=n=>{n&&n!=="new"?y.set(e,n):y.delete(e)};return a(t),{update:a,destroy(){y.delete(e)}}}function K(e){for(let t=e;t;t=t.parentElement){const a=y.get(t);if(a)return a}}function J(e,t){const a=e?.closest("[data-workspace-link-target]")?.dataset.workspaceLinkTarget;return{openInWorkspace:!!t&&a===t,panelId:e?.closest("[data-panel-id]")?.dataset.panelId,assistantLayoutId:e?.closest("[data-assistant-layout-id]")?.dataset.assistantLayoutId,surfaceWorkspaceId:K(e)}}const s=new S("LinkHandler");async function Q(e,t){try{const a=t.event?.target,n=J(a instanceof Element?a:null,t.workspaceId),o=t.openInWorkspace??n.openInWorkspace,r=o?void 0:t.sourcePanelId||n.panelId,{assistantLayoutId:l}=n,u=t.workspaceId??(n.surfaceWorkspaceId?A(n.surfaceWorkspaceId):void 0);if(t={...t,workspaceId:u,openInWorkspace:o,sourcePanelId:r},t.customHandler&&await t.customHandler(e))return s.debug("Link handled by custom handler",{url:e}),!0;if(/^workspace-asset:/i.test(e.trim()))return R.error(v.ui_linkHandler_assetUnavailable_error()),!1;const i=N(e),{event:d}=t,f=i&&d&&!g(t)?t.githubLinkDefaultAction??q.select(k.state):void 0,c=!f||f==="open-in-app";if(t.workspaceId===T&&!t.forceExternal&&c){const{showAssistantContent:m}=await h(async()=>{const{showAssistantContent:_}=await import("./CKK0Gz-a.js");return{showAssistantContent:_}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]),import.meta.url),I=t.rawHref?.startsWith("/workspace/")?t.rawHref:e;if(await m(I,{layoutId:l}))return!0}if(e.startsWith("intent://"))return await X(e,{...t,sourcePanelId:r});if(e.startsWith("devspace://"))return await Y(e,{...t,sourcePanelId:r});const p=ne(e,t.rawHref);if(p)return await re(p.path,{...t,sourcePanelId:r},p.fromResolvedUrl);if(e.startsWith("http://")||e.startsWith("https://")){if(G(e))return s.debug("Auth URL detected, opening in external browser",{url:e}),await w(e);if(t.forceExternal)return await w(e);if(o&&c||g(t))return t.workspaceId?await E(e,t.workspaceId,{...t,assistantLayoutId:l}):(s.debug("No workspaceId available, opening in external browser",{url:e}),await w(e));if(i&&d&&f)switch(f){case"open-in-browser":return await w(e);case"open-in-app":return t.workspaceId?await E(e,t.workspaceId,{...t,assistantLayoutId:l}):await w(e);case"copy-link":return await $(e),!0;case"start-workspace":return k.dispatch(C({...i,url:e})),k.dispatch(D(!0)),!0;case"show-choices":return await oe(e,i,d,t,l)}return await w(e)}return e.startsWith("file://")?t.canOpenFile?.()===!1?!1:await H(e):(s.warn("Unknown link type, falling back to external browser",{url:e}),await w(e))}catch(a){return s.error("Failed to handle link",{url:e,error:a}),!1}}async function X(e,t){try{const{parseIntentLink:a,handleIntentLink:n}=await h(async()=>{const{parseIntentLink:l,handleIntentLink:u}=await import("./CajUAX8N.js");return{parseIntentLink:l,handleIntentLink:u}},__vite__mapDeps([24,1,2,25,11,7,26,16,8,17,27,28,29,14,15,10,18,30,31,32,33,3,4,5,6,9,34,35,36,37,38,39,40,22,41,42,23]),import.meta.url),o=a(e);if(t.canOpenFile&&o.type==="file"&&!t.canOpenFile())return!1;const r=o.workspaceId?A(o.workspaceId):t.workspaceId;return o.valid&&o.type!=="workspace"&&await L(r,t),P(t),await n(e,{workspaceId:t.openInWorkspace?r:t.workspaceId,sourcePanelId:t.sourcePanelId,openInAdjacentPanel:t.openInAdjacentPanel??g(t),openInNewAdjacentPanel:t.openInNewAdjacentPanel??!1})}catch(a){return s.error("Failed to handle intent link",{url:e,error:a}),!1}}async function Y(e,t){try{const a=e.match(/^devspace:\/\/terminal\/(.+)$/);if(a){if(!t.workspaceId)return s.warn("Cannot open terminal without workspaceId",{url:e}),!1;const n=decodeURIComponent(a[1]);s.debug("Opening terminal from devspace link",{terminalId:n,workspaceId:t.workspaceId}),await L(t.workspaceId,t),P(t);const o={type:"terminal",title:v.layout_tabTypes_terminal_title(),terminalId:n,closable:!0};return g(t)?k.dispatch(j(t.workspaceId,o,t.sourcePanelId)):k.dispatch(B(t.workspaceId,o)),!0}return s.warn("Unhandled devspace:// link type",{url:e}),!1}catch(a){return s.error("Failed to handle devspace link",{url:e,error:a}),!1}}const Z=/^[a-z][a-z0-9+.-]*:/i,x=/^[a-z]:\/(?!\/)/i;function W(e){return e.replace(/\\/g,"/")}function ee(e){try{return W(decodeURIComponent(e))}catch{return null}}function te(e){return e.split("/").some(t=>t==="..")}function ae(e){const t=e.split("/").filter(a=>a&&a!==".");return t.length===0||t.some(a=>a==="..")?null:t.join("/")}async function L(e,t){if(!t.openInWorkspace||!e)return;const{openAndShowWorkspace:a}=await h(async()=>{const{openAndShowWorkspace:n}=await import("./DqfSttpc.js").then(o=>o.s);return{openAndShowWorkspace:n}},__vite__mapDeps([45,4,2,3,5,6,7,8,1,9,10,11,46,47]),import.meta.url);try{await a(e)}catch(n){throw R.error(v.ui_linkHandler_navigationFailed_title(),{description:n instanceof Error?n.message:v.ui_linkHandler_unknownError_label()}),n}}function P(e){!e.workspaceId||!e.sourcePanelId||k.dispatch(z(e.workspaceId,e.sourcePanelId))}function ne(e,t){const a=t??e;if(a){if(a.startsWith("#"))return null;const n=O(a).path;if(!a.startsWith("//")&&(x.test(W(n))||!Z.test(n)))return{path:a,fromResolvedUrl:!1}}if((e.startsWith("http://")||e.startsWith("https://"))&&typeof window<"u")try{const n=new URL(e);if(n.origin===window.location.origin)return{path:n.pathname+n.hash,fromResolvedUrl:!0}}catch{}return null}async function re(e,t,a){try{if(t.canOpenFile?.()===!1)return!1;const n=O(e),o=ee(n.path);if(!o||o.includes("\0"))return!1;let r=o;const{line:l,column:u}=n,{workspaceId:i}=t;if(!i)return s.warn("Cannot open file link without workspaceId",{path:r}),!1;if(te(r))return s.warn("Rejected file link with path traversal",{path:r}),!1;if(r.startsWith("/")||x.test(r)){const{selectWorkspaceById:c}=await h(async()=>{const{selectWorkspaceById:b}=await import("./D9Ykl3eH.js").then(M=>M.ea);return{selectWorkspaceById:b}},__vite__mapDeps([40,10,7,1,2,3,4,5,6,8,9,11,35,30,26,16,17,29,22,14,15,18,41,32]),import.meta.url),p=c.select(k.state,i),m=p?.worktreePath??p?.path,I=m?W(m):void 0,_=I?.endsWith("/")?I.slice(0,-1):I;if(_&&r.startsWith(`${_}/`))r=r.slice(_.length+1);else if(a)r=r.replace(/^\/+/,"");else{s.debug("Absolute path outside workspace root, opening in external editor",{path:r});const b=l===void 0?"":`:${l}${u===void 0?"":`:${u}`}`;return await H(`file://${r}${b}`)}}const d=ae(r);if(!d)return s.warn("Rejected invalid workspace file link",{path:r}),!1;r=d;const f=g(t);return await L(i,t),P(t),k.dispatch(V(i,r,{filePathIsLiteral:!0,line:l,openInAdjacentPanel:f,...t.sourcePanelId?{sourcePanelId:t.sourcePanelId}:{}})),s.debug("Opened file link in workspace file viewer",{path:r,workspaceId:i,line:l}),!0}catch(n){return s.error("Failed to open file link",{target:e,error:n}),!1}}async function oe(e,t,a,{workspaceId:n,openInWorkspace:o,sourcePanelId:r},l){try{const{showLinkActionMenu:u}=await h(async()=>{const{showLinkActionMenu:p}=await import("./B3bYRRle.js");return{showLinkActionMenu:p}},__vite__mapDeps([48,2]),import.meta.url),i=a.target instanceof HTMLElement?a.target:null;let d=a instanceof MouseEvent?a.clientX:0,f=a instanceof MouseEvent?a.clientY:0;if(d===0&&f===0&&i){const p=i.getBoundingClientRect();d=p.left,f=p.bottom}const c=u({url:e,gitHubRef:t,x:d,y:f,workspaceId:n,anchorElement:i,openInWorkspace:o??!1,sourcePanelId:r,assistantLayoutId:l});return t.kind==="pr"&&se(c,e),s.debug("Opened link action menu",{url:e,workspaceId:n}),!0}catch(u){return s.warn("Failed to open link action menu, falling back to external browser",{url:e,error:u}),await w(e)}}function se(e,t){h(async()=>{const{loadLinkActionMenuLinkedWorkspaces:a}=await import("./C_9kq4Mf.js");return{loadLinkActionMenuLinkedWorkspaces:a}},__vite__mapDeps([49,12,13,1,2,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,40,35,30,26,29,41,32,48]),import.meta.url).then(({loadLinkActionMenuLinkedWorkspaces:a})=>a(e,t)).catch(a=>{s.debug("PR workspace lookup unavailable",{url:t,error:a})})}async function ie(e){try{return await L(e,{openInWorkspace:!0}),!0}catch(t){return s.warn("Failed to open linked workspace",{workspaceId:e,error:t}),!1}}async function E(e,t,a={}){if(t===T){try{const{showAssistantContent:o}=await h(async()=>{const{showAssistantContent:r}=await import("./CKK0Gz-a.js");return{showAssistantContent:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]),import.meta.url);if(await o(e,{layoutId:a.assistantLayoutId}))return!0}catch(o){s.warn("Assistant panel unavailable, opening in external browser",{url:e,error:o})}return await w(e)}try{await L(t,a)}catch(o){return s.warn("Failed to enter workspace for in-app link",{url:e,workspaceId:t,error:o}),!1}const n=a.openInWorkspace?void 0:a.sourcePanelId;return await U(e,t,n)}async function U(e,t,a){let n=e,o;try{const{resolveBrowserLinkForOpen:r}=await h(async()=>{const{resolveBrowserLinkForOpen:u}=await import("./WQlIWqz7.js").then(i=>i.b);return{resolveBrowserLinkForOpen:u}},__vite__mapDeps([50,25,11,7,1,2,26,16,8,17,27,28,29,14,15,10,18,30,31,32,33,3,4,5,6,9,34,35,36,37,38,39]),import.meta.url),l=await r(e);n=l.url,o=l.requestedUrl}catch(r){s.warn("URL resolution failed, opening the URL unresolved",{url:e,error:r})}try{P({workspaceId:t,sourcePanelId:a});const{getPanelLayoutManager:r}=await h(async()=>{const{getPanelLayoutManager:u}=await import("./0LjODXcP.js").then(i=>i.p);return{getPanelLayoutManager:u}},__vite__mapDeps([51,3,4,2,5,6,7,8,1,9,10,11,43]),import.meta.url);return r(t).openBrowserPanel(n,void 0,a,o),s.debug("Opened URL in browser panel",{url:e,targetUrl:n,workspaceId:t}),!0}catch(r){return s.warn("Failed to open URL in browser panel, falling back to external browser",{url:e,error:r}),await w(n)}}async function w(e){try{return await F("shell:openExternal",{url:e}),s.debug("Opened URL in external browser",{url:e}),!0}catch(t){return s.error("Failed to open URL in external browser",{url:e,error:t}),!1}}async function H(e){try{const t=e.replace("file://","");return typeof window<"u"&&window.electronAPI?(await F("shell:openExternal",{url:`vscode://file/${t}`}),s.debug("Opened file in external editor",{filePath:t}),!0):!1}catch(t){return s.error("Failed to open file in external editor",{url:e,error:t}),!1}}function ce(e,t={}){let a=null,n=null,o=null;async function r(){if(!n||!o){const d=await h(()=>import("./CPDV_dyu.js").then(f=>f.K),__vite__mapDeps([14,1,2,11,7,15,10,16,8,17,18]),import.meta.url);n=d.showLinkTooltip,o=d.hideLinkTooltip}}function l(d){const c=d.target.closest("a");if(c?.href&&!c.href.startsWith("intent://")&&!c.href.startsWith("devspace://")){if(c===a)return;a=c;const p=t.workspaceId??c.closest("[data-workspace-id]")?.dataset.workspaceId??c.closest("[data-workspace-surface]")?.dataset.workspaceSurface;r().then(()=>{a===c&&n&&n(c,c.href,p)})}else a&&(a=null,o?.())}function u(d){const c=d.target.closest("a");if(c&&c===a){const p=d.relatedTarget;if(p&&c.contains(p))return;a=null,o?.()}}function i(){a&&(a=null,o?.())}return e.addEventListener("mouseover",l),e.addEventListener("mouseout",u),e.addEventListener("click",i),()=>{e.removeEventListener("mouseover",l),e.removeEventListener("mouseout",u),e.removeEventListener("click",i),o?.()}}const ve=Object.freeze(Object.defineProperty({__proto__:null,createLinkTooltipHandler:ce,handleLink:Q,openInBrowserPanel:U,openInExternalBrowser:w,openLinkInApp:E,openLinkedWorkspace:ie},Symbol.toStringTag,{value:"Module"}));export{E as a,ie as b,ce as c,Q as h,ve as l,w as o,J as r,ye as w};
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/DRX7fFc0.js","/app/immutable/chunks/ClpAEjbe.js","/app/immutable/chunks/CJxGDkBm.js","/app/immutable/chunks/CpP1PKzF.js","/app/immutable/chunks/PVXvIyE8.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/CgBcONKs.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/WSVFXKpL.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/BxKppgO5.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/CPDV_dyu.js","/app/immutable/chunks/BejTxFyR.js","/app/immutable/chunks/CnGVh7I3.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/ByoP16rr.js","/app/immutable/chunks/B62l45Uf.js","/app/immutable/chunks/C1zxTHwk.js","/app/immutable/chunks/wmcYjLAa.js","/app/immutable/chunks/BVi5KkOP.js","/app/immutable/chunks/NtFyWdpR.js","/app/immutable/chunks/BwASeArv.js","/app/immutable/chunks/DSqSJXGX.js","/app/immutable/chunks/Xh71Wbuh.js","/app/immutable/chunks/By588DV1.js","/app/immutable/chunks/BeYVt6Wg.js","/app/immutable/chunks/DJfJ5NWH.js","/app/immutable/chunks/CtJxHvGv.js","/app/immutable/chunks/oXpJ1LFx.js","/app/immutable/chunks/BoIfXiRv.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/D9Ykl3eH.js","/app/immutable/chunks/CTV49dzf.js","/app/immutable/chunks/DujUyPvo.js","/app/immutable/chunks/C5TH9nNS.js","/app/immutable/chunks/Ck2JBj0W.js","/app/immutable/chunks/1cfvZqIL.js","/app/immutable/chunks/BHINa8Ry.js","/app/immutable/chunks/DKwAaLwd.js","/app/immutable/chunks/B3bYRRle.js","/app/immutable/chunks/C_9kq4Mf.js","/app/immutable/chunks/WQlIWqz7.js","/app/immutable/chunks/0LjODXcP.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{bm as v,_ as h}from"./ClpAEjbe.js";import{a as S}from"./BdWqymET.js";import{bq as A,Jq as k,m as T,HW as C,GW as D,vr as j,vp as B,vG as V,nC as z}from"./CpP1PKzF.js";import{bL as $}from"./CSfWCx1k.js";import{m as R}from"./C1zxTHwk.js";import"./CJxGDkBm.js";import"./CnGVh7I3.js";import"./WSVFXKpL.js";import{R as N,F as g,E as G,Q as O}from"./CPDV_dyu.js";import"./ChTqQfQN.js";import"./BeYVt6Wg.js";import{o as q}from"./CTV49dzf.js";import{i as F}from"./BBWuirRW.js";const y=new WeakMap;function ye(e,t){const a=n=>{n&&n!=="new"?y.set(e,n):y.delete(e)};return a(t),{update:a,destroy(){y.delete(e)}}}function K(e){for(let t=e;t;t=t.parentElement){const a=y.get(t);if(a)return a}}function J(e,t){const a=e?.closest("[data-workspace-link-target]")?.dataset.workspaceLinkTarget;return{openInWorkspace:!!t&&a===t,panelId:e?.closest("[data-panel-id]")?.dataset.panelId,assistantLayoutId:e?.closest("[data-assistant-layout-id]")?.dataset.assistantLayoutId,surfaceWorkspaceId:K(e)}}const s=new S("LinkHandler");async function Q(e,t){try{const a=t.event?.target,n=J(a instanceof Element?a:null,t.workspaceId),o=t.openInWorkspace??n.openInWorkspace,r=o?void 0:t.sourcePanelId||n.panelId,{assistantLayoutId:l}=n,u=t.workspaceId??(n.surfaceWorkspaceId?A(n.surfaceWorkspaceId):void 0);if(t={...t,workspaceId:u,openInWorkspace:o,sourcePanelId:r},t.customHandler&&await t.customHandler(e))return s.debug("Link handled by custom handler",{url:e}),!0;if(/^workspace-asset:/i.test(e.trim()))return R.error(v.ui_linkHandler_assetUnavailable_error()),!1;const i=N(e),{event:d}=t,f=i&&d&&!g(t)?t.githubLinkDefaultAction??q.select(k.state):void 0,c=!f||f==="open-in-app";if(t.workspaceId===T&&!t.forceExternal&&c){const{showAssistantContent:m}=await h(async()=>{const{showAssistantContent:_}=await import("./DRX7fFc0.js");return{showAssistantContent:_}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]),import.meta.url),I=t.rawHref?.startsWith("/workspace/")?t.rawHref:e;if(await m(I,{layoutId:l}))return!0}if(e.startsWith("intent://"))return await X(e,{...t,sourcePanelId:r});if(e.startsWith("devspace://"))return await Y(e,{...t,sourcePanelId:r});const p=ne(e,t.rawHref);if(p)return await re(p.path,{...t,sourcePanelId:r},p.fromResolvedUrl);if(e.startsWith("http://")||e.startsWith("https://")){if(G(e))return s.debug("Auth URL detected, opening in external browser",{url:e}),await w(e);if(t.forceExternal)return await w(e);if(o&&c||g(t))return t.workspaceId?await E(e,t.workspaceId,{...t,assistantLayoutId:l}):(s.debug("No workspaceId available, opening in external browser",{url:e}),await w(e));if(i&&d&&f)switch(f){case"open-in-browser":return await w(e);case"open-in-app":return t.workspaceId?await E(e,t.workspaceId,{...t,assistantLayoutId:l}):await w(e);case"copy-link":return await $(e),!0;case"start-workspace":return k.dispatch(C({...i,url:e})),k.dispatch(D(!0)),!0;case"show-choices":return await oe(e,i,d,t,l)}return await w(e)}return e.startsWith("file://")?t.canOpenFile?.()===!1?!1:await H(e):(s.warn("Unknown link type, falling back to external browser",{url:e}),await w(e))}catch(a){return s.error("Failed to handle link",{url:e,error:a}),!1}}async function X(e,t){try{const{parseIntentLink:a,handleIntentLink:n}=await h(async()=>{const{parseIntentLink:l,handleIntentLink:u}=await import("./B62l45Uf.js");return{parseIntentLink:l,handleIntentLink:u}},__vite__mapDeps([24,1,2,25,11,7,26,16,8,17,27,28,29,14,15,10,18,30,31,32,33,3,4,5,6,9,34,35,36,37,38,39,40,22,41,42,23]),import.meta.url),o=a(e);if(t.canOpenFile&&o.type==="file"&&!t.canOpenFile())return!1;const r=o.workspaceId?A(o.workspaceId):t.workspaceId;return o.valid&&o.type!=="workspace"&&await L(r,t),P(t),await n(e,{workspaceId:t.openInWorkspace?r:t.workspaceId,sourcePanelId:t.sourcePanelId,openInAdjacentPanel:t.openInAdjacentPanel??g(t),openInNewAdjacentPanel:t.openInNewAdjacentPanel??!1})}catch(a){return s.error("Failed to handle intent link",{url:e,error:a}),!1}}async function Y(e,t){try{const a=e.match(/^devspace:\/\/terminal\/(.+)$/);if(a){if(!t.workspaceId)return s.warn("Cannot open terminal without workspaceId",{url:e}),!1;const n=decodeURIComponent(a[1]);s.debug("Opening terminal from devspace link",{terminalId:n,workspaceId:t.workspaceId}),await L(t.workspaceId,t),P(t);const o={type:"terminal",title:v.layout_tabTypes_terminal_title(),terminalId:n,closable:!0};return g(t)?k.dispatch(j(t.workspaceId,o,t.sourcePanelId)):k.dispatch(B(t.workspaceId,o)),!0}return s.warn("Unhandled devspace:// link type",{url:e}),!1}catch(a){return s.error("Failed to handle devspace link",{url:e,error:a}),!1}}const Z=/^[a-z][a-z0-9+.-]*:/i,x=/^[a-z]:\/(?!\/)/i;function W(e){return e.replace(/\\/g,"/")}function ee(e){try{return W(decodeURIComponent(e))}catch{return null}}function te(e){return e.split("/").some(t=>t==="..")}function ae(e){const t=e.split("/").filter(a=>a&&a!==".");return t.length===0||t.some(a=>a==="..")?null:t.join("/")}async function L(e,t){if(!t.openInWorkspace||!e)return;const{openAndShowWorkspace:a}=await h(async()=>{const{openAndShowWorkspace:n}=await import("./1cfvZqIL.js").then(o=>o.s);return{openAndShowWorkspace:n}},__vite__mapDeps([45,4,2,3,5,6,7,8,1,9,10,11,46,47]),import.meta.url);try{await a(e)}catch(n){throw R.error(v.ui_linkHandler_navigationFailed_title(),{description:n instanceof Error?n.message:v.ui_linkHandler_unknownError_label()}),n}}function P(e){!e.workspaceId||!e.sourcePanelId||k.dispatch(z(e.workspaceId,e.sourcePanelId))}function ne(e,t){const a=t??e;if(a){if(a.startsWith("#"))return null;const n=O(a).path;if(!a.startsWith("//")&&(x.test(W(n))||!Z.test(n)))return{path:a,fromResolvedUrl:!1}}if((e.startsWith("http://")||e.startsWith("https://"))&&typeof window<"u")try{const n=new URL(e);if(n.origin===window.location.origin)return{path:n.pathname+n.hash,fromResolvedUrl:!0}}catch{}return null}async function re(e,t,a){try{if(t.canOpenFile?.()===!1)return!1;const n=O(e),o=ee(n.path);if(!o||o.includes("\0"))return!1;let r=o;const{line:l,column:u}=n,{workspaceId:i}=t;if(!i)return s.warn("Cannot open file link without workspaceId",{path:r}),!1;if(te(r))return s.warn("Rejected file link with path traversal",{path:r}),!1;if(r.startsWith("/")||x.test(r)){const{selectWorkspaceById:c}=await h(async()=>{const{selectWorkspaceById:b}=await import("./D9Ykl3eH.js").then(M=>M.ea);return{selectWorkspaceById:b}},__vite__mapDeps([40,10,7,1,2,3,4,5,6,8,9,11,35,30,26,16,17,29,22,14,15,18,41,32]),import.meta.url),p=c.select(k.state,i),m=p?.worktreePath??p?.path,I=m?W(m):void 0,_=I?.endsWith("/")?I.slice(0,-1):I;if(_&&r.startsWith(`${_}/`))r=r.slice(_.length+1);else if(a)r=r.replace(/^\/+/,"");else{s.debug("Absolute path outside workspace root, opening in external editor",{path:r});const b=l===void 0?"":`:${l}${u===void 0?"":`:${u}`}`;return await H(`file://${r}${b}`)}}const d=ae(r);if(!d)return s.warn("Rejected invalid workspace file link",{path:r}),!1;r=d;const f=g(t);return await L(i,t),P(t),k.dispatch(V(i,r,{filePathIsLiteral:!0,line:l,openInAdjacentPanel:f,...t.sourcePanelId?{sourcePanelId:t.sourcePanelId}:{}})),s.debug("Opened file link in workspace file viewer",{path:r,workspaceId:i,line:l}),!0}catch(n){return s.error("Failed to open file link",{target:e,error:n}),!1}}async function oe(e,t,a,{workspaceId:n,openInWorkspace:o,sourcePanelId:r},l){try{const{showLinkActionMenu:u}=await h(async()=>{const{showLinkActionMenu:p}=await import("./B3bYRRle.js");return{showLinkActionMenu:p}},__vite__mapDeps([48,2]),import.meta.url),i=a.target instanceof HTMLElement?a.target:null;let d=a instanceof MouseEvent?a.clientX:0,f=a instanceof MouseEvent?a.clientY:0;if(d===0&&f===0&&i){const p=i.getBoundingClientRect();d=p.left,f=p.bottom}const c=u({url:e,gitHubRef:t,x:d,y:f,workspaceId:n,anchorElement:i,openInWorkspace:o??!1,sourcePanelId:r,assistantLayoutId:l});return t.kind==="pr"&&se(c,e),s.debug("Opened link action menu",{url:e,workspaceId:n}),!0}catch(u){return s.warn("Failed to open link action menu, falling back to external browser",{url:e,error:u}),await w(e)}}function se(e,t){h(async()=>{const{loadLinkActionMenuLinkedWorkspaces:a}=await import("./C_9kq4Mf.js");return{loadLinkActionMenuLinkedWorkspaces:a}},__vite__mapDeps([49,12,13,1,2,3,4,5,6,7,8,9,10,11,14,15,16,17,18,19,20,21,22,23,40,35,30,26,29,41,32,48]),import.meta.url).then(({loadLinkActionMenuLinkedWorkspaces:a})=>a(e,t)).catch(a=>{s.debug("PR workspace lookup unavailable",{url:t,error:a})})}async function ie(e){try{return await L(e,{openInWorkspace:!0}),!0}catch(t){return s.warn("Failed to open linked workspace",{workspaceId:e,error:t}),!1}}async function E(e,t,a={}){if(t===T){try{const{showAssistantContent:o}=await h(async()=>{const{showAssistantContent:r}=await import("./DRX7fFc0.js");return{showAssistantContent:r}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]),import.meta.url);if(await o(e,{layoutId:a.assistantLayoutId}))return!0}catch(o){s.warn("Assistant panel unavailable, opening in external browser",{url:e,error:o})}return await w(e)}try{await L(t,a)}catch(o){return s.warn("Failed to enter workspace for in-app link",{url:e,workspaceId:t,error:o}),!1}const n=a.openInWorkspace?void 0:a.sourcePanelId;return await U(e,t,n)}async function U(e,t,a){let n=e,o;try{const{resolveBrowserLinkForOpen:r}=await h(async()=>{const{resolveBrowserLinkForOpen:u}=await import("./WQlIWqz7.js").then(i=>i.b);return{resolveBrowserLinkForOpen:u}},__vite__mapDeps([50,25,11,7,1,2,26,16,8,17,27,28,29,14,15,10,18,30,31,32,33,3,4,5,6,9,34,35,36,37,38,39]),import.meta.url),l=await r(e);n=l.url,o=l.requestedUrl}catch(r){s.warn("URL resolution failed, opening the URL unresolved",{url:e,error:r})}try{P({workspaceId:t,sourcePanelId:a});const{getPanelLayoutManager:r}=await h(async()=>{const{getPanelLayoutManager:u}=await import("./0LjODXcP.js").then(i=>i.p);return{getPanelLayoutManager:u}},__vite__mapDeps([51,3,4,2,5,6,7,8,1,9,10,11,43]),import.meta.url);return r(t).openBrowserPanel(n,void 0,a,o),s.debug("Opened URL in browser panel",{url:e,targetUrl:n,workspaceId:t}),!0}catch(r){return s.warn("Failed to open URL in browser panel, falling back to external browser",{url:e,error:r}),await w(n)}}async function w(e){try{return await F("shell:openExternal",{url:e}),s.debug("Opened URL in external browser",{url:e}),!0}catch(t){return s.error("Failed to open URL in external browser",{url:e,error:t}),!1}}async function H(e){try{const t=e.replace("file://","");return typeof window<"u"&&window.electronAPI?(await F("shell:openExternal",{url:`vscode://file/${t}`}),s.debug("Opened file in external editor",{filePath:t}),!0):!1}catch(t){return s.error("Failed to open file in external editor",{url:e,error:t}),!1}}function ce(e,t={}){let a=null,n=null,o=null;async function r(){if(!n||!o){const d=await h(()=>import("./CPDV_dyu.js").then(f=>f.K),__vite__mapDeps([14,1,2,11,7,15,10,16,8,17,18]),import.meta.url);n=d.showLinkTooltip,o=d.hideLinkTooltip}}function l(d){const c=d.target.closest("a");if(c?.href&&!c.href.startsWith("intent://")&&!c.href.startsWith("devspace://")){if(c===a)return;a=c;const p=t.workspaceId??c.closest("[data-workspace-id]")?.dataset.workspaceId??c.closest("[data-workspace-surface]")?.dataset.workspaceSurface;r().then(()=>{a===c&&n&&n(c,c.href,p)})}else a&&(a=null,o?.())}function u(d){const c=d.target.closest("a");if(c&&c===a){const p=d.relatedTarget;if(p&&c.contains(p))return;a=null,o?.()}}function i(){a&&(a=null,o?.())}return e.addEventListener("mouseover",l),e.addEventListener("mouseout",u),e.addEventListener("click",i),()=>{e.removeEventListener("mouseover",l),e.removeEventListener("mouseout",u),e.removeEventListener("click",i),o?.()}}const ve=Object.freeze(Object.defineProperty({__proto__:null,createLinkTooltipHandler:ce,handleLink:Q,openInBrowserPanel:U,openInExternalBrowser:w,openLinkInApp:E,openLinkedWorkspace:ie},Symbol.toStringTag,{value:"Module"}));export{E as a,ie as b,ce as c,Q as h,ve as l,w as o,J as r,ye as w};
|