15 lines
353 KiB
JavaScript
15 lines
353 KiB
JavaScript
|
let ys=[],Nl=[];(()=>{let n="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?Nl:ys).push(t=t+n[e])})();function Tf(n){if(n<768)return!1;for(let e=0,t=ys.length;;){let i=e+t>>1;if(n<ys[i])t=i;else if(n>=Nl[i])e=i+1;else return!0;if(e==t)return!1}}function Yr(n){return n>=127462&&n<=127487}const Xr=8205;function Bf(n,e,t=!0,i=!0){return(t?Fl:Pf)(n,e,i)}function Fl(n,e,t){if(e==n.length)return e;e&&Vl(n.charCodeAt(e))&&Hl(n.charCodeAt(e-1))&&e--;let i=Xn(n,e);for(e+=_r(i);e<n.length;){let s=Xn(n,e);if(i==Xr||s==Xr||t&&Tf(s))e+=_r(s),i=s;else if(Yr(s)){let r=0,o=e-2;for(;o>=0&&Yr(Xn(n,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function Pf(n,e,t){for(;e>0;){let i=Fl(n,e-2,t);if(i<e)return i;e--}return 0}function Xn(n,e){let t=n.charCodeAt(e);if(!Hl(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return Vl(i)?(t-55296<<10)+(i-56320)+65536:t}function Vl(n){return n>=56320&&n<57344}function Hl(n){return n>=55296&&n<56320}function _r(n){return n<65536?1:2}class F{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,i){[e,t]=Ut(this,e,t);let s=[];return this.decompose(0,e,s,2),i.length&&i.decompose(0,i.length,s,3),this.decompose(t,this.length,s,1),Ue.from(s,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Ut(this,e,t);let i=[];return this.decompose(e,t,i,0),Ue.from(i,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),i=this.length-this.scanIdentical(e,-1),s=new mi(this),r=new mi(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=i)return!0}}iter(e=1){return new mi(this,e)}iterRange(e,t=this.length){return new Wl(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;i=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new zl(i)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?F.empty:e.length<=32?new _(e):Ue.from(_.split(e,[]))}}class _ extends F{constructor(e,t=Rf(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?i:l)>=e)return new Lf(s,l,i,o)
|
|||
|
`){[e,t]=Ut(this,e,t);let s="";for(let r=0,o=0;r<=t&&o<this.text.length;o++){let l=this.text[o],a=r+l.length;r>e&&o&&(s+=i),e<a&&t>r&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],s=-1;for(let r of e)i.push(r),s+=r.length+1,i.length==32&&(t.push(new _(i,s)),i=[],s=-1);return s>-1&&t.push(new _(i,s)),t}}class Ue extends F{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=i+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,i,s);s=l+1,i=a+1}}decompose(e,t,i,s){for(let r=0,o=0;o<=t&&r<this.children.length;r++){let l=this.children[r],a=o+l.length;if(e<=a&&t>=o){let f=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!f?i.push(l):l.decompose(e-o,t-o,i,f)}o=a+1}}replace(e,t,i){if([e,t]=Ut(this,e,t),i.lines<this.lines)for(let s=0,r=0;s<this.children.length;s++){let o=this.children[s],l=r+o.length;if(e>=r&&t<=l){let a=o.replace(e-r,t-r,i),f=this.lines-o.lines+a.lines;if(a.lines<f>>4&&a.lines>f>>6){let h=this.children.slice();return h[s]=a,new Ue(h,this.length-(t-e)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=`
|
|||
|
`){[e,t]=Ut(this,e,t);let s="";for(let r=0,o=0;r<this.children.length&&o<=t;r++){let l=this.children[r],a=o+l.length;o>e&&r&&(s+=i),e<a&&t>o&&(s+=l.sliceString(e-o,t-o,i)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Ue))return 0;let i=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return i;let a=this.children[s],f=e.children[r];if(a!=f)return i+a.scanIdentical(f,t);i+=a.length+1}}static from(e,t=e.reduce((i,s)=>i+s.length+1,-1)){let i=0;for(let d of e)i+=d.lines;if(i<32){let d=[];for(let p of e)p.flatten(d);return new _(d,t)}let s=Math.max(32,i>>5),r=s<<1,o=s>>1,l=[],a=0,f=-1,h=[];function c(d){let p;if(d.lines>r&&d instanceof Ue)for(let g of d.children)c(g);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof _&&a&&(p=h[h.length-1])instanceof _&&d.lines+p.lines<=32?(a+=d.lines,f+=d.length+1,h[h.length-1]=new _(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>s&&u(),a+=d.lines,f+=d.length+1,h.push(d))}function u(){a!=0&&(l.push(h.length==1?h[0]:Ue.from(h,f)),f=-1,a=h.length=0)}for(let d of e)c(d);return u(),l.length==1?l[0]:new Ue(l,t)}}F.empty=new _([""],0);function Rf(n){let e=-1;for(let t of n)e+=t.length+1;return e}function an(n,e,t=0,i=1e9){for(let s=0,r=0,o=!0;r<n.length&&s<=i;r++){let l=n[r],a=s+l.length;a>=t&&(a>i&&(l=l.slice(0,i-s)),s<t&&(l=l.slice(t-s)),o?(e[e.length-1]+=l,o=!1):e.push(l)),s=a+1}return e}function Qr(n,e,t){return an(n,[""],e,t)}class mi{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof _?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,s=this.nodes[i],r=this.offsets[i],o=r>>1,l=s instanceof _?s.text.length:s.children.length;if(o==(t>0?l:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|||
|
`,this;e--}else if(s instanceof _){let a=s.text[o+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof _?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Wl{constructor(e,t,i){this.value="",this.done=!1,this.cursor=new mi(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=i?s:t<0?s.slice(s.length-i):s.slice(0,i),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class zl{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:s}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(F.prototype[Symbol.iterator]=function(){return this.iter()},mi.prototype[Symbol.iterator]=Wl.prototype[Symbol.iterator]=zl.prototype[Symbol.iterator]=function(){return this});class Lf{constructor(e,t,i,s){this.from=e,this.to=t,this.number=i,this.text=s}get length(){return this.to-this.from}}function Ut(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function re(n,e,t=!0,i=!0){return Bf(n,e,t,i)}function Ef(n){return n>=56320&&n<57344}function If(n){return n>=55296&&n<56320}function ye(n,e){let t=n.charCodeAt(e);if(!If(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return Ef(i)?(t-55296<<10)+(i-56320)+65536:t}function ur(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Ge(n){return n<65536?1:2}const bs=/\r\n?|\n/;var ae=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(ae||(ae={}));class Qe{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let i=this.sections[t+1];e+=i<0?this.sections[t]:i}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,i=0,s=0;t<this.sections.length;){let r=this.sections[t++],o=this.sections[t++];o<0?(e(i,s,r),s+=r):s+=o,i+=r}}iterChangedRanges(e,t=!1){xs(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];s<0?e.push(i,s):e.push(s,i)}return new Qe(e)}composeDesc(e){return this.empty?e:e.empty?this:ql(this,e)}mapDesc(e,t=!1){return e.empty?this:ws(this,e,t)}mapPos(e,t=-1,i=ae.Simple){let s=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],f=s+l;if(a<0){if(f>e)return r+(e-s);r+=l}else{if(i!=ae.Simple&&f>=e&&(i==ae.TrackDel&&s<e&&f>e||i==ae.TrackBefore&&s<e||i==ae.TrackAfter&&f>e))return null;if(f>e||f==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=f}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let i=0,s=0;i<this.sections.length&&s<=t;){let r=this.sections[i++],o=this.sections[i++],l=s+r;if(o>=0&&s<=t&&l>=e)return s<e&&l>t?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let i=this.sections[t++],s=this.sections[t++];e+=(e?" ":"")+i+(s>=0?":"+s:""
|
|||
|
`}get readOnly(){return this.facet(Xl)}phrase(e,...t){for(let i of this.facet(H.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?i:t[r-1]})),e}languageDataAt(e,t,i=-1){let s=[];for(let r of this.facet(jl))for(let o of r(this,t,i))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return Uf(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-i,l=e-i;for(;o>0;){let a=re(t,o,!1);if(r(t.slice(a,o))!=J.Word)break;o=a}for(;l<s;){let a=re(t,l);if(r(t.slice(l,a))!=J.Word)break;l=a}return o==l?null:b.range(o+i,l+i)}}H.allowMultipleSelections=vs;H.tabSize=T.define({combine:n=>n.length?n[0]:4});H.lineSeparator=Ul;H.readOnly=Xl;H.phrases=T.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(s=>n[s]==e[s])}});H.languageData=jl;H.changeFilter=Gl;H.transactionFilter=Jl;H.transactionExtender=Yl;Hn.reconfigure=N.define();function Et(n,e,t={}){let i={};for(let s of n)for(let r of Object.keys(s)){let o=s[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))i[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)i[s]===void 0&&(i[s]=e[s]);return i}class Dt{eq(e){return this==e}range(e,t=e){return Ms.create(e,t,this)}}Dt.prototype.startSide=Dt.prototype.endSide=0;Dt.prototype.point=!1;Dt.prototype.mapMode=ae.TrackDel;let Ms=class Zl{constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new Zl(e,t,i)}};function Ds(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class gr{constructor(e,t,i,s){this.from=e,this.to=t,this.value=i,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,s=0){let r=i?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,f=r[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return f>=0?o:l;f>=0?l=a:o=a+1}}between(e,t,i,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(i,1e9,!1,r);r<o;r++)if(s(this.from[r]+e,this.to[r]+e,this.value[r])===!1)return!1}map(e,t){let i=[],s=[],r=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let f=this.value[a],h=this.from[a]+e,c=this.to[a]+e,u,d;if(h==c){let p=t.mapPos(h,f.startSide,f.mapMode);if(p==null||(u=d=p,f.startSide!=f.endSide&&(d=t.mapPos(h,f.endSide),d<u)))continue}else if(u=t.mapPos(h,f.startSide),d=t.mapPos(c,f.endSide),u>d||u==d&&f.startSide>0&&f.endSide<=0)continue;(d-u||f.endSide-f.startSide)<0||(o<0&&(o=u),f.point&&(l=Math.max(l,d-u)),i.push(f),s.push(u-o),r.push(d-o))}return{mapped:i.length?new gr(s,r,i,l):null,pos:o}}}class K{constructor(e,t,i,s){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=s}static create(e,t,i,s){return new K(e,t,i,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:i=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(i&&(t=t.slice().sort(Ds)),this.isEmpty)return t.length?K.of(t):this;let l=new ea(this,null,-1).goto(0),a=0,f=[],h=new Ot;for(;l.value||a<t.length;)if(a<t.length&&(l.from-t[a].from||l.startSide-t[a].value.startSide)>=0){let c=t[a++];h.addInner(c.from,c.to,c.value)||f.push(c)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==t.length||this.chunkEnd(l.chunkIndex)<t[a].from)&&(!o||s>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&h.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||s>l.to||r<l.from||o(l.from,l.to,l.value))&&(h.addInner(l.from,l.to,l.value)||f.push(Ms.create(l.from,l.to,l.value))),l.next());return h.finishInner(this.nextLayer.isEmpty&&!f.length?K.empty:this.nextLayer.update({add:f,filter:o,filterFrom:s,filterTo:r}))}map(
|
|||
|
`)}static newName(){let e=ro[so]||1;return ro[so]=e+1,Bs+e.toString(36)}static mount(e,t,i){let s=e[Ps],r=i&&i.nonce;s?r&&s.setNonce(r):s=new Jf(e,r),s.mount(Array.isArray(t)?t:[t],e)}}let oo=new Map;class Jf{constructor(e,t){let i=e.ownerDocument||e,s=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let r=oo.get(i);if(r)return e[Ps]=r;this.sheet=new s.CSSStyleSheet,oo.set(i,this)}else this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Ps]=this}mount(e,t){let i=this.sheet,s=0,r=0;for(let o=0;o<e.length;o++){let l=e[o],a=this.modules.indexOf(l);if(a<r&&a>-1&&(this.modules.splice(a,1),r--,a=-1),a==-1){if(this.modules.splice(r++,0,l),i)for(let f=0;f<l.rules.length;f++)i.insertRule(l.rules[f],s++)}else{for(;r<a;)s+=this.modules[r++].rules.length;s+=l.rules.length,r++}}if(i)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let o="";for(let a=0;a<this.modules.length;a++)o+=this.modules[a].getRules()+`
|
|||
|
`;this.styleTag.textContent=o;let l=t.head||t;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var pt={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},ki={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},Yf=typeof navigator<"u"&&/Mac/.test(navigator.platform),Xf=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var se=0;se<10;se++)pt[48+se]=pt[96+se]=String(se);for(var se=1;se<=24;se++)pt[se+111]="F"+se;for(var se=65;se<=90;se++)pt[se]=String.fromCharCode(se+32),ki[se]=String.fromCharCode(se);for(var Qn in pt)ki.hasOwnProperty(Qn)||(ki[Qn]=pt[Qn]);function _f(n){var e=Yf&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Xf&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?ki:pt)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function vi(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Rs(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function fn(n,e){if(!e.anchorNode)return!1;try{return Rs(n,e.anchorNode)}catch{return!1}}function Gt(n){return n.nodeType==3?Bt(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function bi(n,e,t,i){return t?lo(n,e,t,i,-1)||lo(n,e,t,i,1):!1}function Tt(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function xn(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function lo(n,e,t,i,s){for(;;){if(n==t&&e==i)return!0;if(e==(s<0?0:Ze(n))){if(n.nodeName=="DIV")return!1;let r=n.parentNode;if(!r||r.nodeType!=1)return!1;e=Tt(n)+(s<0?0:1),n=r}else if(n.nodeType==1){if(n=n.childNodes[e+(s<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=s<0?Ze(n):0}else return!1}}function Ze(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Li(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function Qf(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function ta(n,e){let t=e.width/n.offsetWidth,i=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(e.height-n.offsetHeight)<1)&&(i=1),{scaleX:t,scaleY:i}}function Zf(n,e,t,i,s,r,o,l){let a=n.ownerDocument,f=a.defaultView||window;for(let h=n,c=!1;h&&!c;)if(h.nodeType==1){let u,d=h==a.body,p=1,g=1;if(d)u=Qf(f);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(c=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let x=h.getBoundingClientRect();({scaleX:p,scaleY:g}=ta(h,x)),u={left:x.left,right:x.left+h.clientWidth*p,top:x.top,bottom:x.top+h.clientHeight*g}}let m=0,y=0;if(s=="nearest")e.top<u.top?(y=-(u.top-e.top+o),t>0&&e.bottom>u.bottom+y&&(y=e.bottom-u.bottom+y+o)):e.bottom>u.bottom&&(y=e.bottom-u.bottom+o,t<0&&e.top-y<u.top&&(y=-(u.top+y-e.top+o)));else{let x=e.bottom-e.top,S=u.bottom-u.top;y=(s=="center"&&x<=S?e.top+x/2-S/2:s=="start"||s=="center"&&t<0?e.top-o:e.bottom-S+o)-u.top}if(i=="nearest"?e.left<u.left?(m=-(u.left-e.left+r),t>0&&e.right>u.rig
|
|||
|
`,s=n.state.doc.line(s.number+(t?1:-1)),r=n.bidiSpans(s),f=n.visualLineSide(s,!t)}if(a){if(!a(h))return l}else{if(!i)return f;a=i(h)}l=f}}function Rc(n,e,t){let i=n.state.charCategorizer(e),s=i(t);return r=>{let o=i(r);return s==J.Space&&(s=o),s==o}}function Lc(n,e,t,i){let s=e.head,r=t?1:-1;if(s==(t?n.state.doc.length:0))return b.cursor(s,e.assoc);let o=e.goalColumn,l,a=n.contentDOM.getBoundingClientRect(),f=n.coordsAtPos(s,e.assoc||-1),h=n.documentTop;if(f)o==null&&(o=f.left-a.left),l=r<0?f.top:f.bottom;else{let d=n.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,n.defaultCharacterWidth*(s-d.from))),l=(r<0?d.top:d.bottom)+h}let c=a.left+o,u=i??n.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,g=Na(n,{x:c,y:p},!1,r);if(p<a.top||p>a.bottom||(r<0?g<s:g>s)){let m=n.docView.coordsForChar(g),y=!m||p<m.top?-1:1;return b.cursor(g,y,void 0,o)}}}function un(n,e,t){for(;;){let i=0;for(let s of n)s.between(e-1,e+1,(r,o,l)=>{if(e>r&&e<o){let a=i||t||(e-r<o-e?-1:1);e=a<0?r:o,i=a}});if(!i)return e}}function is(n,e,t){let i=un(n.state.facet(Sr).map(s=>s(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:b.cursor(i,i<t.from?1:-1)}const di="";class Ec{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(H.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=di}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let s=e;;){this.findPointBefore(i,s);let r=this.text.length;this.readNode(s);let o=s.nextSibling;if(o==t)break;let l=$.get(s),a=$.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:xn(s))||xn(o)&&(s.nodeName!="BR"||s.cmIgnore)&&this.text.length>r)&&this.lineBreak(),s=o}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(i,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(e){if(e.cmIgnore)return;let t=$.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let s=i.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(Ic(e,i.node,i.offset)?t:0))}}function Ic(n,e,t){for(;;){if(!e||t<Ze(e))return!1;if(e==n)return!0;t=Tt(e)+1,e=e.parentNode}}class ko{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class Nc{constructor(e,t,i,s){this.typeOver=s,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let l=r||o?[]:Hc(e),a=new Ec(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=Wc(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!Rs(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),f=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Rs(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((D.ios||D.chrome)&&e.state.selection.main.empty&&a!=f&&(h.from>0||h.to<e.state.doc.length)){let c=Math.min(a,f),u=Math.max(a,f),d=h.from-c,p=h.to-u;(d==0||d==1||c==0)&&(p==0||p==-1||u==e.state.doc.length)&&(a=0,f=e.state.doc.length)}this.newSel=b.single(f,a)}}}function Fa(n,e){let t,{newSel:i}=e,s=n.state.selection.main,r=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o
|
|||
|
`&&n.lineWrapping&&(i&&(i=b.single(i.main.anchor-1,i.main.head-1)),t={from:s.from,to:s.to,insert:F.of([" "])}),t)return vr(n,t,i,r);if(i&&!i.main.eq(s)){let o=!1,l="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),l=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function vr(n,e,t,i=-1){if(D.ios&&n.inputState.flushIOSKey(e))return!0;let s=n.state.selection.main;if(D.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&n.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&qt(n.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||i==8&&e.insert.length<e.to-e.from&&e.to>s.head)&&qt(n.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&qt(n.contentDOM,"Delete",46)))return!0;let r=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,l=()=>o||(o=Fc(n,e,t));return n.state.facet(Aa).some(a=>a(n,e.from,e.to,r,l))||n.dispatch(l()),!0}function Fc(n,e,t){let i,s=n.state,r=s.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let l=r.from<e.from?s.sliceDoc(r.from,e.from):"",a=r.to>e.to?s.sliceDoc(e.to,r.to):"";i=s.replaceSelection(n.state.toText(l+e.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let l=s.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(s.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let f=n.state.sliceDoc(e.from,e.to),h,c=t&&Ia(n,t.main.head);if(c){let p=e.insert.length-(e.to-e.from);h={from:c.from,to:c.to-p}}else h=n.state.doc.lineAt(r.head);let u=r.to-e.to,d=r.to-r.from;i=s.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let g=p.to-u,m=g-f.length;if(p.to-p.from!=d||n.state.sliceDoc(m,g)!=f||p.to>=h.from&&p.from<=h.to)return{range:p};let y=s.changes({from:m,to:g,insert:e.insert}),x=p.to-r.to;return{changes:y,range:a?b.range(Math.max(0,a.anchor+x),Math.max(0,a.head+x)):p.map(y)}})}else i={changes:l,selection:a&&s.selection.replaceRange(a)}}let o="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,o+=".compose",n.inputState.compositionFirstChange&&(o+=".start",n.inputState.compositionFirstChange=!1)),s.update(i,{userEvent:o,scrollIntoView:!0})}function Vc(n,e,t,i){let s=Math.min(n.length,e.length),r=0;for(;r<s&&n.charCodeAt(r)==e.charCodeAt(r);)r++;if(r==s&&n.length==e.length)return null;let o=n.length,l=e.length;for(;o>0&&l>0&&n.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o<r&&n.length<e.length){let a=t<=r&&t>=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l<r){let a=t<=r&&t>=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function Hc(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:s,focusOffset:r}=n.observer.selectionRange;return t&&(e.push(new ko(t,i)),(s!=t||r!=i)&&e.push(new ko(s,r))),e}function Wc(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?b.single(t+e,i+e):null}class zc{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,D.safari&&e.contentDOM.addEventListener("input",()=>null),D.gecko&&nu(e.contentDOM.ownerDocument)}handleEve
|
|||
|
`))};if(f.from==this.from&&r<this.from?f.from=r:f.to==this.to&&r>this.to&&(f.to=r),f.from==f.to&&!f.insert.length){let h=b.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd));h.main.eq(s)||e.dispatch({selection:h,userEvent:"select"});return}if((D.mac||D.android)&&f.from==o-1&&/^\. ?$/.test(i.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:l,to:a,insert:F.of([i.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let h=this.to-this.from+(f.to-f.from+f.insert.length);vr(e,f,b.single(this.toEditorPos(i.selectionStart,h),this.toEditorPos(i.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=i=>{let s=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=e.coordsForChar(o);r=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||r||new DOMRect,s.push(r)}t.updateCharacterBounds(i.rangeStart,s)},this.handlers.textformatupdate=i=>{let s=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(o!="None"&&l!="None"){let a=this.toEditorPos(r.rangeStart),f=this.toEditorPos(r.rangeEnd);if(a<f){let h=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;s.push(P.mark({attributes:{style:h}}).range(a,f))}}}e.dispatch({effects:Ba.of(P.set(s))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:i}=this.composing;this.composing=null,i&&this.reset(e.state)}};for(let i in this.handlers)t.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let s=vi(i.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,i=!1,s=this.pendingContextChange;return e.changes.iterChanges((r,o,l,a,f)=>{if(i)return;let h=f.length-(o-r);if(s&&o>=s.to)if(s.from==r&&s.to==o&&s.insert.eq(f)){s=this.pendingContextChange=null,t+=h,this.to+=h;return}else s=null,this.revertPending(e.state);if(r+=t,o+=t,o<=this.from)this.from+=h,this.to+=h;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+f.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),f.toString()),this.to+=h}t+=h}),s&&!i&&this.revertPending(e.state),!i}update(e){let t=this.pendingContextChange;this.composing&&(this.composing.drifted||e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),s=this.toContextPos(t.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(i,s)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let i=this.composing;return i&&i.drifted?i.editorBase+(e-i.contextBase):e+this
|
|||
|
--\u2028\u2029\uFEFF-]`,_s),Vu={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let rs=null;function Hu(){var n;if(rs==null&&typeof document<"u"&&document.body){let e=document.body.style;rs=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return rs||!1}const gn=T.define({combine(n){let e=Et(n,{render:null,specialChars:Fu,addSpecialChars:null});return(e.replaceTabs=!Hu())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,_s)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,_s)),e}});function Tm(n={}){return[gn.of(n),Wu()]}let jo=null;function Wu(){return jo||(jo=ce.fromClass(class{constructor(n){this.view=n,this.decorations=P.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(gn)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Nu({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:s}=t.state,r=ye(e[0],0);if(r==9){let o=s.lineAt(i),l=t.state.tabSize,a=ti(o.text,l,i-o.from);return P.replace({widget:new $u((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=P.replace({widget:new Ku(n,r)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(gn);n.startState.facet(gn)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const zu="•";function qu(n){return n>=32?zu:n==10?"":String.fromCharCode(9216+n)}class Ku extends It{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=qu(this.code),i=e.state.phrase("Control character")+" "+(Vu[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,i,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class $u extends It{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}class ju extends It{constructor(e){super(),this.content=e}toDOM(e){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):typeof this.content=="function"?this.content(e):this.content.cloneNode(!0)),typeof this.content=="string"?t.setAttribute("aria-label","placeholder "+this.content):t.setAttribute("aria-hidden","true"),t}coordsAt(e){let t=e.firstChild?Gt(e.firstChild):[];if(!t.length)return null;let i=window.getComputedStyle(e.parentNode),s=Li(t[0],i.direction!="rtl"),r=parseInt(i.lineHeight);return s.bottom-s.top>r*1.5?{left:s.left,right:s.right,top:s.top,bottom:s.top+r}:s}ignoreEvent(){return!1}}function Bm(n){return ce.fromClass(class{constructor(e){this.view=e,this.placeholder=n?P.set([P.widget({widget:new ju(n),side:1}).range(0)]):P.none}get decorations(){return this.view.state.doc.length?P.none:this.placeholder}},{decorations:e=>e.decorations})}const Qs=2e3;function Uu(n,e,t){let i=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Qs||t.off>Qs||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=i;a<=s;a++){let f=n.doc.line(a);f.length<=l&&r.push(b.range(f.from+o,f.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=i;a<=s;a++){let f=n.doc.line(a)
|
|||
|
`&&(t="");else{let i=t.indexOf(`
|
|||
|
`);i>-1&&(t=t.slice(0,i))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),i=e+t.length;for(let s=this.rangeIndex;;){let r=this.ranges[s].to;if(r>=i||(t=t.slice(0,r-(i-t.length)),s++,s==this.ranges.length))break;let o=this.ranges[s].from,l=this.lineAfter(o);t+=l,i=o+l.length}return{line:t,end:i}}skipGapsTo(e,t,i){for(;;){let s=this.ranges[this.rangeIndex].to,r=e+t;if(i>0?s>r:s>=r)break;let o=this.ranges[++this.rangeIndex].from;t+=o-s}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,i,s){let r=4;if(this.ranges.length>1){s=this.skipGapsTo(t,s,1),t+=s;let l=this.chunk.length;s=this.skipGapsTo(i,s,-1),i+=s,r+=this.chunk.length-l}let o=this.chunk.length-4;return r==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=i:this.chunk.push(e,t,i,r),s}parseLine(e){let{line:t,end:i}=this.nextLine(),s=0,{streamParser:r}=this.lang,o=new vh(t,e?e.state.tabSize:4,e?Lt(e.state):2);if(o.eol())r.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let l=Mh(r.token,o,this.state);if(l&&(s=this.emitToken(this.lang.tokenTable.resolve(l),this.parsedPos+o.start,this.parsedPos+o.pos,s)),o.start>1e4)break}this.parsedPos=i,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=U.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Xd,topID:0,maxBufferLength:2048,reused:this.chunkReused});e=new U(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new U(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}}function Mh(n,e,t){e.start=e.pos;for(let i=0;i<10;i++){let s=n(e,t);if(e.pos>e.start)return s}throw new Error("Stream parser failed to advance stream.")}const Lr=Object.create(null),Oi=[ge.none],Xd=new Dr(Oi),ul=[],dl=Object.create(null),Dh=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Dh[n]=Th(Lr,e);class Oh{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Dh)}resolve(e){return e?this.table[e]||(this.table[e]=Th(this.extra,e)):0}}const _d=new Oh(Lr);function cs(n,e){ul.indexOf(n)>-1||(ul.push(n),console.warn(e))}function Th(n,e){let t=[];for(let l of e.split(" ")){let a=[];for(let f of l.split(".")){let h=n[f]||M[f];h?typeof h=="function"?a.length?a=a.map(h):cs(f,`Modifier ${f} used at start of tag`):a.length?cs(f,`Tag ${f} used as modifier`):a=Array.isArray(h)?h:[h]:cs(f,`Unknown highlighting tag ${f}`)}for(let f of a)t.push(f)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),s=i+" "+t.map(l=>l.id),r=dl[s];if(r)return r.id;let o=dl[s]=ge.define({id:Oi.length,name:i,props:[wd({[i]:t})]});return Oi.push(o),o.id}function Qd(n,e){let t=ge.define({id:Oi.length,name:"Document",props:[Ct.add(()=>n),mh.add(()=>i=>e.getIndent(i))],top:!0});return Oi.push(t),t}X.RTL,X.LTR;const Zd=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=Ir(n.state,t.from);return i.line?ep(n):i.block?ip(n):!1};function Er(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let s=n(e,t);return s?(i(t.update(s)),!0):!1}}const ep=Er(rp,0),tp=Er(Bh,0),ip=Er((n,e)=>Bh(n,e,sp(e)),0);function Ir(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const fi=50;function np(n,{open:e,close:t},i,s){let r=n.sliceDoc(i-fi,i),o=n.sliceDoc(s,s+fi),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,f=r.length-l;if(r.slice(f-e.length,f)==e&&o.slice(a,a+t.length)==t)return{open:{pos:i-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let h,c;s-i<=2*fi?h=c=n.sliceDoc(i,s):(h=n.sliceDoc(i,i+
|
|||
|
`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new kg(this):new wg(this)}getCursor(e,t=0,i){let s=e.doc?e:H.create({doc:e});return i==null&&(i=s.doc.length),this.regexp?Ht(this,s,t,i):Vt(this,s,t,i)}}class pf{constructor(e){this.spec=e}}function Vt(n,e,t,i){return new ei(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:s=>s.toLowerCase(),n.wholeWord?xg(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function xg(n,e){return(t,i,s,r)=>((r>t||r+s.length<i)&&(r=Math.max(0,t-2),s=n.sliceString(r,Math.min(n.length,i+2))),(e(Ln(s,t-r))!=J.Word||e(En(s,t-r))!=J.Word)&&(e(En(s,i-r))!=J.Word||e(Ln(s,i-r))!=J.Word))}class wg extends pf{constructor(e){super(e)}nextMatch(e,t,i){let s=Vt(this.spec,e,i,e.doc.length).nextOverlapping();if(s.done){let r=Math.min(e.doc.length,t+this.spec.unquoted.length);s=Vt(this.spec,e,0,r).nextOverlapping()}return s.done||s.value.from==t&&s.value.to==i?null:s.value}prevMatchInRange(e,t,i){for(let s=i;;){let r=Math.max(t,s-1e4-this.spec.unquoted.length),o=Vt(this.spec,e,r,s),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==t)return null;s-=1e4}}prevMatch(e,t,i){let s=this.prevMatchInRange(e,0,t);return s||(s=this.prevMatchInRange(e,Math.max(0,i-this.spec.unquoted.length),e.doc.length)),s&&(s.from!=t||s.to!=i)?s:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let i=Vt(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Vt(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}function Ht(n,e,t,i){return new cf(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?Sg(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function Ln(n,e){return n.slice(re(n,e,!1),e)}function En(n,e){return n.slice(e,re(n,e))}function Sg(n){return(e,t,i)=>!i[0].length||(n(Ln(i.input,i.index))!=J.Word||n(En(i.input,i.index))!=J.Word)&&(n(En(i.input,i.index+i[0].length))!=J.Word||n(Ln(i.input,i.index+i[0].length))!=J.Word)}class kg extends pf{nextMatch(e,t,i){let s=Ht(this.spec,e,i,e.doc.length).next();return s.done&&(s=Ht(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,i){for(let s=1;;s++){let r=Math.max(t,i-s*1e4),o=Ht(this.spec,e,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i<e.match.length?e.match[i]:t)}matchAll(e,t){let i=Ht(this.spec,e,0,e.doc.length),s=[];for(;!i.next().done;){if(s.length>=t)return null;s.push(i.value)}return s}highlight(e,t,i,s){let r=Ht(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}}const Ti=N.define(),Vr=N.define(),ut=me.define({create(n){return new ps(cr(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Ti)?n=new ps(t.value.create(),n.panel):t.is(Vr)&&(n=new ps(n.query,t.value?Hr:null));return n},provide:n=>An.from(n,e=>e.panel)});class ps{constructor(e,t){this.query=e,this.panel=t}}const vg=P.mark({class:"cm-searchMatch"}),Cg=P.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Ag=ce.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(ut))}update(n){let e=n.state.field(ut);(e!=n.startState.field(ut)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return P.none;let{view:t}=this,i=new Ot;for(let s=0,r=t.visibleRanges,o=r.length;s<o;s++){let{from:l,to:a}=r[s];for(;s<o-1&&a>r[s+1].from-2*250;)a=r[++s].to;n.highlight(t.state,l,a,(f,h)=>{let c=t.state.selection.ranges.some(u=>u.from==f&&u.to==h);i.add(f,h,c?Cg:vg)})}ret
|