UNPKG

n8n-editor-ui

Version:

Workflow Editor UI for n8n

1 lines 675 kB
!function(){try{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{}).SENTRY_RELEASE={id:"n8n@2.16.1"}}catch(e){}}(),System.register(["./chunk-legacy-Dz3fjYb5.js","./vue.runtime.esm-bundler-legacy-BW6xDdqj.js","./core-legacy-VD8c7QJ-.js","./src-legacy-B67uuxhB.js","./get-legacy-CLCnFf3e.js","./_plugin-vue_export-helper-legacy-DFdC_I5Z.js","./_MapCache-legacy-BrGWD-Li.js","./empty-legacy-CvitQtk3.js","./users.store-legacy-azRUgFdP.js","./constants-legacy-2_ytuuS3.js","./useRootStore-legacy-CC08el-l.js","./settings.store-legacy-I6rZOvfF.js","./useClipboard-legacy-DnQV92ly.js","./assistant.store-legacy-DDWm4tY4.js","./chatPanel.store-legacy-BsMvrm8R.js","./NDVEmptyState-legacy-CLjhzhUP.js","./externalSecrets.ee.store-legacy-BPUK9RyR.js","./uniqBy-legacy-DL4sHxk3.js","./usePinnedData-legacy-BfjAvFWp.js","./RunDataHtml-legacy-BdFqia50.js","./useRunWorkflow-legacy-DKBAJ9Cs.js","./useInjectWorkflowId-legacy-piYT0WDS.js","./vue-json-pretty-legacy-ClDlqUZG.js","./collaboration.store-legacy-CFKDVv2B.js","./useExecutionHelpers-legacy-43gwTTrP.js"],(function(e,t){var i,n,o,r,s,a,l,c,h,d,u,p,f,m,g,O,v,y,b,x,w,k,S,Q,$,T,P,_,C,M,Z,R,A,E,D,L,X,N,j,z,I,W,q,V,Y,B,U,G,F,H,K,J,ee,te,ie,ne,oe,re,se,ae,le,ce,he,de,ue,pe,fe,me,ge,Oe,ve,ye,be,xe,we,ke,Se,Qe,$e,Te,Pe,_e,Ce,Me,Ze,Re,Ae,Ee,De,Le,Xe,Ne,je,ze,Ie,We,qe,Ve,Ye,Be,Ue,Ge,Fe,He,Ke,Je,et,tt,it,nt,ot,rt,st,at,lt,ct,ht,dt,ut,pt,ft,mt,gt,Ot,vt,yt,bt,xt,wt,kt,St,Qt,$t,Tt,Pt,_t,Ct,Mt,Zt,Rt,At,Et,Dt,Lt,Xt,Nt,jt,zt,It,Wt,qt,Vt,Yt,Bt,Ut,Gt,Ft,Ht,Kt,Jt,ei,ti,ii,ni,oi,ri,si,ai,li,ci,hi,di,ui,pi,fi,mi,gi,Oi,vi,yi,bi,xi,wi,ki,Si,Qi,$i,Ti,Pi,_i,Ci,Mi,Zi,Ri,Ai,Ei,Di,Li,Xi,Ni,ji,zi,Ii,Wi,qi,Vi,Yi,Bi,Ui,Gi,Fi,Hi,Ki,Ji,en,tn,nn,on,rn,sn,an,ln,cn,hn,dn,un,pn,fn,mn,gn,On,vn,yn,bn,xn,wn,kn,Sn,Qn,$n,Tn,Pn,_n,Cn,Mn,Zn,Rn,An,En,Dn,Ln,Xn,Nn,jn,zn,In,Wn,qn,Vn,Yn,Bn,Un,Gn,Fn,Hn,Kn,Jn,eo,to,io,no,oo,ro,so,ao,lo,co,ho,uo,po,fo,mo,go,Oo,vo,yo,bo,xo,wo,ko,So,Qo,$o,To,Po,_o,Co,Mo,Zo,Ro,Ao,Eo,Do,Lo,Xo,No,jo,zo,Io,Wo,qo,Vo,Yo,Bo,Uo,Go,Fo,Ho,Ko,Jo,er,tr,ir,nr,or,rr,sr,ar,lr,cr,hr,dr,ur,pr,fr,mr,gr,Or,vr,yr,br,xr,wr,kr,Sr,Qr,$r,Tr,Pr,_r,Cr,Mr,Zr,Rr,Ar,Er,Dr,Lr,Xr,Nr,jr,zr,Ir,Wr,qr,Vr,Yr,Br,Ur,Gr,Fr,Hr,Kr,Jr,es,ts,is,ns,os,rs,ss,as,ls,cs,hs,ds,us,ps,fs,ms,gs,Os,vs,ys,bs,xs,ws,ks,Ss,Qs,$s,Ts,Ps,_s,Cs,Ms,Zs,Rs,As,Es,Ds,Ls,Xs,Ns,js,zs,Is,Ws,qs,Vs,Ys,Bs,Us,Gs,Fs,Hs,Ks,Js,ea,ta,ia,na,oa,ra,sa,aa,la,ca,ha,da,ua,pa,fa,ma,ga,Oa,va,ya,ba,xa,wa,ka,Sa,Qa,$a,Ta,Pa,_a,Ca,Ma,Za,Ra,Aa,Ea,Da,La,Xa,Na,ja,za,Ia,Wa,qa,Va,Ya,Ba,Ua,Ga,Fa,Ha,Ka,Ja,el,tl,il,nl,ol,rl,sl,al,ll,cl,hl,dl,ul,pl,fl,ml,gl,Ol,vl,yl,bl,xl,wl,kl,Sl,Ql,$l,Tl,Pl,_l,Cl,Ml,Zl,Rl,Al,El,Dl,Ll,Xl,Nl,jl,zl,Il,Wl,ql,Vl,Yl,Bl,Ul,Gl,Fl,Hl,Kl,Jl,ec,tc,ic,nc,oc,rc,sc,ac,lc,cc,hc,dc,uc,pc,fc,mc,gc,Oc,vc,yc,bc,xc,wc,kc,Sc,Qc,$c,Tc,Pc,_c,Cc,Mc,Zc,Rc,Ac,Ec,Dc,Lc,Xc,Nc,jc,zc,Ic,Wc,qc,Vc,Yc,Bc,Uc,Gc,Fc,Hc,Kc,Jc,eh,th,ih,nh,oh,rh,sh,ah,lh,ch,hh,dh,uh,ph,fh,mh,gh,Oh,vh,yh,bh,xh,wh,kh,Sh,Qh,$h,Th,Ph,_h,Ch,Mh,Zh,Rh,Ah,Eh,Dh,Lh,Xh,Nh,jh,zh,Ih,Wh,qh,Vh,Yh,Bh,Uh,Gh,Fh,Hh,Kh,Jh,ed,td,id,nd,od,rd,sd,ad,ld,cd,hd,dd,ud,pd,fd,md,gd,Od,vd,yd,bd,xd,wd,kd,Sd,Qd,$d,Td,Pd,_d,Cd,Md,Zd,Rd,Ad,Ed,Dd,Ld,Xd,Nd,jd,zd,Id,Wd,qd,Vd,Yd,Bd,Ud,Gd,Fd,Hd,Kd,Jd,eu,tu,iu,nu,ou,ru,su,au,lu,cu,hu,du,uu,pu,fu,mu,gu,Ou,vu,yu,bu,xu,wu,ku,Su,Qu,$u,Tu,Pu,_u,Cu,Mu,Zu,Ru,Au,Eu,Du,Lu,Xu,Nu,ju,zu,Iu,Wu,qu,Vu,Yu,Bu,Uu,Gu,Fu,Hu,Ku,Ju,ep,tp,ip,np,op,rp,sp,ap,lp,cp,hp,dp,up,pp,fp,mp,gp,Op,vp,yp,bp,xp,wp,kp,Sp,Qp,$p,Tp,Pp,_p,Cp,Mp,Zp,Rp,Ap,Ep,Dp,Lp,Xp,Np,jp,zp,Ip,Wp,qp,Vp,Yp,Bp,Up,Gp,Fp,Hp,Kp,Jp,ef,tf,nf,of,rf,sf,af,lf,cf,hf,df,uf,pf,ff,mf,gf,Of,vf,yf,bf,xf,wf,kf,Sf,Qf,$f,Tf,Pf,_f,Cf,Mf,Zf,Rf,Af,Ef,Df,Lf,Xf,Nf,jf,zf,If,Wf,qf,Vf,Yf,Bf,Uf,Gf,Ff,Hf,Kf,Jf,em,tm,im,nm,om,rm,sm,am,lm,cm,hm,dm,um,pm,fm,mm,gm,Om,vm,ym,bm,xm,wm,km,Sm,Qm,$m,Tm,Pm,_m,Cm,Mm,Zm,Rm,Am,Em,Dm,Lm,Xm,Nm,jm,zm,Im,Wm,qm,Vm,Ym,Bm,Um,Gm,Fm,Hm,Km,Jm,eg,tg,ig,ng,og,rg,sg,ag,lg,cg,hg,dg,ug,pg,fg,mg,gg,Og,vg,yg,bg,xg,wg,kg,Sg,Qg,$g,Tg,Pg,_g,Cg,Mg,Zg,Rg,Ag,Eg,Dg,Lg,Xg,Ng,jg,zg,Ig,Wg,qg,Vg,Yg,Bg,Ug,Gg,Fg,Hg,Kg,Jg,eO,tO,iO,nO,oO,rO,sO,aO,lO,cO,hO,dO,uO,pO,fO,mO,gO,OO,vO,yO,bO,xO,wO,kO,SO,QO,$O,TO,PO,_O,CO,MO,ZO;function RO(e){if(e<768)return!1;for(let t=0,i=Dt.length;;){let n=t+i>>1;if(e<Dt[n])i=n;else{if(!(e>=Lt[n]))return!0;t=n+1}if(t==i)return!1}}function AO(e){return e>=127462&&e<=127487}function EO(e,t,i=!0,n=!0){return(i?DO:LO)(e,t,n)}function DO(e,t,i){if(t==e.length)return t;t&&NO(e.charCodeAt(t))&&jO(e.charCodeAt(t-1))&&t--;let n=XO(e,t);for(t+=zO(n);t<e.length;){let o=XO(e,t);if(n==Xt||o==Xt||i&&RO(o))t+=zO(o),n=o;else{if(!AO(o))break;{let i=0,n=t-2;for(;n>=0&&AO(XO(e,n));)i++,n-=2;if(i%2==0)break;t+=2}}}return t}function LO(e,t,i){for(;t>0;){let n=DO(e,t-2,i);if(n<t)return n;t--}return 0}function XO(e,t){let i=e.charCodeAt(t);if(!jO(i)||t+1==e.length)return i;let n=e.charCodeAt(t+1);return NO(n)?n-56320+(i-55296<<10)+65536:i}function NO(e){return e>=56320&&e<57344}function jO(e){return e>=55296&&e<56320}function zO(e){return e<65536?1:2}function IO(e,t,i=0,n=1e9){for(let o=0,r=0,s=!0;r<e.length&&o<=n;r++){let a=e[r],l=o+a.length;l>=i&&(l>n&&(a=a.slice(0,n-o)),o<i&&(a=a.slice(i-o)),s?(t[t.length-1]+=a,s=!1):t.push(a)),o=l+1}return t}function WO(e,t,i){return IO(e,[""],t,i)}function qO(e,t,i){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,i))]}function VO(e,t,i=!0,n=!0){return EO(e,t,i,n)}function YO(e,t){let i=e.charCodeAt(t);if(!((n=i)>=55296&&n<56320&&t+1!=e.length))return i;var n;let o=e.charCodeAt(t+1);return function(e){return e>=56320&&e<57344}(o)?o-56320+(i-55296<<10)+65536:i}function BO(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function UO(e){return e<65536?1:2}function GO(e,t,i,n=!1){if(0==t&&i<=0)return;let o=e.length-2;o>=0&&i<=0&&i==e[o+1]?e[o]+=t:o>=0&&0==t&&0==e[o]?e[o+1]+=i:n?(e[o]+=t,e[o+1]+=i):e.push(t,i)}function FO(e,t,i){if(0==i.length)return;let n=t.length-2>>1;if(n<e.length)e[e.length-1]=e[e.length-1].append(i);else{for(;e.length<n;)e.push(Nt.empty);e.push(i)}}function HO(e,t,i){let n=e.inserted;for(let o=0,r=0,s=0;s<e.sections.length;){let a=e.sections[s++],l=e.sections[s++];if(l<0)o+=a,r+=a;else{let c=o,h=r,d=Nt.empty;for(;c+=a,h+=l,l&&n&&(d=d.append(n[s-2>>1])),!(i||s==e.sections.length||e.sections[s+1]<0);)a=e.sections[s++],l=e.sections[s++];t(o,c,r,h,d),o=c,r=h}}}function KO(e,t,i,n=!1){let o=[],r=n?[]:null,s=new Ft(e),a=new Ft(t);for(let l=-1;;){if(s.done&&a.len||a.done&&s.len)throw new Error("Mismatched change set lengths");if(-1==s.ins&&-1==a.ins){let e=Math.min(s.len,a.len);GO(o,e,-1),s.forward(e),a.forward(e)}else if(a.ins>=0&&(s.ins<0||l==s.i||0==s.off&&(a.len<s.len||a.len==s.len&&!i))){let e=a.len;for(GO(o,a.ins,-1);e;){let t=Math.min(s.len,e);s.ins>=0&&l<s.i&&s.len<=t&&(GO(o,0,s.ins),r&&FO(r,o,s.text),l=s.i),s.forward(t),e-=t}a.next()}else{if(!(s.ins>=0)){if(s.done&&a.done)return r?Gt.createSet(o,r):Ut.create(o);throw new Error("Mismatched change set lengths")}{let e=0,t=s.len;for(;t;)if(-1==a.ins){let i=Math.min(t,a.len);e+=i,t-=i,a.forward(i)}else{if(!(0==a.ins&&a.len<t))break;t-=a.len,a.next()}GO(o,e,l<s.i?s.ins:0),r&&l<s.i&&FO(r,o,s.text),l=s.i,s.forward(s.len-t)}}}}function JO(e,t,i=!1){let n=[],o=i?[]:null,r=new Ft(e),s=new Ft(t);for(let a=!1;;){if(r.done&&s.done)return o?Gt.createSet(n,o):Ut.create(n);if(0==r.ins)GO(n,r.len,0,a),r.next();else if(0!=s.len||s.done){if(r.done||s.done)throw new Error("Mismatched change set lengths");{let e=Math.min(r.len2,s.len),t=n.length;if(-1==r.ins){let t=-1==s.ins?-1:s.off?0:s.ins;GO(n,e,t,a),o&&t&&FO(o,n,s.text)}else-1==s.ins?(GO(n,r.off?0:r.len,e,a),o&&FO(o,n,r.textBit(e))):(GO(n,r.off?0:r.len,s.off?0:s.ins,a),o&&!s.off&&FO(o,n,s.text));a=(r.ins>e||s.ins>=0&&s.len>e)&&(a||n.length>t),r.forward2(e),s.forward(e)}}else GO(n,0,s.ins,a),o&&FO(o,n,s.text),s.next()}}function ev(e,t){for(let i of e.ranges)if(i.to>t)throw new RangeError("Selection points outside of document")}function tv(e,t){return e==t||e.length==t.length&&e.every(((e,i)=>e===t[i]))}function iv(e,t,i){if(e.length!=t.length)return!1;for(let n=0;n<e.length;n++)if(!i(e[n],t[n]))return!1;return!0}function nv(e,t){let i=!1;for(let n of t)1&sv(e,n)&&(i=!0);return i}function ov(e,t,i){let n=i.map((t=>e[t.id])),o=i.map((e=>e.type)),r=n.filter((e=>!(1&e))),s=e[t.id]>>1;function a(e){let i=[];for(let t=0;t<n.length;t++){let r=av(e,n[t]);if(2==o[t])for(let e of r)i.push(e);else i.push(r)}return t.combine(i)}return{create(e){for(let t of n)sv(e,t);return e.values[s]=a(e),1},update(e,i){if(!nv(e,r))return 0;let n=a(e);return t.compare(n,e.values[s])?0:(e.values[s]=n,1)},reconfigure(e,o){let r=nv(e,n),l=o.config.facets[t.id],c=o.facet(t);if(l&&!r&&tv(i,l))return e.values[s]=c,0;let h=a(e);return t.compare(h,c)?(e.values[s]=c,0):(e.values[s]=h,1)}}}function rv(e){return t=>new si(t,e)}function sv(e,t){if(1&t)return 2;let i=t>>1,n=e.status[i];if(4==n)throw new Error("Cyclic dependency between fields and/or facets");if(2&n)return n;e.status[i]=4;let o=e.computeSlot(e,e.config.dynamicSlots[i]);return e.status[i]=2|o}function av(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}function lv(e,t){let i=[];for(let n=0,o=0;;){let r,s;if(n<e.length&&(o==t.length||t[o]>=e[n]))r=e[n++],s=e[n++];else{if(!(o<t.length))return i;r=t[o++],s=t[o++]}!i.length||i[i.length-1]<r?i.push(r,s):i[i.length-1]<s&&(i[i.length-1]=s)}}function cv(e,t,i){var n;let o,r,s;return i?(o=t.changes,r=Gt.empty(t.changes.length),s=e.changes.compose(t.changes)):(o=t.changes.map(e.changes),r=e.changes.mapDesc(t.changes,!0),s=e.changes.compose(o)),{changes:s,selection:t.selection?t.selection.map(r):null===(n=e.selection)||void 0===n?void 0:n.map(o),effects:bi.mapEffects(e.effects,o).concat(bi.mapEffects(t.effects,r)),annotations:e.annotations.length?e.annotations.concat(t.annotations):t.annotations,scrollIntoView:e.scrollIntoView||t.scrollIntoView}}function hv(e,t,i){let n=t.selection,o=uv(t.annotations);return t.userEvent&&(o=o.concat(xi.userEvent.of(t.userEvent))),{changes:t.changes instanceof Gt?t.changes:Gt.of(t.changes||[],i,e.facet(ui)),selection:n&&(n instanceof Kt?n:Kt.single(n.anchor,n.head)),effects:uv(t.effects),annotations:o,scrollIntoView:!!t.scrollIntoView}}function dv(e,t,i){let n=hv(e,t.length?t[0]:{},e.doc.length);t.length&&!1===t[0].filter&&(i=!1);for(let r=1;r<t.length;r++){!1===t[r].filter&&(i=!1);let o=!!t[r].sequential;n=cv(n,hv(e,t[r],o?n.changes.newLength:e.doc.length),o)}let o=xi.create(e,n.changes,n.selection,n.effects,n.annotations,n.scrollIntoView);return function(e){let t=e.startState,i=t.facet(mi),n=e;for(let o=i.length-1;o>=0;o--){let r=i[o](e);r&&Object.keys(r).length&&(n=cv(n,hv(t,r,e.changes.newLength),!0))}return n==e?e:xi.create(t,e.changes,e.selection,n.effects,n.annotations,n.scrollIntoView)}(i?function(e){let t=e.startState,i=!0;for(let o of t.facet(pi)){let t=o(e);if(!1===t){i=!1;break}Array.isArray(t)&&(i=!0===i?t:lv(i,t))}if(!0!==i){let n,o;if(!1===i)o=e.changes.invertedDesc,n=Gt.empty(t.doc.length);else{let t=e.changes.filter(i);n=t.changes,o=t.filtered.mapDesc(t.changes).invertedDesc}e=xi.create(t,n,e.selection&&e.selection.map(o),bi.mapEffects(e.effects,o),e.annotations,e.scrollIntoView)}let n=t.facet(fi);for(let o=n.length-1;o>=0;o--){let i=n[o](e);e=i instanceof xi?i:Array.isArray(i)&&1==i.length&&i[0]instanceof xi?i[0]:dv(t,uv(i),!1)}return e}(o):o)}function uv(e){return null==e?wi:Array.isArray(e)?e:[e]}function pv(e){return t=>{if(!/\S/.test(t))return ki.Space;if(function(e){if(Qi)return Qi.test(e);for(let t=0;t<e.length;t++){let i=e[t];if(/\w/.test(i)||i>"€"&&(i.toUpperCase()!=i.toLowerCase()||Si.test(i)))return!0}return!1}(t))return ki.Word;for(let i=0;i<e.length;i++)if(t.indexOf(e[i])>-1)return ki.Word;return ki.Other}}function fv(e,t,i={}){let n={};for(let o of e)for(let e of Object.keys(o)){let t=o[e],r=n[e];if(void 0===r)n[e]=t;else if(r===t||void 0===t);else{if(!Object.hasOwnProperty.call(i,e))throw new Error("Config merge conflict for field "+e);n[e]=i[e](r,t)}}for(let o in t)void 0===n[o]&&(n[o]=t[o]);return n}function mv(e,t){return e==t||e.constructor==t.constructor&&e.eq(t)}function gv(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}function Ov(e,t,i){let n=new Map;for(let r of e)for(let e=0;e<r.chunk.length;e++)r.chunk[e].maxPoint<=0&&n.set(r.chunk[e],r.chunkPos[e]);let o=new Set;for(let r of t)for(let e=0;e<r.chunk.length;e++){let t=n.get(r.chunk[e]);null==t||(i?i.mapPos(t):t)!=r.chunkPos[e]||(null==i?void 0:i.touchesRange(t,t+r.chunk[e].length))||o.add(r.chunk[e])}return o}function vv(e,t){for(let i=e[t];;){let n=1+(t<<1);if(n>=e.length)break;let o=e[n];if(n+1<e.length&&o.compare(e[n+1])>=0&&(o=e[n+1],n++),i.compare(o)<0)break;e[n]=i,e[t]=o,t=n}}function yv(e,t,i,n,o,r){e.goto(t),i.goto(n);let s=n+o,a=n,l=n-t,c=!!r.boundChange;for(let h=!1;;){let t=e.to+l-i.to,n=t||e.endSide-i.endSide,o=n<0?e.to+l:i.to,d=Math.min(o,s);if(e.point||i.point?(e.point&&i.point&&mv(e.point,i.point)&&bv(e.activeForPoint(e.to),i.activeForPoint(i.to))||r.comparePoint(a,d,e.point,i.point),h=!1):(h&&r.boundChange(a),d>a&&!bv(e.active,i.active)&&r.compareRange(a,d,e.active,i.active),c&&d<s&&(t||e.openEnd(o)!=i.openEnd(o))&&(h=!0)),o>s)break;a=o,n<=0&&e.next(),n>=0&&i.next()}}function bv(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++)if(e[i]!=t[i]&&!mv(e[i],t[i]))return!1;return!0}function xv(e,t){for(let i=t,n=e.length-1;i<n;i++)e[i]=e[i+1];e.pop()}function wv(e,t,i){for(let n=e.length-1;n>=t;n--)e[n+1]=e[n];e[t]=i}function kv(e,t){let i=-1,n=1e9;for(let o=0;o<t.length;o++)(t[o]-n||e[o].endSide-e[i].endSide)<0&&(i=o,n=t[o]);return i}function Sv(e,t,i=e.length){let n=0;for(let o=0;o<i&&o<e.length;)9==e.charCodeAt(o)?(n+=t-n%t,o++):(n++,o=VO(e,o));return n}function Qv(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,i=arguments[1];if(i&&"object"==typeof i&&null==i.nodeType&&!Array.isArray(i)){for(var n in i)if(Object.prototype.hasOwnProperty.call(i,n)){var o=i[n];"string"==typeof o?e.setAttribute(n,o):null!=o&&(e[n]=o)}t++}for(;t<arguments.length;t++)$v(e,arguments[t]);return e}function $v(e,t){if("string"==typeof t)e.appendChild(document.createTextNode(t));else if(null==t);else if(null!=t.nodeType)e.appendChild(t);else{if(!Array.isArray(t))throw new RangeError("Unsupported child node: "+t);for(var i=0;i<t.length;i++)$v(e,t[i])}}function Tv(e,t){for(let i in e)"class"==i&&t.class?t.class+=" "+e.class:"style"==i&&t.style?t.style+=";"+e.style:t[i]=e[i];return t}function Pv(e,t,i){if(e==t)return!0;e||(e=an),t||(t=an);let n=Object.keys(e),o=Object.keys(t);if(n.length-(i&&n.indexOf(i)>-1?1:0)!=o.length-(i&&o.indexOf(i)>-1?1:0))return!1;for(let r of n)if(r!=i&&(-1==o.indexOf(r)||e[r]!==t[r]))return!1;return!0}function _v(e,t,i){let n=!1;if(t)for(let o in t)i&&o in i||(n=!0,"style"==o?e.style.cssText="":e.removeAttribute(o));if(i)for(let o in i)t&&t[o]==i[o]||(n=!0,"style"==o?e.style.cssText=i[o]:e.setAttribute(o,i[o]));return n}function Cv(e){let t=Object.create(null);for(let i=0;i<e.attributes.length;i++){let n=e.attributes[i];t[n.name]=n.value}return t}function Mv(e,t=!1){let{inclusiveStart:i,inclusiveEnd:n}=e;return null==i&&(i=e.inclusive),null==n&&(n=e.inclusive),{start:null!=i?i:t,end:null!=n?n:t}}function Zv(e,t,i,n=0){let o=i.length-1;o>=0&&i[o]+n>=e?i[o]=Math.max(i[o],t):i.push(e,t)}function Rv(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function Av(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function Ev(e,t){if(!t.anchorNode)return!1;try{return Av(e,t.anchorNode)}catch(i){return!1}}function Dv(e){return 3==e.nodeType?Yv(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function Lv(e,t,i,n){return!!i&&(jv(e,t,i,n,-1)||jv(e,t,i,n,1))}function Xv(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function Nv(e){return 1==e.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(e.nodeName)}function jv(e,t,i,n,o){for(;;){if(e==i&&t==n)return!0;if(t==(o<0?0:zv(e))){if("DIV"==e.nodeName)return!1;let i=e.parentNode;if(!i||1!=i.nodeType)return!1;t=Xv(e)+(o<0?0:1),e=i}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(o<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=o<0?zv(e):0}}}function zv(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function Iv(e,t){let i=t?e.left:e.right;return{left:i,right:i,top:e.top,bottom:e.bottom}}function Wv(e){let t=e.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function qv(e,t){let i=t.width/e.offsetWidth,n=t.height/e.offsetHeight;return(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.width-e.offsetWidth)<1)&&(i=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.height-e.offsetHeight)<1)&&(n=1),{scaleX:i,scaleY:n}}function Vv(e){if(e.setActive)return e.setActive();if(gn)return e.focus(gn);let t=[];for(let i=e;i&&(t.push(i,i.scrollTop,i.scrollLeft),i!=i.ownerDocument);i=i.parentNode);if(e.focus(null==gn?{get preventScroll(){return gn={preventScroll:!0},!0}}:void 0),!gn){gn=!1;for(let e=0;e<t.length;){let i=t[e++],n=t[e++],o=t[e++];i.scrollTop!=n&&(i.scrollTop=n),i.scrollLeft!=o&&(i.scrollLeft=o)}}}function Yv(e,t,i=t){let n=On||(On=document.createRange());return n.setEnd(e,i),n.setStart(e,t),n}function Bv(e,t,i,n){let o={key:t,code:t,keyCode:i,which:i,cancelable:!0};n&&({altKey:o.altKey,ctrlKey:o.ctrlKey,shiftKey:o.shiftKey,metaKey:o.metaKey}=n);let r=new KeyboardEvent("keydown",o);r.synthetic=!0,e.dispatchEvent(r);let s=new KeyboardEvent("keyup",o);return s.synthetic=!0,e.dispatchEvent(s),r.defaultPrevented||s.defaultPrevented}function Uv(e){return e.scrollTop>Math.max(1,e.scrollHeight-e.clientHeight-4)}function Gv(e,t){for(let i=e,n=t;;){if(3==i.nodeType&&n>0)return{node:i,offset:n};if(1==i.nodeType&&n>0){if("false"==i.contentEditable)return null;i=i.childNodes[n-1],n=zv(i)}else{if(!i.parentNode||Nv(i))return null;n=Xv(i),i=i.parentNode}}}function Fv(e,t){for(let i=e,n=t;;){if(3==i.nodeType&&n<i.nodeValue.length)return{node:i,offset:n};if(1==i.nodeType&&n<i.childNodes.length){if("false"==i.contentEditable)return null;i=i.childNodes[n],n=0}else{if(!i.parentNode||Nv(i))return null;n=Xv(i)+1,i=i.parentNode}}}function Hv(e){let t=[];for(let i=0;i<e.length;i++)t.push(1<<+e[i]);return t}function Kv(e){return e<=247?wn[e]:1424<=e&&e<=1524?2:1536<=e&&e<=1785?kn[e-1536]:1774<=e&&e<=2220?4:8192<=e&&e<=8204?256:64336<=e&&e<=65023?4:1}function Jv(e,t){if(e.length!=t.length)return!1;for(let i=0;i<e.length;i++){let n=e[i],o=t[i];if(n.from!=o.from||n.to!=o.to||n.direction!=o.direction||!Jv(n.inner,o.inner))return!1}return!0}function ey(e,t,i,n,o,r,s){let a=n%2?2:1;if(n%2==o%2)for(let l=t,c=0;l<i;){let t=!0,h=!1;if(c==r.length||l<r[c].from){let e=Pn[l];e!=a&&(t=!1,h=16==e)}let d=t||1!=a?null:[],u=t?n:n+1,p=l;e:for(;;)if(c<r.length&&p==r[c].from){if(h)break e;let f=r[c];if(!t)for(let e=f.to,t=c+1;;){if(e==i)break e;if(!(t<r.length&&r[t].from==e)){if(Pn[e]==a)break e;break}e=r[t++].to}c++,d?d.push(f):(f.from>l&&s.push(new Tn(l,f.from,u)),ty(e,f.direction==bn!=!(u%2)?n+1:n,o,f.inner,f.from,f.to,s),l=f.to),p=f.to}else{if(p==i||(t?Pn[p]!=a:Pn[p]==a))break;p++}d?ey(e,l,p,n+1,o,d,s):l<p&&s.push(new Tn(l,p,u)),l=p}else for(let l=i,c=r.length;l>t;){let i=!0,h=!1;if(!c||l>r[c-1].to){let e=Pn[l-1];e!=a&&(i=!1,h=16==e)}let d=i||1!=a?null:[],u=i?n:n+1,p=l;e:for(;;)if(c&&p==r[c-1].to){if(h)break e;let f=r[--c];if(!i)for(let e=f.from,i=c;;){if(e==t)break e;if(!i||r[i-1].to!=e){if(Pn[e-1]==a)break e;break}e=r[--i].from}d?d.push(f):(f.to<l&&s.push(new Tn(f.to,l,u)),ty(e,f.direction==bn!=!(u%2)?n+1:n,o,f.inner,f.from,f.to,s),l=f.from),p=f.from}else{if(p==t||(i?Pn[p-1]!=a:Pn[p-1]==a))break;p--}d?ey(e,p,l,n+1,o,d,s):p<l&&s.push(new Tn(p,l,u)),l=p}}function ty(e,t,i,n,o,r,s){let a=t%2?2:1;!function(e,t,i,n,o){for(let r=0;r<=n.length;r++){let s=r?n[r-1].to:t,a=r<n.length?n[r].from:i,l=r?256:o;for(let t=s,i=l,n=l;t<a;t++){let o=Kv(e.charCodeAt(t));512==o?o=i:8==o&&4==n&&(o=16),Pn[t]=4==o?2:o,7&o&&(n=o),i=o}for(let e=s,t=l,n=l;e<a;e++){let o=Pn[e];if(128==o)e<a-1&&t==Pn[e+1]&&24&t?o=Pn[e]=t:Pn[e]=256;else if(64==o){let o=e+1;for(;o<a&&64==Pn[o];)o++;let r=e&&8==t||o<i&&8==Pn[o]?1==n?1:8:256;for(let t=e;t<o;t++)Pn[t]=r;e=o-1}else 8==o&&1==n&&(Pn[e]=1);t=o,7&o&&(n=o)}}}(e,o,r,n,a),function(e,t,i,n,o){let r=1==o?2:1;for(let s=0,a=0,l=0;s<=n.length;s++){let c=s?n[s-1].to:t,h=s<n.length?n[s].from:i;for(let t,i,n,s=c;s<h;s++)if(i=Sn[t=e.charCodeAt(s)])if(i<0){for(let e=a-3;e>=0;e-=3)if(Qn[e+1]==-i){let t=Qn[e+2],i=2&t?o:4&t?1&t?r:o:0;i&&(Pn[s]=Pn[Qn[e]]=i),a=e;break}}else{if(189==Qn.length)break;Qn[a++]=s,Qn[a++]=t,Qn[a++]=l}else if(2==(n=Pn[s])||1==n){let e=n==o;l=e?0:1;for(let t=a-3;t>=0;t-=3){let i=Qn[t+2];if(2&i)break;if(e)Qn[t+2]|=2;else{if(4&i)break;Qn[t+2]|=4}}}}}(e,o,r,n,a),function(e,t,i,n){for(let o=0,r=n;o<=i.length;o++){let s=o?i[o-1].to:e,a=o<i.length?i[o].from:t;for(let l=s;l<a;){let s=Pn[l];if(256==s){let s=l+1;for(;;)if(s==a){if(o==i.length)break;s=i[o++].to,a=o<i.length?i[o].from:t}else{if(256!=Pn[s])break;s++}let c=1==r,h=c==(1==(s<t?Pn[s]:n))?c?1:2:n;for(let t=s,n=o,r=n?i[n-1].to:e;t>l;)t==r&&(t=i[--n].from,r=n?i[n-1].to:e),Pn[--t]=h;l=s}else r=s,l++}}}(o,r,n,a),ey(e,o,r,t,i,n,s)}function iy(e){return[new Tn(0,e,0)]}function ny(e,t,i,n,o){var r;let s=n.head-e.from,a=Tn.find(t,s,null!==(r=n.bidiLevel)&&void 0!==r?r:-1,n.assoc),l=t[a],c=l.side(o,i);if(s==c){let e=a+=o?1:-1;if(e<0||e>=t.length)return null;l=t[a=e],s=l.side(!o,i),c=l.side(o,i)}let h=VO(e.text,s,l.forward(o,i));(h<l.from||h>l.to)&&(h=c),_n=e.text.slice(Math.min(s,h),Math.max(s,h));let d=a==(o?t.length-1:0)?null:t[a+(o?1:-1)];return d&&h==c&&d.level+(o?0:1)<l.level?Kt.cursor(d.side(!o,i)+e.from,d.forward(o,i)?1:-1,d.level):Kt.cursor(h+e.from,l.forward(o,i)?-1:1,l.level)}function oy(e,t,i){for(let n=t;n<i;n++){let t=Kv(e.charCodeAt(n));if(1==t)return bn;if(2==t||4==t)return xn}return bn}function ry(e,t,i){let n=e.facet(Rn);n.length?n[0](t):window.onerror&&window.onerror(String(t),i,void 0,void 0,t)||(i?console.error(i+":",t):console.error(t))}function sy(e,t){let i=e.state.facet(io);if(!i.length)return i;let n=i.map((t=>t instanceof Function?t(e):t)),o=[];return Ci.spans(n,t.from,t.to,{point(){},span(e,i,n,r){let s=e-t.from,a=i-t.from,l=o;for(let o=n.length-1;o>=0;o--,r--){let e,i=n[o].spec.bidiIsolate;if(null==i&&(i=oy(t.text,s,a)),r>0&&l.length&&(e=l[l.length-1]).to==s&&e.direction==i)e.to=a,l=e.inner;else{let e={from:s,to:a,direction:i,inner:[]};l.push(e),l=e.inner}}}}),o}function ay(e){let t=0,i=0,n=0,o=0;for(let r of e.state.facet(no)){let s=r(e);s&&(null!=s.left&&(t=Math.max(t,s.left)),null!=s.right&&(i=Math.max(i,s.right)),null!=s.top&&(n=Math.max(n,s.top)),null!=s.bottom&&(o=Math.max(o,s.bottom)))}return{left:t,right:i,top:n,bottom:o}}function ly(e){let t=e.nextSibling;return e.parentNode.removeChild(e),t}function cy(e,t){let i=e.coordsIn(0,1),n=t.coordsIn(0,1);return i&&n&&n.top<i.bottom}function hy(e,t){let i=e=>{for(let n of e.children)if((t?n.isText():n.length)||i(n))return!0;return!1};return i(e)}function dy(e){let t=lo.get(e);return t&&t.setDOM(e.cloneNode()),e}function uy(e,t){let i=null==t?void 0:t.get(e);if(1!=i){null==i&&e.destroy();for(let i of e.children)uy(i,t)}}function py(e,t){let i=e.observer.selectionRange;if(!i.focusNode)return null;let n=Gv(i.focusNode,i.focusOffset),o=Fv(i.focusNode,i.focusOffset),r=n||o;if(o&&n&&o.node!=n.node){let t=lo.get(o.node);if(!t||t.isText()&&t.text!=o.node.nodeValue)r=o;else if(e.docView.lastCompositionAfterCursor){let e=lo.get(n.node);!e||e.isText()&&e.text!=n.node.nodeValue||(r=o)}}if(e.docView.lastCompositionAfterCursor=r!=n,!r)return null;let s=t-r.offset;return{from:s,to:s+r.node.nodeValue.length,node:r.node}}function fy(e,t,i,n,o){let r=Math.round((n-t.left)*e.defaultCharacterWidth);if(e.lineWrapping&&i.height>1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;r+=Math.floor((o-i.top-.5*(e.defaultLineHeight-t))/t)*e.viewState.heightOracle.lineLength}let s=e.state.sliceDoc(i.from,i.to);return i.from+function(e,t,i,n){for(let o=0,r=0;;){if(r>=t)return o;if(o==e.length)break;r+=9==e.charCodeAt(o)?i-r%i:1,o=VO(e,o)}return!0===n?-1:e.length}(s,r,e.state.tabSize)}function my(e,t,i){let n=e.lineBlockAt(t);if(Array.isArray(n.type)){let e;for(let o of n.type){if(o.from>t)break;if(!(o.to<t)){if(o.from<t&&o.to>t)return o;e&&(o.type!=cn.Text||e.type==o.type&&!(i<0?o.from<t:o.to>t))||(e=o)}}return e||n}return n}function gy(e,t,i,n){let o=e.state.doc.lineAt(t.head),r=e.bidiSpans(o),s=e.textDirectionAt(o.from);for(let a=t,l=null;;){let t=ny(o,r,s,a,i),c=_n;if(!t){if(o.number==(i?e.state.doc.lines:1))return a;c="\n",o=e.state.doc.line(o.number+(i?1:-1)),r=e.bidiSpans(o),t=e.visualLineSide(o,!i)}if(l){if(!l(c))return a}else{if(!n)return t;l=n(c)}a=t}}function Oy(e,t,i){for(;;){let n=0;for(let o of e)o.between(t-1,t+1,((e,o,r)=>{if(t>e&&t<o){let r=n||i||(t-e<o-t?-1:1);t=r<0?e:o,n=r}}));if(!n)return t}}function vy(e,t){let i=null;for(let n=0;n<t.ranges.length;n++){let o=t.ranges[n],r=null;if(o.empty){let t=Oy(e,o.from,0);t!=o.from&&(r=Kt.cursor(t,-1))}else{let t=Oy(e,o.from,-1),i=Oy(e,o.to,1);t==o.from&&i==o.to||(r=Kt.range(o.from==o.anchor?t:i,o.from==o.head?t:i))}r&&(i||(i=t.ranges.slice()),i[n]=r)}return i?Kt.create(i,t.mainIndex):t}function yy(e,t,i){let n=Oy(e.state.facet(to).map((t=>t(e))),i.from,t.head>i.from?-1:1);return n==i.from?i:Kt.cursor(n,n<i.from?1:-1)}function by(e,t,i,n){let o,r=e.contentDOM.getBoundingClientRect(),s=r.top+e.viewState.paddingTop,{x:a,y:l}=t,c=l-s;for(;;){if(c<0)return new Zo(0,1);if(c>e.viewState.docHeight)return new Zo(e.state.doc.length,-1);if(o=e.elementAtHeight(c),null==n)break;if(o.type==cn.Text){let t=e.docView.coordsAt(n<0?o.from:o.to,n);if(t&&(n<0?t.top<=c+s:t.bottom>=c+s))break}let t=e.viewState.heightOracle.textHeight/2;c=n>0?o.bottom+t:o.top-t}if(e.viewport.from>=o.to||e.viewport.to<=o.from){if(i)return null;if(o.type==cn.Text){let t=fy(e,r,o,a,l);return new Zo(t,t==o.from?1:-1)}}if(o.type!=cn.Text)return c<(o.top+o.bottom)/2?new Zo(o.from,1):new Zo(o.to,-1);let h=e.docView.lineAt(o.from,2);return h&&h.length==o.length||(h=e.docView.lineAt(o.from,-2)),xy(e,h,o.from,a,l)}function xy(e,t,i,n,o){let r=-1,s=null,a=1e9,l=1e9,c=o,h=o,d=(e,t)=>{for(let i=0;i<e.length;i++){let d=e[i];if(d.top==d.bottom)continue;let u=d.left>n?d.left-n:d.right<n?n-d.right:0,p=d.top>o?d.top-o:d.bottom<o?o-d.bottom:0;d.top<=h&&d.bottom>=c&&(c=Math.min(d.top,c),h=Math.max(d.bottom,h),p=0),(r<0||(p-l||u-a)<0)&&(r>=0&&l&&a<u&&s.top<=h-2&&s.bottom>=c+2?l=0:(r=t,a=u,l=p,s=d))}};if(t.isText()){for(let e=0;e<t.length;){let i=VO(t.text,e);if(d(Yv(t.dom,e,i).getClientRects(),e),!a&&!l)break;e=i}return n>(s.left+s.right)/2==(wy(e,r+i)==yn.LTR)?new Zo(i+VO(t.text,r),-1):new Zo(i+r,1)}{if(!t.length)return new Zo(i,1);for(let e=0;e<t.children.length;e++){let i=t.children[e];if(!(48&i.flags||(d((1==i.dom.nodeType?i.dom:Yv(i.dom,0,i.length)).getClientRects(),e),a||l)))break}let c=t.children[r],h=t.posBefore(c,i);return c.isComposite()||c.isText()?xy(e,c,h,Math.max(s.left,Math.min(s.right,n)),o):n>(s.left+s.right)/2==(wy(e,r+i)==yn.LTR)?new Zo(h+c.length,-1):new Zo(h,1)}}function wy(e,t){let i=e.state.doc.lineAt(t);return e.bidiSpans(i)[Tn.find(e.bidiSpans(i),t-i.from,-1,1)].dir}function ky(e,t,i){for(;;){if(!t||i<zv(t))return!1;if(t==e)return!0;i=Xv(t)+1,t=t.parentNode}}function Sy(e,t){let i;for(;e!=t&&e;e=e.nextSibling){let t=lo.get(e);if(!(null==t?void 0:t.isWidget()))return!1;t&&(i||(i=[])).push(t)}if(i)for(let n of i){let e=n.overrideDOMText;if(null==e?void 0:e.length)return!1}return!0}function Qy(e,t,i,n){if(e.isComposite()){let o=-1,r=-1,s=-1,a=-1;for(let l=0,c=n,h=n;l<e.children.length;l++){let n=e.children[l],d=c+n.length;if(c<t&&d>i)return Qy(n,t,i,c);if(d>=t&&-1==o&&(o=l,r=c),c>i&&n.dom.parentNode==e.dom){s=l,a=h;break}h=d,c=d+n.breakAfter}return{from:r,to:a<0?n+e.length:a,startDOM:(o?e.children[o-1].dom.nextSibling:null)||e.dom.firstChild,endDOM:s<e.children.length&&s>=0?e.children[s].dom:null}}return e.isText()?{from:n,to:n+e.length,startDOM:e.dom,endDOM:e.dom.nextSibling}:null}function $y(e,t){let i,{newSel:n}=t,o=e.state.selection.main,r=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:n,to:s}=t.bounds,a=o.from,l=null;(8===r||sn.android&&t.text.length<s-n)&&(a=o.to,l="end");let c=Py(e.state.doc.sliceString(n,s,Ro),t.text,a-n,l);c&&(sn.chrome&&13==r&&c.toB==c.from+2&&t.text.slice(c.from,c.toB)==Ro+Ro&&c.toB--,i={from:n+c.from,to:n+c.toA,insert:Nt.of(t.text.slice(c.from,c.toB).split(Ro))})}else n&&(!e.hasFocus&&e.state.facet(Vn)||n.main.eq(o))&&(n=null);if(!i&&!n)return!1;if(!i&&t.typeOver&&!o.empty&&n&&n.main.empty?i={from:o.from,to:o.to,insert:e.state.doc.slice(o.from,o.to)}:(sn.mac||sn.android)&&i&&i.from==i.to&&i.from==o.head-1&&/^\. ?$/.test(i.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(n&&2==i.insert.length&&(n=Kt.single(n.main.anchor-1,n.main.head-1)),i={from:i.from,to:i.to,insert:Nt.of([i.insert.toString().replace("."," ")])}):i&&i.from>=o.from&&i.to<=o.to&&(i.from!=o.from||i.to!=o.to)&&o.to-o.from-(i.to-i.from)<=4?i={from:o.from,to:o.to,insert:e.state.doc.slice(o.from,i.from).append(i.insert).append(e.state.doc.slice(i.to,o.to))}:e.state.doc.lineAt(o.from).to<o.to&&e.docView.lineHasWidget(o.to)&&e.inputState.insertingTextAt>Date.now()-50?i={from:o.from,to:o.to,insert:e.state.toText(e.inputState.insertingText)}:sn.chrome&&i&&i.from==i.to&&i.from==o.head&&"\n "==i.insert.toString()&&e.lineWrapping&&(n&&(n=Kt.single(n.main.anchor-1,n.main.head-1)),i={from:o.from,to:o.to,insert:Nt.of([" "])}),i)return Ty(e,i,n,r);if(n&&!n.main.eq(o)){let t=!1,i="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),i=e.inputState.lastSelectionOrigin,"select.pointer"==i&&(n=vy(e.state.facet(to).map((t=>t(e))),n))),e.dispatch({selection:n,scrollIntoView:t,userEvent:i}),!0}return!1}function Ty(e,t,i,n=-1){if(sn.ios&&e.inputState.flushIOSKey(t))return!0;let o=e.state.selection.main;if(sn.android&&(t.to==o.to&&(t.from==o.from||t.from==o.from-1&&" "==e.state.sliceDoc(t.from,o.from))&&1==t.insert.length&&2==t.insert.lines&&Bv(e.contentDOM,"Enter",13)||(t.from==o.from-1&&t.to==o.to&&0==t.insert.length||8==n&&t.insert.length<t.to-t.from&&t.to>o.head)&&Bv(e.contentDOM,"Backspace",8)||t.from==o.from&&t.to==o.to+1&&0==t.insert.length&&Bv(e.contentDOM,"Delete",46)))return!0;let r,s=t.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a=()=>r||(r=function(e,t,i){let n,o=e.state,r=o.selection.main,s=-1;if(t.from==t.to&&t.from<r.from||t.from>r.to){let i=t.from<r.from?-1:1,n=i<0?r.from:r.to,a=Oy(o.facet(to).map((t=>t(e))),n,i);t.from==a&&(s=a)}if(s>-1)n={changes:t,selection:Kt.cursor(t.from+t.insert.length,-1)};else if(t.from>=r.from&&t.to<=r.to&&t.to-t.from>=(r.to-r.from)/3&&(!i||i.main.empty&&i.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let i=r.from<t.from?o.sliceDoc(r.from,t.from):"",s=r.to>t.to?o.sliceDoc(t.to,r.to):"";n=o.replaceSelection(e.state.toText(i+t.insert.sliceString(0,void 0,e.state.lineBreak)+s))}else{let s=o.changes(t),a=i&&i.main.to<=s.newLength?i.main:void 0;if(o.selection.ranges.length>1&&(e.inputState.composing>=0||e.inputState.compositionPendingChange)&&t.to<=r.to+10&&t.to>=r.to-10){let l,c=e.state.sliceDoc(t.from,t.to),h=i&&py(e,i.main.head);if(h){let e=t.insert.length-(t.to-t.from);l={from:h.from,to:h.to-e}}else l=e.state.doc.lineAt(r.head);let d=r.to-t.to;n=o.changeByRange((i=>{if(i.from==r.from&&i.to==r.to)return{changes:s,range:a||i.map(s)};let n=i.to-d,h=n-c.length;if(e.state.sliceDoc(h,n)!=c||n>=l.from&&h<=l.to)return{range:i};let u=o.changes({from:h,to:n,insert:t.insert}),p=i.to-r.to;return{changes:u,range:a?Kt.range(Math.max(0,a.anchor+p),Math.max(0,a.head+p)):i.map(u)}}))}else n={changes:s,selection:a&&o.selection.replaceRange(a)}}let a="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,a+=".compose",e.inputState.compositionFirstChange&&(a+=".start",e.inputState.compositionFirstChange=!1)),o.update(n,{userEvent:a,scrollIntoView:!0})}(e,t,i));return e.state.facet(En).some((i=>i(e,t.from,t.to,s,a)))||e.dispatch(a()),!0}function Py(e,t,i,n){let o=Math.min(e.length,t.length),r=0;for(;r<o&&e.charCodeAt(r)==t.charCodeAt(r);)r++;if(r==o&&e.length==t.length)return null;let s=e.length,a=t.length;for(;s>0&&a>0&&e.charCodeAt(s-1)==t.charCodeAt(a-1);)s--,a--;return"end"==n&&(i-=s+Math.max(0,r-Math.min(s,a))-r),s<r&&e.length<t.length?(r-=i<=r&&i>=s?r-i:0,a=r+(a-s),s=r):a<r&&(r-=i<=r&&i>=a?r-i:0,s=r+(s-a),a=r),{from:r,toA:s,toB:a}}function _y(e,t){return(i,n)=>{try{return t.call(e,n,i)}catch(o){ry(i.state,o)}}}function Cy(e){let t=Object.create(null);function i(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let n of e){let e=n.spec,t=e&&e.plugin.domEventHandlers,o=e&&e.plugin.domEventObservers;if(t)for(let r in t){let e=t[r];e&&i(r).handlers.push(_y(n.value,e))}if(o)for(let r in o){let e=o[r];e&&i(r).observers.push(_y(n.value,e))}}for(let n in Io)i(n).handlers.push(Io[n]);for(let n in Wo)i(n).observers.push(Wo[n]);return t}function My(e){return.7*Math.max(0,e)+8}function Zy(e,t,i){for(let n of e.facet(t))i=n(i,e);return i}function Ry(e,t){t=Zy(e.state,Ln,t);let i,{state:n}=e,o=1,r=n.toText(t),s=r.lines==n.selection.ranges.length;if(null!=Go&&n.selection.ranges.every((e=>e.empty))&&Go==r.toString()){let e=-1;i=n.changeByRange((i=>{let a=n.doc.lineAt(i.from);if(a.from==e)return{range:i};e=a.from;let l=n.toText((s?r.line(o++).text:t)+n.lineBreak);return{changes:{from:a.from,insert:l},range:Kt.cursor(i.from+l.length)}}))}else i=s?n.changeByRange((e=>{let t=r.line(o++);return{changes:{from:e.from,to:e.to,insert:t.text},range:Kt.cursor(e.from+t.length)}})):n.replaceSelection(r);e.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}function Ay(e,t,i,n){if(1==n)return Kt.cursor(t,i);if(2==n)return function(e,t,i=1){let n=e.charCategorizer(t),o=e.doc.lineAt(t),r=t-o.from;if(0==o.length)return Kt.cursor(t);0==r?i=1:r==o.length&&(i=-1);let s=r,a=r;i<0?s=VO(o.text,r,!1):a=VO(o.text,r);let l=n(o.text.slice(s,a));for(;s>0;){let e=VO(o.text,s,!1);if(n(o.text.slice(e,s))!=l)break;s=e}for(;a<o.length;){let e=VO(o.text,a);if(n(o.text.slice(a,e))!=l)break;a=e}return Kt.range(s+o.from,a+o.from)}(e.state,t,i);{let n=e.docView.lineAt(t,i),o=e.state.doc.lineAt(n?n.posAtEnd:t),r=n?n.posAtStart:o.from,s=n?n.posAtEnd:o.to;return s<e.state.doc.length&&s==o.to&&s++,Kt.range(r,s)}}function Ey(e){if(!Vo)return e.detail;let t=Yo,i=Uo;return Yo=e,Uo=Date.now(),Bo=!t||i>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(Bo+1)%3:1}function Dy(e,t){let i=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),n=Ey(t),o=e.state.selection;return{update(e){e.docChanged&&(i.pos=e.changes.mapPos(i.pos),o=o.map(e.changes))},get(t,r,s){let a,l=e.posAndSideAtCoords({x:t.clientX,y:t.clientY},!1),c=Ay(e,l.pos,l.assoc,n);if(i.pos!=l.pos&&!r){let t=Ay(e,i.pos,i.assoc,n),o=Math.min(t.from,c.from),r=Math.max(t.to,c.to);c=o<c.from?Kt.range(o,r):Kt.range(r,o)}return r?o.replaceRange(o.main.extend(c.from,c.to)):s&&1==n&&o.ranges.length>1&&(a=function(e,t){for(let i=0;i<e.ranges.length;i++){let{from:n,to:o}=e.ranges[i];if(n<=t&&o>=t)return Kt.create(e.ranges.slice(0,i).concat(e.ranges.slice(i+1)),e.mainIndex==i?0:e.mainIndex-(e.mainIndex>i?1:0))}return null}(o,l.pos))?a:s?o.addRange(c):Kt.create([c])}}}function Ly(e,t,i,n){if(!(i=Zy(e.state,Ln,i)))return;let o=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:r}=e.inputState,s=n&&r&&function(e,t){let i=e.state.facet(Mn);return i.length?i[0](t):sn.mac?!t.altKey:!t.ctrlKey}(e,t)?{from:r.from,to:r.to}:null,a={from:o,insert:i},l=e.state.changes(s?[s,a]:a);e.focus(),e.dispatch({changes:l,selection:{anchor:l.mapPos(o,-1),head:l.mapPos(o,1)},userEvent:s?"move.drop":"input.drop"}),e.inputState.draggedContent=null}function Xy(e,t){let i=[];for(let n of e.facet(Dn)){let o=n(e,t);o&&i.push(o)}return i.length?e.update({effects:i,annotations:Fo.of(!0)}):null}function Ny(e){setTimeout((()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let i=Xy(e.state,t);i?e.dispatch(i):e.update([])}}),10)}function jy(){Jo=!1}function zy(e,t){return e==t?e:(e.constructor!=t.constructor&&(Jo=!0),t)}function Iy(e,t){let i,n;null==e[t]&&(i=e[t-1])instanceof cr&&(n=e[t+1])instanceof cr&&e.splice(t-1,3,new cr(i.length+1+n.length))}function Wy(e,t){let i=e.getBoundingClientRect(),n=e.ownerDocument,o=n.defaultView||window,r=Math.max(0,i.left),s=Math.min(o.innerWidth,i.right),a=Math.max(0,i.top),l=Math.min(o.innerHeight,i.bottom);for(let c=e.parentNode;c&&c!=n.body;)if(1==c.nodeType){let t=c,i=window.getComputedStyle(t);if((t.scrollHeight>t.clientHeight||t.scrollWidth>t.clientWidth)&&"visible"!=i.overflow){let i=t.getBoundingClientRect();r=Math.max(r,i.left),s=Math.min(s,i.right),a=Math.max(a,i.top),l=Math.min(c==e.parentNode?o.innerHeight:l,i.bottom)}c="absolute"==i.position||"fixed"==i.position?t.offsetParent:t.parentNode}else{if(11!=c.nodeType)break;c=c.host}return{left:r-i.left,right:Math.max(r,s)-i.left,top:a-(i.top+t),bottom:Math.max(a,l)-(i.top+t)}}function qy(e,t){let i=e.getBoundingClientRect();return{left:0,right:i.right-i.left,top:t,bottom:i.bottom-(i.top+t)}}function Vy({total:e,ranges:t},i){if(i<=0)return t[0].from;if(i>=1)return t[t.length-1].to;let n=Math.floor(e*i);for(let o=0;;o++){let{from:e,to:i}=t[o],r=i-e;if(n<=r)return e+n;n-=r}}function Yy(e,t){let i=0;for(let{from:n,to:o}of e.ranges){if(t<=o){i+=t-n;break}i+=o-n}return i/e.total}function By(e,t){if(1==t.scale)return e;let i=t.toDOM(e.top),n=t.toDOM(e.bottom);return new ir(e.from,e.length,i,n-i,Array.isArray(e._content)?e._content.map((e=>By(e,t))):e._content)}function Uy(e,t,i){return new Xi(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,(t=>{if("&"==t)return e;if(!i||!i[t])throw new RangeError(`Unsupported selector: ${t}`);return i[t]})):e+" "+t})}function Gy(e,t,i){for(;t;){let n=lo.get(t);if(n&&n.parent==e)return n;let o=t.parentNode;t=o!=e.dom?o:i>0?t.nextSibling:t.previousSibling}return null}function Fy(e,t){let i=t.startContainer,n=t.startOffset,o=t.endContainer,r=t.endOffset,s=e.docView.domAtPos(e.state.selection.main.anchor,1);return Lv(s.node,s.offset,o,r)&&([i,n,o,r]=[o,r,i,n]),{anchorNode:i,anchorOffset:n,focusNode:o,focusOffset:r}}function Hy(e,t,i){for(let n=e.state.facet(t),o=n.length-1;o>=0;o--){let t=n[o],r="function"==typeof t?t(e):t;r&&Tv(r,i)}return i}function Ky(e,t,i){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==i&&t.shiftKey&&(e="Shift-"+e),e}function Jy(e){let t=e.facet(Dr),i=Lr.get(t);return i||Lr.set(t,i=function(e,t=Ar){let i=Object.create(null),n=Object.create(null),o=(e,t)=>{let i=n[e];if(null==i)n[e]=t;else if(i!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},r=(e,n,r,s,a)=>{var l,c;let h=i[e]||(i[e]=Object.create(null)),d=n.split(/ (?!$)/).map((e=>function(e,t){const i=e.split(/-(?!$)/);let n,o,r,s,a=i[i.length-1];"Space"==a&&(a=" ");for(let l=0;l<i.length-1;++l){const e=i[l];if(/^(cmd|meta|m)$/i.test(e))s=!0;else if(/^a(lt)?$/i.test(e))n=!0;else if(/^(c|ctrl|control)$/i.test(e))o=!0;else if(/^s(hift)?$/i.test(e))r=!0;else{if(!/^mod$/i.test(e))throw new Error("Unrecognized modifier name: "+e);"mac"==t?s=!0:o=!0}}return n&&(a="Alt-"+a),o&&(a="Ctrl-"+a),s&&(a="Meta-"+a),r&&(a="Shift-"+a),a}(e,t)));for(let t=1;t<d.length;t++){let i=d.slice(0,t).join(" ");o(i,!0),h[i]||(h[i]={preventDefault:!0,stopPropagation:!1,run:[t=>{let n=Xr={view:t,prefix:i,scope:e};return setTimeout((()=>{Xr==n&&(Xr=null)}),Nr),!0}]})}let u=d.join(" ");o(u,!1);let p=h[u]||(h[u]={preventDefault:!1,stopPropagation:!1,run:(null===(c=null===(l=h._any)||void 0===l?void 0:l.run)||void 0===c?void 0:c.slice())||[]});r&&p.run.push(r),s&&(p.preventDefault=!0),a&&(p.stopPropagation=!0)};for(let s of e){let e=s.scope?s.scope.split(" "):["editor"];if(s.any)for(let t of e){let e=i[t]||(i[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:n}=s;for(let t in e)e[t].run.push((e=>n(e,jr)))}let n=s[t]||s.key;if(n)for(let t of e)r(t,n,s.run,s.preventDefault,s.stopPropagation),s.shift&&r(t,"Shift-"+n,s.shift,s.preventDefault,s.stopPropagation)}return i}(t.reduce(((e,t)=>e.concat(t)),[]))),i}function eb(e,t,i,n){jr=t;let o=function(e){var t=!(Yi&&(e.ctrlKey||e.altKey||e.metaKey)||Vi&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?Ii:zi)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(t),r=UO(YO(o,0))==o.length&&" "!=o,s="",a=!1,l=!1,c=!1;Xr&&Xr.view==i&&Xr.scope==n&&(s=Xr.prefix+" ",jo.indexOf(t.keyCode)<0&&(l=!0,Xr=null));let h,d,u=new Set,p=e=>{if(e){for(let t of e.run)if(!u.has(t)&&(u.add(t),t(i)))return e.stopPropagation&&(c=!0),!0;e.preventDefault&&(e.stopPropagation&&(c=!0),l=!0)}return!1},f=e[n];return f&&(p(f[s+Ky(o,t,!r)])?a=!0:!r||!(t.altKey||t.metaKey||t.ctrlKey)||sn.windows&&t.ctrlKey&&t.altKey||sn.mac&&t.altKey&&!t.ctrlKey&&!t.metaKey||!(h=zi[t.keyCode])||h==o?r&&t.shiftKey&&p(f[s+Ky(o,t,!0)])&&(a=!0):(p(f[s+Ky(h,t,!0)])||t.shiftKey&&(d=Ii[t.keyCode])!=o&&d!=h&&p(f[s+Ky(d,t,!1)]))&&(a=!0),!a&&p(f._any)&&(a=!0)),l&&(a=!0),a&&c&&t.stopPropagation(),jr=null,a}function tb(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==yn.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function ib(e,t,i,n){let o=e.coordsAtPos(t,2*i);if(!o)return n;let r=e.dom.getBoundingClientRect(),s=(o.top+o.bottom)/2,a=e.posAtCoords({x:r.left+1,y:s}),l=e.posAtCoords({x:r.right-1,y:s});return null==a||null==l?n:{from:Math.max(n.from,Math.min(a,l)),to:Math.min(n.to,Math.max(a,l))}}function nb(e,t,i){if(i.to<=e.viewport.from||i.from>=e.viewport.to)return[];let n=Math.max(i.from,e.viewport.from),o=Math.min(i.to,e.viewport.to),r=e.textDirection==yn.LTR,s=e.contentDOM,a=s.getBoundingClientRect(),l=tb(e),c=s.querySelector(".cm-line"),h=c&&window.getComputedStyle(c),d=a.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),u=a.right-(h?parseInt(h.paddingRight):0),p=my(e,n,1),f=my(e,o,-1),m=p.type==cn.Text?p:null,g=f.type==cn.Text?f:null;if(m&&(e.lineWrapping||p.widgetLineBreaks)&&(m=ib(e,n,1,m)),g&&(e.lineWrapping||f.widgetLineBreaks)&&(g=ib(e,o,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return v(y(i.from,i.to,m));{let t=m?y(i.from,null,m):b(p,!1),n=g?y(null,i.to,g):b(f,!0),o=[];return(m||p).to<(g||f).from-(m&&g?1:0)||p.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2<n.top?o.push(O(d,t.bottom,u,n.top)):t.bottom<n.top&&e.elementAtHeight((t.bottom+n.top)/2).type==cn.Text&&(t.bottom=n.top=(t.bottom+n.top)/2),v(t).concat(o).concat(v(n))}function O(e,i,n,o){return new zr(t,e-l.left,i-l.top,n-e,o-i)}function v({top:e,bottom:t,horizontal:i}){let n=[];for(let o=0;o<i.length;o+=2)n.push(O(i[o],e,i[o+1],t));return n}function y(t,i,n){let o=1e9,s=-1e9,a=[];function l(t,i,l,c,h){let p=e.coordsAtPos(t,t==n.to?-2:2),f=e.coordsAtPos(l,l==n.from?2:-2);p&&f&&(o=Math.min(p.top,f.top,o),s=Math.max(p.bottom,f.bottom,s),h==yn.LTR?a.push(r&&i?d:p.left,r&&c?u:f.right):a.push(!r&&c?d:f.left,!r&&i?u:p.right))}let c=null!=t?t:n.from,h=null!=i?i:n.to;for(let r of e.visibleRanges)if(r.to>c&&r.from<h)for(let n=Math.max(r.from,c),o=Math.min(r.to,h);;){let r=e.state.doc.lineAt(n);for(let s of e.bidiSpans(r)){let e=s.from+r.from,a=s.to+r.from;if(e>=o)break;a>n&&l(Math.max(e,n),null==t&&e<=c,Math.min(a,o),null==i&&a>=h,s.dir)}if(n=r.to+1,n>=o)break}return 0==a.length&&l(c,null==t,h,null==i,e.textDirection),{top:o,bottom:s,horizontal:a}}function b(e,t){let i=a.top+(t?e.top:e.bottom);return{top:i,bottom:i,horizontal:[]}}}function ob(e){return[Un.define((t=>new Ir(t,e))),Wr.of(e)]}function rb(e){return e.startState.facet(qr)!=e.state.facet(qr)}function sb(e,t){t.style.animationDuration=e.facet(qr).cursorBlinkRate+"ms"}function ab(){return[Gr,Fr]}function lb(e,t,i,n,o){t.lastIndex=0;for(let r,s=e.iterRange(i,n),a=i;!s.next().done;a+=s.value.length)if(!s.lineBreak)for(;r=t.exec(s.value);)o(a+r.index,r)}function cb(){return ls}function hb(e={}){return ds.of(e)}function db(e){let t=e.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:t.clientHeight,right:t.clientWidth}}function ub(e,t){let i=parseInt(e.style.left,10);(isNaN(i)||Math.abs(t-i)>1)&&(e.style.left=t+"px")}function pb(e,t={}){let i=bi.define(),n=ni.define({create:()=>[],update(e,n){if(e.length&&(t.hideOnChange&&(n.docChanged||n.selection)?e=[]:t.hideOn&&(e=e.filter((e=>!t.hideOn(n,e)))),n.docChanged)){let t=[];for(let i of e){let e=n.changes.mapPos(i.pos,-1,Bt.TrackDel);if(null!=e){let o=Object.assign(Object.create(null),i);o.pos=e,null!=o.end&&(o.end=n.changes.mapPos(o.end)),t.push(o)}}e=t}for(let t of n.effects)t.is(i)&&(e=t.value),t.is(ws)&&(e=[]);return e},provide:e=>Os.from(e)});return{active:n,extension:[n,Un.define((o=>new bs(o,e,n,i,t.hoverTime||300))),ys]}}function fb(e,t){let i=e.plugin(ps);if(!i)return null;let n=i.manager.tooltips.indexOf(t);return n<0?null:i.manager.tooltipViews[n]}function mb(e,t){let i=e.plugin(Ss),n=i?i.specs.indexOf(t):-1;return n>-1?i.panels[n]:null}function gb(e){let t=e.nextSibling;return e.remove(),t}function Ob(e){return[vb(),Ms.of({...Cs,...e})]}function vb(e){let t=[Rs];return e&&!1===e.fixed&&t.push(Zs.of(!0)),t}function yb(e){return Array.isArray(e)?e:[e]}function bb(e,t,i){for(;e.value&&e.from<=i;)e.from==i&&t.push(e.value),e.next()}function xb(e,t){return e.state.facet(Ns).formatNumber(t,e.state)}function wb(e={}){return[Ns.of(e),vb(),zs]}function kb(e){let t=9;for(;t<e;)t=10*t+9;return t}function Sb(){return Ws}function Qb(e,t,i,n){switch(e){case-2:return i<t;case-1:return n>=t&&i<t;case 0:return i<t&&n>t;case 1:return i<=t&&n>t;case 2:return n>t;case 4:return!0}}function $b(e,t,i,n){for(var o;e.from==e.to||(i<1?e.from>=t:e.from>t)||(i>-1?e.to<=t:e.to<t);){let t=!n&&e instanceof ra&&e.index<0?null:e.parent;if(!t)return e;e=t}let r=n?0:ea.IgnoreOverlays;if(n)for(let s=e,a=s.parent;a;s=a,a=s.parent)s instanceof ra&&s.index<0&&(null===(o=a.enter(t,i,r))||void 0===o?void 0:o.from)!=s.from&&(e=a);for(;;){let n=e.enter(t,i,r);if(!n)return e;e=n}}function Tb(e,t,i,n){let o=e.cursor(),r=[];if(!o.firstChild())return r;if(null!=i)for(let s=!1;!s;)if(s=o.type.is(i),!o.nextSibling())return r;for(;;){if(null!=n&&o.type.is(n))return r;if(o.type.is(t)&&r.push(o.node),!o.nextSibling())return null==n?r:[]}}function Pb(e,t,i=t.length-1){for(let n=e.parent;i>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(t[i]&&t[i]!=n.name)return!1;i--}}return!0}function _b(e){if(!e.length)return null;let t=0,i=e[0];for(let r=1;r<e.length;r++){let n=e[r];(n.from>i.from||n.to<i.to)&&(i=n,t=r)}let n=i instanceof ra&&i.index<0?null:i.parent,o=e.slice();return n?o[t]=n:o.splice(t,1),new la(o,i)}function Cb(e){return e.children.some((e=>e instanceof na||!e.type.isAnonymous||Cb(e)))}function Mb(e){var t;let{buffer:i,nodeSet:n,maxBufferLength:o=qs,reused:r=[],minRepeatType:s=n.types.length}=e,a=Array.isArray(i)?new ia(i,i.length):i,l=n.types,c=0,h=0;function d(e,t,i,g,O,v){let{id:y,start:b,end:x,size:w}=a,k=h;for(;w<0;){if(a.next(),-1==w){let t=r[y];return i.push(t),void g.push(b-e)}if(-3==w)return void(c=y);if(-4==w)return void(h=y);throw new RangeError(`Unrecognized record size: ${w}`)}let S,Q,$=l[y],T=b-e;if(x-b<=o&&(Q=function(e,t){let i=a.fork(),n=0,r=0,l=0,c=i.end-o,h={size:0,start:0,skip:0};e:for(let o=i.pos-e;i.pos>o;){let e=i.size;if(i.id==t&&e>=0){h.size=n,h.start=r,h.skip=l,l+=4,n+=4,i.next();continue}let a=i.pos-e;if(e<0||a<o||i.start<c)break;let d=i.id>=s?4:0,u=i.start;for(i.next();i.pos>a;){if(i.size<0){if(-3!=i.size)break e;d+=4}else i.id>=s&&(d+=4);i.next()}r=u,n+=e,l+=d}return(t<0||n==e)&&(h.size=n,h.start=r,h.skip=l),h.size>4?h:void 0}(a.pos-t,O))){let t=new Uint16Array(Q.size-Q.skip),i=a.pos-Q.size,o=t.length;for(;a.pos>i;)o=m(Q.start,t,o);S=new na(t,x-Q.start,n),T=Q.start-e}else{let e=a.pos-w;a.next();let t=[],i=[],n=y>=s?y:-1,r=0,l=x;for(;a.pos>e;)n>=0&&a.id==n&&a.size>=0?(a.end<=l-o&&(p(t,i,b,r,a.end,l,n,k),r=t.length,l=a.end),a.next()):v>2500?u(b,e,t,i):d(b,e,t,i,n,v+1);if(n>=0&&r>0&&r<t.length&&p(t,i,b,r,b,l,n,k),t.reverse(),i.reverse(),n>-1&&r>0){let e=function(e){return(t,i,n)=>{let o,r,s=0,a=t.length-1;if(a>=0&&(o=t[a])instanceof ta){if(!a&&o.type==e&&o.length==n)return o;(r=o.prop(Bs.lookAhead))&&(s=i[a]+o.length+r)}return f(e,t,i,n,s)}}($);S=Rb($,t,i,0,t.length,0,x-b,e,e)}else S=f($,t,i,x-b,k-x)}i.push(S),g.push(T)}function u(e,t,i,r){let s=[],l=0,c=-1;for(;a.pos>t;){let{id:e,start:t,end:i,size:n}=a;if(n>4)a.next();else{if(c>-1&&t<c)break;c<0&&(c=i-o),s.push(e,t,i),l++,a.next()}}if(l){let t=new Uint16Array(4*l),o=s[s.length-2];for(let e=s.length-3,i=0;e>=0;e-=3)t[i++]=s[e],t[i++]=s[e+1]-o,t[i++]=s[e+2]-o,t[i++]=i;i.push(new na(t,s[2]-o,n)),r.push(o-e)}}function p(e,t,i,o,r,s,a,l){let c=[],h=[];for(;e.length>o;)c.push(e.pop()),h.push(t.pop()+i-r);e.push(f(n.types[a],c,h,s-r,l-s)),t.push(r-i)}function f(e,t,i,n,o=0,r){if(c){let e=[Bs.contextHash,c];r=r?[e].concat(r):[e]}if(o>25){let e=[Bs.lookAhead,o];r=r?[e].concat(r):[e]}return new ta(e,t,i,n,r)}function m(e,t,i){let{id:n,start:o,end:r,size:l}=a;if(a.next(),l>=0&&n<s){let s=i;if(l>4){let n=a.pos-(l-4);for(;a.pos>n;)i=m(e,t,i)}t[--i]=s,t[--i]=r-e,t[--i]=o-e,t[--i]=n}else-3==l?c=n:-4==l&&(h=n);return i}let g=[],O=[];for(;a.pos>0;)d(e.start||0,e.bufferStart||0,g,O,-1,0);let v=null!==(t=e.length)&&void 0!==t?t:g.length?O[0]+g[0].length:0;return new ta(l[e.topID],g.reverse(),O.reverse(),v)}function Zb(e,t){if(!e.isAnonymous||t instanceof na||t.type!=e)return 1;let i=ha.get(t);if(null==i){i=1;for(let n of t.children){if(n.type!=e||!(n instanceof ta)){i=1;break}i+=Zb(e,n)}ha.set(t,i)}return i}function Rb(e,t,i,n,o,r,s,a,l){let c=0;for(let p=n;p<o;p++)c+=