From 270301f77073793793ea60ed181fa2484fef40c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=9C=E6=81=92?= <2323333339@qq.com> Date: Fri, 7 May 2021 17:58:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/factory.php | 5 +++-- core/function.php | 2 +- package.json | 2 +- typecho/write/js/_create.js | 13 +++++++++++++ typecho/write/js/joe.write.chunk.js | 4 ++-- typecho/write/js/joe.write.js | 4 ++-- typecho/write/package.json | 5 ++--- 7 files changed, 24 insertions(+), 11 deletions(-) diff --git a/core/factory.php b/core/factory.php index 8fc9ee0..40ecde0 100644 --- a/core/factory.php +++ b/core/factory.php @@ -64,11 +64,12 @@ class Editor canPreview: false } + - - + + = wait) { + fn.apply(context, args); + pre = Date.now(); + } + }; +} + export default function createPreviewHtml(str) { if (!window.JoeConfig.canPreview) return $('.cm-preview-content').html('1. 预览已默认关闭
2. 点击上方预览按钮启用预览
3. 若编辑器卡顿可尝试关闭预览'); diff --git a/typecho/write/js/joe.write.chunk.js b/typecho/write/js/joe.write.chunk.js index 38544f0..991cca8 100644 --- a/typecho/write/js/joe.write.chunk.js +++ b/typecho/write/js/joe.write.chunk.js @@ -1,4 +1,4 @@ -!function(){"use strict";let r="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,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e;else{if(!s(e))break;{let t=0,e=n-2;for(;0<=e&&s(c(i,e));)t++,e-=2;if(t%2==0)break;n+=2}}}return n}function a(t,e){for(;0this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){var n=[];return this.decompose(0,t,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(e,this.length,n,1),m.from(n,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){var i=[];return this.decompose(t,e,i,0),m.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=new g(this),i=new g(t);for(;;){if(e.next(),i.next(),e.lineBreak!=i.lineBreak||e.done!=i.done||e.value!=i.value)return!1;if(e.done)return!0}}iter(t=1){return new g(this,t)}iterRange(t,e=this.length){return new i(this,t,e)}toString(){return this.sliceString(0)}toJSON(){var t=[];return this.flatten(t),t}static of(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new p(t):m.from(p.split(t,[])):d.empty}}"undefined"!=typeof Symbol&&(d.prototype[Symbol.iterator]=function(){return this.iter()});class p extends d{constructor(t,e=function(t){let e=-1;for(var i of t)e+=i.length+1;return e}(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(e,i,n,r){for(let t=0;;t++){var s=this.text[t],o=r+s.length;if(e<=(i?n:o))return new v(r,o,n,s);r=o+1,n++}}decompose(i,t,n,r){i=i<=0&&t>=this.length?this:new p(f(this.text,i,t),Math.min(t,this.length)-Math.max(0,i));if(1&r){let t=n.pop(),e=u(i.text,t.text.slice(),0,i.length);e.length<=32?n.push(new p(e,t.length+i.length)):(r=e.length>>1,n.push(new p(e.slice(0,r)),new p(e.slice(r))))}else n.push(i)}replace(t,e,i){if(!(i instanceof p))return super.replace(t,e,i);var n=u(this.text,u(i.text,f(this.text,0,t)),e),t=this.length+i.length-(e-t);return n.length<=32?new p(n,t):m.from(p.split(n,[]),t)}sliceString(r,s=this.length,o="\n"){let a="";for(let i=0,n=0;i<=s&&nr&&n&&(a+=o),ri&&(a+=t.slice(Math.max(0,r-i),s-i)),i=e+1}return a}flatten(t){for(var e of this.text)t.push(e)}static split(t,e){let i=[],n=-1;for(var r of t)i.push(r),n+=r.length+1,32==i.length&&(e.push(new p(i,n)),i=[],n=-1);return-1=n&&(l=a&((n<=r?1:0)|(s<=e?2:0)),n>=r&&e<=s&&!l?o.push(t):t.decompose(r-n,s-n,o,l)),n=e+1}}replace(r,s,o){if(o.lines=n&&s<=e){var a=t.replace(r-n,s-n,o),l=this.lines-t.lines+a.lines;if(a.lines>4&&a.lines>l>>6){let t=this.children.slice();return t[i]=a,new m(t,this.length-(s-r)+o.length)}return super.replace(n,e,a)}n=e+1}return super.replace(r,s,o)}sliceString(r,s=this.length,o="\n"){let a="";for(let i=0,n=0;ir&&i&&(a+=o),rn&&(a+=t.sliceString(r-n,s-n,o)),n=e+1}return a}flatten(t){for(var e of this.children)e.flatten(t)}static from(t,e=t.reduce((t,e)=>t+e.length+1,-1)){let i=0;for(var n of t)i+=n.lines;if(i<32){var r,s=[];for(r of t)r.flatten(s);return new p(s,e)}let o=Math.max(32,i>>5),a=o<<1,l=o>>1,h=[],c=0,O=-1,d=[];function u(){0!=c&&(h.push(1==d.length?d[0]:m.from(d,O)),O=-1,c=d.length=0)}for(var f of t)!function t(e){let i;if(e.lines>a&&e instanceof m)for(var n of e.children)t(n);else e.lines>l&&(c>l||!c)?(u(),h.push(e)):e instanceof p&&c&&(i=d[d.length-1])instanceof p&&e.lines+i.lines<=32?(c+=e.lines,O+=e.length+1,d[d.length-1]=new p(i.text.concat(e.text),i.length+1+e.length)):(c+e.lines>o&&u(),c+=e.lines,O+=e.length+1,d.push(e))}(f);return u(),1==h.length?h[0]:new m(h,e)}}function u(s,o,a=0,l=1e9){for(let i=0,n=0,r=!0;nMath.max(0,n))return this.value=0==n?t:0t.length?n-=t.length:(this.nodes.push(t),this.offsets.push(0this.limit&&(this.value=0r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(i,n=i){for(let t=0,e=0;t"number"!=typeof t))throw new RangeError("Invalid JSON representation of ChangeDesc");return new y(t)}}class k extends y{constructor(t,e){super(t),this.inserted=e}apply(s){if(this.length!=s.length)throw new RangeError("Applying change set to a document with the wrong length");return T(this,(t,e,i,n,r)=>s=s.replace(i,i+(e-t),r),!1),s}mapDesc(t,e=!1){return W(this,t,e,!0)}invert(i){let n=this.sections.slice(),r=[];for(let t=0,e=0;t>1;r.length>1].toJSON()))}return n}static of(t,s,o){let a=[],l=[],h=0,i=null;function c(t=!1){if(t||a.length){hh&&S(a,t-h,-1),S(a,e-t,n),P(l,a,r),h=e)}}(t),c(!i),i}static empty(t){return new k(t?[t,-1]:[],[])}static fromJSON(i){if(!Array.isArray(i))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let e=0;ee&&"string"!=typeof t))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==t.length)n.push(t[0],0);else{for(;r.length>1;if(n>1])),!(c||a==l.sections.length||l.sections[a+1]<0);)n=l.sections[a++],r=l.sections[a++];h(s,t,o,e,i),s=t,o=e}}}function W(t,e,r,i=!1){var s=[],o=i?[]:null;let a=new X(t),l=new X(e);for(let i=0,n=0;;)if(-1==a.ins)i+=a.len,a.next();else if(-1==l.ins&&nn&&!a.done&&i+a.leni&&n+l.lenl||0<=o.ins&&o.len>l)&&(t||h>1;return e>=t.length?d.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?d.empty:e[i].slice(this.off,null==t?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class R{constructor(t,e,i){this.from=t,this.to=e,this.flags=i}get anchor(){return 16&this.flags?this.to:this.from}get head(){return 16&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 4&this.flags?-1:8&this.flags?1:0}get bidiLevel(){var t=3&this.flags;return 3==t?null:t}get goalColumn(){var t=this.flags>>5;return 33554431==t?void 0:t}map(t,e=-1){var i=t.mapPos(this.from,e),e=t.mapPos(this.to,e);return i==this.from&&e==this.to?this:new R(i,e,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return _.range(t,e);e=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return _.range(this.anchor,e)}eq(t){return this.anchor==t.anchor&&this.head==t.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return _.range(t.anchor,t.head)}}class _{constructor(t,e=0){this.ranges=t,this.mainIndex=e}map(e,i=-1){return e.empty?this:_.create(this.ranges.map(t=>t.map(e,i)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;tt.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new _(t.ranges.map(t=>R.fromJSON(t)),t.main)}static single(t,e=t){return new _([_.range(t,e)],0)}static create(i,n=0){if(0==i.length)throw new RangeError("A selection needs at least one range");for(let t=0,e=0;et.from-e.from),i=e.indexOf(t);for(let t=1;tr.head?_.range(s,n):_.range(n,s)))}return new _(e,i)}(i.slice(),n);t=r.to}return new _(i,n)}static cursor(t,e=0,i,n){return new R(t,t,(0==e?0:e<0?4:8)|(null==i?3:Math.min(2,i))|(null!=n?n:33554431)<<5)}static range(t,e,i){i=(null!=i?i:33554431)<<5;return ee)throw new RangeError("Selection points outside of document")}let A=0;class L{constructor(t,e,i,n,r){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=n,this.extensions=r,this.id=A++,this.default=t([])}static define(t={}){return new L(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:z),!!t.static,t.enables)}of(t){return new q([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new q(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new q(t,this,2,e)}from(e,i){return i=i||(t=>t),this.compute([e],t=>i(t.field(e)))}}function z(t,i){return t==i||t.length==i.length&&t.every((t,e)=>t===i[e])}class q{constructor(t,e,i,n){this.dependencies=t,this.facet=e,this.type=i,this.value=n,this.id=A++}dynamicSlot(t){var e,i;let n=this.value,r=this.facet.compareInput,s=t[this.id]>>1,o=2==this.type,a=!1,l=!1,h=[];for(i of this.dependencies)"doc"==i?a=!0:"selection"==i?l=!0:0==(1&(null!==(e=t[i.id])&&void 0!==e?e:1))&&h.push(t[i.id]);return(e,t)=>{if(!t||t.reconfigured)return e.values[s]=n(e),1;if(!(a&&t.docChanged||l&&(t.docChanged||t.selection)||h.some(t=>0<(1&G(e,t)))))return 0;var i=n(e),t=t.startState.values[s];return(o?function(e,i,n){if(e.length!=i.length)return!1;for(let t=0;t>1}const Y=L.define({static:!0});class M{constructor(t,e,i,n,r){this.id=t,this.createF=e,this.updateF=i,this.compareF=n,this.spec=r,this.provides=void 0}static define(t){let e=new M(A++,t.create,t.update,t.compare||((t,e)=>t===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(Y).find(t=>t.field==this);return((null===e||void 0===e?void 0:e.create)||this.createF)(t)}slot(t){let r=t[this.id]>>1;return(t,e)=>{if(!e||e.reconfigured&&null==V(e.startState,this.id))return t.values[r]=this.create(t),1;let i,n=0;e.reconfigured?(i=e.startState.values[V(e.startState,this.id)],n=1):i=e.startState.values[r];e=this.updateF(i,e);return n||this.compareF(i,e)||(n=1),n&&(t.values[r]=e),n}}init(t){return[this,Y.of({field:this,create:t})]}get extension(){return this}}const Z={fallback:3,default:2,extend:1,override:0};function t(e){return t=>new j(t,e)}const E={fallback:t(Z.fallback),default:t(Z.default),extend:t(Z.extend),override:t(Z.override)};class j{constructor(t,e){this.inner=t,this.prec=e}}class D{of(t){return new H(this,t)}reconfigure(t){return D.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class H{constructor(t,e){this.compartment=t,this.inner=e}}class I{constructor(t,e,i,n,r){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=n,this.staticValues=r,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,e,n){let i=[],r=Object.create(null);var s,o,a=new Map;for(s of function(t,a,l){let h=[[],[],[],[]],c=new Map;return function t(e,i){var n=c.get(e);if(null!=n){if(i<=n)return;var r=h[n].indexOf(e);-1t.concat(e))}(t,e,a))(s instanceof M?i:r[s.facet.id]||(r[s.facet.id]=[])).push(s);let l=Object.create(null),h=[],c=[];for(let e of i)l[e.id]=c.length<<1,c.push(t=>e.slot(t));for(o in r){let i=r[o],e=i[0].facet;if(i.every(t=>0==t.type)){l[e.id]=h.length<<1|1;let t=e.combine(i.map(t=>t.value));var O=n?n.config.address[e.id]:null;null!=O&&(O=B(n,O),e.compare(t,O)&&(t=O)),h.push(t)}else{for(let e of i)0==e.type?(l[e.id]=h.length<<1|1,h.push(e.value)):(l[e.id]=c.length<<1,c.push(t=>e.dynamicSlot(t)));l[e.id]=c.length<<1,c.push(t=>function(e,h,t){let c=t.map(t=>e[t.id]),O=t.map(t=>t.type),d=c.filter(t=>!(1&t)),u=e[h.id]>>1;return(e,t)=>{var i,n=t?t.reconfigured?t.startState.config.address[h.id]:u<<1:null;let r=null==n;for(i of d)1&G(e,i)&&(r=!0);if(!r)return 0;let s=[];for(let t=0;tt(l)),l,h)}}function G(t,e){if(1&e)return 2;var i=e>>1,e=t.status[i];if(4==e)throw new Error("Cyclic dependency between fields and/or facets");if(2&e)return e;t.status[i]=4;e=t.config.dynamicSlots[i](t,t.applying);return t.status[i]=2|e}function B(t,e){return(1&e?t.config.staticValues:t.values)[e>>1]}const N=L.define(),U=L.define({combine:t=>t.some(t=>t),static:!0}),F=L.define({combine:t=>t.length?t[0]:void 0,static:!0}),J=L.define(),K=L.define(),tt=L.define();class et{constructor(t,e){this.type=t,this.value=e}static define(){return new it}}class it{of(t){return new et(this,t)}}class nt{constructor(t){this.map=t}of(t){return new rt(this,t)}}class rt{constructor(t,e){this.type=t,this.value=e}map(t){t=this.type.map(this.value,t);return void 0===t?void 0:t==this.value?this:new rt(this.type,t)}is(t){return this.type==t}static define(t={}){return new nt(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(var n of t){n=n.map(e);n&&i.push(n)}return i}}rt.reconfigure=rt.define(),rt.appendConfig=rt.define();class st{constructor(t,e,i,n,r,s){this.startState=t,this.changes=e,this.selection=i,this.effects=n,this.annotations=r,this.scrollIntoView=s,this._doc=null,this._state=null,i&&C(i,e.newLength),r.some(t=>t.type==st.time)||(this.annotations=r.concat(st.time.of(Date.now())))}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(var e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}}function ot(t,e,i){let n,r,s;return s=i?(n=e.changes,r=k.empty(e.changes.length),t.changes.compose(e.changes)):(n=e.changes.map(t.changes),r=t.changes.mapDesc(e.changes,!0),t.changes.compose(n)),{changes:s,selection:e.selection?e.selection.map(r):null===(i=t.selection)||void 0===i?void 0:i.map(n),effects:rt.mapEffects(t.effects,n).concat(rt.mapEffects(e.effects,r)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function at(t,e,i){var n=e.selection;return{changes:e.changes instanceof k?e.changes:k.of(e.changes||[],i,t.facet(F)),selection:n&&(n instanceof _?n:_.single(n.anchor,n.head)),effects:ct(e.effects),annotations:ct(e.annotations),scrollIntoView:!!e.scrollIntoView}}function lt(e,i,n){let r=at(e,i.length?i[0]:{},e.doc.length);i.length&&!1===i[0].filter&&(n=!1);for(let t=1;t=r[i]))t=r[i++],e=r[i++];else{if(!(n{if(!/\S/.test(e))return Ot.Space;if(function(i){if(ut)return ut.test(i);for(let e=0;enull),n)for(var r in t.address){var s=t.address[r],r=n.startState.config.address[r];null!=r&&0==(1&s)&&(this.values[s>>1]=B(n.startState,r))}(this.applying=n)&&(n._state=this);for(let t=0;tn.set(e,t)),e=null),n.set(r.value.compartment,r.value.extension)):r.is(rt.reconfigure)?(e=null,i=r.value):r.is(rt.appendConfig)&&(e=null,i=ct(i).concat(r.value));new pt(e||I.resolve(i,n,this),t.newDoc,t.newSelection,t)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:_.cursor(t.from+e.length)}))}changeByRange(r){var s=this.selection,t=r(s.ranges[0]);let o=this.changes(t.changes),a=[t.range],l=ct(t.effects);for(let n=1;ne.spec.fromJSON(i,t)))}return pt.create({doc:t.doc,selection:_.fromJSON(t.selection),extensions:e.extensions?r.concat([e.extensions]):r})}static create(t={}){let e=I.resolve(t.extensions||[],new Map);var i=t.doc instanceof d?t.doc:d.of((t.doc||"").split(e.staticFacet(pt.lineSeparator)||Q));let n=t.selection?t.selection instanceof _?t.selection:_.single(t.selection.anchor,t.selection.head):_.single(0);return C(n,i.length),e.staticFacet(U)||(n=n.asSingle()),new pt(e,i,n)}get tabSize(){return this.facet(pt.tabSize)}get lineBreak(){return this.facet(pt.lineSeparator)||"\n"}phrase(t){for(var e of this.facet(pt.phrases))if(Object.prototype.hasOwnProperty.call(e,t))return e[t];return t}languageDataAt(t,e){let i=[];for(var n of this.facet(N))for(var r of n(this,e))Object.prototype.hasOwnProperty.call(r,t)&&i.push(r[t]);return i}charCategorizer(t){return ft(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:e,from:i,length:n}=this.doc.lineAt(t),r=this.charCategorizer(t),s=t-i,o=t-i;for(;0t.length?t[0]:4}),pt.lineSeparator=F,pt.phrases=L.define(),pt.languageData=N,pt.changeFilter=J,pt.transactionFilter=K,pt.transactionExtender=tt,D.reconfigure=rt.define();const gt="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),vt="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),Qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class wt{constructor(t,e){this.rules=[];let{finish:c}=e||{};function O(t){return/^@/.test(t)?[t]:t.split(/,\s*/)}for(var i in t)!function t(i,e,n,r){let s=[],o=/^@(\w+)\b/.exec(i[0]),a=o&&"keyframes"==o[1];if(o&&null==e)return n.push(i[0]+";");for(var l in e){var h=e[l];if(/&/.test(l))t(l.split(/,\s*/).map(e=>i.map(t=>e.replace(/&/,t))).reduce((t,e)=>t.concat(e)),h,n);else if(h&&"object"==typeof h){if(!o)throw new RangeError("The value of a property ("+l+") should be a primitive value.");t(O(l),h,s,a)}else null!=h&&s.push(l.replace(/_.*/,"").replace(/[A-Z]/g,t=>"-"+t.toLowerCase())+": "+h+";")}(s.length||a)&&n.push((!c||o||r?i:i.map(c)).join(", ")+" {"+s.join(" ")+"}")}(O(i),t[i],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let t=Qt[gt]||1;return Qt[gt]=t+1,"ͼ"+t.toString(36)}static mount(t,e){(t[vt]||new yt(t)).mount(Array.isArray(e)?e:[e])}}let $t=null;class yt{constructor(e){if(!e.head&&e.adoptedStyleSheets&&"undefined"!=typeof CSSStyleSheet){if($t)return e.adoptedStyleSheets=[$t.sheet].concat(e.adoptedStyleSheets),e[vt]=$t;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),$t=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[vt]=this}mount(n){let r=this.sheet,s=0,o=0;for(let i=0;i>1,l=o[a]-i||(n<0?this.value[a].startSide:this.value[a].endSide)-r;if(a==t)return 0<=l?t:e;0<=l?e=a:t=1+a}}between(i,n,r,s){for(let t=this.findIndex(n,-1),e=this.findIndex(r,1,void 0,t);tr||n==r&&0this.chunkEnd(o.chunkIndex)||ro.to||r500<=t.maxPoint||t!=Pt.empty&&i.indexOf(t)<0&&t.maxPoint>=r),o=i.filter(t=>500<=t.maxPoint||t!=Pt.empty&&e.indexOf(t)<0&&t.maxPoint>=r),a=function(t,e){let i=new Map;for(var n of t)for(let t=0;tCt(l,t,h,e,i,n)),t.empty&&0==t.length&&Ct(l,0,h,0,0,n)}static spans(t,e,i,n,r=-1){let s=new _t(t,null,r).goto(e),o=e,a=s.openStart;for(;;){var l=Math.min(s.to,i);if(s.point?(n.point(o,l,s.point,s.activeForPoint(s.to),a),a=s.openEnd(l)+(s.to>l?1:0)):l>o&&(n.span(o,l,s.active,a),a=s.openEnd(l)),s.to>i)break;o=s.to,s.next()}return a}static of(t,e=!1){let i=new Tt;for(var n of t instanceof xt?[t]:e?t.slice().sort(kt):t)i.add(n.from,n.to,n.value);return i.finish()}}Pt.empty=new Pt([],[],null,-1),Pt.empty.nextLayer=Pt.empty;class Tt{constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}finishChunk(t){this.chunks.push(new St(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}add(t,e,i){this.addInner(t,e,i)||(this.nextLayer||(this.nextLayer=new Tt)).add(t,e,i)}addInner(t,e,i){var n=t-this.lastTo||i.startSide-this.last.endSide;if(n<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(n<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);var i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0}finish(){return this.finishInner(Pt.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;t=new Pt(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,t}}class Wt{constructor(t,e,i,n=0){this.layer=t,this.skip=e,this.minPoint=i,this.rank=n}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,e=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}gotoInner(t,e,i){for(;this.chunkIndex=this.minPoint)break}}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.to-t.to||this.endSide-t.endSide}}class Xt{constructor(t){this.heap=t}static from(i,n=null,r=-1){let s=[];for(let e=0;e=r&&s.push(new Wt(t,n,r,e));return 1==s.length?s[0]:new Xt(s)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(var i of this.heap)i.goto(t,e);for(let t=this.heap.length>>1;0<=t;t--)Rt(this.heap,t);return this.next(),this}forward(t,e){for(var i of this.heap)i.forward(t,e);for(let t=this.heap.length>>1;0<=t;t--)Rt(this.heap,t);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Rt(this.heap,0)}}}function Rt(n,r){for(let i=n[r];;){let t=1+(r<<1);if(t>=n.length)break;let e=n[t];if(t+1e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&At(i,r)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}r=this.cursor.value;if(r.point){if(!(t&&this.cursor.to==this.to&&this.cursor.frome&&this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(i),this.cursor.next()}}if(i){let t=0;for(;tthis.pointRank);t++)(this.activeTo[t]>e||this.activeTo[t]==e&&this.active[t].endSide>this.point.endSide)&&i.push(this.active[t]);return i}openEnd(t){let e=0;for(;et;)e++;return e}}function Ct(t,e,i,n,r,s){t.goto(e),i.goto(n);var o=n+r;let a=n,l=n-e;for(;;){var h=t.to+l-i.to||t.endSide-i.endSide,c=h<0?t.to+l:i.to,O=Math.min(c,o);if(t.point||i.point?t.point&&i.point&&(t.point==i.point||t.point.eq(i.point))||s.comparePoint(a,O,t.point,i.point):O>a&&!function(e,i){if(e.length!=i.length)return!1;for(let t=0;t=i;t--)e[t+1]=e[t];e[i]=t}function zt(e,i){let n=-1,r=1e9;for(let t=0;t",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},Yt="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Mt="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Zt="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Et="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),jt="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),Dt=Yt&&(Et||+Yt[1]<57)||Zt&&Et,Ht=0;Ht<10;Ht++)qt[48+Ht]=qt[96+Ht]=String(Ht);for(Ht=1;Ht<=24;Ht++)qt[Ht+111]="F"+Ht;for(var It,Ht=65;Ht<=90;Ht++)qt[Ht]=String.fromCharCode(Ht+32),Vt[Ht]=String.fromCharCode(Ht);for(It in qt)Vt.hasOwnProperty(It)||(Vt[It]=qt[It]);function Gt(t){return(t.getSelection?t:document).getSelection()}function Bt(t,e){return!!e&&t.contains(1!=e.nodeType?e.parentNode:e)}function Nt(t,e){if(!e.anchorNode)return!1;try{return Bt(t,e.anchorNode)}catch(t){return!1}}function Ut(t){return 3==t.nodeType?ae(t,0,t.nodeValue.length).getClientRects():1==t.nodeType?t.getClientRects():[]}function Ft(t,e,i,n){return i&&(Kt(t,e,i,n,-1)||Kt(t,e,i,n,1))}function Jt(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e}function Kt(t,e,i,n,r){for(;;){if(t==i&&e==n)return!0;if(e==(r<0?0:te(t))){if("DIV"==t.nodeName)return!1;var s=t.parentNode;if(!s||1!=s.nodeType)return!1;e=Jt(t)+(r<0?0:1),t=s}else{if(1!=t.nodeType)return!1;t=t.childNodes[e+(r<0?-1:0)],e=r<0?te(t):0}}}function te(t){return(3==t.nodeType?t.nodeValue:t.childNodes).length}const ee={left:0,right:0,top:0,bottom:0};function ie(t,e){e=e?t.left:t.right;return{left:e,right:e,top:t.top,bottom:t.bottom}}class ne{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}}let re=null;function se(e){if(e.setActive)return e.setActive();if(re)return e.focus(re);let r=[];for(let t=e;t&&(r.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(e.focus(null==re?{get preventScroll(){return re={preventScroll:!0},!0}}:void 0),!re){re=!1;for(let n=0;no&&t.dom.parentNode==this.dom){h=i,c=r;break}r=e,n=e+t.breakAfter}return{from:l,to:c<0?t+this.length:c,startDOM:(a?this.children[a-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:hthis.pos||t==this.pos&&(0t.width)||a),o?ie(a,o<0):a}class We extends ke{constructor(t,e,i){super(),this.widget=t,this.length=e,this.side=i}static create(t,e,i){return new(t.customView||We)(t,e,i)}slice(t){return We.create(this.widget,this.length-t,this.side)}sync(){this.dom&&this.widget.updateDOM(this.dom)||(this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}getSide(){return this.side}merge(t,e,i,n,r){return!(i&&(!(i instanceof We&&this.widget.compare(i.widget))||0i&&st?i[r]=Math.max(i[r],e):i.push(t,e)}Ee.prototype.point=!0;class He extends ce{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(t,e,i,n,r,s){if(i){if(!(i instanceof He))return!1;this.dom||i.transferDOM(this)}return n&&this.setDeco(i?i.attrs:null),Re(this,t,e,i?i.children:Ie,r,s),!0}split(t){let e=new He;if(e.breakAfter=this.breakAfter,0==this.length)return e;let{i,off:n}=this.childPos(t);n&&(e.append(this.children[i].slice(n),0),this.children[i].merge(n,this.children[i].length,null,0,0),i++);for(let t=i;t!t.length||t[0]});class si{constructor(t,e){this.field=t,this.get=e}}class oi{from(t){return new si(this,t)}static define(){return new oi}}oi.decorations=oi.define(),oi.scrollMargins=oi.define();let ai=0;const li=L.define();class hi{constructor(t,e,i){this.id=t,this.create=e,this.fields=i,this.extension=li.of(this)}static define(t,e){let{eventHandlers:i,provide:n,decorations:r}=e||{},s=[];if(n)for(var o of Array.isArray(n)?n:[n])s.push(o);return i&&s.push(ci.from(t=>({plugin:t,handlers:i}))),r&&s.push(oi.decorations.from(r)),new hi(ai++,t,s)}static fromClass(e,t){return hi.define(t=>new e(t),t)}}const ci=oi.define();class Oi{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}takeField(t,e){for(var{field:i,get:n}of this.spec.fields)i==t&&e.push(n(this.value))}update(e){if(this.value){if(this.mustUpdate){var i=this.mustUpdate;if(this.mustUpdate=null,!this.value.update)return this;try{this.value.update(i)}catch(t){if(ni(i.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(t){}return Oi.dummy}}}else try{this.value=this.spec.create(e)}catch(t){return ni(e.state,t,"CodeMirror plugin crashed"),Oi.dummy}return this}destroy(e){var t;if(null!==(t=this.value)&&void 0!==t&&t.destroy)try{this.value.destroy()}catch(t){ni(e.state,t,"CodeMirror plugin crashed")}}}Oi.dummy=new Oi(hi.define(()=>({})));const di=L.define({combine:t=>t.reduce((t,e)=>Ae(e,t),{})}),ui=L.define({combine:t=>t.reduce((t,e)=>Ae(e,t),{})}),fi=L.define(),pi=L.define();class mi{constructor(t,e,i,n){this.fromA=t,this.toA=e,this.fromB=i,this.toB=n}join(t){return new mi(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;0i.toA)){if(n.toAr.push(new mi(t,e,i,n))),this.changedRanges=r;i=t.hasFocus;i!=t.inputState.notifiedFocused&&(t.inputState.notifiedFocused=i,this.flags|=1),this.docChanged&&(this.flags|=2)}get viewportChanged(){return 0<(4&this.flags)}get heightChanged(){return 0<(2&this.flags)}get geometryChanged(){return this.docChanged||0<(18&this.flags)}get focusChanged(){return 0<(1&this.flags)}get docChanged(){return this.transactions.some(t=>t.docChanged)}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}class vi extends ce{constructor(t){super(),this.view=t,this.compositionDeco=Ye.none,this.decorations=[],this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.setDOM(t.contentDOM),this.children=[new He],this.children[0].setParent(this),this.updateInner([new mi(0,0,0,t.state.doc.length)],this.updateDeco(),0)}get root(){return this.view.root}get editorView(){return this.view}get length(){return this.view.state.doc.length}update(t){let e=t.changedRanges;0ethis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=0),this.view.inputState.composing<0?this.compositionDeco=Ye.none:t.transactions.length&&(this.compositionDeco=function(t,e){var i=t.observer.selectionRange,i=i.focusNode&&$i(i.focusNode,i.focusOffset,0);if(!i)return Ye.none;let n=t.docView.nearest(i),r,s,o=i;if(n instanceof ke){for(;n.parent instanceof ke;)n=n.parent;r=n.posAtStart,s=r+n.length,o=n.dom}else{if(!(n instanceof He))return Ye.none;{for(;o.parentNode!=n.dom;)o=o.parentNode;let t=o.previousSibling;for(;t&&!ce.get(t);)t=t.previousSibling;r=s=t?ce.get(t).posAtEnd:n.posAtStart}}let a=e.mapPos(r,1),l=Math.max(a,e.mapPos(s,-1)),h=i.nodeValue,{state:c}=t;if(l-a"pointerselection"==t.annotation(st.userEvent));return 0==this.dirty&&0==e.length&&!(12&t.flags)&&t.state.selection.main.from>=this.view.viewport.from&&t.state.selection.main.to<=this.view.viewport.to?(this.updateSelection(s,o),!1):(this.updateInner(e,a,t.startState.doc.length,s,o),!0)}updateInner(t,e,i,n=!1,r=!1){this.updateChildren(t,e,i),this.view.observer.ignore(()=>{this.dom.style.height=this.view.viewState.domHeight+"px",this.dom.style.minWidth=this.minWidth?this.minWidth+"px":"";var t=be.chrome?{node:Gt(this.view.root).focusNode,written:!1}:void 0;this.sync(t),this.dirty=0,null!=t&&t.written&&(n=!0),this.updateSelection(n,r),this.dom.style.height=""})}updateChildren(e,i,t){let n=this.childCursor(t);for(let t=e.length-1;;t--){var r=0<=t?e[t]:null;if(!r)break;var{fromA:s,toA:o,fromB:a,toB:l}=r,{content:h,breakAtStart:c,openStart:O,openEnd:r}=Be.build(this.view.state.doc,a,l,i),{i:a,off:l}=n.findPos(o,1),{i:o,off:s}=n.findPos(s,-1);this.replaceRange(o,s,a,l,h,c,O,r)}}replaceRange(e,i,n,r,s,o,a,l){let h=this.children[e],c=s.length?s[s.length-1]:null;var O=c?c.breakAfter:o;if(e!=n||o||O||!(s.length<2)||!h.merge(i,r,s.length?c:null,0==i,a,l)){let t=this.children[n];for(rr.node.insertBefore(t,r.node.childNodes[r.offset]||null)),r=s=new le(t,0),e=!0}let o=this.view.observer.selectionRange;!(e||!o.focusNode||be.gecko&&n.empty&&yi(o.focusNode,o.focusOffset))&&Ft(r.node,r.offset,o.anchorNode,o.anchorOffset)&&Ft(s.node,s.offset,o.focusNode,o.focusOffset)||(this.view.observer.ignore(()=>{let e=Gt(this.root);var t,i;if(n.empty)be.gecko&&(!(t=yi(r.node,r.offset))||3==t||(i=$i(r.node,r.offset,1==t?1:-1))&&(r=new le(i,1==t?0:i.nodeValue.length))),e.collapse(r.node,r.offset),null!=n.bidiLevel&&null!=o.cursorBidiLevel&&(o.cursorBidiLevel=n.bidiLevel);else if(e.extend)e.collapse(r.node,r.offset),e.extend(s.node,s.offset);else{let t=document.createRange();n.anchor>n.head&&([r,s]=[s,r]),t.setEnd(s.node,s.offset),t.setStart(r.node,r.offset),e.removeAllRanges(),e.addRange(t)}}),this.view.observer.setSelectionRange(r,s)),this.impreciseAnchor=r.precise?null:new le(o.anchorNode,o.anchorOffset),this.impreciseHead=s.precise?null:new le(o.focusNode,o.focusOffset)}}enforceCursorAssoc(){var t,e,i=this.view.state.selection.main;let n=Gt(this.root);i.empty&&i.assoc&&n.modify&&((e=He.find(this,i.head))&&(t=e.posAtStart,i.head!=t&&i.head!=t+e.length&&(t=this.coordsAt(i.head,-1),e=this.coordsAt(i.head,1),!t||!e||t.bottom>e.top||(e=this.domAtPos(i.head+i.assoc),n.collapse(e.node,e.offset),n.modify("move",i.assoc<0?"forward":"backward","lineboundary")))))}mayControlSelection(){return this.view.state.facet(ri)?this.root.activeElement==this.dom:Nt(this.dom,this.view.observer.selectionRange)}nearest(e){for(let t=e;t;){var i=ce.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(t,e){let i=this.nearest(t);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart}domAtPos(t){let{i:e,off:i}=this.childCursor().findPos(t,-1);for(;e=s&&(r.push(t.dom.getBoundingClientRect().height),(l=t.dom.scrollWidth)>a&&(this.minWidth=a=l,this.minWidthFrom=i,this.minWidthTo=e)),i=e+t.breakAfter}return r}measureTextSize(){for(var t of this.children)if(t instanceof He){t=t.measureTextSize();if(t)return t}let e=document.createElement("div"),i,n;return e.className="cm-line",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);var t=Ut(e.firstChild)[0];i=e.getBoundingClientRect().height,n=t?t.width/27:7,e.remove()}),{lineHeight:i,charWidth:n}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new de(this.children,t,e)}computeBlockGapDeco(){let i=[],n=this.view.viewState;for(let t=0,e=0;;e++){var r,s=e==n.viewports.length?null:n.viewports[e],o=s?s.from-1:this.length;if(o>t&&(r=n.lineAt(o,0).bottom-n.lineAt(t,0).top,i.push(Ye.replace({widget:new Qi(r),block:!0,inclusive:!0}).range(t,o))),!s)break;t=s.to+1}return Ye.set(i)}updateDeco(){return this.decorations=[this.computeBlockGapDeco(),this.view.viewState.lineGapDeco,this.compositionDeco,...this.view.state.facet(fi),...this.view.pluginField(oi.decorations)]}scrollPosIntoView(t,r){var s,o,a,r=this.coordsAt(t,r);if(r){let t=0,e=0,i=0,n=0;for(var l of this.view.pluginField(oi.scrollMargins))l&&({left:s,right:o,top:a,bottom:l}=l,null!=s&&(t=Math.max(t,s)),null!=o&&(e=Math.max(e,o)),null!=a&&(i=Math.max(i,a)),null!=l&&(n=Math.max(n,l)));!function(t,s){let e=t.ownerDocument,o=e.defaultView;for(let r=t.parentNode;r;)if(1==r.nodeType){let t,e=r==document.body;if(e)t={left:0,right:(l=o).innerWidth,top:0,bottom:l.innerHeight};else{if(r.scrollHeight<=r.clientHeight&&r.scrollWidth<=r.clientWidth){r=r.parentNode;continue}l=r.getBoundingClientRect();t={left:l.left,right:l.left+r.clientWidth,top:l.top,bottom:l.top+r.clientHeight}}let i=0,n=0;var a;if(s.topt.bottom&&(n=s.bottom-t.bottom+5),s.leftt.right&&(i=s.right-t.right+5),(i||n)&&(e?o.scrollBy(i,n):(n&&(a=r.scrollTop,r.scrollTop+=n,n=r.scrollTop-a),i&&(a=r.scrollLeft,r.scrollLeft+=i,i=r.scrollLeft-a),s={left:s.left-i,top:s.top-n,right:s.right-i,bottom:s.bottom-n})),e)break;r=r.assignedSlot||r.parentNode}else{if(11!=r.nodeType)break;r=r.host}var l}(this.dom,{left:r.left-t,top:r.top-i,right:r.right+e,bottom:r.bottom+n})}}}class Qi extends qe{constructor(t){super(),this.height=t}toDOM(){var t=document.createElement("div");return this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}}class wi extends qe{constructor(t,e){super(),this.top=t,this.text=e}eq(t){return this.top==t.top&&this.text==t.text}toDOM(){return this.top}ignoreEvent(){return!1}get customView(){return Xe}}function $i(t,e,i){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&0=i){if(o.level==n)return t;(s<0||(0!=r?r<0?o.fromi:e[s].level>o.level))&&(s=t)}}if(s<0)throw new RangeError("Index out of range");return s}}const qi=[];function Vi(o,t){var r,a=o.length,l=t==Si?1:2,h=t==Si?2:1;if(!o||1==l&&!Li.test(o))return Yi(a);for(let e=0,i=l,n=l;ef;){for(var m=t,g=2!=qi[--t];t>f&&g==(2!=qi[t-1]);)t--;i.push(new zi(t,m,g?2:1))}else i.push(new zi(f,e,0))}else for(let t=0;te.top+1}function Ei(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function Di(t,n,r){let s,o,a,l,h,c,O,d;for(let i=t.firstChild;i;i=i.nextSibling){var u=Ut(i);for(let e=0;em?p.left-m:Math.max(0,m-p.right)),p=(m=r,(p=t).top>m?p.top-m:Math.max(0,m-p.bottom));if(0==f&&0==p)return(3==i.nodeType?Hi:Di)(i,n,r);(!s||l>p||l==p&&a>f)&&(s=i,o=t,a=f,l=p),0==f?r>t.bottom&&(!O||O.bottomt.top)&&(c=i,d=t):O&&Zi(O,t)?O=ji(O,t.bottom):d&&Zi(d,t)&&(d=Ei(d,t.top))}}var m,p;if(O&&O.bottom>=r?(s=h,o=O):d&&d.top<=r&&(s=c,o=d),!s)return{node:t,offset:0};var e=Math.max(o.left,Math.min(o.right,n));return 3==s.nodeType?Hi(s,e,r):a||"true"!=s.contentEditable?{node:t,offset:Array.prototype.indexOf.call(t.childNodes,s)+(n>=(o.left+o.right)/2?1:0)}:Di(s,e,r)}function Hi(n,r,e){var t=n.nodeValue.length;let s=-1,o=1e9,a=0;for(let i=0;ie?h.top-e:e-h.bottom)-1;if(h.left-1<=r&&h.right+1>=r&&c=(h.left+h.right)/2,e=t;if((be.chrome||be.gecko)&&ae(n,i).getBoundingClientRect().left==h.right&&(e=!t),c<=0)return{node:n,offset:i+(e?1:0)};s=i+(e?1:0),o=c}}}}return{node:n,offset:-1i||s.bottomi?-1:1,i=Math.min(s.bottom-o,Math.max(s.top+o,i)),t)return-1;t=!0}if(s.type==Ve.Text)break;i=0e.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:null;t=Math.max(r.left+1,Math.min(r.right-1,t));let h=e.root,c=h.elementFromPoint(t,i),O,d=-1;return!c||!e.contentDOM.contains(c)||e.docView.nearest(c)instanceof We||(h.caretPositionFromPoint?(a=h.caretPositionFromPoint(t,i))&&({offsetNode:O,offset:d}=a):!h.caretRangeFromPoint||(a=h.caretRangeFromPoint(t,i))&&({startContainer:O,startOffset:d}=a,be.safari&&function(e,t,i){let n;if(3!=e.nodeType||t!=(n=e.nodeValue.length))return!1;for(let t=e.nextSibling;t;t=e.nextSibling)if(1!=t.nodeType||"BR"!=t.nodeName)return!1;return ae(e,n-1,n).getBoundingClientRect().left>i}(O,d,t)&&(O=void 0))),O&&e.docView.dom.contains(O)||(l=He.find(e.docView,l),{node:O,offset:d}=Di(l.dom,t,i)),e.docView.posFromDOM(O,d)}function Gi(r,t,s,o){let a=r.state.doc.lineAt(t.head),l=r.bidiSpans(a);for(let i=t,n=null;;){let t=function(t,e,i,n,r){let s=n.head-t.from,o=-1;if(0==s){if(!r||!t.length)return null;e[0].level!=i&&(s=e[0].side(!1,i),o=0)}else if(s==t.length){if(r)return null;let t=e[e.length-1];t.level!=i&&(s=t.side(!0,i),o=e.length-1)}o<0&&(o=zi.find(e,s,null!==(l=n.bidiLevel)&&void 0!==l?l:-1,n.assoc));let a=e[o];s==a.side(r,i)&&(a=e[o+=r?1:-1],s=a.side(!r,i));var l=r==(a.dir==i),n=b(t.text,s,l);if(Mi=t.text.slice(Math.min(s,n),Math.max(s,n)),n!=a.side(r,i))return _.cursor(n+t.from,l?-1:1,a.level);let h=o==(r?e.length-1:0)?null:e[o+(r?1:-1)];return h||a.level==i?h&&h.level>1;for(let t=s<0?o.top:o.bottom,e=0;e<50;e+=10){var O=Ii(i,{x:h,y:t+(c+e)*s},s);if(null==O)break;if(O!=r)return _.cursor(O,void 0,void 0,l)}}let{doc:d}=i.state,u=d.lineAt(r),f=i.state.tabSize,p=t.goalColumn,m=0;if(null==p){for(const $=d.iterRange(u.from,r);!$.next().done;)m=x($.value,m,f);p=m*i.defaultCharacterWidth}else m=Math.round(p/i.defaultCharacterWidth);if(s<0&&0==u.from)return _.cursor(0);if(0=m&&!y.next().done;){var{offset:Q,leftOver:w}=function(e,i,n,r){for(let t=0;t{"keydown"==i&&this.keydown(n,t)||Ji(n,t)&&!this.ignoreDuringComposition(t)&&(this.mustFlushObserver(t)&&n.observer.forceFlush(),this.runCustomHandlers(i,n,t)?t.preventDefault():e(n,t))}),this.registeredEvents.push(i)}this.notifiedFocused=n.hasFocus,this.ensureHandlers(n)}setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}ensureHandlers(i){var t;for(t of this.customHandlers=i.pluginField(ci))for(let e in t.handlers)this.registeredEvents.indexOf(e)<0&&"scroll"!=e&&(this.registeredEvents.push(e),i.contentDOM.addEventListener(e,t=>{Ji(i,t)&&this.runCustomHandlers(e,i,t)&&t.preventDefault()}))}runCustomHandlers(i,n,r){for(var s of this.customHandlers){let t=s.handlers[i],e=!1;if(t){try{e=t.call(s.plugin,r,n)}catch(t){ni(n.state,t)}if(e||r.defaultPrevented)return be.android&&"keydown"==i&&13==r.keyCode&&n.observer.flushSoon(),!0}}return!1}runScrollHandlers(e,i){for(var n of this.customHandlers){let t=n.handlers.scroll;if(t)try{t.call(n.plugin,i,e)}catch(t){ni(e.state,t)}}}keydown(t,e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),!this.screenKeyEvent(t,e))return!(!be.ios||13!=e.keyCode&&8!=e.keyCode||e.ctrlKey||e.altKey||e.metaKey||e.synthetic)&&(this[13==e.keyCode?"lastIOSEnter":"lastIOSBackspace"]=Date.now(),!0)}ignoreDuringComposition(t){return!!/^key/.test(t.type)&&(0=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}(e,i)&&null,!1===this.dragging&&(i.preventDefault(),this.select(i))}move(t){if(0==t.buttons)return this.destroy();!1===this.dragging&&this.select(t)}up(t){null==this.dragging&&this.select(this.startEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.inputState.mouseSelection=null}select(t){let e=this.style.get(t,this.extend,this.multiple);e.eq(this.view.state.selection)&&e.main.assoc==this.view.state.selection.main.assoc||this.view.dispatch({selection:e,annotations:st.userEvent.of("pointerselection"),scrollIntoView:!0})}update(t){t.docChanged&&this.dragging&&(this.dragging=this.dragging.map(t.changes)),this.style.update(t)}}function Ji(i,n){if(!n.bubbles)return 1;if(!n.defaultPrevented){for(let t=n.target,e;t!=i.contentDOM;t=t.parentNode)if(!t||11==t.nodeType||(e=ce.get(t))&&e.ignoreEvent(n))return;return 1}}const Ki=Object.create(null),tn=be.ie&&be.ie_version<15||be.ios&&be.webkit_version<604;function en(t,r){let{state:s}=t,e,o=1,a=s.toText(r),l=a.lines==s.selection.ranges.length;if(dn&&s.selection.ranges.every(t=>t.empty)&&dn==a.toString()){let n=-1;e=s.changeByRange(t=>{var e=s.doc.lineAt(t.from);if(e.from==n)return{range:t};n=e.from;var i=s.toText((l?a.line(o++).text:r)+s.lineBreak);return{changes:{from:e.from,insert:i},range:_.cursor(t.from+i.length)}})}else e=l?s.changeByRange(t=>{var e=a.line(o++);return{changes:{from:t.from,to:t.to,insert:e.text},range:_.cursor(t.from+e.length)}}):s.replaceSelection(a);t.dispatch(e,{annotations:st.userEvent.of("paste"),scrollIntoView:!0})}Ki.keydown=(t,e)=>{t.inputState.setSelectionOrigin("keyboardselection")};let nn=0;function rn(i,n,r,t){if(1==t)return _.cursor(n,r);if(2==t)return function(t,e,i=1){let n=t.charCategorizer(e),r=t.doc.lineAt(e),s=e-r.from;if(0==r.length)return _.cursor(e);0==s?i=1:s==r.length&&(i=-1);let o=s,a=s;i<0?o=b(r.text,s,!1):a=b(r.text,s);for(var l=n(r.text.slice(o,a));0{nn=Date.now(),t.inputState.setSelectionOrigin("pointerselection")},Ki.touchmove=t=>{t.inputState.setSelectionOrigin("pointerselection")},Ki.mousedown=(e,i)=>{if(e.observer.flush(),!(nn>Date.now()-2e3)){let t=null;for(var n of e.state.facet(Ke))if(t=n(e,i),t)break;t||0!=i.button||(t=function(o,t){let a=an(o,t),l=function(t){if(!ln)return t.detail;var e=hn,i=On;return hn=t,On=Date.now(),cn=!e||i>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(cn+1)%3:1}(t),h=o.state.selection,c=a,O=t;return{update(t){t.changes&&(a&&(a.pos=t.changes.mapPos(a.pos)),h=h.map(t.changes))},get(t,e,i){let n;if(t.clientX==O.clientX&&t.clientY==O.clientY?n=c:(n=c=an(o,t),O=t),!n||!a)return h;let r=rn(o,n.pos,n.bias,l);var s;return a.pos==n.pos||e||(s=rn(o,a.pos,a.bias,l),t=Math.min(s.from,r.from),s=Math.max(s.to,r.to),r=tse(e.contentDOM)),e.inputState.startMouseSelection(e,i,t))}};let sn=(t,e)=>t>=e.top&&t<=e.bottom,on=(t,e,i)=>sn(e,i)&&t>=i.left&&t<=i.right;function an(t,e){var i=t.posAtCoords({x:e.clientX,y:e.clientY});return null==i?null:{pos:i,bias:function(t,e,i,n){let r=He.find(t.docView,e);return r&&0!=(t=e-r.posAtStart)&&(t==r.length||(e=r.coordsAt(t,-1))&&on(i,n,e)||(!(t=r.coordsAt(t,1))||!on(i,n,t))&&e&&sn(n,e))?-1:1}(t,i,e.clientX,e.clientY)}}const ln=be.ie&&be.ie_version<=11;let hn=null,cn=0,On=0;Ki.dragstart=(t,e)=>{var{selection:{main:i}}=t.state;let{mouseSelection:n}=t.inputState;n&&(n.dragging=i),e.dataTransfer&&(e.dataTransfer.setData("Text",t.state.sliceDoc(i.from,i.to)),e.dataTransfer.effectAllowed="copyMove")},Ki.drop=(e,i)=>{if(i.dataTransfer&&e.state.facet(ri)){var n=e.posAtCoords({x:i.clientX,y:i.clientY}),r=i.dataTransfer.getData("Text");if(null!=n&&r){i.preventDefault();var{mouseSelection:i}=e.inputState,i=i&&i.dragging&&i.dragMove?{from:i.dragging.from,to:i.dragging.to}:null,r={from:n,insert:r};let t=e.state.changes(i?[i,r]:r);e.focus(),e.dispatch({changes:t,selection:{anchor:t.mapPos(n,-1),head:t.mapPos(n,1)},annotations:st.userEvent.of("drop")})}}},Ki.paste=(e,i)=>{if(e.state.facet(ri)){e.observer.flush();let t=tn?null:i.clipboardData;var n=t&&t.getData("text/plain");n?(en(e,n),i.preventDefault()):function(e){let i=e.dom.parentNode;if(i){let t=i.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{e.focus(),t.remove(),en(e,t.value)},50)}}(e)}};let dn=null;function un(t){t.docView.compositionDeco.size&&t.update([])}Ki.copy=Ki.cut=(e,i)=>{var{text:n,ranges:r,linewise:s}=function(e){let i=[],n=[],r=!1;for(var t of e.selection.ranges)t.empty||(i.push(e.sliceDoc(t.from,t.to)),n.push(t));if(!i.length){let t=-1;for(var{from:s}of e.selection.ranges){s=e.doc.lineAt(s);s.number>t&&(i.push(s.text),n.push({from:s.from,to:Math.min(e.doc.length,s.to+1)})),t=s.number}r=!0}return{text:i.join(e.lineBreak),ranges:n,linewise:r}}(e.state);if(n){dn=s?n:null;let t=tn?null:i.clipboardData;t?(i.preventDefault(),t.clearData(),t.setData("text/plain",n)):function(e,i){let n=e.dom.parentNode;if(n){let t=n.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.value=i,t.focus(),t.selectionEnd=i.length,t.selectionStart=0,setTimeout(()=>{t.remove(),e.focus()},50)}}(e,n),"cut"==i.type&&e.state.facet(ri)&&e.dispatch({changes:r,scrollIntoView:!0,annotations:st.userEvent.of("cut")})}},Ki.focus=Ki.blur=t=>{setTimeout(()=>{t.hasFocus!=t.inputState.notifiedFocused&&t.update([])},10)},Ki.beforeprint=t=>{t.viewState.printing=!0,t.requestMeasure(),setTimeout(()=>{t.viewState.printing=!1,t.requestMeasure()},2e3)},Ki.compositionstart=Ki.compositionupdate=t=>{t.inputState.composing<0&&(t.docView.compositionDeco.size&&(t.observer.flush(),un(t)),t.inputState.composing=0)},Ki.compositionend=t=>{t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),setTimeout(()=>{t.inputState.composing<0&&un(t)},50)},Ki.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};const fn=["pre-wrap","normal","pre-line"];class pn{constructor(){this.doc=d.empty,this.lineWrapping=!1,this.direction=ki.LTR,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength)),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefresh(e,t,i){let n=!1;for(let t=0;t=e?r:c.lineAt(e,vn.ByPosNoHeight,a,0,0);for(n+=O.to-e,e=O.to;02*r){var o=t[e-1];o.break?t.splice(--e,1,o.left,null,o.right):t.splice(--e,1,o.left,o.right),i+=1+o.break,n-=o.size}else{if(!(r>2*n))break;o=t[i];o.break?t.splice(i,1,o.left,null,o.right):t.splice(i,1,o.left,o.right),i+=2+o.break,r-=o.size}else nt&&e.push(new yn(r.from-t-1).updateHeight(n,t));i<=s&&r.more;){var o=n.doc.lineAt(i).length;e.length&&e.push(null);let t=new $n(o,r.heights[r.index++]);t.outdated=!1,e.push(t),i+=o+1}return i<=s&&e.push(null,new yn(s-i).updateHeight(n,i)),n.heightChanged=!0,Qn.of(e)}return(e||this.outdated)&&(this.setHeight(n,n.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class bn extends Qn{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return 1&this.flags}blockAt(t,e,i,n){var r=i+this.left.height;return to))return l;e=e==vn.ByPosNoHeight?vn.ByPosNoHeight:vn.ByPos;return a?l.join(this.right.lineAt(o,e,i,s,o)):this.left.lineAt(o,e,i,n,r).join(l)}forEachLine(t,e,i,n,r,s){var o,a=n+this.left.height,l=r+this.left.length+this.break;this.break?(t=t&&o.from<=e&&s(o),e>o.to&&this.right.forEachLine(o.to+1,e,i,a,l,s))}replace(t,e,i){var n=this.left.length+this.break;if(ethis.left.length)return this.balanced(this.left,this.right.replace(t-n,e-n,i));let r=[];0=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){var i=this.left.length,n=i+this.break;if(n<=t)return this.right.decomposeRight(t-n,e);t2*e.size||e.size>2*t.size?Qn.of(this.break?[t,null,e]:[t,e]):(this.left=t,this.right=e,this.height=t.height+e.height,this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,i=!1,n){let{left:r,right:s}=this,o=e+r.length+this.break,a=null;return n&&n.from<=e+r.length&&n.more?a=r=r.updateHeight(t,e,i,n):r.updateHeight(t,e,i),n&&n.from<=o+s.length&&n.more?a=s=s.updateHeight(t,o,i,n):s.updateHeight(t,o,i),a?this.balanced(r,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function xn(t,e){let i,n;null==t[e]&&(i=t[e-1])instanceof yn&&(n=t[e+1])instanceof yn&&t.splice(e-1,3,new yn(i.length+1+n.length))}class kn{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,i){if(-1this.pos||!this.isCovered)&&this.nodes.push(new $n(t-this.pos,-1)),(this.writtenTo=t)t&&this.nodes.push(new $n(this.pos-t,-1)),this.writtenTo=this.pos)}blankContent(t,e){let i=new yn(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();var t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof $n)return t;t=new $n(0,-1);return this.nodes.push(t),t}addBlock(t){this.enterLine(),t.type!=Ve.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,t.type!=Ve.WidgetBefore&&(this.covering=t)}addLineDeco(t,e){let i=this.ensureLine();i.length+=e,i.collapsed+=e,i.widgetHeight=Math.max(i.widgetHeight,t),this.writtenTo=this.pos=this.pos+e}finish(t){var e,i=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(-1t.draw(!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let t=0;t<=1;t++){let i=t?n.head:n.anchor;var r,s;e.some(({from:t,to:e})=>i>=t&&i<=e)||({from:r,to:s}=this.lineAt(i,0),e.push(new Xn(r,s)))}this.viewports=e.sort((t,e)=>t.from-e.from),this.scaler=this.heightMap.height<=7e6?An:new Ln(this.heightOracle.doc,this.heightMap,this.viewports)}update(t,e=null){var i=this.state;this.state=t.state;var n,r,s,o=this.state.facet(fi),a=t.changedRanges,s=mi.extendWithRanges(a,(n=t.startState.facet(fi),r=o,s=t?t.changes:k.empty(this.state.doc.length),a=new Sn,Pt.compare(n,r,s,a,0),a.changes)),a=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(o,i.doc,this.heightOracle.setDoc(this.state.doc),s),this.heightMap.height!=a&&(t.flags|=2);let l=s.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,e)),l.eq(this.viewport)||(this.viewport=l,t.flags|=4),this.updateForViewport(),(this.lineGaps.length||15e3t.clientHeight||t.scrollWidth>t.clientWidth)&&"visible"!=l.overflow&&(a=t.getBoundingClientRect(),n=Math.max(n,a.left),r=Math.min(r,a.right),s=Math.max(s,a.top),o=Math.min(o,a.bottom)),t="absolute"==l.position||"fixed"==l.position?t.offsetParent:t.parentNode}else{if(11!=t.nodeType)break;t=t.host}return{left:n-i.left,right:r-i.left,top:s-(i.top+t),bottom:o-(i.top+t)}}(i,this.paddingTop),o=s.top-this.pixelViewport.top,a=s.bottom-this.pixelViewport.bottom;if(this.pixelViewport=s,this.inView=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left,!this.inView)return 0;var l,h=t.measureVisibleLineHeights();let c=!1,O=0,d=0,u=this.heightOracle;return e||(l=t.dom.clientWidth,(u.mustRefresh(h,n,r)||u.lineWrapping&&Math.abs(l-this.contentWidth)>u.charWidth)&&({lineHeight:s,charWidth:e}=t.measureTextSize(),c=u.refresh(n,r,s,e,l/e,h),c&&(t.minWidth=0,d|=16)),this.contentWidth!=l&&(this.contentWidth=l,d|=16),0this.viewport.to))&&((h=this.getViewport(O,this.scrollTo)).from==this.viewport.from&&h.to==this.viewport.to||(this.viewport=h,d|=4)),this.updateForViewport(),(this.lineGaps.length||15e3o.to&&({bottom:e}=i.lineAt(e.head,vn.ByPos,n,0,0),o=new Xn(i.lineAt(e-(s-r)-500,vn.ByHeight,n,0,0).from,i.lineAt(e+500,vn.ByHeight,n,0,0).to))),o}mapViewport(t,e){var i=e.mapPos(t.from,-1),t=e.mapPos(t.to,1);return new Xn(this.heightMap.lineAt(i,vn.ByPos,this.state.doc,0,0).from,this.heightMap.lineAt(t,vn.ByPos,this.state.doc,0,0).to)}viewportIsAppropriate({from:t,to:e},i=0){var{top:n}=this.heightMap.lineAt(t,vn.ByPos,this.state.doc,0,0),{bottom:r}=this.heightMap.lineAt(e,vn.ByPos,this.state.doc,0,0),{visibleTop:s,visibleBottom:o}=this;return(0==t||n<=s-Math.max(10,Math.min(-i,250)))&&(e==this.state.doc.length||r>=o+Math.max(10,Math.min(i,250)))&&s-2e3{if(!(r.length<1e4)){var s=function(t,e,i){let n=[],r=t,s=0;Pt.spans(i.facet(fi),t,e,{span(){},point(t,e){t>r&&(n.push({from:r,to:t}),s+=t-r),r=e}},20),r=r.from&&(t=o.from),o.from<=r.to&&o.to>=e&&(e=o.to);let i=t-1e4,n=e+1e4;i>r.from+5e3&&l.push(Cn(a,t=>t.from==r.from&&t.to>i-5e3&&t.to<5e3+i)||new Pn(r.from,i,this.gapSize(r,i,!0,s))),nt.to==r.to&&t.from>n-5e3&&t.fromt.draw(this.heightOracle.lineWrapping))),8)}computeVisibleRanges(){let t=this.state.facet(fi);this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];Pt.spans(t,this.viewport.from,this.viewport.to,{span(t,e){i.push({from:t,to:e})},point(){}},20),this.visibleRanges=i}lineAt(t,e){return e+=this.paddingTop,zn(this.heightMap.lineAt(t,vn.ByPos,this.state.doc,e,0),this.scaler,e)}lineAtHeight(t,e){return e+=this.paddingTop,zn(this.heightMap.lineAt(this.scaler.fromDOM(t,e),vn.ByHeight,this.state.doc,e,0),this.scaler,e)}blockAtHeight(t,e){return e+=this.paddingTop,zn(this.heightMap.blockAt(this.scaler.fromDOM(t,e),this.state.doc,e,0),this.scaler,e)}forEachLine(t,e,i,n){return n+=this.paddingTop,this.heightMap.forEachLine(t,e,this.state.doc,n,0,1==this.scaler.scale?i:t=>i(zn(t,this.scaler,n)))}get contentHeight(){return this.domHeight+this.paddingTop+this.paddingBottom}get domHeight(){return this.scaler.toDOM(this.heightMap.height,this.paddingTop)}}class Xn{constructor(t,e){this.from=t,this.to=e}eq(t){return this.from==t.from&&this.to==t.to}}function Rn({total:t,ranges:e},i){if(i<=0)return e[0].from;if(1<=i)return e[e.length-1].to;let n=Math.floor(t*i);for(let t=0;;t++){var{from:r,to:s}=e[t],s=s-r;if(n<=s)return r+n;n-=s}}function _n(t,e){let i=0;for(var{from:n,to:r}of t.ranges){if(e<=r){i+=e-n;break}i+=r-n}return i/t.total}function Cn(t,e){for(var i of t)if(e(i))return i}const An={toDOM(t){return t},fromDOM(t){return t},scale:1};class Ln{constructor(r,s,t){let o=0,e=0,i=0;this.viewports=t.map(({from:t,to:e})=>{var i=s.lineAt(t,vn.ByPos,r,0,0).top,n=s.lineAt(e,vn.ByPos,r,0,0).bottom;return o+=n-i,{from:t,to:e,top:i,bottom:n,domTop:0,domBottom:0}}),this.scale=(7e6-o)/(s.height-o);for(var n of this.viewports)n.domTop=i+(n.top-e)*this.scale,i=n.domBottom=n.domTop+(n.bottom-n.top),e=n.bottom}toDOM(n,r){n-=r;for(let t=0,e=0,i=0;;t++){var s=tzn(t,e,i)):t.type)}const qn=L.define({combine:t=>t.join(" ")}),Vn=L.define({combine:t=>-1{if("&"==t)return e;if(!i||!i[t])throw new RangeError(`Unsupported selector: ${t}`);return i[t]}):e+" "+t}})}const Dn=jn("."+Yn,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,minHeight:"100%",display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none"},".cm-lineWrapping":{whiteSpace:"pre-wrap",overflowWrap:"anywhere"},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 4px"},".cm-selectionLayer":{zIndex:-1,contain:"size style"},".cm-selectionBackground":{position:"absolute"},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{zIndex:100,contain:"size style",pointerEvents:"none"},"&.cm-focused .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},".cm-cursor":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none",display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#f3f9ff"},"&dark .cm-activeLine":{backgroundColor:"#223039"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-placeholder":{color:"#888",display:"inline-block"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"3px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},En),Hn={childList:!0,characterData:!0,subtree:!0,characterDataOldValue:!0},In=be.ie&&be.ie_version<=11;class Gn{constructor(i,t,e){this.view=i,this.onChange=t,this.onScrollChanged=e,this.active=!1,this.ignoreSelection=new ne,this.delayedFlush=-1,this.queue=[],this.lastFlush=0,this.scrollTargets=[],this.intersection=null,this.intersecting=!1,this._selectionRange=null,this.parentCheck=-1,this.dom=i.contentDOM,this.observer=new MutationObserver(t=>{for(var e of t)this.queue.push(e);this._selectionRange=null,(be.ie&&be.ie_version<=11||be.ios&&i.composing)&&t.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),In&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.start(),this.onScroll=this.onScroll.bind(this),window.addEventListener("scroll",this.onScroll),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),0{this.delayedFlush=-1,this.flush()},20))}forceFlush(){0<=this.delayedFlush&&(window.clearTimeout(this.delayedFlush),this.delayedFlush=-1,this.flush())}flush(){if(!(0<=this.delayedFlush)){this.lastFlush=Date.now();let n=this.queue;for(var t of this.observer.takeRecords())n.push(t);n.length&&(this.queue=[]);var r=this.selectionRange,s=!this.ignoreSelection.eq(r)&&Nt(this.dom,r);if(0!=n.length||s){let t=-1,e=-1,i=!1;for(var o of n){o=this.readMutation(o);o&&(o.typeOver&&(i=!0),-1==t?{from:t,to:e}=o:(t=Math.min(o.from,t),e=Math.max(o.to,e)))}r=this.view.state;(-1this.view.docView.sync()),this.view.docView.dirty=0),this.view.docView.updateSelection()),this.clearSelection()}}}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty(),"childList"!=t.type)return{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue};var i=Bn(e,t.previousSibling||t.target.previousSibling,-1),t=Bn(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:t?e.posBefore(t):e.posAtEnd,typeOver:!1}}destroy(){this.stop(),this.intersection&&this.intersection.disconnect();for(var t of this.scrollTargets)t.removeEventListener("scroll",this.onScroll);window.removeEventListener("scroll",this.onScroll),clearTimeout(this.parentCheck)}}function Bn(t,e,i){for(;e;){var n=ce.get(e);if(n&&n.parent==t)return n;n=e.parentNode;e=n!=t.dom?n:0Date.now()-100||be.android&&t.text.length=o?s-i:0,s-=l,a=s+(a-o),o=s):a=a?s-i:0,s-=i,o=s+(o-a),a=s)}return{from:s,toA:o,toB:a}}(n.state.sliceDoc(h,c),t.text,e-h,i);O&&(s={from:h+O.from,to:h+O.toA,insert:n.state.toText(t.text.slice(O.from,O.toB))})}else!n.hasFocus&&n.state.facet(ri)||(c=n.observer.selectionRange,{impreciseHead:h,impreciseAnchor:O}=n.docView,h=h&&h.node==c.focusNode&&h.offset==c.focusOffset||!Bt(n.contentDOM,c.focusNode)?n.state.selection.main.head:n.docView.posFromDOM(c.focusNode,c.focusOffset),c=O&&O.node==c.anchorNode&&O.offset==c.anchorOffset||!Bt(n.contentDOM,c.anchorNode)?n.state.selection.main.anchor:n.docView.posFromDOM(c.anchorNode,c.anchorOffset),h==a.head&&c==a.anchor||(o=_.single(c,h)));if(s||o)if(!s&&r&&!a.empty&&o&&o.main.empty?s={from:a.from,to:a.to,insert:n.state.doc.slice(a.from,a.to)}:s&&s.from>=a.from&&s.to<=a.to&&(s.from!=a.from||s.to!=a.to)&&a.to-a.from-(s.to-s.from)<=4&&(s={from:a.from,to:a.to,insert:n.state.doc.slice(a.from,s.from).append(s.insert).append(n.state.doc.slice(s.to,a.to))}),s){let i=n.state;if(!(be.android&&(s.from==a.from&&s.to==a.to&&1==s.insert.length&&2==s.insert.lines&&Kn(n,"Enter",13)||s.from==a.from-1&&s.to==a.to&&0==s.insert.length&&Kn(n,"Backspace",8)||s.from==a.from&&s.to==a.to+1&&0==s.insert.length&&Kn(n,"Delete",46))||be.ios&&(n.inputState.lastIOSEnter>Date.now()-225&&1Date.now()-225&&!s.insert.length&&Kn(n,"Backspace",8)))){let e=s.insert.toString();if(!n.state.facet(ii).some(t=>t(n,s.from,s.to,e))){0<=n.inputState.composing&&n.inputState.composing++;let t;var d;t=s.from>=a.from&&s.to<=a.to&&s.to-s.from>=(a.to-a.from)/3&&(!o||o.main.empty&&o.main.from==s.from+s.insert.length)?(r=a.froms.to?i.sliceDoc(s.to,a.to):"",i.replaceSelection(n.state.toText(r+s.insert.sliceString(0,void 0,n.state.lineBreak)+d))):{changes:d=i.changes(s),selection:o&&!i.selection.main.eq(o.main)&&o.main.to<=d.newLength?i.selection.replaceRange(o.main):void 0},n.dispatch(t,{scrollIntoView:!0,annotations:st.userEvent.of("input")})}}}else if(o&&!o.main.eq(a)){let t=!1,e;n.inputState.lastSelectionTime>Date.now()-50&&("keyboardselection"==n.inputState.lastSelectionOrigin?t=!0:e=st.userEvent.of(n.inputState.lastSelectionOrigin)),n.dispatch({selection:o,scrollIntoView:t,annotations:e})}}class Un{constructor(t,e){this.points=t,this.view=e,this.text="",this.lineBreak=e.state.lineBreak}readRange(e,i){if(e){var n=e.parentNode;for(let t=e;;){this.findPointBefore(n,t),this.readNode(t);var r=t.nextSibling;if(r==i)break;var s=ce.get(t),o=ce.get(r);((s?s.breakAfter:Fn(t))||(o?o.breakAfter:Fn(r))&&("BR"!=t.nodeName||t.cmIgnore))&&(this.text+=this.lineBreak),t=r}this.findPointBefore(n,i)}}readNode(i){if(!i.cmIgnore){var n=ce.get(i);let t=n&&n.overrideDOMText,e;null!=t?e=t.sliceString(0,void 0,this.lineBreak):3==i.nodeType?e=i.nodeValue:"BR"==i.nodeName?e=i.nextSibling?this.lineBreak:"":1==i.nodeType&&this.readRange(i.firstChild,null),null!=e&&(this.findPointIn(i,e.length),this.text+=e,be.chrome&&13==this.view.inputState.lastKeyCode&&!i.nextSibling&&/\n\n$/.test(this.text)&&(this.text=this.text.slice(0,-1)))}}findPointBefore(t,e){for(var i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointIn(t,e){for(var i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e))}}function Fn(t){return 1==t.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}class Jn{constructor(t,e){this.node=t,this.offset=e,this.pos=-1}}function Kn(t,e,i){i={key:e,code:e,keyCode:i,which:i,cancelable:!0};let n=new KeyboardEvent("keydown",i);n.synthetic=!0,t.contentDOM.dispatchEvent(n);let r=new KeyboardEvent("keyup",i);return r.synthetic=!0,t.contentDOM.dispatchEvent(r),n.defaultPrevented||r.defaultPrevented}class tr{constructor(t={}){this.plugins=[],this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: absolute; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=t.dispatch||(t=>this.update([t])),this.dispatch=this.dispatch.bind(this),this.root=t.root||document,this.viewState=new Wn(t.state||pt.create()),this.plugins=this.state.facet(li).map(t=>new Oi(t).update(this)),this.observer=new Gn(this,(t,e,i)=>{Nn(this,t,e,i)},t=>{this.inputState.runScrollHandlers(this,t),this.observer.intersecting&&this.measure()}),this.inputState=new Ni(this),this.docView=new vi(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,window.addEventListener("resize",()=>{-1==nr&&(nr=setTimeout(rr,50))}),this.requestMeasure(),t.parent&&t.parent.appendChild(this.dom)}get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return 0t.scrollIntoView)?n.selection.main:null;this.viewState.update(i,s),this.bidiCache=or.update(this.bidiCache,i.changes),i.empty||this.updatePlugins(i),e=this.docView.update(i),this.state.facet(pi)!=this.styleModules&&this.mountStyles(),this.updateAttrs(),this.showAnnouncements(t)}finally{this.updateState=0}if((e||scrollTo||this.viewState.mustEnforceCursorAssoc)&&this.requestMeasure(),!i.empty)for(var o of this.state.facet(ei))o(i)}setState(t){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");this.updateState=2;try{for(var e of this.plugins)e.destroy(this);this.viewState=new Wn(t),this.plugins=t.facet(li).map(t=>new Oi(t).update(this)),this.docView=new vi(this),this.inputState.ensureHandlers(this),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}this.requestMeasure()}updatePlugins(i){let t=i.startState.facet(li),n=i.state.facet(li);if(t!=n){let e=[];for(var r of n){var s=t.indexOf(r);if(s<0)e.push(new Oi(r));else{let t=this.plugins[s];t.mustUpdate=i,e.push(t)}}for(var o of this.plugins)o.mustUpdate!=i&&o.destroy(this);this.plugins=e,this.inputState.ensureHandlers(this)}else for(var e of this.plugins)e.mustUpdate=i;for(let t=0;t{try{return t.read(this)}catch(t){return ni(this.state,t),sr}});let t=new gi(this,this.state);t.flags|=r,n?n.flags|=r:n=t,this.updateState=2,t.empty||this.updatePlugins(t),this.updateAttrs(),r&&this.docView.update(t);for(let t=0;tthis.measure())),e){if(null!=e.key)for(let t=0;tfunction(t,e,i){let n=t.state.charCategorizer(e),r=n(i);return t=>{t=n(t);return r==Ot.Space&&(r=t),r==t}}(this,e.head,t))}moveToLineBoundary(t,e,i=!0){return function(t,e,i,n){var r=t.state.doc.lineAt(e.head),s=n&&t.lineWrapping?t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head):null;if(s){n=t.dom.getBoundingClientRect(),s=t.posAtCoords({x:i==(t.textDirection==ki.LTR)?n.right-1:n.left+1,y:(s.top+s.bottom)/2});if(null!=s)return _.cursor(s,i?-1:1)}return e=He.find(t.docView,e.head),r=e?i?e.posAtEnd:e.posAtStart:i?r.to:r.from,_.cursor(r,i?-1:1)}(this,t,e,i)}moveVertically(t,e,i){return Bi(this,t,e,i)}scrollPosIntoView(t){this.viewState.scrollTo=_.cursor(t),this.requestMeasure()}domAtPos(t){return this.docView.domAtPos(t)}posAtDOM(t,e=0){return this.docView.posFromDOM(t,e)}posAtCoords(t){return this.readMeasured(),Ii(this,t)}coordsAtPos(t,e=1){this.readMeasured();var i=this.docView.coordsAt(t,e);if(!i||i.left==i.right)return i;var n=this.state.doc.lineAt(t),r=this.bidiSpans(n);return ie(i,r[zi.find(r,t-n.from,-1,e)].dir==ki.LTR==0er)return Yi(t.length);var e,i=this.textDirection;for(e of this.bidiCache)if(e.from==t.from&&e.dir==i)return e.order;var n=Vi(t.text,this.textDirection);return this.bidiCache.push(new or(t.from,t.to,i,n)),n}get hasFocus(){var t;return(document.hasFocus()||be.safari&&(null===(t=this.inputState)||void 0===t?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{se(this.contentDOM),this.docView.updateSelection()})}destroy(){for(var t of this.plugins)t.destroy(this);this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),-1({}),{eventHandlers:t})}static theme(t,e){var i=wt.newName();let n=[qn.of(i),pi.of(jn(`.${i}`,t))];return e&&e.dark&&n.push(Vn.of(!0)),n}static baseTheme(t){return E.fallback(pi.of(jn("."+Yn,t,En)))}}tr.styleModule=pi,tr.inputHandler=ii,tr.exceptionSink=ti,tr.updateListener=ei,tr.editable=ri,tr.mouseSelectionStyle=Ke,tr.dragMovesSelection=Je,tr.clickAddsSelectionRange=Fe,tr.decorations=fi,tr.contentAttributes=ui,tr.editorAttributes=di,tr.lineWrapping=tr.contentAttributes.of({class:"cm-lineWrapping"}),tr.announce=rt.define();const er=4096;function ir(t,e){return null==t?e.getBoundingClientRect().top:t}let nr=-1;function rr(){nr=-1;var i=document.querySelectorAll(".cm-content");for(let e=0;e{if(t){for(var e of t.commands)if(e(i))return!0;t.preventDefault&&(a=!0)}return!1},h=t[n],c;if(h){if(l(h[o+lr(r,e,!s)]))return!0;if(s&&(e.shiftKey||e.altKey||e.metaKey)&&(c=qt[e.keyCode])&&c!=r){if(l(h[o+lr(c,e,!0)]))return!0}else if(s&&e.shiftKey&&l(h[o+lr(r,e,!0)]))return!0}return a}(function(t){let e=t.facet(hr),i=cr.get(e);i||cr.set(e,i=function(t,a=ar){let l=Object.create(null),n=Object.create(null),h=(t,e)=>{var i=n[t];if(null==i)n[t]=e;else if(i!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix")},e=(n,t,e,i)=>{let r=l[n]||(l[n]=Object.create(null)),s=t.split(/ (?!$)/).map(t=>function(t,e){var i=t.split(/-(?!$)/);let n=i[i.length-1];"Space"==n&&(n=" ");let r,s,o,a;for(let t=0;t{let e=Or={view:t,prefix:i,scope:n};return setTimeout(()=>{Or==e&&(Or=null)},dr),!0}]})}t=s.join(" ");h(t,!1);let o=r[t]||(r[t]={preventDefault:!1,commands:[]});o.commands.push(e),i&&(o.preventDefault=!0)};for(var i of t){var r=i[a]||i.key;if(r)for(var s of i.scope?i.scope.split(" "):["editor"])e(s,r,i.run,i.preventDefault),i.shift&&e(s,"Shift-"+r,i.shift,i.preventDefault)}return l}(e.reduce((t,e)=>t.concat(e),[])));return i}(e.state),t,e,"editor")}})}),cr=new WeakMap;let Or=null;const dr=4e3;be.ios;let ur=0;const fr=new WeakMap;class pr{constructor({deserialize:t}={}){this.id=ur++,this.deserialize=t||(()=>{throw new Error("This node type doesn't define a deserialize function")})}static string(){return new pr({deserialize:t=>t})}static number(){return new pr({deserialize:Number})}static flag(){return new pr({deserialize:()=>!0})}set(t,e){return t[this.id]=e,t}add(e){return"function"!=typeof e&&(e=gr.match(e)),t=>{t=e(t);return void 0===t?null:[this,t]}}}pr.closedBy=new pr({deserialize:t=>t.split(" ")}),pr.openedBy=new pr({deserialize:t=>t.split(" ")}),pr.group=new pr({deserialize:t=>t.split(" ")});const mr=Object.create(null);class gr{constructor(t,e,i,n=0){this.name=t,this.props=e,this.id=i,this.flags=n}static define(t){var e=t.props&&t.props.length?Object.create(null):mr,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),n=new gr(t.name||"",e,t.id,i);if(t.props)for(var r of t.props)Array.isArray(r)||(r=r(n)),r&&r[0].set(e,r[1]);return n}prop(t){return this.props[t.id]}get isTop(){return 0<(1&this.flags)}get isSkipped(){return 0<(2&this.flags)}get isError(){return 0<(4&this.flags)}get isAnonymous(){return 0<(8&this.flags)}is(e){if("string"!=typeof e)return this.id==e;{if(this.name==e)return!0;let t=this.prop(pr.group);return!!t&&-1{for(let t=i.prop(pr.group),e=-1;e<(t?t.length:0);e++){var n=r[e<0?i.name:t[e]];if(n)return n}}}}gr.none=new gr("",Object.create(null),0,8);class vr{constructor(e){this.types=e;for(let t=0;tt.toString()).join();return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(t,e=0){var i=null!=t&&fr.get(this)||this.topNode;let n=new Sr(i);return null!=t&&(n.moveTo(t,e),fr.set(this,n._tree)),n}fullCursor(){return new Sr(this.topNode,!0)}get topNode(){return new yr(this,0,0,null)}resolve(t,e=0){return this.cursor(t,e).node}iterate(t){let{enter:i,leave:n,from:r=0,to:s=this.length}=t;for(let e=this.cursor();;){let t=!1;if(e.from<=s&&e.to>=r&&(e.type.isAnonymous||!1!==i(e.type,e.from,e.to))){if(e.firstChild())continue;e.type.isAnonymous||(t=!0)}for(;t&&n&&n(e.type,e.from,e.to),t=e.type.isAnonymous,!e.nextSibling();){if(!e.parent())return;t=!0}}}balance(t=1024){return this.children.length<=Wr?this:Xr(this.type,gr.none,this.children,this.positions,0,this.children.length,0,t,this.length,0)}static build(t){let{buffer:e,nodeSet:m,topID:i=0,maxBufferLength:g=1024,reused:v=[],minRepeatType:Q=m.types.length}=t,w=Array.isArray(e)?new Tr(e,e.length):e,$=m.types,y=0;function b(i,t,e,n,r){var{id:s,start:o,end:a,size:l}=w;let h=o-i;if(l<0)return-1==l?(e.push(v[s]),n.push(h)):y=s,void w.next();let c=$[s],O,d;if(a-o<=g&&(d=function(t,e){let i=w.fork(),n=0,r=0,s=0,o=i.end-g,a={size:0,start:0,skip:0};t:for(var l=i.pos-t;i.pos>l;)if(i.id!=e){var h=i.size,c=i.pos-h;if(h<0||c=Q?4:0;var O=i.start;for(i.next();i.pos>c;){if(i.size<0)break t;i.id>=Q&&(t+=4),i.next()}r=O,n+=h,s+=t}else a.size=n,a.start=r,a.skip=s,s+=4,n+=4,i.next();(e<0||n==t)&&(a.size=n,a.start=r,a.skip=s);return 4t;)e=function t(e,i,n,r){var{id:s,start:o,end:a,size:l}=w;w.next();if(s==r)return n;var h=n;if(4c;)n=t(e,i,n,r);s=Q?s:-1;w.pos>f;)w.id==p?w.next():b(o,f,t,e,p);t.reverse(),e.reverse(),O=-1Wr?Xr(c,c,t,e,0,t.length,0,g,a-o,y):wr(new Qr(c,t,e,a-o),y)}e.push(O),n.push(h)}let n=[],r=[];for(;0=t:this.from>t)||(-1=t:this.from>t)||(-1!t.type.isAnonymous||t instanceof $r||Pr(t))}class Tr{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Tr(this.buffer,this.index)}}const Wr=8;function Xr(t,i,n,r,s,o,a,l,e,h){let c=[],O=[];if(e<=l)for(let t=s;td<<1){for(let t=0;t=i)for(;s&&s.from=t.from||d<=t.to||l)&&(h=Math.max(t.from,a)-l,c=Math.min(t.to,d)-l,t=c<=h?null:new Rr(h,c,t.tree,t.offset+l,(0d)break;s=rt.length&&n.push(r);return n}}function _r(t){return new Cr(t)}class Cr{constructor(t,e=t.length){this.string=t,this.length=e}get(t){return t<0||t>=this.length?-1:this.string.charCodeAt(t)}lineAfter(t){if(t<0)return"";var e=this.string.indexOf("\n",t);return this.string.slice(t,e<0?this.length:Math.min(e,this.length))}read(t,e){return this.string.slice(t,Math.min(this.length,e))}clip(t){return new Cr(this.string,t)}}const Ar=new pr;function Lr(e){return L.define({combine:e?t=>t.concat(e):void 0})}class zr{constructor(t,e,i,n=[]){this.data=t,this.topNode=i,pt.prototype.hasOwnProperty("tree")||Object.defineProperty(pt.prototype,"tree",{get(){return Yr(this)}}),this.parser=e,this.extension=[Gr.of(this),pt.languageData.of((t,e)=>t.facet(qr(t,e)))].concat(n)}isActiveAt(t,e){return qr(t,e)==this.data}findRegions(t){var e=t.facet(Gr);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let n=[];return Yr(t).iterate({enter:(t,e,i)=>{if(t.isTop&&t.prop(Ar)==this.data)return n.push({from:e,to:i}),!1}}),n}get allowsNesting(){return!0}parseString(t){var e=d.of(t.split("\n"));let i=this.parser.startParse(new Mr(e),0,new Zr(this.parser,pt.create({doc:e}),[],Qr.empty,{from:0,to:t.length},[],null)),n;for(;!(n=i.advance()););return n}}function qr(t,e){var i=t.facet(Gr);if(!i)return null;if(!i.allowsNesting)return i.data;let n=Yr(t),r=n.resolve(e,-1);for(;r;){var s=r.type.prop(Ar);if(s)return s;r=r.parent}return i.data}zr.setState=rt.define();class Vr extends zr{constructor(t,e){super(t,e,e.topNode),this.parser=e}static define(t){let e=Lr(t.languageData);return new Vr(e,t.parser.configure({props:[Ar.add(t=>t.isTop?e:void 0)]}))}configure(t){return new Vr(this.data,this.parser.configure(t))}get allowsNesting(){return this.parser.hasNested}}function Yr(t){t=t.field(zr.state,!1);return t?t.tree:Qr.empty}class Mr{constructor(t,e=t.length){this.doc=t,this.length=e,this.cursorPos=0,this.string="",this.prevString="",this.cursor=t.iter()}syncTo(t){return t=this.length)return-1;let e=this.cursorPos-this.string.length;if(t=this.cursorPos){if(t=e-this.prevString.length)return this.prevString.charCodeAt(t-(e-this.prevString.length));e=this.syncTo(t)}return this.string.charCodeAt(t-e)}lineAfter(t){if(t>=this.length||t<0)return"";let e=this.cursorPos-this.string.length;return(t=this.cursorPos)&&(e=this.syncTo(t)),this.cursor.lineBreak?"":this.string.slice(t-e,Math.min(this.length-e,this.string.length))}read(t,e){var i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i)}clip(t){return new Mr(this.doc,t)}}class Zr{constructor(t,e,i=[],n,r,s,o){this.parser=t,this.state=e,this.fragments=i,this.tree=n,this.viewport=r,this.skipped=s,this.scheduleOn=o,this.parse=null,this.tempSkipped=[]}work(t,e){if(this.tree!=Qr.empty&&(null==e?this.tree.length==this.state.doc.length:this.tree.length>=e))return this.takeTree(),!0;this.parse||(this.parse=this.parser.startParse(new Mr(this.state.doc),0,this));for(var i=Date.now()+t;;){var n=this.parse.advance();if(n)return this.fragments=this.withoutTempSkipped(Rr.addTree(n)),this.parse=null,this.tree=n,!0;if(null!=e&&this.parse.pos>=e)return this.takeTree(),!0;if(Date.now()>i)return!1}}takeTree(){this.parse&&this.parse.pos>this.tree.length&&(this.tree=this.parse.forceFinish(),this.fragments=this.withoutTempSkipped(Rr.addTree(this.tree,this.fragments,!0)))}withoutTempSkipped(t){for(var e;e=this.tempSkipped.pop();)t=Er(t,e.from,e.to);return t}changes(t,e){let{fragments:i,tree:n,viewport:s,skipped:o}=this;if(this.takeTree(),!t.empty){let r=[];if(t.iterChangedRanges((t,e,i,n)=>r.push({fromA:t,toA:e,fromB:i,toB:n})),i=Rr.applyChanges(i,r),n=Qr.empty,s={from:t.mapPos(s.from,-1),to:t.mapPos(s.to,1)},this.skipped.length){o=[];for(var a of this.skipped){var l=t.mapPos(a.from,1),a=t.mapPos(a.to,-1);le.from&&(this.fragments=Er(this.fragments,i,n),this.skipped.splice(t--,1))}return this.skipped.length=t}}function Er(t,e,i){return Rr.applyChanges(t,[{fromA:e,toA:i,fromB:e,toB:i}])}Zr.skippingParser=Zr.getSkippingParser();class jr{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged)return this;let e=this.context.changes(t.changes,t.state);t=this.context.tree.length==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.tree.length),e.viewport.to);return e.work(25,t)||e.takeTree(),new jr(e)}static init(t){let e=new Zr(t.facet(Gr).parser,t,[],Qr.empty,{from:0,to:t.doc.length},[],null);return e.work(25)||e.takeTree(),new jr(e)}}zr.state=M.define({create:jr.init,update(t,e){for(var i of e.effects)if(i.is(zr.setState))return i.value;return e.startState.facet(Gr)!=e.state.facet(Gr)?jr.init(e.state):t.apply(e)}});let Dr="undefined"!=typeof window&&window.requestIdleCallback||((t,{timeout:e})=>setTimeout(t,e)),Hr="undefined"!=typeof window&&window.cancelIdleCallback||clearTimeout;var Ir=hi.fromClass(class{constructor(t){this.view=t,this.working=-1,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(zr.state).context;t.viewportChanged&&(e.updateViewport(t.view.viewport)&&e.reset(),this.view.viewport.to>e.tree.length&&this.scheduleWork()),t.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(i=!1){if(!(-1=t.doc.length||(this.working=Dr(this.work,{timeout:500}))}}work(n){this.working=-1;var r=Date.now();if(this.chunkEnd=e+1e6||(n=Math.min(this.chunkBudget,n?Math.max(25,n.timeRemaining()):100),n=i.context.work(n,e+1e6),this.chunkBudget-=Date.now()-r,(n||this.chunkBudget<=0||i.context.movedPast(e))&&(i.context.takeTree(),this.view.dispatch({effects:zr.setState.of(new jr(i.context))})),!n&&0this.scheduleWork(!0)),t.scheduleOn=null)}destroy(){0<=this.working&&Hr(this.working)}},{eventHandlers:{focus(){this.scheduleWork()}}});const Gr=L.define({combine(t){return t.length?t[0]:null},enables:[zr.state,Ir]});class Br{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}class Nr{constructor(t,e,i,n,r){this.name=t,this.alias=e,this.extensions=i,this.filename=n,this.loadFunc=r,this.support=void 0,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(t=>this.support=t,t=>{throw this.loading=null,t}))}static of(t){return new Nr(t.name,(t.alias||[]).concat(t.name).map(t=>t.toLowerCase()),t.extensions||[],t.filename,t.load)}static matchFilename(t,e){for(var i of t)if(i.filename&&i.filename.test(e))return i;var n=/\.([^.]+)$/.exec(e);if(n)for(var r of t)if(-1t==e))return n;if(i)for(var r of t)for(var s of r.alias){var o=e.indexOf(s);if(-1{if(!t.length)return" ";if(!/^(?: +|\t+)$/.test(t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return t[0]}});function Jr(t){let e=t.facet(Fr);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function Kr(t,e){let i="",n=t.tabSize;if(9==t.facet(Fr).charCodeAt(0))for(;n<=e;)i+="\t",e-=n;for(let t=0;tas(t,!0,1,void 0,i&&!function(t){var e,i;return t.pos==(null===(e=t.options)||void 0===e?void 0:e.simulateBreak)&&null!==(i=t.options)&&void 0!==i&&i.simulateDoubleBreak}(t)?e.from:void 0)}return null==t.parent?ss:null}function rs(e,i,n){for(;e;e=e.parent){let t=ns(e);if(t)return t(new os(n,i,e))}return null}function ss(){return 0}class os extends es{constructor(t,e,i){super(t.state,t.options),this.base=t,this.pos=e,this.node=i}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){let e=this.state.doc.lineAt(this.node.from);for(;;){let t=this.node.resolve(e.from);for(;t.parent&&t.parent.from==t.from;)t=t.parent;if(function(e,i){for(let t=i;t;t=t.parent)if(e==t)return!0;return!1}(t,this.node))break;e=this.state.doc.lineAt(t.from)}return this.lineIndent(e)}continue(){var t=this.node.parent;return t?rs(t,this.pos,this.base):0}}function as(t,e,i,n,r){let s=t.textAfter,o=s.match(/^\s*/)[0].length;r=n&&s.slice(o,o+n.length)==n||r==t.pos+o,e=e?function(t){let e=t.node;var i=e.childAfter(e.from),n=e.lastChild;if(!i)return null;var r=null===(r=t.options)||void 0===r?void 0:r.simulateBreak,t=t.state.doc.lineAt(i.from),s=null==r||r<=t.from?t.to:Math.min(t.to,r);for(let t=i.to;;){var o=e.childAfter(t);if(!o||o==n)return null;if(!o.type.isSkipped)return o.from{var e=i&&i.test(t.textAfter);return t.baseIndent+(e?0:n*t.unit)}}L.define();const hs=new pr;function cs(t){var e=t.firstChild,i=t.lastChild;return e&&e.totr.decorations.from(t)}),Os];function vs(t,e,i){var n=t.prop(e<0?pr.openedBy:pr.closedBy);if(n)return n;if(1==t.name.length){t=i.indexOf(t.name);if(-1=e.to){if(0==o&&-1>1==l>>1};O--}}0"},$s=rt.define({map(t,e){t=e.mapPos(t,-1,w.TrackAfter);return null==t?void 0:t}}),ys=rt.define({map(t,e){return e.mapPos(t)}}),bs=new class extends bt{};bs.startSide=1,bs.endSide=-1;const xs=M.define({create(){return Pt.empty},update(t,i){var e,n;i.selection&&(e=i.state.doc.lineAt(i.selection.main.head).from,n=i.startState.doc.lineAt(i.startState.selection.main.head).from,e!=i.changes.mapPos(n,-1)&&(t=Pt.empty)),t=t.map(i.changes);for(let e of i.effects)e.is($s)?t=t.update({add:[bs.range(e.value,e.value+1)]}):e.is(ys)&&(t=t.update({filter:t=>t!=e.value}));return t}});const ks="()[]{}<>";function Ss(e){for(let t=0;t>10),56320+(1023&t)));var t}function Ps(t,e){return t.languageDataAt("closeBrackets",e)[0]||ws}function Ts(t,e,i,n){if(t.composing)return!1;var r=t.state.selection.main;if(2{if(!t.empty)return{changes:[{insert:s,from:t.from},{insert:s,from:t.to}],effects:$s.of(t.to+s.length),range:_.range(t.anchor+s.length,t.head+s.length)};var e=t.head,i=Rs(r.doc,e);if(i==s){if(_s(r,e))return{changes:{insert:s+s,from:e},effects:$s.of(e+s.length),range:_.cursor(e+s.length)};if(Xs(r,e)){var n=o&&r.sliceDoc(e,e+3*s.length)==s+s+s;return{range:_.cursor(e+s.length*(n?3:1)),effects:ys.of(e)}}}else{if(o&&r.sliceDoc(e-2*s.length,e)==s+s&&_s(r,e-2*s.length))return{changes:{insert:s+s+s+s,from:e},effects:$s.of(e+s.length),range:_.cursor(e+s.length)};if(r.charCategorizer(e)(i)!=Ot.Word){i=r.sliceDoc(e-1,e);if(i!=s&&r.charCategorizer(e)(i)!=Ot.Word)return{changes:{insert:s+s,from:e},effects:$s.of(e+s.length),range:_.cursor(e+s.length)}}}return{range:a=t}});return a?null:r.update(t,{scrollIntoView:!0,annotations:st.userEvent.of("input")})}(t,r,-1{if(!t.empty)return{changes:[{insert:n,from:t.from},{insert:r,from:t.to}],effects:$s.of(t.to+n.length),range:_.range(t.anchor+n.length,t.head+n.length)};var e=Rs(i.doc,t.head);return!e||/\s/.test(e)||-1t.empty&&Rs(e.doc,t.head)==i?_.cursor(t.head+i.length):n=t);return n?null:e.update({selection:_.create(t,e.selection.mainIndex),scrollIntoView:!0,effects:e.selection.ranges.map(({from:t})=>ys.of(t))})}(t,(r,s))}return null}(t.state,n);return!!n&&(t.dispatch(n),!0)}const Ws=[{key:"Backspace",run:({state:n,dispatch:t})=>{let r=Ps(n,n.selection.main.head).brackets||ws.brackets,s=null,e=n.changeByRange(t=>{if(t.empty){var e,i=function(t,e){let i=t.sliceString(e-2,e);return O(c(i,0))==i.length?i:i.slice(1)}(n.doc,t.head);for(e of r)if(e==i&&Rs(n.doc,t.head)==Ss(c(e,0)))return{changes:{from:t.head-e.length,to:t.head+e.length},range:_.cursor(t.head-e.length),annotations:st.userEvent.of("delete")}}return{range:s=t}});return s||t(n.update(e,{scrollIntoView:!0})),!s}}];function Xs(t,e){let i=!1;return t.field(xs).between(0,t.doc.length,t=>{t==e&&(i=!0)}),i}function Rs(t,e){let i=t.sliceString(e,e+2);return i.slice(0,O(c(i,0)))}function _s(t,e){t=Yr(t).resolve(e+1);return t.parent&&t.from==e}function Cs(t,e){return _.create(t.ranges.map(e),t.mainIndex)}function As(t,e){return t.update({selection:e,scrollIntoView:!0,annotations:st.userEvent.of("keyboardselection")})}function Ls({state:t,dispatch:e},i){let n=Cs(t.selection,i);return!n.eq(t.selection)&&(e(As(t,n)),!0)}function zs(t,e){return _.cursor(e?t.to:t.from)}function qs(e,i){return Ls(e,t=>t.empty?e.moveByChar(t,i):zs(t,i))}var Vs=t=>qs(t,t.textDirection!=ki.LTR),Ys=t=>qs(t,t.textDirection==ki.LTR);function Ms(e,i){return Ls(e,t=>t.empty?e.moveByGroup(t,i):zs(t,i))}function Zs(e,i,n){let r=Yr(e).resolve(i.head);var s,o,a,l=n?pr.closedBy:pr.openedBy;for(let t=i.head;;){var h=n?r.childAfter(t):r.childBefore(t);if(!h)break;s=e,a=l,(o=h).type.prop(a)||((a=o.to-o.from)&&(2t.empty?e.moveVertically(t,i):zs(t,i))}var js=t=>Es(t,!1),Ds=t=>Es(t,!0);function Hs(e,i){return Ls(e,t=>t.empty?e.moveVertically(t,i,e.dom.clientHeight):zs(t,i))}var Is=t=>Hs(t,!1),Gs=t=>Hs(t,!0);function Bs(t,e,i){let n=t.visualLineAt(e.head),r=t.moveToLineBoundary(e,i);return r.head==e.head&&r.head!=(i?n.to:n.from)&&(r=t.moveToLineBoundary(e,i,!1)),i||r.head!=n.from||!n.length||(t=/^\s*/.exec(t.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length)&&e.head!=n.from+t&&(r=_.cursor(n.from+t)),r}var Ns=e=>Ls(e,t=>_.cursor(e.visualLineAt(t.head).from,1)),Us=e=>Ls(e,t=>_.cursor(e.visualLineAt(t.head).to,-1));function Fs(t,i){let e=Cs(t.state.selection,t=>{var e=i(t);return _.range(t.anchor,e.head,e.goalColumn)});return!e.eq(t.state.selection)&&(t.dispatch(As(t.state,e)),!0)}function Js(e,i){return Fs(e,t=>e.moveByChar(t,i))}var Ks=t=>Js(t,t.textDirection!=ki.LTR),to=t=>Js(t,t.textDirection==ki.LTR);function eo(e,i){return Fs(e,t=>e.moveByGroup(t,i))}function io(e,i){return Fs(e,t=>e.moveVertically(t,i))}var no=t=>io(t,!1),Yt=t=>io(t,!0);function ro(e,i){return Fs(e,t=>e.moveVertically(t,i,e.dom.clientHeight))}Zt=t=>ro(t,!1),Et=t=>ro(t,!0),ve=e=>Fs(e,t=>_.cursor(e.visualLineAt(t.head).from)),me=e=>Fs(e,t=>_.cursor(e.visualLineAt(t.head).to)),ge=({state:t,dispatch:e})=>(e(As(t,{anchor:0})),!0),pe=({state:t,dispatch:e})=>(e(As(t,{anchor:t.doc.length})),!0),Qe=({state:t,dispatch:e})=>(e(As(t,{anchor:t.selection.main.anchor,head:0})),!0),we=({state:t,dispatch:e})=>(e(As(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0);function so({state:t,dispatch:e},r){var i=t.changeByRange(t=>{let{from:e,to:i}=t;var n;return e==i&&(n=r(e),e=Math.min(e,n),i=Math.max(i,n)),e==i?{range:t}:{changes:{from:e,to:i},range:_.cursor(e)}});return!i.changes.empty&&(e(t.update(i,{scrollIntoView:!0,annotations:st.userEvent.of("delete")})),!0)}const oo=(a,l,h)=>so(a,e=>{let{state:t}=a,i=t.doc.lineAt(e),n;if(!l&&e>i.from&&eoo(t,!1,!0),ye=t=>oo(t,!0,!1);const ao=(t,h)=>so(t,e=>{let i=e,{state:n}=t,r=n.doc.lineAt(i),s=n.charCategorizer(i);for(let t=null;;){if(i==(h?r.to:r.from)){i==e&&r.number!=(h?n.doc.lines:1)&&(i+=h?1:-1);break}var o=b(r.text,i-r.from,h)+r.from,a=r.text.slice(Math.min(i,o)-r.from,Math.max(i,o)-r.from),l=s(a);if(null!=t&&l!=t)break;" "==a&&i==e||(t=l),i=o}return i});$e=t=>ao(t,!1),fe=t=>ao(t,!0),Ir=i=>so(i,t=>{var e=i.visualLineAt(t).to;return t{var i=[];for(let t=e.from;t<=e.to;){var n=r.doc.lineAt(t);n.number>o&&(e.empty||e.to>n.from)&&(s(n,i,e),o=n.number),t=n.to+1}let t=r.changes(i);return{changes:i,range:_.range(t.mapPos(e.anchor,1),t.mapPos(e.head,1))}})}Os=({state:o,dispatch:t})=>{let a=Object.create(null),l=new es(o,{overrideIndentation:t=>{t=a[t];return null==t?-1:t}});var e=Oo(o,(t,e,i)=>{var n,r,s=ts(l,t.from);null==s||((n=/^\s*/.exec(t.text)[0])!=(r=Kr(o,s))||i.from(t(i.update(Oo(i,(t,e)=>{e.push({from:t.from,insert:i.facet(Fr)})}))),!0);const fo=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>Ls(e,t=>Zs(e.state,t,e.textDirection!=ki.LTR)),shift:e=>Fs(e,t=>Zs(e.state,t,e.textDirection!=ki.LTR))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>Ls(e,t=>Zs(e.state,t,e.textDirection==ki.LTR)),shift:e=>Fs(e,t=>Zs(e.state,t,e.textDirection==ki.LTR))},{key:"Alt-ArrowUp",run:({state:t,dispatch:e})=>ho(t,e,!1)},{key:"Shift-Alt-ArrowUp",run:({state:t,dispatch:e})=>co(t,e,!1)},{key:"Alt-ArrowDown",run:({state:t,dispatch:e})=>ho(t,e,!0)},{key:"Shift-Alt-ArrowDown",run:({state:t,dispatch:e})=>co(t,e,!0)},{key:"Escape",run:({state:t,dispatch:e})=>{let i=t.selection,n=null;return 1{var e=lo(i).map(({from:t,to:e})=>_.range(t,Math.min(e+1,i.doc.length)));return t(i.update({selection:_.create(e),annotations:st.userEvent.of("keyboardselection")})),!0}},{key:"Mod-i",run:({state:n,dispatch:t})=>{var e=Cs(n.selection,t=>{var e;let i=Yr(n).resolve(t.head,1);for(;!(i.from=t.to||i.to>t.to&&i.from<=t.from||null===(e=i.parent)||void 0===e)&&e.parent;)i=i.parent;return _.range(i.to,i.from)});return t(As(n,e)),!0}},{key:"Mod-[",run:({state:o,dispatch:t})=>(t(o.update(Oo(o,(n,r)=>{let s=/^\s*/.exec(n.text)[0];if(s){let t=x(s,0,o.tabSize),e=0,i=Kr(o,Math.max(0,t-Jr(o)));for(;e{let{state:i}=e,t=i.changes(lo(i).map(({from:t,to:e})=>(0e.moveVertically(t,!0)).map(t);return e.dispatch({changes:t,selection:n,scrollIntoView:!0}),!0}},{key:"Shift-Mod-\\",run:({state:t,dispatch:e})=>function(i,t,n){let r=!1,e=Cs(i.selection,t=>{var e=Qs(i,t.head,-1)||Qs(i,t.head,1)||0Ms(t,t.textDirection!=ki.LTR),shift:t=>eo(t,t.textDirection!=ki.LTR)},{mac:"Cmd-ArrowLeft",run:Ns,shift:ve},{key:"ArrowRight",run:Ys,shift:to},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:t=>Ms(t,t.textDirection==ki.LTR),shift:t=>eo(t,t.textDirection==ki.LTR)},{mac:"Cmd-ArrowRight",run:Us,shift:me},{key:"ArrowUp",run:js,shift:no},{mac:"Cmd-ArrowUp",run:ge,shift:Qe},{mac:"Ctrl-ArrowUp",run:Is,shift:Zt},{key:"ArrowDown",run:Ds,shift:Yt},{mac:"Cmd-ArrowDown",run:pe,shift:we},{mac:"Ctrl-ArrowDown",run:Gs,shift:Et},{key:"PageUp",run:Is,shift:Zt},{key:"PageDown",run:Gs,shift:Et},{key:"Home",run:e=>Ls(e,t=>Bs(e,t,!1)),shift:e=>Fs(e,t=>Bs(e,t,!1))},{key:"Mod-Home",run:ge,shift:Qe},{key:"End",run:e=>Ls(e,t=>Bs(e,t,!0)),shift:e=>Fs(e,t=>Bs(e,t,!0))},{key:"Mod-End",run:pe,shift:we},{key:"Enter",run:({state:a,dispatch:t})=>{var e=a.changeByRange(({from:t,to:e})=>{var i=t==e&&function(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let i=Yr(t).resolve(e),n=i.childBefore(e),r=i.childAfter(e),s;return n&&r&&n.to<=e&&r.from>=e&&(s=n.type.prop(pr.closedBy))&&-1s.from&&t(e(t.update({selection:{anchor:0,head:t.doc.length},annotations:st.userEvent.of("keyboardselection")})),!0)},{key:"Backspace",run:ue,shift:ue},{key:"Delete",run:ye,shift:ye},{key:"Mod-Backspace",mac:"Alt-Backspace",run:$e},{key:"Mod-Delete",mac:"Alt-Delete",run:fe},{mac:"Mod-Backspace",run:i=>so(i,t=>{var e=i.visualLineAt(t).from;return eoo(t,!1,!1)},{key:"Ctrl-k",run:Ir},{key:"Alt-d",run:fe},{key:"Ctrl-Alt-h",run:$e},{key:"Ctrl-o",run:({state:t,dispatch:e})=>{var i=t.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:d.of(["",""])},range:_.cursor(t.from)}));return e(t.update(i,{scrollIntoView:!0,annotations:st.userEvent.of("input")})),!0}},{key:"Ctrl-t",run:({state:n,dispatch:t})=>{var e=n.changeByRange(t=>{if(!t.empty||0==t.from||t.from==n.doc.length)return{range:t};var e=t.from,i=n.doc.lineAt(e),t=e==i.from?e-1:b(i.text,e-i.from,!1)+i.from,i=e==i.to?e+1:b(i.text,e-i.from,!0)+i.from;return{changes:{from:t,to:i,insert:n.doc.slice(e,i).append(n.doc.slice(t,e))},range:_.cursor(i)}});return!e.changes.empty&&(t(n.update(e,{scrollIntoView:!0})),!0)}},{key:"Alt-f",run:t=>Ms(t,!0),shift:t=>eo(t,!0)},{key:"Alt-b",run:t=>Ms(t,!1),shift:t=>eo(t,!1)},{key:"Alt-<",run:ge},{key:"Alt->",run:pe},{key:"Ctrl-v",run:Gs},{key:"Alt-v",run:Is}].map(t=>({mac:t.key,run:t.run,shift:t.shift})))),po={key:"Tab",run:({state:t,dispatch:e})=>t.selection.ranges.some(t=>!t.empty)?uo({state:t,dispatch:e}):(e(t.update(t.replaceSelection("\t"),{scrollIntoView:!0,annotations:st.userEvent.of("input")})),!0),shift:Os},mo=et.define(),go=et.define(),vo=L.define(),Qo=L.define({combine(t){return mt(t,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min})}}),wo=M.define({create(){return Ro.empty},update(e,i){var n=i.state.facet(Qo),r=i.annotation(mo);if(r){var s=xo.fromTransaction(i),o=r.side;let t=0==o?e.undone:e.done;return t=s?ko(t,t.length,n.minDepth,s):Wo(t,i.startState.selection),new Ro(0==o?r.rest:t,0==o?t:r.rest)}var t=i.annotation(go);if("full"!=t&&"before"!=t||(e=e.isolate()),!1===i.annotation(st.addToHistory))return i.changes.empty?e:e.addMapping(i.changes.desc);s=xo.fromTransaction(i),o=i.annotation(st.time),r=i.annotation(st.userEvent);return s?e=e.addChanges(s,o,r,n.newGroupDelay,n.minDepth):i.selection&&(e=e.addSelection(i.startState.selection,o,r,n.newGroupDelay)),e="full"==t||"after"==t?e.isolate():e},toJSON(t){return{done:t.done.map(t=>t.toJSON()),undone:t.undone.map(t=>t.toJSON())}},fromJSON(t){return new Ro(t.done.map(xo.fromJSON),t.undone.map(xo.fromJSON))}});function $o(n,r){return function({state:t,dispatch:e}){let i=t.field(wo,!1);if(!i)return!1;t=i.pop(n,t,r);return!!t&&(e(t),!0)}}const yo=$o(0,!1),bo=$o(1,!1);Ns=$o(0,!0),ve=$o(1,!0);class xo{constructor(t,e,i,n,r){this.changes=t,this.effects=e,this.mapped=i,this.startSelection=n,this.selectionsAfter=r}setSelAfter(t){return new xo(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t;return{changes:null===(t=this.changes)||void 0===t?void 0:t.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(t=this.startSelection)||void 0===t?void 0:t.toJSON(),selectionsAfter:this.selectionsAfter.map(t=>t.toJSON())}}static fromJSON(t){return new xo(t.changes&&k.fromJSON(t.changes),[],t.mapped&&y.fromJSON(t.mapped),t.startSelection&&_.fromJSON(t.startSelection),t.selectionsAfter.map(_.fromJSON))}static fromTransaction(t){let e=Po;for(var i of t.startState.facet(vo)){i=i(t);i.length&&(e=e.concat(i))}return!e.length&&t.changes.empty?null:new xo(t.changes.invert(t.startState.doc),e,void 0,t.startState.selection,Po)}static selection(t){return new xo(void 0,Po,void 0,void 0,t)}}function ko(t,e,i,n){let r=t.slice(i+20t.map(e)):Po,i);if(!t.changes)return xo.selection(n);var r=t.changes.map(e),s=e.mapDesc(t.changes,!0),i=t.mapped?t.mapped.composeDesc(s):s;return new xo(r,rt.mapEffects(t.effects,e),i,t.startSelection.map(s),n)}(e[i-1],t,n);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,i);return t[i-1]=r,t}t=r.mapped,i--,n=r.selectionsAfter}return n.length?[xo.selection(n)]:Po}class Ro{constructor(t,e,i=0,n=void 0){this.done=t,this.undone=e,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new Ro(this.done,this.undone):this}addChanges(t,e,i,n,r){let s=this.done,o=s[s.length-1];return s=o&&o.changes&&e-this.prevTimeo.push(t,e)),e.iterChangedRanges((t,e,i,n)=>{for(let t=0;tt.empty!=r.ranges[e].empty).length)?this:new Ro(Wo(this.done,t),this.undone,e,i)}addMapping(t){return new Ro(Xo(this.done,t),Xo(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,i,t){let n=0==e?this.done:this.undone;if(0==n.length)return null;var r=n[n.length-1];if(t&&r.selectionsAfter.length)return i.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:mo.of({side:e,rest:function(t){let e=t[t.length-1],i=t.slice();return i[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),i}(n)})});if(r.changes){let t=1==n.length?Po:n.slice(0,n.length-1);return r.mapped&&(t=Xo(t,r.mapped)),i.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:mo.of({side:e,rest:t}),filter:!1})}return null}}Ro.empty=new Ro(Po,Po);const _o=[{key:"Mod-z",run:yo,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:bo,preventDefault:!0},{key:"Mod-u",run:Ns,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:ve,preventDefault:!0}];let Co=0;class Ao{constructor(t,e,i){this.set=t,this.base=e,this.modified=i,this.id=Co++}static define(t){if(null!=t&&t.base)throw new Error("Can not derive from a modified tag");let e=new Ao([],null,[]);if(e.set.push(e),t)for(var i of t.set)e.set.push(i);return e}static defineModifier(){let e=new zo;return t=>-1t.id-e.id))}}let Lo=0;class zo{constructor(){this.instances=[],this.id=Lo++}static get(e,i){if(!i.length)return e;var t,n=i[0].instances.find(t=>t.base==e&&function(t,i){return t.length==i.length&&t.every((t,e)=>t==i[e])}(i,t.modified));if(n)return n;let r=[],s=new Ao(r,e,i);for(t of i)t.instances.push(s);var o,a=function e(i){let n=[i];for(let t=0;tt.scope)?void 0:Object.create(null);return(t,e)=>{var i,n=a&&a[t.id];if(void 0!==n)return n;let r=null;for(i of o){var s=i.match(t,e);s&&(r=r?r+" "+s:s)}return a&&(a[t.id]=r),r}}static define(t,e){return new Do(t,e||{})}static get(t,e,i){return Eo(t)(e,i||gr.none)}}const Ho=E.fallback(hi.fromClass(class{constructor(t){this.markCache=Object.create(null),this.tree=Yr(t.state),this.decorations=this.buildDeco(t,Eo(t.state))}update(t){var e=Yr(t.state),i=Eo(t.state),n=i!=t.startState.facet(Yo);e.lengthr-1)){for(let t=r-1,e=i.length-1;0<=e;e--,t--){var s=i[e];if(s&&s!=n[t])return}return 1}}(e.context,Io,s)){for(var h of e.tags)(h=d(h,o))&&(t&&(t+=" "),t+=h,1==e.mode?r+=(r?" ":"")+h:0==e.mode&&(i=!0));break}e=e.next}if(t!=p&&(l>f&&p&&u(f,m.from,p),f=l,p=t),!i&&m.firstChild()){do{var c=m.to;n(r,s+1,o),p!=t&&((c=Math.min(O,c))>f&&p&&u(f,c,p),f=c,p=t)}while(m.nextSibling());m.parent()}}}("",0,t.type)}(this.tree,i,r,e,(t,e,i)=>{n.add(t,e,this.markCache[i]||(this.markCache[i]=Ye.mark({class:i})))});return n.finish()}},{decorations:t=>t.decorations})),Io=[""];const Go=Ao.define;var Bo,Us=Go(),me=Go(),ye=Go(me),Ir=Go(),fe=Go(Ir),$e=Go(Ir),ge=Go(),pe=Go(ge),Gs=Go(),Is=Go(),Os=Go(),Ns=Go(Os),ve=Go();const No={comment:Us,lineComment:Go(Us),blockComment:Go(Us),docComment:Go(Us),name:me,variableName:Go(me),typeName:ye,tagName:Go(ye),propertyName:Go(me),className:Go(me),labelName:Go(me),namespace:Go(me),macroName:Go(me),literal:Ir,string:fe,docString:Go(fe),character:Go(fe),number:$e,integer:Go($e),float:Go($e),bool:Go(Ir),regexp:Go(Ir),escape:Go(Ir),color:Go(Ir),url:Go(Ir),keyword:Gs,self:Go(Gs),null:Go(Gs),atom:Go(Gs),unit:Go(Gs),modifier:Go(Gs),operatorKeyword:Go(Gs),controlKeyword:Go(Gs),definitionKeyword:Go(Gs),operator:Is,derefOperator:Go(Is),arithmeticOperator:Go(Is),logicOperator:Go(Is),bitwiseOperator:Go(Is),compareOperator:Go(Is),updateOperator:Go(Is),definitionOperator:Go(Is),typeOperator:Go(Is),controlOperator:Go(Is),punctuation:Os,separator:Go(Os),bracket:Ns,angleBracket:Go(Ns),squareBracket:Go(Ns),paren:Go(Ns),brace:Go(Ns),content:ge,heading:pe,heading1:Go(pe),heading2:Go(pe),heading3:Go(pe),heading4:Go(pe),heading5:Go(pe),heading6:Go(pe),contentSeparator:Go(ge),list:Go(ge),quote:Go(ge),emphasis:Go(ge),strong:Go(ge),link:Go(ge),monospace:Go(ge),inserted:Go(),deleted:Go(),changed:Go(),invalid:Go(),meta:ve,documentMeta:Go(ve),annotation:Go(ve),processingInstruction:Go(ve),definition:Ao.defineModifier(),constant:Ao.defineModifier(),function:Ao.defineModifier(),standard:Ao.defineModifier(),local:Ao.defineModifier(),special:Ao.defineModifier()};Do.define([{tag:No.link,textDecoration:"underline"},{tag:No.heading,textDecoration:"underline",fontWeight:"bold"},{tag:No.emphasis,fontStyle:"italic"},{tag:No.strong,fontWeight:"bold"},{tag:No.keyword,color:"#708"},{tag:[No.atom,No.bool,No.url,No.contentSeparator,No.labelName],color:"#219"},{tag:[No.literal,No.inserted],color:"#164"},{tag:[No.string,No.deleted],color:"#a11"},{tag:[No.regexp,No.escape,No.special(No.string)],color:"#e40"},{tag:No.definition(No.variableName),color:"#00f"},{tag:No.local(No.variableName),color:"#30a"},{tag:[No.typeName,No.namespace],color:"#085"},{tag:No.className,color:"#167"},{tag:[No.special(No.variableName),No.macroName],color:"#256"},{tag:No.definition(No.propertyName),color:"#00c"},{tag:No.comment,color:"#940"},{tag:No.meta,color:"#7a757a"},{tag:No.invalid,color:"#f00"}]);const Uo=Do.define([{tag:No.link,class:"cmt-link"},{tag:No.heading,class:"cmt-heading"},{tag:No.emphasis,class:"cmt-emphasis"},{tag:No.strong,class:"cmt-strong"},{tag:No.keyword,class:"cmt-keyword"},{tag:No.atom,class:"cmt-atom"},{tag:No.bool,class:"cmt-bool"},{tag:No.url,class:"cmt-url"},{tag:No.labelName,class:"cmt-labelName"},{tag:No.inserted,class:"cmt-inserted"},{tag:No.deleted,class:"cmt-deleted"},{tag:No.literal,class:"cmt-literal"},{tag:No.string,class:"cmt-string"},{tag:No.number,class:"cmt-number"},{tag:[No.regexp,No.escape,No.special(No.string)],class:"cmt-string2"},{tag:No.variableName,class:"cmt-variableName"},{tag:No.local(No.variableName),class:"cmt-variableName cmt-local"},{tag:No.definition(No.variableName),class:"cmt-variableName cmt-definition"},{tag:No.special(No.variableName),class:"cmt-variableName2"},{tag:No.typeName,class:"cmt-typeName"},{tag:No.namespace,class:"cmt-namespace"},{tag:No.macroName,class:"cmt-macroName"},{tag:No.propertyName,class:"cmt-propertyName"},{tag:No.operator,class:"cmt-operator"},{tag:No.comment,class:"cmt-comment"},{tag:No.meta,class:"cmt-meta"},{tag:No.invalid,class:"cmt-invalid"},{tag:No.punctuation,class:"cmt-punctuation"}]);class Fo{constructor(t,e,i,n,r,s,o){this.type=t,this.value=e,this.from=i,this.hash=n,this.end=r,this.children=s,this.positions=o}static create(t,e,i,n,r){n=n+(n<<8)+t+(e<<4)|0;return new Fo(t,e,i,n,r,[],[])}toTree(t,e=this.end){var i=this.children.length-1;0<=i&&(e=Math.max(e,this.positions[i]+this.children[i].length+this.from));e=new Qr(t.types[this.type],this.children,this.positions,e-this.from).balance(2048);return function t(e,i){for(var n of e)Na.set(n,i),n instanceof Qr&&n.type.isAnonymous&&t(n.children,i)}(e.children,this.hash),e}copy(){return new Fo(this.type,this.value,this.from,this.hash,this.end,this.children.slice(),this.positions.slice())}}(Ir=Bo=Bo||{})[Ir.Document=1]="Document",Ir[Ir.CodeBlock=2]="CodeBlock",Ir[Ir.FencedCode=3]="FencedCode",Ir[Ir.Blockquote=4]="Blockquote",Ir[Ir.HorizontalRule=5]="HorizontalRule",Ir[Ir.BulletList=6]="BulletList",Ir[Ir.OrderedList=7]="OrderedList",Ir[Ir.ListItem=8]="ListItem",Ir[Ir.ATXHeading1=9]="ATXHeading1",Ir[Ir.ATXHeading2=10]="ATXHeading2",Ir[Ir.ATXHeading3=11]="ATXHeading3",Ir[Ir.ATXHeading4=12]="ATXHeading4",Ir[Ir.ATXHeading5=13]="ATXHeading5",Ir[Ir.ATXHeading6=14]="ATXHeading6",Ir[Ir.SetextHeading1=15]="SetextHeading1",Ir[Ir.SetextHeading2=16]="SetextHeading2",Ir[Ir.HTMLBlock=17]="HTMLBlock",Ir[Ir.LinkReference=18]="LinkReference",Ir[Ir.Paragraph=19]="Paragraph",Ir[Ir.CommentBlock=20]="CommentBlock",Ir[Ir.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",Ir[Ir.Escape=22]="Escape",Ir[Ir.Entity=23]="Entity",Ir[Ir.HardBreak=24]="HardBreak",Ir[Ir.Emphasis=25]="Emphasis",Ir[Ir.StrongEmphasis=26]="StrongEmphasis",Ir[Ir.Link=27]="Link",Ir[Ir.Image=28]="Image",Ir[Ir.InlineCode=29]="InlineCode",Ir[Ir.HTMLTag=30]="HTMLTag",Ir[Ir.Comment=31]="Comment",Ir[Ir.ProcessingInstruction=32]="ProcessingInstruction",Ir[Ir.URL=33]="URL",Ir[Ir.HeaderMark=34]="HeaderMark",Ir[Ir.QuoteMark=35]="QuoteMark",Ir[Ir.ListMark=36]="ListMark",Ir[Ir.LinkMark=37]="LinkMark",Ir[Ir.EmphasisMark=38]="EmphasisMark",Ir[Ir.CodeMark=39]="CodeMark",Ir[Ir.CodeInfo=40]="CodeInfo",Ir[Ir.LinkTitle=41]="LinkTitle",Ir[Ir.LinkLabel=42]="LinkLabel";class Jo{constructor(t,e){this.start=t,this.content=e,this.marks=[],this.parsers=[]}}class Ko{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){var t=this.skipSpace(this.basePos);this.indent=this.countIndent(t,this.pos,this.indent),this.pos=t,this.next=t==this.text.length?-1:this.text.charCodeAt(t)}skipSpace(t){return na(this.text,t)}reset(t){for(this.text=t,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(t){this.basePos=t,this.baseIndent=this.countIndent(t,this.pos,this.indent)}moveBaseColumn(t){this.baseIndent=t,this.basePos=this.findColumn(t)}addMarker(t){this.markers.push(t)}countIndent(e,i=0,n=0){for(let t=i;t=e.stack[i.depth+1].value+i.baseIndent)return!0;if(i.indent>=i.baseIndent+4)return!1;var n=(t.type==Bo.OrderedList?ca:ha)(i,e,!1);return 0t.pos+9||46!=r&&41!=r||nt.pos+1||49!=t.next)?-1:n+1-t.pos}function Oa(t){if(35!=t.next)return-1;let e=t.pos+1;for(;e=t.baseIndent+4)return-1;let e=t.pos+1;for(;e/,pa=/\?>/,ma=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(r);if(t)return e.append(La(Bo.Comment,n,n+1+t[0].length));t=/^\?[^]*?\?>/.exec(r);if(t)return e.append(La(Bo.ProcessingInstruction,n,n+1+t[0].length));r=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);if(!r)return-1;let s=[];if(e.parser.htmlParser){let t=e.parser.htmlParser.startParse(_r(e.slice(n,n+1+r[0].length)),0,{}),i;for(;!(i=t.advance()););s=i.children.map((t,e)=>new Aa(t,n+i.positions[e]))}return e.append(La(Bo.HTMLTag,n,n+1+r[0].length,s))},Emphasis(t,e,i){if(95!=e&&42!=e)return-1;let n=i+1;for(;t.char(n)==e;)n++;var r=t.slice(i-1,i),s=t.slice(n,n+1),o=Ea.test(r),a=Ea.test(s),l=/\s|^$/.test(r),r=/\s|^$/.test(s),s=!r&&(!a||l||o),r=!l&&(!o||r||a),o=s&&(42==e||!r||o),a=r&&(42==e||!s||a);return t.append(new Ma(95==e?za:qa,i,n,(o?1:0)|(a?2:0)))},HardBreak(e,t,i){if(92==t&&10==e.char(i+1))return e.append(La(Bo.HardBreak,i,i+2));if(32==t){let t=i+1;for(;32==e.char(t);)t++;if(10==e.char(t)&&t>=i+2)return e.append(La(Bo.HardBreak,i,t+1))}return-1},Link(t,e,i){return 91==e?t.append(new Ma(Va,i,i+1,1)):-1},Image(t,e,i){return 33==e&&91==t.char(i+1)?t.append(new Ma(Ya,i,i+2,1)):-1},LinkEnd(i,t,e){if(93!=t)return-1;for(let t=i.parts.length-1;0<=t;t--){var n=i.parts[t];if(n instanceof Ma&&(n.type==Va||n.type==Ya)){if(!n.side||i.skipSpace(n.to)==e&&!/[(\[]/.test(i.slice(e+1,e+2)))return i.parts[t]=null,-1;var r=i.takeContent(t),r=i.parts[t]=function(n,r,t,e,s){let{text:o}=n,i=n.char(s),a=s;if(r.unshift(La(Bo.LinkMark,e,e+(t==Bo.Image?2:1))),r.push(La(Bo.LinkMark,s-1,s)),40==i){let t=n.skipSpace(s+1),e=Da(o,t-n.offset,n.offset),i;e&&(t=n.skipSpace(e.to),i=Ha(o,t-n.offset,n.offset),i&&(t=n.skipSpace(i.to))),41==n.char(t)&&(r.push(La(Bo.LinkMark,s,s+1)),a=t+1,e&&r.push(e),i&&r.push(i),r.push(La(Bo.LinkMark,t,a)))}else 91!=i||(n=Ia(o,s-n.offset,n.offset,!1))&&(r.push(n),a=n.to);return La(t,e,a,r)}(i,r,n.type==Va?Bo.Link:Bo.Image,n.from,e+1);if(n.type==Va)for(let e=0;er?La(Bo.URL,r+s,i+s):i==n.length&&null}}function Ha(i,n,r){var t=i.charCodeAt(n);if(39!=t&&34!=t&&40!=t)return!1;var s=40==t?41:t;for(let t=n+1,e=!1;t=this.end?-1:this.text.charCodeAt(t-this.offset)}get end(){return this.offset+this.text.length}slice(t,e){return this.text.slice(t-this.offset,e-this.offset)}append(t){return this.parts.push(t),t.to}addDelimiter(t,e,i,n,r){return this.append(new Ma(t,e,i,(n?1:0)|(r?2:0)))}addElement(t){return this.append(t)}resolveMarkers(e){for(let o=e;o=e;s--){var t=this.parts[s];if(t instanceof Ma&&1&t.side&&t.type==a.type&&!(l&&(1&a.side||2&t.side)&&(t.to-t.from+h)%3==0&&((t.to-t.from)%3||h%3))){r=t;break}}if(r){let t=a.type.resolve,e=[],i=r.from,n=a.to;l&&(c=Math.min(2,r.to-r.from,h),i=r.to-c,n=a.from+c,t=1==c?"Emphasis":"StrongEmphasis"),r.type.mark&&e.push(this.elt(r.type.mark,i,r.to));for(let t=s+1;t(t?t-1:0))return!1;if(this.fragmentEnd<0){let t=this.fragment.to;for(;0=n)return this.fragment.from<=e;if(!i.childAfter(n))return!1}}matches(t){var e=this.cursor.tree;return e&&Na.get(e)==t}takeNodes(t){let e=this.cursor,i=this.fragment.offset,n=t.lineStart,r=n,s=t.block.children.length,o=r,a=s;for(;;){if(e.to-i>=this.fragmentEnd){if(e.type.isAnonymous&&e.firstChild())continue;break}if(t.addNode(e.tree,e.from-i),e.type.is("Block")&&(Ua.indexOf(e.type.id)<0?(r=e.to-i,s=t.block.children.length):(r=o,s=a,o=e.to-i,a=t.block.children.length)),!e.nextSibling())break}for(;t.block.children.length>s;)t.block.children.pop(),t.block.positions.pop();return r-n}}const Ja=new Sa(new vr(Wa),null,null,Object.keys(Qa).map(t=>Qa[t]),Object.keys(Qa).map(t=>ba[t]),Object.keys(Qa),Gs,ea,Object.keys(ja).map(t=>ja[t]),Object.keys(ja)),Ka={resolve:"Strikethrough",mark:"StrikethroughMark"};function tl(e,i,n=0,r,s=0){let o=0,a=!0,l=-1,h=-1,c=!1;var O=()=>{r.push(e.elt("TableCell",s+l,s+h,e.parser.parseInline(i.slice(l,h),s+l)))};for(let t=n;t{if(t!=s||e.char(i+1)==s)return-1;let n=[e.elt(a,i,i+1)];for(let t=i+1;te%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,i=0){var n=t.parser.context;return new rl(t,[],e,i,i,0,[],0,n?new sl(n,n.start):null,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var e=t>>19,i=65535&t;let{parser:n}=this.p;var r=n.dynamicPrecedence(i);if(r&&(this.score+=r),0==e)return is;)this.stack.pop();this.reduceContext(i)}storeNode(e,i,n,r=4,t=!1){if(0==e){let t=this,e=this.buffer.length;if(0==e&&t.parent&&(e=t.bufferBase-t.parent.bufferBase,t=t.parent),0=i)return void(t.buffer[e-2]=n)}}if(t&&this.pos!=n){let t=this.buffer.length;if(0n;)this.buffer[t]=this.buffer[t-4],this.buffer[t+1]=this.buffer[t-3],this.buffer[t+2]=this.buffer[t-2],this.buffer[t+3]=this.buffer[t-1],t-=4,4this.pos||r<=i.maxNode)&&(this.pos=s,i.stateFlag(e,1)||(this.reducePos=s)),this.pushState(e,t),r<=i.maxNode&&this.buffer.push(r,t,s,4),this.shiftContext(r)}else r<=this.p.parser.maxNode&&this.buffer.push(r,this.pos,s,4),this.pos=s}apply(t,e,i){65536&t?this.reduce(t):this.shift(t,e,i)}useNode(t,e){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=t)&&(this.p.reused.push(t),i++);var n=this.pos;this.reducePos=this.pos=n+t.length,this.pushState(e,n),this.buffer.push(i,n,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this.p.input,this))}split(){let t=this,e=t.buffer.length;for(;0t.reducePos;)e-=4;for(var i=t.buffer.slice(e),n=t.bufferBase+e;t&&n==t.bufferBase;)t=t.parent;return new rl(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,n,this.curContext,t)}recoverByDelete(t,e){var i=t<=this.p.parser.maxNode;i&&this.storeNode(t,this.pos,e),this.storeNode(0,this.pos,e,i?8:4),this.pos=this.reducePos=e,this.score-=200}canShift(e){for(let t=new ol(this);;){var i=this.p.parser.stateSlot(t.top,4)||this.p.parser.hasAction(t.top,e);if(0==(65536&i))return!0;if(0==i)return!1;t.reduce(i)}}get ruleStart(){for(let t=this.state,e=this.stack.length;;){var i=this.p.parser.stateSlot(t,5);if(!(65536&i))return 0;if(e-=3*(i>>19),(65535&i)>19,a=65535&s;if(-1>19),s=this.stack[1+s];if(null==e||s1&e&&t==i)||n.push(r[t],i)}r=n}let n=[];for(let e=0;e>19;0==t?(this.rest==this.stack.stack&&(this.rest=this.rest.slice()),this.rest.push(this.top,0,0),this.offset+=3):this.offset-=3*(t-1);e=this.stack.p.parser.getGoto(this.rest[this.offset-3],e,!0);this.top=e}}class al{constructor(t,e,i){this.stack=t,this.pos=e,this.index=i,this.buffer=t.buffer,0==this.index&&this.maybeNext()}static create(t){return new al(t,t.bufferBase+t.buffer.length,t.buffer.length)}maybeNext(){var t=this.stack.parent;null!=t&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new al(this.stack,this.pos,this.index)}}class ll{constructor(){this.start=-1,this.value=-1,this.end=-1}accept(t,e){this.value=t,this.end=e}}class hl{constructor(t,e){this.data=t,this.id=e}token(t,e,i){!function(i,t,n,r,e){let s=0,o=1<>1,d=l+O+(O<<1),u=i[d],f=i[d+1];if(c=e)&&!n.type.isError)return i<0?Math.max(0,Math.min(n.to-1,e-5)):Math.min(t.length,Math.max(n.from+1,e+5));if(i<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return i<0?0:t.length}}class pl{constructor(t){this.fragments=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){var t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?fl(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?fl(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t=this.safeFrom?r:null;r instanceof $r?(this.index[e]++,this.nextStart=n+r.length):(this.index[e]++,n+r.length>=t&&(this.trees.push(r),this.start.push(n),this.index.push(0)))}else this.trees.pop(),this.start.pop(),this.index.pop()}}}class ml extends ll{constructor(){super(...arguments),this.extended=-1,this.mask=0,this.context=0}clear(t){this.start=t,this.value=this.extended=-1}}const gl=new ll;class vl{constructor(t){this.tokens=[],this.mainToken=gl,this.actions=[],this.tokens=t.tokenizers.map(t=>new ml)}getActions(n,r){let s=0,o=null,{parser:t}=n.p,{tokenizers:a}=t;var l=t.stateSlot(n.state,3),h=n.curContext?n.curContext.hash:0;for(let i=0;ic))break}}for(;this.actions.length>s;)this.actions.pop();return o||(o=gl,o.start=n.pos,n.pos==r.length?o.accept(n.p.parser.eofTerm,n.pos):o.accept(0,n.pos+1)),this.mainToken=o,this.actions}updateCachedToken(i,t,n,r){if(i.clear(n.pos),t.token(r,i,n),-1>1)){0==(1&s)?i.value=s>>1:i.extended=s>>1;break}}}else n.pos==r.length?i.accept(n.p.parser.eofTerm,n.pos):i.accept(0,n.pos+1)}putAction(e,t,i,n){for(let t=0;ti)n.push(a);else if(l=this.checkNest(a))(!o||o.stack.scoreh)for(n.sort((t,e)=>e.score-t.score);n.length>h;)n.pop();n.some(t=>t.reducePos>i)&&this.recovering--}else if(1 ":"";if(this.fragments){var e=i.curContext&&i.curContext.tracker.strict,l=e?i.curContext.hash:0;for(let t=this.fragments.nodeAt(s);t;){var h=this.parser.nodeSet.types[t.type.id]==t.type?o.getGoto(i.state,t.type.id):-1;if(-1s?n:r).push(t)}return!1}advanceFully(t,e){for(var i=t.pos;;){var n=this.checkNest(t);if(n)return n;if(!this.advanceStack(t,null,null))return!1;if(t.pos>i)return wl(t,e),!0}}runRecovery(o,a,l){let h=null,c=!1,O;for(let s=0;s ":"";if(t.deadEnd){if(c)continue;c=!0,t.restart(),dl&&console.log(u+this.stackID(t)+" (restarted)");var f=this.advanceFully(t,l);if(f){!0!==f&&(O=f);continue}}let n=t.split(),r=u;for(let t=0;n.forceReduce()&&t<10;t++){dl&&console.log(r+this.stackID(n)+" (via force-reduce)");var p=this.advanceFully(n,l);if(p){!0!==p&&(O=p);break}dl&&(r=this.stackID(n)+" -> ")}for(d of t.recoverByInsert(e))dl&&console.log(u+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,l);this.input.length>t.pos?(i==t.pos&&(i++,e=0),t.recoverByDelete(e,i),dl&&console.log(u+this.stackID(t)+` (via recover-delete ${this.parser.getName(e)})`),wl(t,l)):(!h||h.scoreO.stack.score){O=void 0;break}return O&&this.startNested(O),null}forceFinish(){let t=this.stacks[0].split();return this.nested&&this.finishNested(t,this.nested.forceFinish()),this.stackToTree(t.forceAll())}stackToTree(t,e=t.pos){return this.parser.context&&t.emitContext(),Qr.build({buffer:al.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.startPos,length:e-this.startPos,minRepeatType:this.parser.minRepeatTerm})}checkNest(t){var e=this.parser.findNested(t.state);if(!e)return null;let i=e.value;return"function"==typeof i&&(i=i(this.input,t)),i?{stack:t,info:e,spec:i}:null}startNested(t){let{stack:e,info:i,spec:n}=t;this.stacks=[e],this.nestEnd=this.scanForNestEnd(e,i.end,n.filterEnd),this.nestWrap="number"==typeof n.wrapType?this.parser.nodeSet.types[n.wrapType]:n.wrapType||null,n.startParse?this.nested=n.startParse(this.input.clip(this.nestEnd),e.pos,this.context):this.finishNested(e)}scanForNestEnd(e,i,n){for(let t=e.pos;tt;class bl{constructor(i){if(this.bufferLength=1024,this.strict=!1,this.cachedDialect=null,13!=i.version)throw new RangeError(`Parser version (${i.version}) doesn't match runtime version (13)`);let e=Ol(i.tokenData),n=i.nodeNames.split(" ");this.minRepeatTerm=n.length,this.context=i.context;for(let t=0;ti.topRules[t][1]);this.nodeSet=new vr(n.map((t,e)=>gr.define({name:e>=this.minRepeatTerm?void 0:t,id:e,props:r[e],top:-1"number"==typeof t?new hl(e,t):t),this.topRules=i.topRules,this.nested=(i.nested||[]).map(([t,e,i,n])=>({name:t,value:e,end:new hl(Ol(i),0),placeholder:n})),this.dialects=i.dialects||{},this.dynamicPrecedences=i.dynamicPrecedences||null,this.tokenPrecTable=i.tokenPrec,this.termNames=i.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}parse(t,e=0,i={}){"string"==typeof t&&(t=_r(t));let n=new Ql(this,t,e,i);for(;;){var r=n.advance();if(r)return r}}startParse(t,e=0,i={}){return"string"==typeof t&&(t=_r(t)),new Ql(this,t,e,i)}getGoto(e,i,n=!1){var r=this.goto;if(i>=r[0])return-1;for(let t=r[i+1];;){var s=r[t++],o=1&s,a=r[t++];if(o&&n)return a;for(var l=t+(s>>1);t>10]:null}validAction(e,i){if(i==this.stateSlot(e,4))return!0;for(let t=this.stateSlot(e,1);;t+=3){if(65535==this.data[t]){if(1!=this.data[t+1])return!1;t=xl(this.data,t+2)}if(i==xl(this.data,t+1))return!0}}nextStates(e){let n=[];for(let t=this.stateSlot(e,1);;t+=3){if(65535==this.data[t]){if(1!=this.data[t+1])break;t=xl(this.data,t+2)}if(0==(1&this.data[t+2])){let i=this.data[t+1];n.some((t,e)=>1&e&&t==i)||n.push(this.data[t],i)}}return n}overrides(t,e){e=kl(this.data,this.tokenPrecTable,e);return e<0||kl(this.data,this.tokenPrecTable,t){var t=i.tokenizers.find(t=>t.from==e);return t?t.to:e})),i.dialect&&(t.dialect=this.parseDialect(i.dialect)),i.nested&&(t.nested=this.nested.map(t=>Object.prototype.hasOwnProperty.call(i.nested,t.name)?{name:t.name,value:i.nested[t.name],end:t.end,placeholder:t.placeholder}:t)),null!=i.strict&&(t.strict=i.strict),null!=i.bufferLength&&(t.bufferLength=i.bufferLength),t}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get hasNested(){return 0!1);if(t)for(var i of t.split(" ")){i=n.indexOf(i);0<=i&&(e[i]=!0)}let r=null;for(let i=0;i{let n=e.start,r=t.get(n),s;if(r<0&&i.context&&e.accept(33,e.start),60==r){n++,(s=47==t.get(n))&&n++;var o=Cl(t,n);if(void 0!==o){if(!o)return e.accept(s?4:1,n);t=i.context?i.context.name:null;if(s){if(o==t)return e.accept(2,n);if(t&&Tl[t])return e.accept(33,e.start);if(i.dialectEnabled(0))return e.accept(2,n);for(let t=i.context;t;t=t.parent)if(t.name==o)return;e.accept(3,n)}else t&&Wl[t]&&Wl[t][o]?e.accept(33,e.start):e.accept(1,n)}}}),Gs=new cl((t,e,i)=>{let n=t.get(e.start),r=e.start+1;if(47==n){if(62!=t.get(r))return;r++}else if(62!=n)return;i.context&&Pl[i.context.name]&&e.accept(5,r)}),pe=new cl((t,e)=>{let i=e.start,n=0;for(;;){var r=t.get(i);if(r<0)break;if(i++,r=="--\x3e".charCodeAt(n)){if(n++,3==n){i-=3;break}}else n=0}i>e.start&&e.accept(34,i)});const Ll=/^<\/?\s*([\.\-\:\w\xa1-\uffff]+)/;function zl(t){let e=Ll.exec(t);return e?e[1].toLowerCase():null}function ql(e){return t=>zl(t)==e}function Vl(t){let a=null;for(var e of t)a=a||Object.create(null),(a[e.tag]||(a[e.tag]=[])).push({attrs:e.attrs,value:{filterEnd:ql(e.tag),startParse:e.parser.startParse.bind(e.parser)}});return function(t,e){var i=t.read(e.ruleStart,e.pos);let n=zl(i),r,s;if(!n)return null;if(a&&(r=a[n]))for(var o of r)if(!o.attrs||o.attrs(s=s||function(i){let n=Ll.exec(i),r={};if(n){let t=/\s*([\.\-\:\w\xa1-\uffff]+)\s*(?:=\s*(?:"([^"]*)"|'([^']*)'|([^\s=<>"'/]+)))?/g,e;for(t.lastIndex=n.index+n[0].length;e=t.exec(i);)r[e[1]]=e[4]||e[3]||e[2]||e[1]}return r}(i)))return o.value;return"script"==n||"textarea"==n||"style"==n?{filterEnd:ql(n),wrapType:Sl}:null}}ge=Vl([]);function Yl(t){return{elementContent:Vl(t)}}ve=bl.deserialize({version:13,states:"'OOVOXOOOtQ`O'#CgS!eOXO'#CfOOOP'#Cf'#CfO!oOdO'#CqO!wQ`O'#CsOOOP'#DR'#DROOOP'#Cv'#CvQVOXOOO!|QrO,59ROOOP'#Cz'#CzO#XOXO'#DWO#cOPO,59QOOOS'#C{'#C{O#kOdO,59]OOOP,59],59]O#sQ`O,59_OOOP-E6t-E6tO#xQrO'#CiOOQQ'#Cw'#CwO$WQrO1G.mOOOP1G.m1G.mOOOP1G.v1G.vOOOP-E6x-E6xO$cQ`O'#CoOOOP1G.l1G.lOOOS-E6y-E6yOOOP1G.w1G.wOOOP1G.y1G.yO$hQ!bO,59TOOQQ-E6u-E6uOOOP7+$X7+$XOOOP7+$b7+$bO$sQ`O,59ZO$xO#tO'#ClO%WO&jO'#ClOOQQ1G.o1G.oOOOP1G.u1G.uOOOO'#Cx'#CxO%fO#tO,59WOOQQ,59W,59WOOOO'#Cy'#CyO%tO&jO,59WOOOO-E6v-E6vOOQQ1G.r1G.rOOOO-E6w-E6w",stateData:"&X~OtOS~OPPORTOSUOVUOWUOXUOfUOhVO{SO~O[XO~OPPORTOSUOVUOWUOXUOfUO{SO~OQzPqzP~PyOr]O|_O~O[`O~OTfO^bObeO~OQzXqzX~PyOQhOqiO~Or]O|kO~OblO~O_mOT]X^]Xb]X~OTpO^bOboO~O[qO~OatOvrOxsO~ObuO~OWvOXvOvxOwvO~OWyOXyOxxOyyO~OWvOXvOv|OwvO~OWyOXyOx|OyyO~O{fhf~",goto:"#k{PPPPPPPPPP|!SP!YPP!^PP!a!d|P|PP!j!p!v!|#S#YPPPPP#`PPPP#hXUOQWZXQOQWZTcXdRtmRi[XROQWZQWORaWQdXRndQwrR{wQzsR}zQZQRgZQ^SRj^SVOWTYQZR[Q",nodeNames:"⚠ StartTag StartCloseTag StartCloseTag IncompleteCloseTag SelfCloseEndTag Document Text EntityReference CharacterReference Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue EndTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag DoctypeDecl RawText",maxTerm:44,context:ve,nodeProps:[[pr.closedBy,-2,1,2,"EndTag SelfCloseEndTag",11,"CloseTag"],[pr.openedBy,5,"StartTag",18,"StartTag StartCloseTag",19,"OpenTag"]],skippedNodes:[0,25],repeatNodeCount:6,tokenData:"!#`!aR!WOX$kXY)sYZ)sZ]$k]^)s^p$kpq)sqr$krs*zsv$kvw+dwx2wx}$k}!O3d!O!P$k!P!Q7]!Q![$k![!]8s!]!^$k!^!_>`!_!`!!n!`!a8R!a!c$k!c!}8s!}#R$k#R#S8s#S#T$k#T#o8s#o$f$k$f$g&R$g%W$k%W%o8s%o%p$k%p&a8s&a&b$k&b1p8s1p4U$k4U4d8s4d4e$k4e$IS8s$IS$I`$k$I`$Ib8s$Ib$Kh$k$Kh%#t8s%#t&/x$k&/x&Et8s&Et&FV$k&FV;'S8s;'S;:jgWw`ypOq(kqr?Prs'gsv(kwx(]x!a(k!a!bKh!b~(k!R?WZw`ypOr(krs'gsv(kwx(]x}(k}!O?y!O!f(k!f!gAP!g#W(k#W#XGx#X~(k!R@QVw`ypOr(krs'gsv(kwx(]x}(k}!O@g!O~(k!R@pTw`yp{POr(krs'gsv(kwx(]x~(k!RAWVw`ypOr(krs'gsv(kwx(]x!q(k!q!rAm!r~(k!RAtVw`ypOr(krs'gsv(kwx(]x!e(k!e!fBZ!f~(k!RBbVw`ypOr(krs'gsv(kwx(]x!v(k!v!wBw!w~(k!RCOVw`ypOr(krs'gsv(kwx(]x!{(k!{!|Ce!|~(k!RClVw`ypOr(krs'gsv(kwx(]x!r(k!r!sDR!s~(k!RDYVw`ypOr(krs'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&/x&Et!m&FV;'S!m;'S;:j$|?&r?Ah!m?BY?Mn!m~!pkXY$eYZ$e]^$epq$e}!O!m!O!P!m!Q![!m![!]!m!`!a$w!c!}!m#R#S!m#T#o!m$}%O!m%W%o!m%p&a!m&b1p!m1p4U!m4U4d!m4e$IS!m$I`$Ib!m$Je$Jg!m$Kh%#t!m&/x&Et!m&FV;'S!m;'S;:j$|?&r?Ah!m?BY?Mn!m~$hTXY$eYZ$e]^$epq$e!`!a$w~$|Op~~%PP;=`<%l!m",42]],dialects:{noMatch:0},tokenPrec:234});const Ml=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];function Zl(t){return 65<=t&&t<=90||97<=t&&t<=122||161<=t}Ir=new cl((t,e)=>{let i=e.start,n=i,r=!1;for(;;){var s=t.get(n);if(!(Zl(s)||45==s||95==s||r&&(48<=(o=s)&&o<=57))){r&&e.accept(40==s?93:94,n);break}!r&&(45!=s||n>i)&&(r=!0),n++}var o}),Gs=new cl((t,e)=>{Ml.includes(t.get(e.start-1))&&(!Zl(t=t.get(e.start))&&95!=t&&35!=t&&46!=t&&91!=t&&58!=t&&45!=t||e.accept(92,e.start))}),pe=new cl((e,i)=>{var{start:n}=i;if(!Ml.includes(e.get(n-1))){var t=e.get(n);if(37==t&&i.accept(1,n+1),Zl(t)){let t=n+1;for(;Zl(e.get(t));)t++;i.accept(1,t)}}});const El={__proto__:null,not:30,url:64,"url-prefix":64,domain:64,regexp:64,selector:132},jl={__proto__:null,"@import":112,"@media":136,"@charset":140,"@namespace":144,"@keyframes":150,"@supports":162},Dl={__proto__:null,not:126,only:126,from:156,to:158},Hl=bl.deserialize({version:13,states:"7WOYQ[OOOOQP'#Cc'#CcOOQP'#Cb'#CbO!ZQ[O'#CeO!}QXO'#C`O#UQ[O'#CgO#aQ[O'#DOO#fQ[O'#DSOOQP'#Eb'#EbO#kQdO'#DdO$SQ[O'#DqO#kQdO'#DsO$eQ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!Q![6z![~%Q^6nSqWOy%Qz!Q%Q!Q![6z![~%Q^7RSqW#ZUOy%Qz!Q%Q!Q![6z![~%Q^7fYqW#ZUOy%Qz!O%Q!O!P8U!P!Q%Q!Q![7_![!g%Q!g!h5z!h#X%Q#X#Y5z#Y~%Q^8]WqW#ZUOy%Qz!Q%Q!Q![8U![!g%Q!g!h5z!h#X%Q#X#Y5z#Y~%Q_8zQcVOy%Qz~%Q^9VUlSOy%Qz!O%Q!O!P4x!P!Q%Q!Q![7_![~%Q_9nS#VPOy%Qz!Q%Q!Q![5Z![~%Q~:PRlSOy%Qz{:Y{~%Q~:_SqWOy:Yyz:kz{;`{~:Y~:nROz:kz{:w{~:k~:zTOz:kz{:w{!P:k!P!Q;Z!Q~:k~;`OQ~~;eUqWOy:Yyz:kz{;`{!P:Y!P!Q;w!Q~:Y~US{POy%Qz!`%Q!`!a>b!a~%QX>iQ{PqWOy%Qz~%QX>rUOy%Qz!c%Q!c!}?U!}#T%Q#T#o?U#o~%QX?]Y!XPqWOy%Qz}%Q}!O?U!O!Q%Q!Q![?U![!c%Q!c!}?U!}#T%Q#T#o?U#o~%QX@QQwPOy%Qz~%Q^@]QuUOy%Qz~%QX@fSOy%Qz#b%Q#b#c@r#c~%QX@wSqWOy%Qz#W%Q#W#XAT#X~%QXA[Q!_PqWOy%Qz~%QXAeSOy%Qz#f%Q#f#gAT#g~%QXAvQ!QPOy%Qz~%Q_BRQ!PVOy%Qz~%QZB^S!OPOy%Qz!_%Q!_!`2e!`~%Q",tokenizers:[Gs,pe,Ir,0,1,2,3],topRules:{StyleSheet:[0,3]},specialized:[{term:93,get:t=>El[t]||-1},{term:55,get:t=>jl[t]||-1},{term:94,get:t=>Dl[t]||-1}],tokenPrec:1060});let Il=null;function Gl(){if(!Il&&"object"==typeof document&&document.body){let t=[];for(var e in document.body.style)/[A-Z]|^-|^(item|length)$/.test(e)||t.push(e);Il=t.sort().map(t=>({type:"property",label:t}))}return Il||[]}const Bl=["active","after","before","checked","default","disabled","empty","enabled","first-child","first-letter","first-line","first-of-type","focus","hover","in-range","indeterminate","invalid","lang","last-child","last-of-type","link","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-of-type","only-child","optional","out-of-range","placeholder","read-only","read-write","required","root","selection","target","valid","visited"].map(t=>({type:"class",label:t})),Nl=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),Ul=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),Fl=/^[\w-]*/;const Jl=Vr.define({parser:Hl.configure({props:[is.add({Declaration:ls()}),hs.add({Block:cs}),qo({"import charset namespace keyframes":No.definitionKeyword,"media supports":No.controlKeyword,"from to":No.keyword,NamespaceName:No.namespace,KeyframeName:No.labelName,TagName:No.typeName,ClassName:No.className,PseudoClassName:No.constant(No.className),not:No.operatorKeyword,IdName:No.labelName,"FeatureName PropertyName AttributeName":No.propertyName,NumberLiteral:No.number,KeywordQuery:No.keyword,UnaryQueryOp:No.operatorKeyword,callee:No.keyword,"CallTag ValueName":No.atom,Callee:No.variableName,Unit:No.unit,"UniversalSelector NestingSelector":No.definitionOperator,AtKeyword:No.keyword,MatchOp:No.compareOperator,"ChildOp SiblingOp, LogicOp":No.logicOperator,BinOp:No.arithmeticOperator,Important:No.modifier,Comment:No.blockComment,ParenthesizedContent:No.special(No.name),ColorLiteral:No.color,StringLiteral:No.string,":":No.punctuation,"PseudoOp #":No.derefOperator,"; ,":No.separator,"( )":No.paren,"[ ]":No.squareBracket,"{ }":No.brace})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/}});Jl.data.of({autocomplete:t=>{let{state:e,pos:i}=t,n=Yr(e).resolve(i,-1);if("PropertyName"==n.name)return{from:n.from,options:Gl(),span:Fl};if("ValueName"==n.name)return{from:n.from,options:Nl,span:Fl};if("PseudoClassName"==n.name)return{from:n.from,options:Bl,span:Fl};if("TagName"==n.name){for(let{parent:t}=n;t;t=t.parent)if("Block"==t.name)return{from:n.from,options:Gl(),span:Fl};return{from:n.from,options:Ul,span:Fl}}if(!t.explicit)return null;let r=n.resolve(i),s=r.childBefore(i);return s&&":"==s.name&&"PseudoClassSelector"==r.name?{from:i,options:Bl,span:Fl}:s&&":"==s.name&&"Declaration"==r.name||"ArgList"==r.name?{from:i,options:Nl,span:Fl}:"Block"==r.name?{from:i,options:Gl(),span:Fl}:null}});const Kl=[10,13,8232,8233],th=[9,11,12,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288];function eh(e,i){for(let t=i-1;0<=t;t--){var n=e.get(t);if(-1{var n=e.start,r=t.get(n);(125==r||-1==r||eh(t,n))&&i.canShift(273)&&e.accept(273,e.start)},{contextual:!0,fallback:!0}),Gs=new cl((t,e,i)=>{var n=e.start,r=t.get(n++);if(!(-1{var n=e.start,r=t.get(n);43!=r&&45!=r||r!=t.get(n+1)||(i=!eh(t,e.start)&&i.canShift(1),e.accept(i?1:2,n+2))},{contextual:!0}),Ir=new cl((t,e)=>{let i=e.start,n=!1;for(;;){var r=t.get(i++);if(r<0){i-1>e.start&&e.accept(270,i-1);break}if(96==r){i==e.start+1?e.accept(272,i):e.accept(270,i-1);break}if(123==r&&n){i==e.start+2?e.accept(271,i):e.accept(270,i-2);break}if(10==r&&i>e.start+1){e.accept(270,i);break}92==r&&i!=t.length&&i++,n=36==r}});const ih={__proto__:null,export:16,as:21,from:25,default:30,async:35,function:36,this:46,true:54,false:54,void:58,typeof:62,null:76,super:78,new:112,await:129,yield:131,delete:132,class:142,extends:144,public:181,private:181,protected:181,readonly:183,in:202,instanceof:204,const:206,import:238,keyof:289,unique:293,infer:299,is:333,abstract:353,implements:355,type:357,let:360,var:362,interface:369,enum:373,namespace:379,module:381,declare:385,global:389,for:410,of:419,while:422,with:426,do:430,if:434,else:436,switch:440,case:446,try:452,catch:454,finally:456,return:460,throw:464,break:468,continue:472,debugger:476},nh={__proto__:null,async:99,get:101,set:103,public:151,private:151,protected:151,static:153,abstract:155,readonly:159,new:337},rh={__proto__:null,"<":119},sh=bl.deserialize({version:13,states:"$,lO]QYOOO&zQ!LdO'#CgO'ROSO'#DRO)ZQYO'#DWO)kQYO'#DcO)rQYO'#DmO-iQYO'#DsOOQO'#ET'#ETO-|QWO'#ESO.RQWO'#ESO0QQ!LdO'#IgO2hQ!LdO'#IhO3UQWO'#EqO3ZQpO'#FWOOQ!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$t$O!8SR#W#v#{WO!^$t!_#o$t#p~$t$O!8dT#V#v#{WO!^$t!_!`2l!`!a!8s!a#o$t#p~$t$O!8zS#V#v#{WO!^$t!_!`2l!`#o$t#p~$t%w!9_V'e%o#{WO!O$t!O!P!9t!P!^$t!_!a$t!a!b!:U!b#o$t#p~$t$`!9{Rr$W#{WO!^$t!_#o$t#p~$t$O!:]S#{W#a#vO!^$t!_!`2l!`#o$t#p~$t&e!:pRt&]#{WO!^$t!_#o$t#p~$tZ!;QRyR#{WO!^$t!_#o$t#p~$t$O!;bS#^#v#{WO!^$t!_!`2l!`#o$t#p~$t$P!;uR#{W']#wO!^$t!_#o$t#p~$t~!function(t,e){return"extends"==t&&e.dialectEnabled(1)?3:-1}(t,e)<<1|1},{term:277,get:t=>ih[t]||-1},{term:286,get:t=>nh[t]||-1},{term:58,get:t=>rh[t]||-1}],tokenPrec:11096});const oh=tr.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{cursor:"pointer",padding:"1px 1em 1px 3px",lineHeight:1.2},"& > li[aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"}}},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"300px"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class ah{constructor(t,e,i,n){this.field=t,this.line=e,this.from=i,this.to=n}}class lh{constructor(t,e,i){this.field=t,this.from=e,this.to=i}map(t){return new lh(this.field,t.mapPos(this.from,-1),t.mapPos(this.to,1))}}class hh{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(n,t){let e=[],r=[t];var s,i=n.doc.lineAt(t),o=/^\s*/.exec(i.text)[0];for(s of this.lines){if(e.length){let e=o,i=/^\t*/.exec(s)[0].length;for(let t=0;tnew lh(t.field,r[t.line]+t.from,r[t.line]+t.to));return{text:e,ranges:i}}static parse(t){let r=[],s=[],o=[],a;for(var l of t.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(l);){let e=a[1]?+a[1]:null,i=a[2]||a[3],n=-1;for(let t=0;t=n&&h.field++}o.push(new ah(n,s.length,a.index,a.index+i.length)),l=l.slice(0,a.index)+i+l.slice(a.index+a[0].length)}s.push(l)}return new hh(s,o)}}let ch=Ye.widget({widget:new class extends qe{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),Oh=Ye.mark({class:"cm-snippetField"});class dh{constructor(t,e){this.ranges=t,this.active=e,this.deco=Ye.set(t.map(t=>(t.from==t.to?ch:Oh).range(t.from,t.to)))}map(e){return new dh(this.ranges.map(t=>t.map(e)),this.active)}selectionInsideField(t){return t.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}}const uh=rt.define({map(t,e){return t&&t.map(e)}}),fh=rt.define(),ph=M.define({create(){return null},update(t,e){for(var i of e.effects){if(i.is(uh))return i.value;if(i.is(fh)&&t)return new dh(t.ranges,i.value)}return t=(t=t&&e.docChanged?t.map(e.changes):t)&&e.selection&&!t.selectionInsideField(e.selection)?null:t},provide:t=>tr.decorations.from(t,t=>t?t.deco:Ye.none)});function mh(t,e){return _.create(t.filter(t=>t.field==e).map(t=>_.range(t.from,t.to)))}function gh(s){return({state:t,dispatch:e})=>{let i=t.field(ph,!1);if(!i||s<0&&0==i.active)return!1;let n=i.active+s,r=0t.field==n+s);return e(t.update({selection:mh(i.ranges,n),effects:uh.of(r?null:new dh(i.ranges,n))})),!0}}var vh,Qh,wh;const $h=[{key:"Tab",run:gh(1),shift:gh(-1)},{key:"Escape",run:({state:t,dispatch:e})=>{return!!t.field(ph,!1)&&(e(t.update({effects:uh.of(null)})),!0)}}],yh=L.define({combine(t){return t.length?t[0]:$h}}),bh=E.override(hr.compute([yh],t=>t.facet(yh)));function xh(t,e){return Object.assign(Object.assign({},e),{apply:function(t){let a=hh.parse(t);return(i,t,e,n)=>{var{text:r,ranges:s}=a.instantiate(i.state,e);let o={changes:{from:e,to:n,insert:d.of(r)}};if(s.length&&(o.selection=mh(s,0)),1t),bh,kh,oh]))}i.dispatch(i.state.update(o))}}(t)})}const kh=tr.domEventHandlers({mousedown(t,e){let i=e.state.field(ph,!1),n;if(!i||null==(n=e.posAtCoords({x:t.clientX,y:t.clientY})))return!1;let r=i.ranges.find(t=>t.from<=n&&t.to>=n);return!(!r||r.field==i.active)&&(e.dispatch({selection:mh(i.ranges,r.field),effects:uh.of(i.ranges.some(t=>t.field>r.field)?new dh(i.ranges,r.field):null)}),!0)}});xh("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),xh("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),xh("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),xh("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"block",type:"keyword"}),xh("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),xh('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),xh('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"});const Sh=Vr.define({parser:sh.configure({props:[is.add({IfStatement:ls({except:/^\s*({|else\b)/}),TryStatement:ls({except:/^\s*({|catch|finally)\b/}),LabeledStatement:t=>t.baseIndent,SwitchBody:t=>{var e=t.textAfter,i=/^\s*\}/.test(e),e=/^\s*(case|default)\b/.test(e);return t.baseIndent+(i?0:e?1:2)*t.unit},Block:([{closing:vh,align:Qh=!0,units:wh=1}]=[{closing:"}"}],t=>as(t,Qh,wh,vh)),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>-1,"Statement Property":ls({except:/^{/}),JSXElement(t){var e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.state.doc.lineAt(t.node.from))+(e?0:t.unit)},JSXEscape(t){var e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.state.doc.lineAt(t.node.from))+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),hs.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression":cs,BlockComment(t){return{from:t.from+2,to:t.to-2}}}),qo({"get set async static":No.modifier,"for while do if else switch try catch finally return throw break continue default case":No.controlKeyword,"in of await yield void typeof delete instanceof":No.operatorKeyword,"export import let var const function class extends":No.definitionKeyword,"with debugger from as new":No.keyword,TemplateString:No.special(No.string),Super:No.atom,BooleanLiteral:No.bool,this:No.self,null:No.null,Star:No.modifier,VariableName:No.variableName,"CallExpression/VariableName":No.function(No.variableName),VariableDefinition:No.definition(No.variableName),Label:No.labelName,PropertyName:No.propertyName,"CallExpression/MemberExpression/PropertyName":No.function(No.propertyName),"FunctionDeclaration/VariableDefinition":No.function(No.definition(No.variableName)),"ClassDeclaration/VariableDefinition":No.definition(No.className),PropertyNameDefinition:No.definition(No.propertyName),UpdateOp:No.updateOperator,LineComment:No.lineComment,BlockComment:No.blockComment,Number:No.number,String:No.string,ArithOp:No.arithmeticOperator,LogicOp:No.logicOperator,BitOp:No.bitwiseOperator,CompareOp:No.compareOperator,RegExp:No.regexp,Equals:No.definitionOperator,"Arrow : Spread":No.punctuation,"( )":No.paren,"[ ]":No.squareBracket,"{ }":No.brace,".":No.derefOperator,", ;":No.separator,TypeName:No.typeName,TypeDefinition:No.definition(No.typeName),"type enum interface implements namespace module declare":No.definitionKeyword,"abstract global privacy readonly":No.modifier,"is keyof unique infer":No.operatorKeyword,JSXAttributeValue:No.string,JSXText:No.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":No.angleBracket,"JSXIdentifier JSXNameSpacedName":No.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":No.propertyName})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}});Sh.configure({dialect:"ts"}),Sh.configure({dialect:"jsx"}),Sh.configure({dialect:"jsx ts"});const Ph=Vr.define({parser:ve.configure({props:[is.add({Element(t){var e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.state.doc.lineAt(t.node.from))+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length{if(t.is("Block")&&!t.is("Document"))return(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})}),is.add({Document:()=>null}),Ar.add({Document:Th})],htmlParser:Ph.parser.configure({dialect:"noMatch"})}),Xh=_h(Wh),Rh=_h(Wh.configure([Is,Ns,Os,{defineNodes:["Emoji"],parseInline:[{name:"Emoji",parse(t,e,i){let n;return 58==e&&(n=/^[a-zA-Z_0-9]+:/.exec(t.slice(i+1,t.end)))?t.addElement(t.elt("Emoji",i,i+1+n[0].length)):-1}}]},{props:[qo({"TableDelimiter SubscriptMark SuperscriptMark StrikethroughMark":No.processingInstruction,"TableHeader/...":No.heading,"Strikethrough/...":No.deleted,TaskMarker:No.atom,Task:No.list,Emoji:No.character,"Subscript Superscript":No.special(No.content),TableCell:No.content})]}]));function _h(t){return new zr(Th,t,t.nodeSet.types.find(t=>"Document"==t.name))}function Ch(t,e){return e.sliceString(t.from,t.from+50)}function Ah(e,n,r){let s=[];for(let t=e;t&&"Document"!=t.name;t=t.parent)"ListItem"!=t.name&&"Blockquote"!=t.name||s.push(t);let o=[],a=0;for(let i=s.length-1;0<=i;i--){let t=s[i],e;var l;"Blockquote"==t.name&&(e=/^\s*> ?/.exec(n.slice(a)))?(o.push({from:a,string:e[0],node:t}),a+=e[0].length):"ListItem"==t.name&&"OrderedList"==t.parent.name&&(e=/^\s*\d+([.)])\s*/.exec(Ch(t,r)))?(l=4<=e[1].length?e[0].length-e[1].length+1:e[0].length,o.push({from:a,string:n.slice(a,a+l).replace(/\S/g," "),node:t}),a+=l):"ListItem"==t.name&&"BulletList"==t.parent.name&&(e=/^\s*[-+*] (\s*)/.exec(Ch(t,r)))&&(l=4<=e[1].length?e[0].length-e[1].length:e[0].length,o.push({from:a,string:n.slice(a,a+l).replace(/\S/g," "),node:t}),a+=l)}return o}const Lh=[{key:"Enter",run:({state:a,dispatch:t})=>{let i=Yr(a),e=null,n=a.changeByRange(o=>{if(o.empty&&Rh.isActiveAt(a,o.from)){let n=a.doc.lineAt(o.from),t=Ah(i.resolve(o.from,-1),n.text,a.doc),r=o.from,s=[];if(t.length){let e=t[t.length-1],i=e.from+e.string.length;if(o.from-n.from>=i&&!/\S/.test(n.text.slice(i,o.from-n.from))){let t=/List/.test(e.node.name)?e.from:i;for(;0+t+1),function(i,n,r){for(let t=-1,e=i;;){if("ListItem"==e.name){var s=/^(\s*)(\d+)(?=[.)])/.exec(n.sliceString(e.from,e.from+10));if(!s)return;var o=+s[2];if(0<=t){if(o!=t+1)return;r.push({from:e.from+s[1].length,to:e.from+s[0].length,insert:String(t+2)})}t=o}o=e.nextSibling;if(!o)break;e=o}}(e.node,a.doc,s))))}let e=t.map(t=>t.string).join("");return o.from-n.from{let o=Yr(s),a=null,e=s.changeByRange(e=>{if(e.empty&&Rh.isActiveAt(s,e.from)){let t=s.doc.lineAt(e.from);var i=Ah(o.resolve(e.from,-1),t.text,s.doc);if(i.length){var n=i[i.length-1],r=n.from+n.string.length;if(e.from>r+t.from&&!/\S/.test(t.text.slice(r,e.from-t.from)))return{range:_.cursor(r+t.from),changes:{from:r+t.from,to:e.from}};if(e.from-t.from==r){i=t.from+n.from;return"ListItem"==n.node.name&&n.node.parent.from'},{type:"redo",title:"重做",innerHTML:''},{type:"bold",title:"加粗",innerHTML:''},{type:"italic",title:"倾斜",innerHTML:''},{type:"delete",title:"删除",innerHTML:''},{type:"code-inline",title:"行内代码",innerHTML:''},{type:"hr",title:"横线",innerHTML:''},{type:"quote",title:"引用",innerHTML:''},{type:"title",title:"标题",innerHTML:''},{type:"ordered-list",title:"有序列表",innerHTML:''},{type:"unordered-list",title:"无序列表",innerHTML:''},{type:"link",title:"超链接",innerHTML:''},{type:"image",title:"插入图片",innerHTML:''},{type:"table",title:"表格",innerHTML:''},{type:"code-block",title:"代码块",innerHTML:''},{type:"html",title:"原生HTML",innerHTML:''},{type:"time",title:"当前时间",innerHTML:''},{type:"indent",title:"缩进",innerHTML:''},{type:"character",title:"实体符号",innerHTML:''},{type:"emoji",title:"符号表情",innerHTML:''},{type:"expression",title:"图片表情",innerHTML:''},{type:"task-no",title:"任务 - 未完成",innerHTML:''},{type:"task-yes",title:"任务 - 已完成",innerHTML:''},{type:"mtitle",title:"居中标题",innerHTML:''},{type:"dplayer",title:"M3U8/MP4视频",innerHTML:''},{type:"bilibili",title:"哔哩哔哩视频",innerHTML:''},{type:"netease-list",title:"网易云列表",innerHTML:''},{type:"netease-single",title:"网易云单首",innerHTML:''},{type:"abtn",title:"多彩按钮",innerHTML:''},{type:"anote",title:"便条按钮",innerHTML:''},{type:"dotted",title:"彩色虚线",innerHTML:''},{type:"hide",title:"回复可见",innerHTML:''},{type:"card-default",title:"默认卡片",innerHTML:''},{type:"message",title:"消息提示",innerHTML:''},{type:"progress",title:"进度条",innerHTML:''},{type:"callout",title:"标注",innerHTML:''},{type:"mp3",title:"外部音乐",innerHTML:''},{type:"tabs",title:"标签页",innerHTML:''},{type:"card-list",title:"卡片列表",innerHTML:''},{type:"timeline",title:"时间轴",innerHTML:''},{type:"copy",title:"复制文本",innerHTML:''},{type:"card-describe",title:"描述卡片",innerHTML:''},{type:"lamp",title:"跑马灯",innerHTML:''},{type:"collapse",title:"折叠面板",innerHTML:''},{type:"cloud",title:"云盘下载",innerHTML:''},{type:"gird",title:"宫格",innerHTML:''},{type:"alert",title:"提示",innerHTML:''},{type:"clean",title:"清屏",innerHTML:''},{type:"download",title:"下载",innerHTML:''},{type:"fullScreen",title:"全屏/取消全屏",innerHTML:''},{type:"preview",title:"预览/取消预览",innerHTML:''},{type:"draft",title:"保存草稿",innerHTML:''},{type:"publish",title:"发布文章",innerHTML:''},{type:"about",title:"关于",innerHTML:''}];const Vh=new HyperDown,Yh=window.JoeConfig.playerAPI;function Mh(t){if(!window.JoeConfig.canPreview)return $(".cm-preview-content").html("1. 预览已默认关闭
2. 点击上方预览按钮启用预览
3. 若编辑器卡顿可尝试关闭预览");-1!==t.indexOf(" ")&&(t=t.replace(/ /g," ")),-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=(t=(t=Vh.makeHtml(t)).replace(/\:\:\(\s*(呵呵|哈哈|吐舌|太开心|笑眼|花心|小乖|乖|捂嘴笑|滑稽|你懂的|不高兴|怒|汗|黑线|泪|真棒|喷|惊哭|阴险|鄙视|酷|啊|狂汗|what|疑问|酸爽|呀咩爹|委屈|惊讶|睡觉|笑尿|挖鼻|吐|犀利|小红脸|懒得理|勉强|爱心|心碎|玫瑰|礼物|彩虹|太阳|星星月亮|钱币|茶杯|蛋糕|大拇指|胜利|haha|OK|沙发|手纸|香蕉|便便|药丸|红领巾|蜡烛|音乐|灯泡|开心|钱|咦|呼|冷|生气|弱|吐血|狗头)\s*\)/g,function(t,e){return e=encodeURI(e).replace(/%/g,""),``})).replace(/\:\@\(\s*(高兴|小怒|脸红|内伤|装大款|赞一个|害羞|汗|吐血倒地|深思|不高兴|无语|亲亲|口水|尴尬|中指|想一想|哭泣|便便|献花|皱眉|傻笑|狂汗|吐|喷水|看不见|鼓掌|阴暗|长草|献黄瓜|邪恶|期待|得意|吐舌|喷血|无所谓|观察|暗地观察|肿包|中枪|大囧|呲牙|抠鼻|不说话|咽气|欢呼|锁眉|蜡烛|坐等|击掌|惊喜|喜极而泣|抽烟|不出所料|愤怒|无奈|黑线|投降|看热闹|扇耳光|小眼睛|中刀)\s*\)/g,function(t,e){return e=encodeURI(e).replace(/%/g,""),``})).indexOf("{lamp")?t.replace(/{lamp\/}/g,''):t).indexOf("{x}")?t.replace(/{x}/g,''):t).indexOf("{ }")?t.replace(/{ }/g,''):t).indexOf("{mtitle")?t.replace(/{mtitle([^}]*)\/}/g,""):t).indexOf("{dplayer")?t.replace(/{dplayer([^}]*)\/}/g,''):t).indexOf("{bilibili")?t.replace(/{bilibili([^}]*)\/}/g,""):t).indexOf("{music-list")?t.replace(/{music-list([^}]*)\/}/g,""):t).indexOf("{music")?t.replace(/{music([^}]*)\/}/g,""):t).indexOf("{mp3")?t.replace(/{mp3([^}]*)\/}/g,""):t).indexOf("{abtn")?t.replace(/{abtn([^}]*)\/}/g,""):t).indexOf("{anote")?t.replace(/{anote([^}]*)\/}/g,""):t).indexOf("{copy")?t.replace(/{copy([^}]*)\/}/g,""):t).indexOf("{dotted")?t.replace(/{dotted([^}]*)\/}/g,""):t).indexOf("{message")?t.replace(/{message([^}]*)\/}/g,""):t).indexOf("{progress")?t.replace(/{progress([^}]*)\/}/g,""):t).indexOf("{cloud")?t.replace(/{cloud([^}]*)\/}/g,""):t).indexOf("{hide")?t.replace(/{hide[^}]*}([\s\S]*?){\/hide}/g,""):t).indexOf("{card-default")?t.replace(/{card-default([^}]*)}([\s\S]*?){\/card-default}/g,'
'):t).indexOf("{callout")?t.replace(/{callout([^}]*)}([\s\S]*?){\/callout}/g,'
'):t).indexOf("{card-describe")?t.replace(/{card-describe([^}]*)}([\s\S]*?){\/card-describe}/g,'
'):t).indexOf("{tabs")?t.replace(/{tabs}([\s\S]*?){\/tabs}/g,'
'):t).indexOf("{card-list")?t.replace(/{card-list}([\s\S]*?){\/card-list}/g,'
'):t).indexOf("{timeline")?t.replace(/{timeline}([\s\S]*?){\/timeline}/g,'
'):t).indexOf("{collapse")?t.replace(/{collapse}([\s\S]*?){\/collapse}/g,'
'):t).indexOf("{alert")?t.replace(/{alert([^}]*)}([\s\S]*?){\/alert}/g,'
'):t).indexOf("{gird")&&(t=t.replace(/{gird([^}]*)}([\s\S]*?){\/gird}/g,'
')),$(".cm-preview-content").html(t),$(".cm-preview-content p:empty").remove(),$(".cm-preview-content pre code").each((t,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,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(t=>t?parseInt(t,36):1);for(let t=1;te)return r[t-1]<=e}(e))n+=O(e),t=e;else{if(!s(e))break;{let t=0,e=n-2;for(;0<=e&&s(c(i,e));)t++,e-=2;if(t%2==0)break;n+=2}}}return n}function a(t,e){for(;0this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){var n=[];return this.decompose(0,t,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(e,this.length,n,1),m.from(n,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){var i=[];return this.decompose(t,e,i,0),m.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=new g(this),i=new g(t);for(;;){if(e.next(),i.next(),e.lineBreak!=i.lineBreak||e.done!=i.done||e.value!=i.value)return!1;if(e.done)return!0}}iter(t=1){return new g(this,t)}iterRange(t,e=this.length){return new i(this,t,e)}toString(){return this.sliceString(0)}toJSON(){var t=[];return this.flatten(t),t}static of(t){if(0==t.length)throw new RangeError("A document must have at least one line");return 1!=t.length||t[0]?t.length<=32?new p(t):m.from(p.split(t,[])):d.empty}}"undefined"!=typeof Symbol&&(d.prototype[Symbol.iterator]=function(){return this.iter()});class p extends d{constructor(t,e=function(t){let e=-1;for(var i of t)e+=i.length+1;return e}(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(e,i,n,r){for(let t=0;;t++){var s=this.text[t],o=r+s.length;if(e<=(i?n:o))return new v(r,o,n,s);r=o+1,n++}}decompose(i,t,n,r){i=i<=0&&t>=this.length?this:new p(f(this.text,i,t),Math.min(t,this.length)-Math.max(0,i));if(1&r){let t=n.pop(),e=u(i.text,t.text.slice(),0,i.length);e.length<=32?n.push(new p(e,t.length+i.length)):(r=e.length>>1,n.push(new p(e.slice(0,r)),new p(e.slice(r))))}else n.push(i)}replace(t,e,i){if(!(i instanceof p))return super.replace(t,e,i);var n=u(this.text,u(i.text,f(this.text,0,t)),e),t=this.length+i.length-(e-t);return n.length<=32?new p(n,t):m.from(p.split(n,[]),t)}sliceString(r,s=this.length,o="\n"){let a="";for(let i=0,n=0;i<=s&&nr&&n&&(a+=o),ri&&(a+=t.slice(Math.max(0,r-i),s-i)),i=e+1}return a}flatten(t){for(var e of this.text)t.push(e)}static split(t,e){let i=[],n=-1;for(var r of t)i.push(r),n+=r.length+1,32==i.length&&(e.push(new p(i,n)),i=[],n=-1);return-1=n&&(l=a&((n<=r?1:0)|(s<=e?2:0)),n>=r&&e<=s&&!l?o.push(t):t.decompose(r-n,s-n,o,l)),n=e+1}}replace(r,s,o){if(o.lines=n&&s<=e){var a=t.replace(r-n,s-n,o),l=this.lines-t.lines+a.lines;if(a.lines>4&&a.lines>l>>6){let t=this.children.slice();return t[i]=a,new m(t,this.length-(s-r)+o.length)}return super.replace(n,e,a)}n=e+1}return super.replace(r,s,o)}sliceString(r,s=this.length,o="\n"){let a="";for(let i=0,n=0;ir&&i&&(a+=o),rn&&(a+=t.sliceString(r-n,s-n,o)),n=e+1}return a}flatten(t){for(var e of this.children)e.flatten(t)}static from(t,e=t.reduce((t,e)=>t+e.length+1,-1)){let i=0;for(var n of t)i+=n.lines;if(i<32){var r,s=[];for(r of t)r.flatten(s);return new p(s,e)}let o=Math.max(32,i>>5),a=o<<1,l=o>>1,h=[],c=0,O=-1,d=[];function u(){0!=c&&(h.push(1==d.length?d[0]:m.from(d,O)),O=-1,c=d.length=0)}for(var f of t)!function t(e){let i;if(e.lines>a&&e instanceof m)for(var n of e.children)t(n);else e.lines>l&&(c>l||!c)?(u(),h.push(e)):e instanceof p&&c&&(i=d[d.length-1])instanceof p&&e.lines+i.lines<=32?(c+=e.lines,O+=e.length+1,d[d.length-1]=new p(i.text.concat(e.text),i.length+1+e.length)):(c+e.lines>o&&u(),c+=e.lines,O+=e.length+1,d.push(e))}(f);return u(),1==h.length?h[0]:new m(h,e)}}function u(s,o,a=0,l=1e9){for(let i=0,n=0,r=!0;nMath.max(0,n))return this.value=0==n?t:0t.length?n-=t.length:(this.nodes.push(t),this.offsets.push(0this.limit&&(this.value=0r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(i,n=i){for(let t=0,e=0;t"number"!=typeof t))throw new RangeError("Invalid JSON representation of ChangeDesc");return new y(t)}}class k extends y{constructor(t,e){super(t),this.inserted=e}apply(s){if(this.length!=s.length)throw new RangeError("Applying change set to a document with the wrong length");return T(this,(t,e,i,n,r)=>s=s.replace(i,i+(e-t),r),!1),s}mapDesc(t,e=!1){return W(this,t,e,!0)}invert(i){let n=this.sections.slice(),r=[];for(let t=0,e=0;t>1;r.length>1].toJSON()))}return n}static of(t,s,o){let a=[],l=[],h=0,i=null;function c(t=!1){if(t||a.length){hh&&S(a,t-h,-1),S(a,e-t,n),P(l,a,r),h=e)}}(t),c(!i),i}static empty(t){return new k(t?[t,-1]:[],[])}static fromJSON(i){if(!Array.isArray(i))throw new RangeError("Invalid JSON representation of ChangeSet");let n=[],r=[];for(let e=0;ee&&"string"!=typeof t))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==t.length)n.push(t[0],0);else{for(;r.length>1;if(n>1])),!(c||a==l.sections.length||l.sections[a+1]<0);)n=l.sections[a++],r=l.sections[a++];h(s,t,o,e,i),s=t,o=e}}}function W(t,e,r,i=!1){var s=[],o=i?[]:null;let a=new X(t),l=new X(e);for(let i=0,n=0;;)if(-1==a.ins)i+=a.len,a.next();else if(-1==l.ins&&nn&&!a.done&&i+a.leni&&n+l.lenl||0<=o.ins&&o.len>l)&&(t||h>1;return e>=t.length?d.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?d.empty:e[i].slice(this.off,null==t?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){-1==this.ins?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class R{constructor(t,e,i){this.from=t,this.to=e,this.flags=i}get anchor(){return 16&this.flags?this.to:this.from}get head(){return 16&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 4&this.flags?-1:8&this.flags?1:0}get bidiLevel(){var t=3&this.flags;return 3==t?null:t}get goalColumn(){var t=this.flags>>5;return 33554431==t?void 0:t}map(t,e=-1){var i=t.mapPos(this.from,e),e=t.mapPos(this.to,e);return i==this.from&&e==this.to?this:new R(i,e,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return _.range(t,e);e=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return _.range(this.anchor,e)}eq(t){return this.anchor==t.anchor&&this.head==t.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||"number"!=typeof t.anchor||"number"!=typeof t.head)throw new RangeError("Invalid JSON representation for SelectionRange");return _.range(t.anchor,t.head)}}class _{constructor(t,e=0){this.ranges=t,this.mainIndex=e}map(e,i=-1){return e.empty?this:_.create(this.ranges.map(t=>t.map(e,i)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;tt.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||"number"!=typeof t.main||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new _(t.ranges.map(t=>R.fromJSON(t)),t.main)}static single(t,e=t){return new _([_.range(t,e)],0)}static create(i,n=0){if(0==i.length)throw new RangeError("A selection needs at least one range");for(let t=0,e=0;et.from-e.from),i=e.indexOf(t);for(let t=1;tr.head?_.range(s,n):_.range(n,s)))}return new _(e,i)}(i.slice(),n);t=r.to}return new _(i,n)}static cursor(t,e=0,i,n){return new R(t,t,(0==e?0:e<0?4:8)|(null==i?3:Math.min(2,i))|(null!=n?n:33554431)<<5)}static range(t,e,i){i=(null!=i?i:33554431)<<5;return ee)throw new RangeError("Selection points outside of document")}let A=0;class L{constructor(t,e,i,n,r){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=n,this.extensions=r,this.id=A++,this.default=t([])}static define(t={}){return new L(t.combine||(t=>t),t.compareInput||((t,e)=>t===e),t.compare||(t.combine?(t,e)=>t===e:z),!!t.static,t.enables)}of(t){return new q([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new q(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new q(t,this,2,e)}from(e,i){return i=i||(t=>t),this.compute([e],t=>i(t.field(e)))}}function z(t,i){return t==i||t.length==i.length&&t.every((t,e)=>t===i[e])}class q{constructor(t,e,i,n){this.dependencies=t,this.facet=e,this.type=i,this.value=n,this.id=A++}dynamicSlot(t){var e,i;let n=this.value,r=this.facet.compareInput,s=t[this.id]>>1,o=2==this.type,a=!1,l=!1,h=[];for(i of this.dependencies)"doc"==i?a=!0:"selection"==i?l=!0:0==(1&(null!==(e=t[i.id])&&void 0!==e?e:1))&&h.push(t[i.id]);return(e,t)=>{if(!t||t.reconfigured)return e.values[s]=n(e),1;if(!(a&&t.docChanged||l&&(t.docChanged||t.selection)||h.some(t=>0<(1&G(e,t)))))return 0;var i=n(e),t=t.startState.values[s];return(o?function(e,i,n){if(e.length!=i.length)return!1;for(let t=0;t>1}const Y=L.define({static:!0});class M{constructor(t,e,i,n,r){this.id=t,this.createF=e,this.updateF=i,this.compareF=n,this.spec=r,this.provides=void 0}static define(t){let e=new M(A++,t.create,t.update,t.compare||((t,e)=>t===e),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(Y).find(t=>t.field==this);return((null===e||void 0===e?void 0:e.create)||this.createF)(t)}slot(t){let r=t[this.id]>>1;return(t,e)=>{if(!e||e.reconfigured&&null==V(e.startState,this.id))return t.values[r]=this.create(t),1;let i,n=0;e.reconfigured?(i=e.startState.values[V(e.startState,this.id)],n=1):i=e.startState.values[r];e=this.updateF(i,e);return n||this.compareF(i,e)||(n=1),n&&(t.values[r]=e),n}}init(t){return[this,Y.of({field:this,create:t})]}get extension(){return this}}const Z={fallback:3,default:2,extend:1,override:0};function t(e){return t=>new D(t,e)}const E={fallback:t(Z.fallback),default:t(Z.default),extend:t(Z.extend),override:t(Z.override)};class D{constructor(t,e){this.inner=t,this.prec=e}}class j{of(t){return new H(this,t)}reconfigure(t){return j.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class H{constructor(t,e){this.compartment=t,this.inner=e}}class I{constructor(t,e,i,n,r){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=n,this.staticValues=r,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(t,e,n){let i=[],r=Object.create(null);var s,o,a=new Map;for(s of function(t,a,l){let h=[[],[],[],[]],c=new Map;return function t(e,i){var n=c.get(e);if(null!=n){if(i<=n)return;var r=h[n].indexOf(e);-1t.concat(e))}(t,e,a))(s instanceof M?i:r[s.facet.id]||(r[s.facet.id]=[])).push(s);let l=Object.create(null),h=[],c=[];for(let e of i)l[e.id]=c.length<<1,c.push(t=>e.slot(t));for(o in r){let i=r[o],e=i[0].facet;if(i.every(t=>0==t.type)){l[e.id]=h.length<<1|1;let t=e.combine(i.map(t=>t.value));var O=n?n.config.address[e.id]:null;null!=O&&(O=B(n,O),e.compare(t,O)&&(t=O)),h.push(t)}else{for(let e of i)0==e.type?(l[e.id]=h.length<<1|1,h.push(e.value)):(l[e.id]=c.length<<1,c.push(t=>e.dynamicSlot(t)));l[e.id]=c.length<<1,c.push(t=>function(e,h,t){let c=t.map(t=>e[t.id]),O=t.map(t=>t.type),d=c.filter(t=>!(1&t)),u=e[h.id]>>1;return(e,t)=>{var i,n=t?t.reconfigured?t.startState.config.address[h.id]:u<<1:null;let r=null==n;for(i of d)1&G(e,i)&&(r=!0);if(!r)return 0;let s=[];for(let t=0;tt(l)),l,h)}}function G(t,e){if(1&e)return 2;var i=e>>1,e=t.status[i];if(4==e)throw new Error("Cyclic dependency between fields and/or facets");if(2&e)return e;t.status[i]=4;e=t.config.dynamicSlots[i](t,t.applying);return t.status[i]=2|e}function B(t,e){return(1&e?t.config.staticValues:t.values)[e>>1]}const N=L.define(),U=L.define({combine:t=>t.some(t=>t),static:!0}),F=L.define({combine:t=>t.length?t[0]:void 0,static:!0}),J=L.define(),K=L.define(),tt=L.define();class et{constructor(t,e){this.type=t,this.value=e}static define(){return new it}}class it{of(t){return new et(this,t)}}class nt{constructor(t){this.map=t}of(t){return new rt(this,t)}}class rt{constructor(t,e){this.type=t,this.value=e}map(t){t=this.type.map(this.value,t);return void 0===t?void 0:t==this.value?this:new rt(this.type,t)}is(t){return this.type==t}static define(t={}){return new nt(t.map||(t=>t))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(var n of t){n=n.map(e);n&&i.push(n)}return i}}rt.reconfigure=rt.define(),rt.appendConfig=rt.define();class st{constructor(t,e,i,n,r,s){this.startState=t,this.changes=e,this.selection=i,this.effects=n,this.annotations=r,this.scrollIntoView=s,this._doc=null,this._state=null,i&&C(i,e.newLength),r.some(t=>t.type==st.time)||(this.annotations=r.concat(st.time.of(Date.now())))}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(t){for(var e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}}function ot(t,e,i){let n,r,s;return s=i?(n=e.changes,r=k.empty(e.changes.length),t.changes.compose(e.changes)):(n=e.changes.map(t.changes),r=t.changes.mapDesc(e.changes,!0),t.changes.compose(n)),{changes:s,selection:e.selection?e.selection.map(r):null===(i=t.selection)||void 0===i?void 0:i.map(n),effects:rt.mapEffects(t.effects,n).concat(rt.mapEffects(e.effects,r)),annotations:t.annotations.length?t.annotations.concat(e.annotations):e.annotations,scrollIntoView:t.scrollIntoView||e.scrollIntoView}}function at(t,e,i){var n=e.selection;return{changes:e.changes instanceof k?e.changes:k.of(e.changes||[],i,t.facet(F)),selection:n&&(n instanceof _?n:_.single(n.anchor,n.head)),effects:ct(e.effects),annotations:ct(e.annotations),scrollIntoView:!!e.scrollIntoView}}function lt(e,i,n){let r=at(e,i.length?i[0]:{},e.doc.length);i.length&&!1===i[0].filter&&(n=!1);for(let t=1;t=r[i]))t=r[i++],e=r[i++];else{if(!(n{if(!/\S/.test(e))return Ot.Space;if(function(i){if(ut)return ut.test(i);for(let e=0;enull),n)for(var r in t.address){var s=t.address[r],r=n.startState.config.address[r];null!=r&&0==(1&s)&&(this.values[s>>1]=B(n.startState,r))}(this.applying=n)&&(n._state=this);for(let t=0;tn.set(e,t)),e=null),n.set(r.value.compartment,r.value.extension)):r.is(rt.reconfigure)?(e=null,i=r.value):r.is(rt.appendConfig)&&(e=null,i=ct(i).concat(r.value));new pt(e||I.resolve(i,n,this),t.newDoc,t.newSelection,t)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:_.cursor(t.from+e.length)}))}changeByRange(r){var s=this.selection,t=r(s.ranges[0]);let o=this.changes(t.changes),a=[t.range],l=ct(t.effects);for(let n=1;ne.spec.fromJSON(i,t)))}return pt.create({doc:t.doc,selection:_.fromJSON(t.selection),extensions:e.extensions?r.concat([e.extensions]):r})}static create(t={}){let e=I.resolve(t.extensions||[],new Map);var i=t.doc instanceof d?t.doc:d.of((t.doc||"").split(e.staticFacet(pt.lineSeparator)||Q));let n=t.selection?t.selection instanceof _?t.selection:_.single(t.selection.anchor,t.selection.head):_.single(0);return C(n,i.length),e.staticFacet(U)||(n=n.asSingle()),new pt(e,i,n)}get tabSize(){return this.facet(pt.tabSize)}get lineBreak(){return this.facet(pt.lineSeparator)||"\n"}phrase(t){for(var e of this.facet(pt.phrases))if(Object.prototype.hasOwnProperty.call(e,t))return e[t];return t}languageDataAt(t,e){let i=[];for(var n of this.facet(N))for(var r of n(this,e))Object.prototype.hasOwnProperty.call(r,t)&&i.push(r[t]);return i}charCategorizer(t){return ft(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:e,from:i,length:n}=this.doc.lineAt(t),r=this.charCategorizer(t),s=t-i,o=t-i;for(;0t.length?t[0]:4}),pt.lineSeparator=F,pt.phrases=L.define(),pt.languageData=N,pt.changeFilter=J,pt.transactionFilter=K,pt.transactionExtender=tt,j.reconfigure=rt.define();const gt="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),vt="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),Qt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class wt{constructor(t,e){this.rules=[];let{finish:c}=e||{};function O(t){return/^@/.test(t)?[t]:t.split(/,\s*/)}for(var i in t)!function t(i,e,n,r){let s=[],o=/^@(\w+)\b/.exec(i[0]),a=o&&"keyframes"==o[1];if(o&&null==e)return n.push(i[0]+";");for(var l in e){var h=e[l];if(/&/.test(l))t(l.split(/,\s*/).map(e=>i.map(t=>e.replace(/&/,t))).reduce((t,e)=>t.concat(e)),h,n);else if(h&&"object"==typeof h){if(!o)throw new RangeError("The value of a property ("+l+") should be a primitive value.");t(O(l),h,s,a)}else null!=h&&s.push(l.replace(/_.*/,"").replace(/[A-Z]/g,t=>"-"+t.toLowerCase())+": "+h+";")}(s.length||a)&&n.push((!c||o||r?i:i.map(c)).join(", ")+" {"+s.join(" ")+"}")}(O(i),t[i],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let t=Qt[gt]||1;return Qt[gt]=t+1,"ͼ"+t.toString(36)}static mount(t,e){(t[vt]||new yt(t)).mount(Array.isArray(e)?e:[e])}}let $t=null;class yt{constructor(e){if(!e.head&&e.adoptedStyleSheets&&"undefined"!=typeof CSSStyleSheet){if($t)return e.adoptedStyleSheets=[$t.sheet].concat(e.adoptedStyleSheets),e[vt]=$t;this.sheet=new CSSStyleSheet,e.adoptedStyleSheets=[this.sheet].concat(e.adoptedStyleSheets),$t=this}else{this.styleTag=(e.ownerDocument||e).createElement("style");let t=e.head||e;t.insertBefore(this.styleTag,t.firstChild)}this.modules=[],e[vt]=this}mount(n){let r=this.sheet,s=0,o=0;for(let i=0;i>1,l=o[a]-i||(n<0?this.value[a].startSide:this.value[a].endSide)-r;if(a==t)return 0<=l?t:e;0<=l?e=a:t=1+a}}between(i,n,r,s){for(let t=this.findIndex(n,-1),e=this.findIndex(r,1,void 0,t);tr||n==r&&0this.chunkEnd(o.chunkIndex)||ro.to||r500<=t.maxPoint||t!=Pt.empty&&i.indexOf(t)<0&&t.maxPoint>=r),o=i.filter(t=>500<=t.maxPoint||t!=Pt.empty&&e.indexOf(t)<0&&t.maxPoint>=r),a=function(t,e){let i=new Map;for(var n of t)for(let t=0;tCt(l,t,h,e,i,n)),t.empty&&0==t.length&&Ct(l,0,h,0,0,n)}static spans(t,e,i,n,r=-1){let s=new _t(t,null,r).goto(e),o=e,a=s.openStart;for(;;){var l=Math.min(s.to,i);if(s.point?(n.point(o,l,s.point,s.activeForPoint(s.to),a),a=s.openEnd(l)+(s.to>l?1:0)):l>o&&(n.span(o,l,s.active,a),a=s.openEnd(l)),s.to>i)break;o=s.to,s.next()}return a}static of(t,e=!1){let i=new Tt;for(var n of t instanceof xt?[t]:e?t.slice().sort(kt):t)i.add(n.from,n.to,n.value);return i.finish()}}Pt.empty=new Pt([],[],null,-1),Pt.empty.nextLayer=Pt.empty;class Tt{constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}finishChunk(t){this.chunks.push(new St(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}add(t,e,i){this.addInner(t,e,i)||(this.nextLayer||(this.nextLayer=new Tt)).add(t,e,i)}addInner(t,e,i){var n=t-this.lastTo||i.startSide-this.last.endSide;if(n<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(n<0)&&(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);var i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0}finish(){return this.finishInner(Pt.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return t;t=new Pt(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,t}}class Wt{constructor(t,e,i,n=0){this.layer=t,this.skip=e,this.minPoint=i,this.rank=n}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,e=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}gotoInner(t,e,i){for(;this.chunkIndex=this.minPoint)break}}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.to-t.to||this.endSide-t.endSide}}class Xt{constructor(t){this.heap=t}static from(i,n=null,r=-1){let s=[];for(let e=0;e=r&&s.push(new Wt(t,n,r,e));return 1==s.length?s[0]:new Xt(s)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(var i of this.heap)i.goto(t,e);for(let t=this.heap.length>>1;0<=t;t--)Rt(this.heap,t);return this.next(),this}forward(t,e){for(var i of this.heap)i.forward(t,e);for(let t=this.heap.length>>1;0<=t;t--)Rt(this.heap,t);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(0==this.heap.length)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),Rt(this.heap,0)}}}function Rt(n,r){for(let i=n[r];;){let t=1+(r<<1);if(t>=n.length)break;let e=n[t];if(t+1e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&At(i,r)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}r=this.cursor.value;if(r.point){if(!(t&&this.cursor.to==this.to&&this.cursor.frome&&this.forward(this.to,this.endSide);break}this.cursor.next()}else this.addActive(i),this.cursor.next()}}if(i){let t=0;for(;tthis.pointRank);t++)(this.activeTo[t]>e||this.activeTo[t]==e&&this.active[t].endSide>this.point.endSide)&&i.push(this.active[t]);return i}openEnd(t){let e=0;for(;et;)e++;return e}}function Ct(t,e,i,n,r,s){t.goto(e),i.goto(n);var o=n+r;let a=n,l=n-e;for(;;){var h=t.to+l-i.to||t.endSide-i.endSide,c=h<0?t.to+l:i.to,O=Math.min(c,o);if(t.point||i.point?t.point&&i.point&&(t.point==i.point||t.point.eq(i.point))||s.comparePoint(a,O,t.point,i.point):O>a&&!function(e,i){if(e.length!=i.length)return!1;for(let t=0;t=i;t--)e[t+1]=e[t];e[i]=t}function zt(e,i){let n=-1,r=1e9;for(let t=0;t",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"',229:"Q"},Yt="undefined"!=typeof navigator&&/Chrome\/(\d+)/.exec(navigator.userAgent),Mt="undefined"!=typeof navigator&&/Apple Computer/.test(navigator.vendor),Zt="undefined"!=typeof navigator&&/Gecko\/\d+/.test(navigator.userAgent),Et="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),Dt="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),jt=Yt&&(Et||+Yt[1]<57)||Zt&&Et,Ht=0;Ht<10;Ht++)qt[48+Ht]=qt[96+Ht]=String(Ht);for(Ht=1;Ht<=24;Ht++)qt[Ht+111]="F"+Ht;for(var It,Ht=65;Ht<=90;Ht++)qt[Ht]=String.fromCharCode(Ht+32),Vt[Ht]=String.fromCharCode(Ht);for(It in qt)Vt.hasOwnProperty(It)||(Vt[It]=qt[It]);function Gt(t){return(t.getSelection?t:document).getSelection()}function Bt(t,e){return!!e&&t.contains(1!=e.nodeType?e.parentNode:e)}function Nt(t,e){if(!e.anchorNode)return!1;try{return Bt(t,e.anchorNode)}catch(t){return!1}}function Ut(t){return 3==t.nodeType?ae(t,0,t.nodeValue.length).getClientRects():1==t.nodeType?t.getClientRects():[]}function Ft(t,e,i,n){return i&&(Kt(t,e,i,n,-1)||Kt(t,e,i,n,1))}function Jt(t){for(var e=0;;e++)if(!(t=t.previousSibling))return e}function Kt(t,e,i,n,r){for(;;){if(t==i&&e==n)return!0;if(e==(r<0?0:te(t))){if("DIV"==t.nodeName)return!1;var s=t.parentNode;if(!s||1!=s.nodeType)return!1;e=Jt(t)+(r<0?0:1),t=s}else{if(1!=t.nodeType)return!1;t=t.childNodes[e+(r<0?-1:0)],e=r<0?te(t):0}}}function te(t){return(3==t.nodeType?t.nodeValue:t.childNodes).length}const ee={left:0,right:0,top:0,bottom:0};function ie(t,e){e=e?t.left:t.right;return{left:e,right:e,top:t.top,bottom:t.bottom}}class ne{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}set(t){this.anchorNode=t.anchorNode,this.anchorOffset=t.anchorOffset,this.focusNode=t.focusNode,this.focusOffset=t.focusOffset}}let re=null;function se(e){if(e.setActive)return e.setActive();if(re)return e.focus(re);let r=[];for(let t=e;t&&(r.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(e.focus(null==re?{get preventScroll(){return re={preventScroll:!0},!0}}:void 0),!re){re=!1;for(let n=0;no&&t.dom.parentNode==this.dom){h=i,c=r;break}r=e,n=e+t.breakAfter}return{from:l,to:c<0?t+this.length:c,startDOM:(a?this.children[a-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:hthis.pos||t==this.pos&&(0t.width)||a),o?ie(a,o<0):a}class We extends ke{constructor(t,e,i){super(),this.widget=t,this.length=e,this.side=i}static create(t,e,i){return new(t.customView||We)(t,e,i)}slice(t){return We.create(this.widget,this.length-t,this.side)}sync(){this.dom&&this.widget.updateDOM(this.dom)||(this.setDOM(this.widget.toDOM(this.editorView)),this.dom.contentEditable="false")}getSide(){return this.side}merge(t,e,i,n,r){return!(i&&(!(i instanceof We&&this.widget.compare(i.widget))||0i&&st?i[r]=Math.max(i[r],e):i.push(t,e)}Ee.prototype.point=!0;class He extends ce{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(t,e,i,n,r,s){if(i){if(!(i instanceof He))return!1;this.dom||i.transferDOM(this)}return n&&this.setDeco(i?i.attrs:null),Re(this,t,e,i?i.children:Ie,r,s),!0}split(t){let e=new He;if(e.breakAfter=this.breakAfter,0==this.length)return e;let{i,off:n}=this.childPos(t);n&&(e.append(this.children[i].slice(n),0),this.children[i].merge(n,this.children[i].length,null,0,0),i++);for(let t=i;t!t.length||t[0]});class si{constructor(t,e){this.field=t,this.get=e}}class oi{from(t){return new si(this,t)}static define(){return new oi}}oi.decorations=oi.define(),oi.scrollMargins=oi.define();let ai=0;const li=L.define();class hi{constructor(t,e,i){this.id=t,this.create=e,this.fields=i,this.extension=li.of(this)}static define(t,e){let{eventHandlers:i,provide:n,decorations:r}=e||{},s=[];if(n)for(var o of Array.isArray(n)?n:[n])s.push(o);return i&&s.push(ci.from(t=>({plugin:t,handlers:i}))),r&&s.push(oi.decorations.from(r)),new hi(ai++,t,s)}static fromClass(e,t){return hi.define(t=>new e(t),t)}}const ci=oi.define();class Oi{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}takeField(t,e){for(var{field:i,get:n}of this.spec.fields)i==t&&e.push(n(this.value))}update(e){if(this.value){if(this.mustUpdate){var i=this.mustUpdate;if(this.mustUpdate=null,!this.value.update)return this;try{this.value.update(i)}catch(t){if(ni(i.state,t,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(t){}return Oi.dummy}}}else try{this.value=this.spec.create(e)}catch(t){return ni(e.state,t,"CodeMirror plugin crashed"),Oi.dummy}return this}destroy(e){var t;if(null!==(t=this.value)&&void 0!==t&&t.destroy)try{this.value.destroy()}catch(t){ni(e.state,t,"CodeMirror plugin crashed")}}}Oi.dummy=new Oi(hi.define(()=>({})));const di=L.define({combine:t=>t.reduce((t,e)=>Ae(e,t),{})}),ui=L.define({combine:t=>t.reduce((t,e)=>Ae(e,t),{})}),fi=L.define(),pi=L.define();class mi{constructor(t,e,i,n){this.fromA=t,this.toA=e,this.fromB=i,this.toB=n}join(t){return new mi(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;0i.toA)){if(n.toAr.push(new mi(t,e,i,n))),this.changedRanges=r;i=t.hasFocus;i!=t.inputState.notifiedFocused&&(t.inputState.notifiedFocused=i,this.flags|=1),this.docChanged&&(this.flags|=2)}get viewportChanged(){return 0<(4&this.flags)}get heightChanged(){return 0<(2&this.flags)}get geometryChanged(){return this.docChanged||0<(18&this.flags)}get focusChanged(){return 0<(1&this.flags)}get docChanged(){return this.transactions.some(t=>t.docChanged)}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return 0==this.flags&&0==this.transactions.length}}class vi extends ce{constructor(t){super(),this.view=t,this.compositionDeco=Ye.none,this.decorations=[],this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.setDOM(t.contentDOM),this.children=[new He],this.children[0].setParent(this),this.updateInner([new mi(0,0,0,t.state.doc.length)],this.updateDeco(),0)}get root(){return this.view.root}get editorView(){return this.view}get length(){return this.view.state.doc.length}update(t){let e=t.changedRanges;0ethis.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=0),this.view.inputState.composing<0?this.compositionDeco=Ye.none:t.transactions.length&&(this.compositionDeco=function(t,e){var i=t.observer.selectionRange,i=i.focusNode&&$i(i.focusNode,i.focusOffset,0);if(!i)return Ye.none;let n=t.docView.nearest(i),r,s,o=i;if(n instanceof ke){for(;n.parent instanceof ke;)n=n.parent;r=n.posAtStart,s=r+n.length,o=n.dom}else{if(!(n instanceof He))return Ye.none;{for(;o.parentNode!=n.dom;)o=o.parentNode;let t=o.previousSibling;for(;t&&!ce.get(t);)t=t.previousSibling;r=s=t?ce.get(t).posAtEnd:n.posAtStart}}let a=e.mapPos(r,1),l=Math.max(a,e.mapPos(s,-1)),h=i.nodeValue,{state:c}=t;if(l-a"pointerselection"==t.annotation(st.userEvent));return 0==this.dirty&&0==e.length&&!(12&t.flags)&&t.state.selection.main.from>=this.view.viewport.from&&t.state.selection.main.to<=this.view.viewport.to?(this.updateSelection(s,o),!1):(this.updateInner(e,a,t.startState.doc.length,s,o),!0)}updateInner(t,e,i,n=!1,r=!1){this.updateChildren(t,e,i),this.view.observer.ignore(()=>{this.dom.style.height=this.view.viewState.domHeight+"px",this.dom.style.minWidth=this.minWidth?this.minWidth+"px":"";var t=be.chrome?{node:Gt(this.view.root).focusNode,written:!1}:void 0;this.sync(t),this.dirty=0,null!=t&&t.written&&(n=!0),this.updateSelection(n,r),this.dom.style.height=""})}updateChildren(e,i,t){let n=this.childCursor(t);for(let t=e.length-1;;t--){var r=0<=t?e[t]:null;if(!r)break;var{fromA:s,toA:o,fromB:a,toB:l}=r,{content:h,breakAtStart:c,openStart:O,openEnd:r}=Be.build(this.view.state.doc,a,l,i),{i:a,off:l}=n.findPos(o,1),{i:o,off:s}=n.findPos(s,-1);this.replaceRange(o,s,a,l,h,c,O,r)}}replaceRange(e,i,n,r,s,o,a,l){let h=this.children[e],c=s.length?s[s.length-1]:null;var O=c?c.breakAfter:o;if(e!=n||o||O||!(s.length<2)||!h.merge(i,r,s.length?c:null,0==i,a,l)){let t=this.children[n];for(rr.node.insertBefore(t,r.node.childNodes[r.offset]||null)),r=s=new le(t,0),e=!0}let o=this.view.observer.selectionRange;!(e||!o.focusNode||be.gecko&&n.empty&&yi(o.focusNode,o.focusOffset))&&Ft(r.node,r.offset,o.anchorNode,o.anchorOffset)&&Ft(s.node,s.offset,o.focusNode,o.focusOffset)||(this.view.observer.ignore(()=>{let e=Gt(this.root);var t,i;if(n.empty)be.gecko&&(!(t=yi(r.node,r.offset))||3==t||(i=$i(r.node,r.offset,1==t?1:-1))&&(r=new le(i,1==t?0:i.nodeValue.length))),e.collapse(r.node,r.offset),null!=n.bidiLevel&&null!=o.cursorBidiLevel&&(o.cursorBidiLevel=n.bidiLevel);else if(e.extend)e.collapse(r.node,r.offset),e.extend(s.node,s.offset);else{let t=document.createRange();n.anchor>n.head&&([r,s]=[s,r]),t.setEnd(s.node,s.offset),t.setStart(r.node,r.offset),e.removeAllRanges(),e.addRange(t)}}),this.view.observer.setSelectionRange(r,s)),this.impreciseAnchor=r.precise?null:new le(o.anchorNode,o.anchorOffset),this.impreciseHead=s.precise?null:new le(o.focusNode,o.focusOffset)}}enforceCursorAssoc(){var t,e,i=this.view.state.selection.main;let n=Gt(this.root);i.empty&&i.assoc&&n.modify&&((e=He.find(this,i.head))&&(t=e.posAtStart,i.head!=t&&i.head!=t+e.length&&(t=this.coordsAt(i.head,-1),e=this.coordsAt(i.head,1),!t||!e||t.bottom>e.top||(e=this.domAtPos(i.head+i.assoc),n.collapse(e.node,e.offset),n.modify("move",i.assoc<0?"forward":"backward","lineboundary")))))}mayControlSelection(){return this.view.state.facet(ri)?this.root.activeElement==this.dom:Nt(this.dom,this.view.observer.selectionRange)}nearest(e){for(let t=e;t;){var i=ce.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(t,e){let i=this.nearest(t);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart}domAtPos(t){let{i:e,off:i}=this.childCursor().findPos(t,-1);for(;e=s&&(r.push(t.dom.getBoundingClientRect().height),(l=t.dom.scrollWidth)>a&&(this.minWidth=a=l,this.minWidthFrom=i,this.minWidthTo=e)),i=e+t.breakAfter}return r}measureTextSize(){for(var t of this.children)if(t instanceof He){t=t.measureTextSize();if(t)return t}let e=document.createElement("div"),i,n;return e.className="cm-line",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);var t=Ut(e.firstChild)[0];i=e.getBoundingClientRect().height,n=t?t.width/27:7,e.remove()}),{lineHeight:i,charWidth:n}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new de(this.children,t,e)}computeBlockGapDeco(){let i=[],n=this.view.viewState;for(let t=0,e=0;;e++){var r,s=e==n.viewports.length?null:n.viewports[e],o=s?s.from-1:this.length;if(o>t&&(r=n.lineAt(o,0).bottom-n.lineAt(t,0).top,i.push(Ye.replace({widget:new Qi(r),block:!0,inclusive:!0}).range(t,o))),!s)break;t=s.to+1}return Ye.set(i)}updateDeco(){return this.decorations=[this.computeBlockGapDeco(),this.view.viewState.lineGapDeco,this.compositionDeco,...this.view.state.facet(fi),...this.view.pluginField(oi.decorations)]}scrollPosIntoView(t,r){var s,o,a,r=this.coordsAt(t,r);if(r){let t=0,e=0,i=0,n=0;for(var l of this.view.pluginField(oi.scrollMargins))l&&({left:s,right:o,top:a,bottom:l}=l,null!=s&&(t=Math.max(t,s)),null!=o&&(e=Math.max(e,o)),null!=a&&(i=Math.max(i,a)),null!=l&&(n=Math.max(n,l)));!function(t,s){let e=t.ownerDocument,o=e.defaultView;for(let r=t.parentNode;r;)if(1==r.nodeType){let t,e=r==document.body;if(e)t={left:0,right:(l=o).innerWidth,top:0,bottom:l.innerHeight};else{if(r.scrollHeight<=r.clientHeight&&r.scrollWidth<=r.clientWidth){r=r.parentNode;continue}l=r.getBoundingClientRect();t={left:l.left,right:l.left+r.clientWidth,top:l.top,bottom:l.top+r.clientHeight}}let i=0,n=0;var a;if(s.topt.bottom&&(n=s.bottom-t.bottom+5),s.leftt.right&&(i=s.right-t.right+5),(i||n)&&(e?o.scrollBy(i,n):(n&&(a=r.scrollTop,r.scrollTop+=n,n=r.scrollTop-a),i&&(a=r.scrollLeft,r.scrollLeft+=i,i=r.scrollLeft-a),s={left:s.left-i,top:s.top-n,right:s.right-i,bottom:s.bottom-n})),e)break;r=r.assignedSlot||r.parentNode}else{if(11!=r.nodeType)break;r=r.host}var l}(this.dom,{left:r.left-t,top:r.top-i,right:r.right+e,bottom:r.bottom+n})}}}class Qi extends qe{constructor(t){super(),this.height=t}toDOM(){var t=document.createElement("div");return this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get estimatedHeight(){return this.height}}class wi extends qe{constructor(t,e){super(),this.top=t,this.text=e}eq(t){return this.top==t.top&&this.text==t.text}toDOM(){return this.top}ignoreEvent(){return!1}get customView(){return Xe}}function $i(t,e,i){for(;;){if(3==t.nodeType)return t;if(1==t.nodeType&&0=i){if(o.level==n)return t;(s<0||(0!=r?r<0?o.fromi:e[s].level>o.level))&&(s=t)}}if(s<0)throw new RangeError("Index out of range");return s}}const qi=[];function Vi(o,t){var r,a=o.length,l=t==Si?1:2,h=t==Si?2:1;if(!o||1==l&&!Li.test(o))return Yi(a);for(let e=0,i=l,n=l;ef;){for(var m=t,g=2!=qi[--t];t>f&&g==(2!=qi[t-1]);)t--;i.push(new zi(t,m,g?2:1))}else i.push(new zi(f,e,0))}else for(let t=0;te.top+1}function Ei(t,e){return et.bottom?{top:t.top,left:t.left,right:t.right,bottom:e}:t}function ji(t,n,r){let s,o,a,l,h,c,O,d;for(let i=t.firstChild;i;i=i.nextSibling){var u=Ut(i);for(let e=0;em?p.left-m:Math.max(0,m-p.right)),p=(m=r,(p=t).top>m?p.top-m:Math.max(0,m-p.bottom));if(0==f&&0==p)return(3==i.nodeType?Hi:ji)(i,n,r);(!s||l>p||l==p&&a>f)&&(s=i,o=t,a=f,l=p),0==f?r>t.bottom&&(!O||O.bottomt.top)&&(c=i,d=t):O&&Zi(O,t)?O=Di(O,t.bottom):d&&Zi(d,t)&&(d=Ei(d,t.top))}}var m,p;if(O&&O.bottom>=r?(s=h,o=O):d&&d.top<=r&&(s=c,o=d),!s)return{node:t,offset:0};var e=Math.max(o.left,Math.min(o.right,n));return 3==s.nodeType?Hi(s,e,r):a||"true"!=s.contentEditable?{node:t,offset:Array.prototype.indexOf.call(t.childNodes,s)+(n>=(o.left+o.right)/2?1:0)}:ji(s,e,r)}function Hi(n,r,e){var t=n.nodeValue.length;let s=-1,o=1e9,a=0;for(let i=0;ie?h.top-e:e-h.bottom)-1;if(h.left-1<=r&&h.right+1>=r&&c=(h.left+h.right)/2,e=t;if((be.chrome||be.gecko)&&ae(n,i).getBoundingClientRect().left==h.right&&(e=!t),c<=0)return{node:n,offset:i+(e?1:0)};s=i+(e?1:0),o=c}}}}return{node:n,offset:-1i||s.bottomi?-1:1,i=Math.min(s.bottom-o,Math.max(s.top+o,i)),t)return-1;t=!0}if(s.type==Ve.Text)break;i=0e.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:null;t=Math.max(r.left+1,Math.min(r.right-1,t));let h=e.root,c=h.elementFromPoint(t,i),O,d=-1;return!c||!e.contentDOM.contains(c)||e.docView.nearest(c)instanceof We||(h.caretPositionFromPoint?(a=h.caretPositionFromPoint(t,i))&&({offsetNode:O,offset:d}=a):!h.caretRangeFromPoint||(a=h.caretRangeFromPoint(t,i))&&({startContainer:O,startOffset:d}=a,be.safari&&function(e,t,i){let n;if(3!=e.nodeType||t!=(n=e.nodeValue.length))return!1;for(let t=e.nextSibling;t;t=e.nextSibling)if(1!=t.nodeType||"BR"!=t.nodeName)return!1;return ae(e,n-1,n).getBoundingClientRect().left>i}(O,d,t)&&(O=void 0))),O&&e.docView.dom.contains(O)||(l=He.find(e.docView,l),{node:O,offset:d}=ji(l.dom,t,i)),e.docView.posFromDOM(O,d)}function Gi(r,t,s,o){let a=r.state.doc.lineAt(t.head),l=r.bidiSpans(a);for(let i=t,n=null;;){let t=function(t,e,i,n,r){let s=n.head-t.from,o=-1;if(0==s){if(!r||!t.length)return null;e[0].level!=i&&(s=e[0].side(!1,i),o=0)}else if(s==t.length){if(r)return null;let t=e[e.length-1];t.level!=i&&(s=t.side(!0,i),o=e.length-1)}o<0&&(o=zi.find(e,s,null!==(l=n.bidiLevel)&&void 0!==l?l:-1,n.assoc));let a=e[o];s==a.side(r,i)&&(a=e[o+=r?1:-1],s=a.side(!r,i));var l=r==(a.dir==i),n=b(t.text,s,l);if(Mi=t.text.slice(Math.min(s,n),Math.max(s,n)),n!=a.side(r,i))return _.cursor(n+t.from,l?-1:1,a.level);let h=o==(r?e.length-1:0)?null:e[o+(r?1:-1)];return h||a.level==i?h&&h.level>1;for(let t=s<0?o.top:o.bottom,e=0;e<50;e+=10){var O=Ii(i,{x:h,y:t+(c+e)*s},s);if(null==O)break;if(O!=r)return _.cursor(O,void 0,void 0,l)}}let{doc:d}=i.state,u=d.lineAt(r),f=i.state.tabSize,p=t.goalColumn,m=0;if(null==p){for(const $=d.iterRange(u.from,r);!$.next().done;)m=x($.value,m,f);p=m*i.defaultCharacterWidth}else m=Math.round(p/i.defaultCharacterWidth);if(s<0&&0==u.from)return _.cursor(0);if(0=m&&!y.next().done;){var{offset:Q,leftOver:w}=function(e,i,n,r){for(let t=0;t{"keydown"==i&&this.keydown(n,t)||Ji(n,t)&&!this.ignoreDuringComposition(t)&&(this.mustFlushObserver(t)&&n.observer.forceFlush(),this.runCustomHandlers(i,n,t)?t.preventDefault():e(n,t))}),this.registeredEvents.push(i)}this.notifiedFocused=n.hasFocus,this.ensureHandlers(n)}setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}ensureHandlers(i){var t;for(t of this.customHandlers=i.pluginField(ci))for(let e in t.handlers)this.registeredEvents.indexOf(e)<0&&"scroll"!=e&&(this.registeredEvents.push(e),i.contentDOM.addEventListener(e,t=>{Ji(i,t)&&this.runCustomHandlers(e,i,t)&&t.preventDefault()}))}runCustomHandlers(i,n,r){for(var s of this.customHandlers){let t=s.handlers[i],e=!1;if(t){try{e=t.call(s.plugin,r,n)}catch(t){ni(n.state,t)}if(e||r.defaultPrevented)return be.android&&"keydown"==i&&13==r.keyCode&&n.observer.flushSoon(),!0}}return!1}runScrollHandlers(e,i){for(var n of this.customHandlers){let t=n.handlers.scroll;if(t)try{t.call(n.plugin,i,e)}catch(t){ni(e.state,t)}}}keydown(t,e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),!this.screenKeyEvent(t,e))return!(!be.ios||13!=e.keyCode&&8!=e.keyCode||e.ctrlKey||e.altKey||e.metaKey||e.synthetic)&&(this[13==e.keyCode?"lastIOSEnter":"lastIOSBackspace"]=Date.now(),!0)}ignoreDuringComposition(t){return!!/^key/.test(t.type)&&(0=e.clientX&&s.top<=e.clientY&&s.bottom>=e.clientY)return!0}return!1}(e,i)&&null,!1===this.dragging&&(i.preventDefault(),this.select(i))}move(t){if(0==t.buttons)return this.destroy();!1===this.dragging&&this.select(t)}up(t){null==this.dragging&&this.select(this.startEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.inputState.mouseSelection=null}select(t){let e=this.style.get(t,this.extend,this.multiple);e.eq(this.view.state.selection)&&e.main.assoc==this.view.state.selection.main.assoc||this.view.dispatch({selection:e,annotations:st.userEvent.of("pointerselection"),scrollIntoView:!0})}update(t){t.docChanged&&this.dragging&&(this.dragging=this.dragging.map(t.changes)),this.style.update(t)}}function Ji(i,n){if(!n.bubbles)return 1;if(!n.defaultPrevented){for(let t=n.target,e;t!=i.contentDOM;t=t.parentNode)if(!t||11==t.nodeType||(e=ce.get(t))&&e.ignoreEvent(n))return;return 1}}const Ki=Object.create(null),tn=be.ie&&be.ie_version<15||be.ios&&be.webkit_version<604;function en(t,r){let{state:s}=t,e,o=1,a=s.toText(r),l=a.lines==s.selection.ranges.length;if(dn&&s.selection.ranges.every(t=>t.empty)&&dn==a.toString()){let n=-1;e=s.changeByRange(t=>{var e=s.doc.lineAt(t.from);if(e.from==n)return{range:t};n=e.from;var i=s.toText((l?a.line(o++).text:r)+s.lineBreak);return{changes:{from:e.from,insert:i},range:_.cursor(t.from+i.length)}})}else e=l?s.changeByRange(t=>{var e=a.line(o++);return{changes:{from:t.from,to:t.to,insert:e.text},range:_.cursor(t.from+e.length)}}):s.replaceSelection(a);t.dispatch(e,{annotations:st.userEvent.of("paste"),scrollIntoView:!0})}Ki.keydown=(t,e)=>{t.inputState.setSelectionOrigin("keyboardselection")};let nn=0;function rn(i,n,r,t){if(1==t)return _.cursor(n,r);if(2==t)return function(t,e,i=1){let n=t.charCategorizer(e),r=t.doc.lineAt(e),s=e-r.from;if(0==r.length)return _.cursor(e);0==s?i=1:s==r.length&&(i=-1);let o=s,a=s;i<0?o=b(r.text,s,!1):a=b(r.text,s);for(var l=n(r.text.slice(o,a));0{nn=Date.now(),t.inputState.setSelectionOrigin("pointerselection")},Ki.touchmove=t=>{t.inputState.setSelectionOrigin("pointerselection")},Ki.mousedown=(e,i)=>{if(e.observer.flush(),!(nn>Date.now()-2e3)){let t=null;for(var n of e.state.facet(Ke))if(t=n(e,i),t)break;t||0!=i.button||(t=function(o,t){let a=an(o,t),l=function(t){if(!ln)return t.detail;var e=hn,i=On;return hn=t,On=Date.now(),cn=!e||i>Date.now()-400&&Math.abs(e.clientX-t.clientX)<2&&Math.abs(e.clientY-t.clientY)<2?(cn+1)%3:1}(t),h=o.state.selection,c=a,O=t;return{update(t){t.changes&&(a&&(a.pos=t.changes.mapPos(a.pos)),h=h.map(t.changes))},get(t,e,i){let n;if(t.clientX==O.clientX&&t.clientY==O.clientY?n=c:(n=c=an(o,t),O=t),!n||!a)return h;let r=rn(o,n.pos,n.bias,l);var s;return a.pos==n.pos||e||(s=rn(o,a.pos,a.bias,l),t=Math.min(s.from,r.from),s=Math.max(s.to,r.to),r=tse(e.contentDOM)),e.inputState.startMouseSelection(e,i,t))}};let sn=(t,e)=>t>=e.top&&t<=e.bottom,on=(t,e,i)=>sn(e,i)&&t>=i.left&&t<=i.right;function an(t,e){var i=t.posAtCoords({x:e.clientX,y:e.clientY});return null==i?null:{pos:i,bias:function(t,e,i,n){let r=He.find(t.docView,e);return r&&0!=(t=e-r.posAtStart)&&(t==r.length||(e=r.coordsAt(t,-1))&&on(i,n,e)||(!(t=r.coordsAt(t,1))||!on(i,n,t))&&e&&sn(n,e))?-1:1}(t,i,e.clientX,e.clientY)}}const ln=be.ie&&be.ie_version<=11;let hn=null,cn=0,On=0;Ki.dragstart=(t,e)=>{var{selection:{main:i}}=t.state;let{mouseSelection:n}=t.inputState;n&&(n.dragging=i),e.dataTransfer&&(e.dataTransfer.setData("Text",t.state.sliceDoc(i.from,i.to)),e.dataTransfer.effectAllowed="copyMove")},Ki.drop=(e,i)=>{if(i.dataTransfer&&e.state.facet(ri)){var n=e.posAtCoords({x:i.clientX,y:i.clientY}),r=i.dataTransfer.getData("Text");if(null!=n&&r){i.preventDefault();var{mouseSelection:i}=e.inputState,i=i&&i.dragging&&i.dragMove?{from:i.dragging.from,to:i.dragging.to}:null,r={from:n,insert:r};let t=e.state.changes(i?[i,r]:r);e.focus(),e.dispatch({changes:t,selection:{anchor:t.mapPos(n,-1),head:t.mapPos(n,1)},annotations:st.userEvent.of("drop")})}}},Ki.paste=(e,i)=>{if(e.state.facet(ri)){e.observer.flush();let t=tn?null:i.clipboardData;var n=t&&t.getData("text/plain");n?(en(e,n),i.preventDefault()):function(e){let i=e.dom.parentNode;if(i){let t=i.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{e.focus(),t.remove(),en(e,t.value)},50)}}(e)}};let dn=null;function un(t){t.docView.compositionDeco.size&&t.update([])}Ki.copy=Ki.cut=(e,i)=>{var{text:n,ranges:r,linewise:s}=function(e){let i=[],n=[],r=!1;for(var t of e.selection.ranges)t.empty||(i.push(e.sliceDoc(t.from,t.to)),n.push(t));if(!i.length){let t=-1;for(var{from:s}of e.selection.ranges){s=e.doc.lineAt(s);s.number>t&&(i.push(s.text),n.push({from:s.from,to:Math.min(e.doc.length,s.to+1)})),t=s.number}r=!0}return{text:i.join(e.lineBreak),ranges:n,linewise:r}}(e.state);if(n){dn=s?n:null;let t=tn?null:i.clipboardData;t?(i.preventDefault(),t.clearData(),t.setData("text/plain",n)):function(e,i){let n=e.dom.parentNode;if(n){let t=n.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.value=i,t.focus(),t.selectionEnd=i.length,t.selectionStart=0,setTimeout(()=>{t.remove(),e.focus()},50)}}(e,n),"cut"==i.type&&e.state.facet(ri)&&e.dispatch({changes:r,scrollIntoView:!0,annotations:st.userEvent.of("cut")})}},Ki.focus=Ki.blur=t=>{setTimeout(()=>{t.hasFocus!=t.inputState.notifiedFocused&&t.update([])},10)},Ki.beforeprint=t=>{t.viewState.printing=!0,t.requestMeasure(),setTimeout(()=>{t.viewState.printing=!1,t.requestMeasure()},2e3)},Ki.compositionstart=Ki.compositionupdate=t=>{t.inputState.composing<0&&(t.docView.compositionDeco.size&&(t.observer.flush(),un(t)),t.inputState.composing=0)},Ki.compositionend=t=>{t.inputState.composing=-1,t.inputState.compositionEndedAt=Date.now(),setTimeout(()=>{t.inputState.composing<0&&un(t)},50)},Ki.contextmenu=t=>{t.inputState.lastContextMenu=Date.now()};const fn=["pre-wrap","normal","pre-line"];class pn{constructor(){this.doc=d.empty,this.lineWrapping=!1,this.direction=ki.LTR,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.lineLength=30,this.heightChanged=!1}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength)),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefresh(e,t,i){let n=!1;for(let t=0;t=e?r:c.lineAt(e,vn.ByPosNoHeight,a,0,0);for(n+=O.to-e,e=O.to;02*r){var o=t[e-1];o.break?t.splice(--e,1,o.left,null,o.right):t.splice(--e,1,o.left,o.right),i+=1+o.break,n-=o.size}else{if(!(r>2*n))break;o=t[i];o.break?t.splice(i,1,o.left,null,o.right):t.splice(i,1,o.left,o.right),i+=2+o.break,r-=o.size}else nt&&e.push(new yn(r.from-t-1).updateHeight(n,t));i<=s&&r.more;){var o=n.doc.lineAt(i).length;e.length&&e.push(null);let t=new $n(o,r.heights[r.index++]);t.outdated=!1,e.push(t),i+=o+1}return i<=s&&e.push(null,new yn(s-i).updateHeight(n,i)),n.heightChanged=!0,Qn.of(e)}return(e||this.outdated)&&(this.setHeight(n,n.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class bn extends Qn{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return 1&this.flags}blockAt(t,e,i,n){var r=i+this.left.height;return to))return l;e=e==vn.ByPosNoHeight?vn.ByPosNoHeight:vn.ByPos;return a?l.join(this.right.lineAt(o,e,i,s,o)):this.left.lineAt(o,e,i,n,r).join(l)}forEachLine(t,e,i,n,r,s){var o,a=n+this.left.height,l=r+this.left.length+this.break;this.break?(t=t&&o.from<=e&&s(o),e>o.to&&this.right.forEachLine(o.to+1,e,i,a,l,s))}replace(t,e,i){var n=this.left.length+this.break;if(ethis.left.length)return this.balanced(this.left,this.right.replace(t-n,e-n,i));let r=[];0=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){var i=this.left.length,n=i+this.break;if(n<=t)return this.right.decomposeRight(t-n,e);t2*e.size||e.size>2*t.size?Qn.of(this.break?[t,null,e]:[t,e]):(this.left=t,this.right=e,this.height=t.height+e.height,this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,i=!1,n){let{left:r,right:s}=this,o=e+r.length+this.break,a=null;return n&&n.from<=e+r.length&&n.more?a=r=r.updateHeight(t,e,i,n):r.updateHeight(t,e,i),n&&n.from<=o+s.length&&n.more?a=s=s.updateHeight(t,o,i,n):s.updateHeight(t,o,i),a?this.balanced(r,s):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function xn(t,e){let i,n;null==t[e]&&(i=t[e-1])instanceof yn&&(n=t[e+1])instanceof yn&&t.splice(e-1,3,new yn(i.length+1+n.length))}class kn{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,i){if(-1this.pos||!this.isCovered)&&this.nodes.push(new $n(t-this.pos,-1)),(this.writtenTo=t)t&&this.nodes.push(new $n(this.pos-t,-1)),this.writtenTo=this.pos)}blankContent(t,e){let i=new yn(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();var t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof $n)return t;t=new $n(0,-1);return this.nodes.push(t),t}addBlock(t){this.enterLine(),t.type!=Ve.WidgetAfter||this.isCovered||this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,t.type!=Ve.WidgetBefore&&(this.covering=t)}addLineDeco(t,e){let i=this.ensureLine();i.length+=e,i.collapsed+=e,i.widgetHeight=Math.max(i.widgetHeight,t),this.writtenTo=this.pos=this.pos+e}finish(t){var e,i=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(-1t.draw(!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:n}=this.state.selection;for(let t=0;t<=1;t++){let i=t?n.head:n.anchor;var r,s;e.some(({from:t,to:e})=>i>=t&&i<=e)||({from:r,to:s}=this.lineAt(i,0),e.push(new Xn(r,s)))}this.viewports=e.sort((t,e)=>t.from-e.from),this.scaler=this.heightMap.height<=7e6?An:new Ln(this.heightOracle.doc,this.heightMap,this.viewports)}update(t,e=null){var i=this.state;this.state=t.state;var n,r,s,o=this.state.facet(fi),a=t.changedRanges,s=mi.extendWithRanges(a,(n=t.startState.facet(fi),r=o,s=t?t.changes:k.empty(this.state.doc.length),a=new Sn,Pt.compare(n,r,s,a,0),a.changes)),a=this.heightMap.height;this.heightMap=this.heightMap.applyChanges(o,i.doc,this.heightOracle.setDoc(this.state.doc),s),this.heightMap.height!=a&&(t.flags|=2);let l=s.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.headl.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,e)),l.eq(this.viewport)||(this.viewport=l,t.flags|=4),this.updateForViewport(),(this.lineGaps.length||15e3t.clientHeight||t.scrollWidth>t.clientWidth)&&"visible"!=l.overflow&&(a=t.getBoundingClientRect(),n=Math.max(n,a.left),r=Math.min(r,a.right),s=Math.max(s,a.top),o=Math.min(o,a.bottom)),t="absolute"==l.position||"fixed"==l.position?t.offsetParent:t.parentNode}else{if(11!=t.nodeType)break;t=t.host}return{left:n-i.left,right:r-i.left,top:s-(i.top+t),bottom:o-(i.top+t)}}(i,this.paddingTop),o=s.top-this.pixelViewport.top,a=s.bottom-this.pixelViewport.bottom;if(this.pixelViewport=s,this.inView=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left,!this.inView)return 0;var l,h=t.measureVisibleLineHeights();let c=!1,O=0,d=0,u=this.heightOracle;return e||(l=t.dom.clientWidth,(u.mustRefresh(h,n,r)||u.lineWrapping&&Math.abs(l-this.contentWidth)>u.charWidth)&&({lineHeight:s,charWidth:e}=t.measureTextSize(),c=u.refresh(n,r,s,e,l/e,h),c&&(t.minWidth=0,d|=16)),this.contentWidth!=l&&(this.contentWidth=l,d|=16),0this.viewport.to))&&((h=this.getViewport(O,this.scrollTo)).from==this.viewport.from&&h.to==this.viewport.to||(this.viewport=h,d|=4)),this.updateForViewport(),(this.lineGaps.length||15e3o.to&&({bottom:e}=i.lineAt(e.head,vn.ByPos,n,0,0),o=new Xn(i.lineAt(e-(s-r)-500,vn.ByHeight,n,0,0).from,i.lineAt(e+500,vn.ByHeight,n,0,0).to))),o}mapViewport(t,e){var i=e.mapPos(t.from,-1),t=e.mapPos(t.to,1);return new Xn(this.heightMap.lineAt(i,vn.ByPos,this.state.doc,0,0).from,this.heightMap.lineAt(t,vn.ByPos,this.state.doc,0,0).to)}viewportIsAppropriate({from:t,to:e},i=0){var{top:n}=this.heightMap.lineAt(t,vn.ByPos,this.state.doc,0,0),{bottom:r}=this.heightMap.lineAt(e,vn.ByPos,this.state.doc,0,0),{visibleTop:s,visibleBottom:o}=this;return(0==t||n<=s-Math.max(10,Math.min(-i,250)))&&(e==this.state.doc.length||r>=o+Math.max(10,Math.min(i,250)))&&s-2e3{if(!(r.length<1e4)){var s=function(t,e,i){let n=[],r=t,s=0;Pt.spans(i.facet(fi),t,e,{span(){},point(t,e){t>r&&(n.push({from:r,to:t}),s+=t-r),r=e}},20),r=r.from&&(t=o.from),o.from<=r.to&&o.to>=e&&(e=o.to);let i=t-1e4,n=e+1e4;i>r.from+5e3&&l.push(Cn(a,t=>t.from==r.from&&t.to>i-5e3&&t.to<5e3+i)||new Pn(r.from,i,this.gapSize(r,i,!0,s))),nt.to==r.to&&t.from>n-5e3&&t.fromt.draw(this.heightOracle.lineWrapping))),8)}computeVisibleRanges(){let t=this.state.facet(fi);this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let i=[];Pt.spans(t,this.viewport.from,this.viewport.to,{span(t,e){i.push({from:t,to:e})},point(){}},20),this.visibleRanges=i}lineAt(t,e){return e+=this.paddingTop,zn(this.heightMap.lineAt(t,vn.ByPos,this.state.doc,e,0),this.scaler,e)}lineAtHeight(t,e){return e+=this.paddingTop,zn(this.heightMap.lineAt(this.scaler.fromDOM(t,e),vn.ByHeight,this.state.doc,e,0),this.scaler,e)}blockAtHeight(t,e){return e+=this.paddingTop,zn(this.heightMap.blockAt(this.scaler.fromDOM(t,e),this.state.doc,e,0),this.scaler,e)}forEachLine(t,e,i,n){return n+=this.paddingTop,this.heightMap.forEachLine(t,e,this.state.doc,n,0,1==this.scaler.scale?i:t=>i(zn(t,this.scaler,n)))}get contentHeight(){return this.domHeight+this.paddingTop+this.paddingBottom}get domHeight(){return this.scaler.toDOM(this.heightMap.height,this.paddingTop)}}class Xn{constructor(t,e){this.from=t,this.to=e}eq(t){return this.from==t.from&&this.to==t.to}}function Rn({total:t,ranges:e},i){if(i<=0)return e[0].from;if(1<=i)return e[e.length-1].to;let n=Math.floor(t*i);for(let t=0;;t++){var{from:r,to:s}=e[t],s=s-r;if(n<=s)return r+n;n-=s}}function _n(t,e){let i=0;for(var{from:n,to:r}of t.ranges){if(e<=r){i+=e-n;break}i+=r-n}return i/t.total}function Cn(t,e){for(var i of t)if(e(i))return i}const An={toDOM(t){return t},fromDOM(t){return t},scale:1};class Ln{constructor(r,s,t){let o=0,e=0,i=0;this.viewports=t.map(({from:t,to:e})=>{var i=s.lineAt(t,vn.ByPos,r,0,0).top,n=s.lineAt(e,vn.ByPos,r,0,0).bottom;return o+=n-i,{from:t,to:e,top:i,bottom:n,domTop:0,domBottom:0}}),this.scale=(7e6-o)/(s.height-o);for(var n of this.viewports)n.domTop=i+(n.top-e)*this.scale,i=n.domBottom=n.domTop+(n.bottom-n.top),e=n.bottom}toDOM(n,r){n-=r;for(let t=0,e=0,i=0;;t++){var s=tzn(t,e,i)):t.type)}const qn=L.define({combine:t=>t.join(" ")}),Vn=L.define({combine:t=>-1{if("&"==t)return e;if(!i||!i[t])throw new RangeError(`Unsupported selector: ${t}`);return i[t]}):e+" "+t}})}const jn=Dn("."+Yn,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,minHeight:"100%",display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",padding:"4px 0",outline:"none"},".cm-lineWrapping":{whiteSpace:"pre-wrap",overflowWrap:"anywhere"},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 4px"},".cm-selectionLayer":{zIndex:-1,contain:"size style"},".cm-selectionBackground":{position:"absolute"},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{zIndex:100,contain:"size style",pointerEvents:"none"},"&.cm-focused .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{visibility:"hidden"},"100%":{}},".cm-cursor":{position:"absolute",borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none",display:"none"},"&dark .cm-cursor":{borderLeftColor:"#444"},"&.cm-focused .cm-cursor":{display:"block"},"&light .cm-activeLine":{backgroundColor:"#f3f9ff"},"&dark .cm-activeLine":{backgroundColor:"#223039"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-placeholder":{color:"#888",display:"inline-block"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"3px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},En),Hn={childList:!0,characterData:!0,subtree:!0,characterDataOldValue:!0},In=be.ie&&be.ie_version<=11;class Gn{constructor(i,t,e){this.view=i,this.onChange=t,this.onScrollChanged=e,this.active=!1,this.ignoreSelection=new ne,this.delayedFlush=-1,this.queue=[],this.lastFlush=0,this.scrollTargets=[],this.intersection=null,this.intersecting=!1,this._selectionRange=null,this.parentCheck=-1,this.dom=i.contentDOM,this.observer=new MutationObserver(t=>{for(var e of t)this.queue.push(e);this._selectionRange=null,(be.ie&&be.ie_version<=11||be.ios&&i.composing)&&t.some(t=>"childList"==t.type&&t.removedNodes.length||"characterData"==t.type&&t.oldValue.length>t.target.nodeValue.length)?this.flushSoon():this.flush()}),In&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.start(),this.onScroll=this.onScroll.bind(this),window.addEventListener("scroll",this.onScroll),"function"==typeof IntersectionObserver&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),0{this.delayedFlush=-1,this.flush()},20))}forceFlush(){0<=this.delayedFlush&&(window.clearTimeout(this.delayedFlush),this.delayedFlush=-1,this.flush())}flush(){if(!(0<=this.delayedFlush)){this.lastFlush=Date.now();let n=this.queue;for(var t of this.observer.takeRecords())n.push(t);n.length&&(this.queue=[]);var r=this.selectionRange,s=!this.ignoreSelection.eq(r)&&Nt(this.dom,r);if(0!=n.length||s){let t=-1,e=-1,i=!1;for(var o of n){o=this.readMutation(o);o&&(o.typeOver&&(i=!0),-1==t?{from:t,to:e}=o:(t=Math.min(o.from,t),e=Math.max(o.to,e)))}r=this.view.state;(-1this.view.docView.sync()),this.view.docView.dirty=0),this.view.docView.updateSelection()),this.clearSelection()}}}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty(),"childList"!=t.type)return{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue};var i=Bn(e,t.previousSibling||t.target.previousSibling,-1),t=Bn(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:t?e.posBefore(t):e.posAtEnd,typeOver:!1}}destroy(){this.stop(),this.intersection&&this.intersection.disconnect();for(var t of this.scrollTargets)t.removeEventListener("scroll",this.onScroll);window.removeEventListener("scroll",this.onScroll),clearTimeout(this.parentCheck)}}function Bn(t,e,i){for(;e;){var n=ce.get(e);if(n&&n.parent==t)return n;n=e.parentNode;e=n!=t.dom?n:0Date.now()-100||be.android&&t.text.length=o?s-i:0,s-=l,a=s+(a-o),o=s):a=a?s-i:0,s-=i,o=s+(o-a),a=s)}return{from:s,toA:o,toB:a}}(n.state.sliceDoc(h,c),t.text,e-h,i);O&&(s={from:h+O.from,to:h+O.toA,insert:n.state.toText(t.text.slice(O.from,O.toB))})}else!n.hasFocus&&n.state.facet(ri)||(c=n.observer.selectionRange,{impreciseHead:h,impreciseAnchor:O}=n.docView,h=h&&h.node==c.focusNode&&h.offset==c.focusOffset||!Bt(n.contentDOM,c.focusNode)?n.state.selection.main.head:n.docView.posFromDOM(c.focusNode,c.focusOffset),c=O&&O.node==c.anchorNode&&O.offset==c.anchorOffset||!Bt(n.contentDOM,c.anchorNode)?n.state.selection.main.anchor:n.docView.posFromDOM(c.anchorNode,c.anchorOffset),h==a.head&&c==a.anchor||(o=_.single(c,h)));if(s||o)if(!s&&r&&!a.empty&&o&&o.main.empty?s={from:a.from,to:a.to,insert:n.state.doc.slice(a.from,a.to)}:s&&s.from>=a.from&&s.to<=a.to&&(s.from!=a.from||s.to!=a.to)&&a.to-a.from-(s.to-s.from)<=4&&(s={from:a.from,to:a.to,insert:n.state.doc.slice(a.from,s.from).append(s.insert).append(n.state.doc.slice(s.to,a.to))}),s){let i=n.state;if(!(be.android&&(s.from==a.from&&s.to==a.to&&1==s.insert.length&&2==s.insert.lines&&Kn(n,"Enter",13)||s.from==a.from-1&&s.to==a.to&&0==s.insert.length&&Kn(n,"Backspace",8)||s.from==a.from&&s.to==a.to+1&&0==s.insert.length&&Kn(n,"Delete",46))||be.ios&&(n.inputState.lastIOSEnter>Date.now()-225&&1Date.now()-225&&!s.insert.length&&Kn(n,"Backspace",8)))){let e=s.insert.toString();if(!n.state.facet(ii).some(t=>t(n,s.from,s.to,e))){0<=n.inputState.composing&&n.inputState.composing++;let t;var d;t=s.from>=a.from&&s.to<=a.to&&s.to-s.from>=(a.to-a.from)/3&&(!o||o.main.empty&&o.main.from==s.from+s.insert.length)?(r=a.froms.to?i.sliceDoc(s.to,a.to):"",i.replaceSelection(n.state.toText(r+s.insert.sliceString(0,void 0,n.state.lineBreak)+d))):{changes:d=i.changes(s),selection:o&&!i.selection.main.eq(o.main)&&o.main.to<=d.newLength?i.selection.replaceRange(o.main):void 0},n.dispatch(t,{scrollIntoView:!0,annotations:st.userEvent.of("input")})}}}else if(o&&!o.main.eq(a)){let t=!1,e;n.inputState.lastSelectionTime>Date.now()-50&&("keyboardselection"==n.inputState.lastSelectionOrigin?t=!0:e=st.userEvent.of(n.inputState.lastSelectionOrigin)),n.dispatch({selection:o,scrollIntoView:t,annotations:e})}}class Un{constructor(t,e){this.points=t,this.view=e,this.text="",this.lineBreak=e.state.lineBreak}readRange(e,i){if(e){var n=e.parentNode;for(let t=e;;){this.findPointBefore(n,t),this.readNode(t);var r=t.nextSibling;if(r==i)break;var s=ce.get(t),o=ce.get(r);((s?s.breakAfter:Fn(t))||(o?o.breakAfter:Fn(r))&&("BR"!=t.nodeName||t.cmIgnore))&&(this.text+=this.lineBreak),t=r}this.findPointBefore(n,i)}}readNode(i){if(!i.cmIgnore){var n=ce.get(i);let t=n&&n.overrideDOMText,e;null!=t?e=t.sliceString(0,void 0,this.lineBreak):3==i.nodeType?e=i.nodeValue:"BR"==i.nodeName?e=i.nextSibling?this.lineBreak:"":1==i.nodeType&&this.readRange(i.firstChild,null),null!=e&&(this.findPointIn(i,e.length),this.text+=e,be.chrome&&13==this.view.inputState.lastKeyCode&&!i.nextSibling&&/\n\n$/.test(this.text)&&(this.text=this.text.slice(0,-1)))}}findPointBefore(t,e){for(var i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointIn(t,e){for(var i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e))}}function Fn(t){return 1==t.nodeType&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(t.nodeName)}class Jn{constructor(t,e){this.node=t,this.offset=e,this.pos=-1}}function Kn(t,e,i){i={key:e,code:e,keyCode:i,which:i,cancelable:!0};let n=new KeyboardEvent("keydown",i);n.synthetic=!0,t.contentDOM.dispatchEvent(n);let r=new KeyboardEvent("keyup",i);return r.synthetic=!0,t.contentDOM.dispatchEvent(r),n.defaultPrevented||r.defaultPrevented}class tr{constructor(t={}){this.plugins=[],this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.style.cssText="position: absolute; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),this._dispatch=t.dispatch||(t=>this.update([t])),this.dispatch=this.dispatch.bind(this),this.root=t.root||document,this.viewState=new Wn(t.state||pt.create()),this.plugins=this.state.facet(li).map(t=>new Oi(t).update(this)),this.observer=new Gn(this,(t,e,i)=>{Nn(this,t,e,i)},t=>{this.inputState.runScrollHandlers(this,t),this.observer.intersecting&&this.measure()}),this.inputState=new Ni(this),this.docView=new vi(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,window.addEventListener("resize",()=>{-1==nr&&(nr=setTimeout(rr,50))}),this.requestMeasure(),t.parent&&t.parent.appendChild(this.dom)}get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return 0t.scrollIntoView)?n.selection.main:null;this.viewState.update(i,s),this.bidiCache=or.update(this.bidiCache,i.changes),i.empty||this.updatePlugins(i),e=this.docView.update(i),this.state.facet(pi)!=this.styleModules&&this.mountStyles(),this.updateAttrs(),this.showAnnouncements(t)}finally{this.updateState=0}if((e||scrollTo||this.viewState.mustEnforceCursorAssoc)&&this.requestMeasure(),!i.empty)for(var o of this.state.facet(ei))o(i)}setState(t){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");this.updateState=2;try{for(var e of this.plugins)e.destroy(this);this.viewState=new Wn(t),this.plugins=t.facet(li).map(t=>new Oi(t).update(this)),this.docView=new vi(this),this.inputState.ensureHandlers(this),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}this.requestMeasure()}updatePlugins(i){let t=i.startState.facet(li),n=i.state.facet(li);if(t!=n){let e=[];for(var r of n){var s=t.indexOf(r);if(s<0)e.push(new Oi(r));else{let t=this.plugins[s];t.mustUpdate=i,e.push(t)}}for(var o of this.plugins)o.mustUpdate!=i&&o.destroy(this);this.plugins=e,this.inputState.ensureHandlers(this)}else for(var e of this.plugins)e.mustUpdate=i;for(let t=0;t{try{return t.read(this)}catch(t){return ni(this.state,t),sr}});let t=new gi(this,this.state);t.flags|=r,n?n.flags|=r:n=t,this.updateState=2,t.empty||this.updatePlugins(t),this.updateAttrs(),r&&this.docView.update(t);for(let t=0;tthis.measure())),e){if(null!=e.key)for(let t=0;tfunction(t,e,i){let n=t.state.charCategorizer(e),r=n(i);return t=>{t=n(t);return r==Ot.Space&&(r=t),r==t}}(this,e.head,t))}moveToLineBoundary(t,e,i=!0){return function(t,e,i,n){var r=t.state.doc.lineAt(e.head),s=n&&t.lineWrapping?t.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head):null;if(s){n=t.dom.getBoundingClientRect(),s=t.posAtCoords({x:i==(t.textDirection==ki.LTR)?n.right-1:n.left+1,y:(s.top+s.bottom)/2});if(null!=s)return _.cursor(s,i?-1:1)}return e=He.find(t.docView,e.head),r=e?i?e.posAtEnd:e.posAtStart:i?r.to:r.from,_.cursor(r,i?-1:1)}(this,t,e,i)}moveVertically(t,e,i){return Bi(this,t,e,i)}scrollPosIntoView(t){this.viewState.scrollTo=_.cursor(t),this.requestMeasure()}domAtPos(t){return this.docView.domAtPos(t)}posAtDOM(t,e=0){return this.docView.posFromDOM(t,e)}posAtCoords(t){return this.readMeasured(),Ii(this,t)}coordsAtPos(t,e=1){this.readMeasured();var i=this.docView.coordsAt(t,e);if(!i||i.left==i.right)return i;var n=this.state.doc.lineAt(t),r=this.bidiSpans(n);return ie(i,r[zi.find(r,t-n.from,-1,e)].dir==ki.LTR==0er)return Yi(t.length);var e,i=this.textDirection;for(e of this.bidiCache)if(e.from==t.from&&e.dir==i)return e.order;var n=Vi(t.text,this.textDirection);return this.bidiCache.push(new or(t.from,t.to,i,n)),n}get hasFocus(){var t;return(document.hasFocus()||be.safari&&(null===(t=this.inputState)||void 0===t?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{se(this.contentDOM),this.docView.updateSelection()})}destroy(){for(var t of this.plugins)t.destroy(this);this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),-1({}),{eventHandlers:t})}static theme(t,e){var i=wt.newName();let n=[qn.of(i),pi.of(Dn(`.${i}`,t))];return e&&e.dark&&n.push(Vn.of(!0)),n}static baseTheme(t){return E.fallback(pi.of(Dn("."+Yn,t,En)))}}tr.styleModule=pi,tr.inputHandler=ii,tr.exceptionSink=ti,tr.updateListener=ei,tr.editable=ri,tr.mouseSelectionStyle=Ke,tr.dragMovesSelection=Je,tr.clickAddsSelectionRange=Fe,tr.decorations=fi,tr.contentAttributes=ui,tr.editorAttributes=di,tr.lineWrapping=tr.contentAttributes.of({class:"cm-lineWrapping"}),tr.announce=rt.define();const er=4096;function ir(t,e){return null==t?e.getBoundingClientRect().top:t}let nr=-1;function rr(){nr=-1;var i=document.querySelectorAll(".cm-content");for(let e=0;e{if(t){for(var e of t.commands)if(e(i))return!0;t.preventDefault&&(a=!0)}return!1},h=t[n],c;if(h){if(l(h[o+lr(r,e,!s)]))return!0;if(s&&(e.shiftKey||e.altKey||e.metaKey)&&(c=qt[e.keyCode])&&c!=r){if(l(h[o+lr(c,e,!0)]))return!0}else if(s&&e.shiftKey&&l(h[o+lr(r,e,!0)]))return!0}return a}(function(t){let e=t.facet(hr),i=cr.get(e);i||cr.set(e,i=function(t,a=ar){let l=Object.create(null),n=Object.create(null),h=(t,e)=>{var i=n[t];if(null==i)n[t]=e;else if(i!=e)throw new Error("Key binding "+t+" is used both as a regular binding and as a multi-stroke prefix")},e=(n,t,e,i)=>{let r=l[n]||(l[n]=Object.create(null)),s=t.split(/ (?!$)/).map(t=>function(t,e){var i=t.split(/-(?!$)/);let n=i[i.length-1];"Space"==n&&(n=" ");let r,s,o,a;for(let t=0;t{let e=Or={view:t,prefix:i,scope:n};return setTimeout(()=>{Or==e&&(Or=null)},dr),!0}]})}t=s.join(" ");h(t,!1);let o=r[t]||(r[t]={preventDefault:!1,commands:[]});o.commands.push(e),i&&(o.preventDefault=!0)};for(var i of t){var r=i[a]||i.key;if(r)for(var s of i.scope?i.scope.split(" "):["editor"])e(s,r,i.run,i.preventDefault),i.shift&&e(s,"Shift-"+r,i.shift,i.preventDefault)}return l}(e.reduce((t,e)=>t.concat(e),[])));return i}(e.state),t,e,"editor")}})}),cr=new WeakMap;let Or=null;const dr=4e3;be.ios;let ur=0;const fr=new WeakMap;class pr{constructor({deserialize:t}={}){this.id=ur++,this.deserialize=t||(()=>{throw new Error("This node type doesn't define a deserialize function")})}static string(){return new pr({deserialize:t=>t})}static number(){return new pr({deserialize:Number})}static flag(){return new pr({deserialize:()=>!0})}set(t,e){return t[this.id]=e,t}add(e){return"function"!=typeof e&&(e=gr.match(e)),t=>{t=e(t);return void 0===t?null:[this,t]}}}pr.closedBy=new pr({deserialize:t=>t.split(" ")}),pr.openedBy=new pr({deserialize:t=>t.split(" ")}),pr.group=new pr({deserialize:t=>t.split(" ")});const mr=Object.create(null);class gr{constructor(t,e,i,n=0){this.name=t,this.props=e,this.id=i,this.flags=n}static define(t){var e=t.props&&t.props.length?Object.create(null):mr,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(null==t.name?8:0),n=new gr(t.name||"",e,t.id,i);if(t.props)for(var r of t.props)Array.isArray(r)||(r=r(n)),r&&r[0].set(e,r[1]);return n}prop(t){return this.props[t.id]}get isTop(){return 0<(1&this.flags)}get isSkipped(){return 0<(2&this.flags)}get isError(){return 0<(4&this.flags)}get isAnonymous(){return 0<(8&this.flags)}is(e){if("string"!=typeof e)return this.id==e;{if(this.name==e)return!0;let t=this.prop(pr.group);return!!t&&-1{for(let t=i.prop(pr.group),e=-1;e<(t?t.length:0);e++){var n=r[e<0?i.name:t[e]];if(n)return n}}}}gr.none=new gr("",Object.create(null),0,8);class vr{constructor(e){this.types=e;for(let t=0;tt.toString()).join();return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(t,e=0){var i=null!=t&&fr.get(this)||this.topNode;let n=new Sr(i);return null!=t&&(n.moveTo(t,e),fr.set(this,n._tree)),n}fullCursor(){return new Sr(this.topNode,!0)}get topNode(){return new yr(this,0,0,null)}resolve(t,e=0){return this.cursor(t,e).node}iterate(t){let{enter:i,leave:n,from:r=0,to:s=this.length}=t;for(let e=this.cursor();;){let t=!1;if(e.from<=s&&e.to>=r&&(e.type.isAnonymous||!1!==i(e.type,e.from,e.to))){if(e.firstChild())continue;e.type.isAnonymous||(t=!0)}for(;t&&n&&n(e.type,e.from,e.to),t=e.type.isAnonymous,!e.nextSibling();){if(!e.parent())return;t=!0}}}balance(t=1024){return this.children.length<=Wr?this:Xr(this.type,gr.none,this.children,this.positions,0,this.children.length,0,t,this.length,0)}static build(t){let{buffer:e,nodeSet:m,topID:i=0,maxBufferLength:g=1024,reused:v=[],minRepeatType:Q=m.types.length}=t,w=Array.isArray(e)?new Tr(e,e.length):e,$=m.types,y=0;function b(i,t,e,n,r){var{id:s,start:o,end:a,size:l}=w;let h=o-i;if(l<0)return-1==l?(e.push(v[s]),n.push(h)):y=s,void w.next();let c=$[s],O,d;if(a-o<=g&&(d=function(t,e){let i=w.fork(),n=0,r=0,s=0,o=i.end-g,a={size:0,start:0,skip:0};t:for(var l=i.pos-t;i.pos>l;)if(i.id!=e){var h=i.size,c=i.pos-h;if(h<0||c=Q?4:0;var O=i.start;for(i.next();i.pos>c;){if(i.size<0)break t;i.id>=Q&&(t+=4),i.next()}r=O,n+=h,s+=t}else a.size=n,a.start=r,a.skip=s,s+=4,n+=4,i.next();(e<0||n==t)&&(a.size=n,a.start=r,a.skip=s);return 4t;)e=function t(e,i,n,r){var{id:s,start:o,end:a,size:l}=w;w.next();if(s==r)return n;var h=n;if(4c;)n=t(e,i,n,r);s=Q?s:-1;w.pos>f;)w.id==p?w.next():b(o,f,t,e,p);t.reverse(),e.reverse(),O=-1Wr?Xr(c,c,t,e,0,t.length,0,g,a-o,y):wr(new Qr(c,t,e,a-o),y)}e.push(O),n.push(h)}let n=[],r=[];for(;0=t:this.from>t)||(-1=t:this.from>t)||(-1!t.type.isAnonymous||t instanceof $r||Pr(t))}class Tr{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Tr(this.buffer,this.index)}}const Wr=8;function Xr(t,i,n,r,s,o,a,l,e,h){let c=[],O=[];if(e<=l)for(let t=s;td<<1){for(let t=0;t=i)for(;s&&s.from=t.from||d<=t.to||l)&&(h=Math.max(t.from,a)-l,c=Math.min(t.to,d)-l,t=c<=h?null:new Rr(h,c,t.tree,t.offset+l,(0d)break;s=rt.length&&n.push(r);return n}}function _r(t){return new Cr(t)}class Cr{constructor(t,e=t.length){this.string=t,this.length=e}get(t){return t<0||t>=this.length?-1:this.string.charCodeAt(t)}lineAfter(t){if(t<0)return"";var e=this.string.indexOf("\n",t);return this.string.slice(t,e<0?this.length:Math.min(e,this.length))}read(t,e){return this.string.slice(t,Math.min(this.length,e))}clip(t){return new Cr(this.string,t)}}const Ar=new pr;function Lr(e){return L.define({combine:e?t=>t.concat(e):void 0})}class zr{constructor(t,e,i,n=[]){this.data=t,this.topNode=i,pt.prototype.hasOwnProperty("tree")||Object.defineProperty(pt.prototype,"tree",{get(){return Yr(this)}}),this.parser=e,this.extension=[Gr.of(this),pt.languageData.of((t,e)=>t.facet(qr(t,e)))].concat(n)}isActiveAt(t,e){return qr(t,e)==this.data}findRegions(t){var e=t.facet(Gr);if((null==e?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let n=[];return Yr(t).iterate({enter:(t,e,i)=>{if(t.isTop&&t.prop(Ar)==this.data)return n.push({from:e,to:i}),!1}}),n}get allowsNesting(){return!0}parseString(t){var e=d.of(t.split("\n"));let i=this.parser.startParse(new Mr(e),0,new Zr(this.parser,pt.create({doc:e}),[],Qr.empty,{from:0,to:t.length},[],null)),n;for(;!(n=i.advance()););return n}}function qr(t,e){var i=t.facet(Gr);if(!i)return null;if(!i.allowsNesting)return i.data;let n=Yr(t),r=n.resolve(e,-1);for(;r;){var s=r.type.prop(Ar);if(s)return s;r=r.parent}return i.data}zr.setState=rt.define();class Vr extends zr{constructor(t,e){super(t,e,e.topNode),this.parser=e}static define(t){let e=Lr(t.languageData);return new Vr(e,t.parser.configure({props:[Ar.add(t=>t.isTop?e:void 0)]}))}configure(t){return new Vr(this.data,this.parser.configure(t))}get allowsNesting(){return this.parser.hasNested}}function Yr(t){t=t.field(zr.state,!1);return t?t.tree:Qr.empty}class Mr{constructor(t,e=t.length){this.doc=t,this.length=e,this.cursorPos=0,this.string="",this.prevString="",this.cursor=t.iter()}syncTo(t){return t=this.length)return-1;let e=this.cursorPos-this.string.length;if(t=this.cursorPos){if(t=e-this.prevString.length)return this.prevString.charCodeAt(t-(e-this.prevString.length));e=this.syncTo(t)}return this.string.charCodeAt(t-e)}lineAfter(t){if(t>=this.length||t<0)return"";let e=this.cursorPos-this.string.length;return(t=this.cursorPos)&&(e=this.syncTo(t)),this.cursor.lineBreak?"":this.string.slice(t-e,Math.min(this.length-e,this.string.length))}read(t,e){var i=this.cursorPos-this.string.length;return t=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i)}clip(t){return new Mr(this.doc,t)}}class Zr{constructor(t,e,i=[],n,r,s,o){this.parser=t,this.state=e,this.fragments=i,this.tree=n,this.viewport=r,this.skipped=s,this.scheduleOn=o,this.parse=null,this.tempSkipped=[]}work(t,e){if(this.tree!=Qr.empty&&(null==e?this.tree.length==this.state.doc.length:this.tree.length>=e))return this.takeTree(),!0;this.parse||(this.parse=this.parser.startParse(new Mr(this.state.doc),0,this));for(var i=Date.now()+t;;){var n=this.parse.advance();if(n)return this.fragments=this.withoutTempSkipped(Rr.addTree(n)),this.parse=null,this.tree=n,!0;if(null!=e&&this.parse.pos>=e)return this.takeTree(),!0;if(Date.now()>i)return!1}}takeTree(){this.parse&&this.parse.pos>this.tree.length&&(this.tree=this.parse.forceFinish(),this.fragments=this.withoutTempSkipped(Rr.addTree(this.tree,this.fragments,!0)))}withoutTempSkipped(t){for(var e;e=this.tempSkipped.pop();)t=Er(t,e.from,e.to);return t}changes(t,e){let{fragments:i,tree:n,viewport:s,skipped:o}=this;if(this.takeTree(),!t.empty){let r=[];if(t.iterChangedRanges((t,e,i,n)=>r.push({fromA:t,toA:e,fromB:i,toB:n})),i=Rr.applyChanges(i,r),n=Qr.empty,s={from:t.mapPos(s.from,-1),to:t.mapPos(s.to,1)},this.skipped.length){o=[];for(var a of this.skipped){var l=t.mapPos(a.from,1),a=t.mapPos(a.to,-1);le.from&&(this.fragments=Er(this.fragments,i,n),this.skipped.splice(t--,1))}return this.skipped.length=t}}function Er(t,e,i){return Rr.applyChanges(t,[{fromA:e,toA:i,fromB:e,toB:i}])}Zr.skippingParser=Zr.getSkippingParser();class Dr{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged)return this;let e=this.context.changes(t.changes,t.state);t=this.context.tree.length==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.tree.length),e.viewport.to);return e.work(25,t)||e.takeTree(),new Dr(e)}static init(t){let e=new Zr(t.facet(Gr).parser,t,[],Qr.empty,{from:0,to:t.doc.length},[],null);return e.work(25)||e.takeTree(),new Dr(e)}}zr.state=M.define({create:Dr.init,update(t,e){for(var i of e.effects)if(i.is(zr.setState))return i.value;return e.startState.facet(Gr)!=e.state.facet(Gr)?Dr.init(e.state):t.apply(e)}});let jr="undefined"!=typeof window&&window.requestIdleCallback||((t,{timeout:e})=>setTimeout(t,e)),Hr="undefined"!=typeof window&&window.cancelIdleCallback||clearTimeout;var Ir=hi.fromClass(class{constructor(t){this.view=t,this.working=-1,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(zr.state).context;t.viewportChanged&&(e.updateViewport(t.view.viewport)&&e.reset(),this.view.viewport.to>e.tree.length&&this.scheduleWork()),t.docChanged&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(i=!1){if(!(-1=t.doc.length||(this.working=jr(this.work,{timeout:500}))}}work(n){this.working=-1;var r=Date.now();if(this.chunkEnd=e+1e6||(n=Math.min(this.chunkBudget,n?Math.max(25,n.timeRemaining()):100),n=i.context.work(n,e+1e6),this.chunkBudget-=Date.now()-r,(n||this.chunkBudget<=0||i.context.movedPast(e))&&(i.context.takeTree(),this.view.dispatch({effects:zr.setState.of(new Dr(i.context))})),!n&&0this.scheduleWork(!0)),t.scheduleOn=null)}destroy(){0<=this.working&&Hr(this.working)}},{eventHandlers:{focus(){this.scheduleWork()}}});const Gr=L.define({combine(t){return t.length?t[0]:null},enables:[zr.state,Ir]});class Br{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}class Nr{constructor(t,e,i,n,r){this.name=t,this.alias=e,this.extensions=i,this.filename=n,this.loadFunc=r,this.support=void 0,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(t=>this.support=t,t=>{throw this.loading=null,t}))}static of(t){return new Nr(t.name,(t.alias||[]).concat(t.name).map(t=>t.toLowerCase()),t.extensions||[],t.filename,t.load)}static matchFilename(t,e){for(var i of t)if(i.filename&&i.filename.test(e))return i;var n=/\.([^.]+)$/.exec(e);if(n)for(var r of t)if(-1t==e))return n;if(i)for(var r of t)for(var s of r.alias){var o=e.indexOf(s);if(-1{if(!t.length)return" ";if(!/^(?: +|\t+)$/.test(t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(t[0]));return t[0]}});function Jr(t){let e=t.facet(Fr);return 9==e.charCodeAt(0)?t.tabSize*e.length:e.length}function Kr(t,e){let i="",n=t.tabSize;if(9==t.facet(Fr).charCodeAt(0))for(;n<=e;)i+="\t",e-=n;for(let t=0;tas(t,!0,1,void 0,i&&!function(t){var e,i;return t.pos==(null===(e=t.options)||void 0===e?void 0:e.simulateBreak)&&null!==(i=t.options)&&void 0!==i&&i.simulateDoubleBreak}(t)?e.from:void 0)}return null==t.parent?ss:null}function rs(e,i,n){for(;e;e=e.parent){let t=ns(e);if(t)return t(new os(n,i,e))}return null}function ss(){return 0}class os extends es{constructor(t,e,i){super(t.state,t.options),this.base=t,this.pos=e,this.node=i}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){let e=this.state.doc.lineAt(this.node.from);for(;;){let t=this.node.resolve(e.from);for(;t.parent&&t.parent.from==t.from;)t=t.parent;if(function(e,i){for(let t=i;t;t=t.parent)if(e==t)return!0;return!1}(t,this.node))break;e=this.state.doc.lineAt(t.from)}return this.lineIndent(e)}continue(){var t=this.node.parent;return t?rs(t,this.pos,this.base):0}}function as(t,e,i,n,r){let s=t.textAfter,o=s.match(/^\s*/)[0].length;r=n&&s.slice(o,o+n.length)==n||r==t.pos+o,e=e?function(t){let e=t.node;var i=e.childAfter(e.from),n=e.lastChild;if(!i)return null;var r=null===(r=t.options)||void 0===r?void 0:r.simulateBreak,t=t.state.doc.lineAt(i.from),s=null==r||r<=t.from?t.to:Math.min(t.to,r);for(let t=i.to;;){var o=e.childAfter(t);if(!o||o==n)return null;if(!o.type.isSkipped)return o.from{var e=i&&i.test(t.textAfter);return t.baseIndent+(e?0:n*t.unit)}}L.define();const hs=new pr;function cs(t){var e=t.firstChild,i=t.lastChild;return e&&e.totr.decorations.from(t)}),Os];function vs(t,e,i){var n=t.prop(e<0?pr.openedBy:pr.closedBy);if(n)return n;if(1==t.name.length){t=i.indexOf(t.name);if(-1=e.to){if(0==o&&-1>1==l>>1};O--}}0"},$s=rt.define({map(t,e){t=e.mapPos(t,-1,w.TrackAfter);return null==t?void 0:t}}),ys=rt.define({map(t,e){return e.mapPos(t)}}),bs=new class extends bt{};bs.startSide=1,bs.endSide=-1;const xs=M.define({create(){return Pt.empty},update(t,i){var e,n;i.selection&&(e=i.state.doc.lineAt(i.selection.main.head).from,n=i.startState.doc.lineAt(i.startState.selection.main.head).from,e!=i.changes.mapPos(n,-1)&&(t=Pt.empty)),t=t.map(i.changes);for(let e of i.effects)e.is($s)?t=t.update({add:[bs.range(e.value,e.value+1)]}):e.is(ys)&&(t=t.update({filter:t=>t!=e.value}));return t}});const ks="()[]{}<>";function Ss(e){for(let t=0;t>10),56320+(1023&t)));var t}function Ps(t,e){return t.languageDataAt("closeBrackets",e)[0]||ws}function Ts(t,e,i,n){if(t.composing)return!1;var r=t.state.selection.main;if(2{if(!t.empty)return{changes:[{insert:s,from:t.from},{insert:s,from:t.to}],effects:$s.of(t.to+s.length),range:_.range(t.anchor+s.length,t.head+s.length)};var e=t.head,i=Rs(r.doc,e);if(i==s){if(_s(r,e))return{changes:{insert:s+s,from:e},effects:$s.of(e+s.length),range:_.cursor(e+s.length)};if(Xs(r,e)){var n=o&&r.sliceDoc(e,e+3*s.length)==s+s+s;return{range:_.cursor(e+s.length*(n?3:1)),effects:ys.of(e)}}}else{if(o&&r.sliceDoc(e-2*s.length,e)==s+s&&_s(r,e-2*s.length))return{changes:{insert:s+s+s+s,from:e},effects:$s.of(e+s.length),range:_.cursor(e+s.length)};if(r.charCategorizer(e)(i)!=Ot.Word){i=r.sliceDoc(e-1,e);if(i!=s&&r.charCategorizer(e)(i)!=Ot.Word)return{changes:{insert:s+s,from:e},effects:$s.of(e+s.length),range:_.cursor(e+s.length)}}}return{range:a=t}});return a?null:r.update(t,{scrollIntoView:!0,annotations:st.userEvent.of("input")})}(t,r,-1{if(!t.empty)return{changes:[{insert:n,from:t.from},{insert:r,from:t.to}],effects:$s.of(t.to+n.length),range:_.range(t.anchor+n.length,t.head+n.length)};var e=Rs(i.doc,t.head);return!e||/\s/.test(e)||-1t.empty&&Rs(e.doc,t.head)==i?_.cursor(t.head+i.length):n=t);return n?null:e.update({selection:_.create(t,e.selection.mainIndex),scrollIntoView:!0,effects:e.selection.ranges.map(({from:t})=>ys.of(t))})}(t,(r,s))}return null}(t.state,n);return!!n&&(t.dispatch(n),!0)}const Ws=[{key:"Backspace",run:({state:n,dispatch:t})=>{let r=Ps(n,n.selection.main.head).brackets||ws.brackets,s=null,e=n.changeByRange(t=>{if(t.empty){var e,i=function(t,e){let i=t.sliceString(e-2,e);return O(c(i,0))==i.length?i:i.slice(1)}(n.doc,t.head);for(e of r)if(e==i&&Rs(n.doc,t.head)==Ss(c(e,0)))return{changes:{from:t.head-e.length,to:t.head+e.length},range:_.cursor(t.head-e.length),annotations:st.userEvent.of("delete")}}return{range:s=t}});return s||t(n.update(e,{scrollIntoView:!0})),!s}}];function Xs(t,e){let i=!1;return t.field(xs).between(0,t.doc.length,t=>{t==e&&(i=!0)}),i}function Rs(t,e){let i=t.sliceString(e,e+2);return i.slice(0,O(c(i,0)))}function _s(t,e){t=Yr(t).resolve(e+1);return t.parent&&t.from==e}function Cs(t,e){return _.create(t.ranges.map(e),t.mainIndex)}function As(t,e){return t.update({selection:e,scrollIntoView:!0,annotations:st.userEvent.of("keyboardselection")})}function Ls({state:t,dispatch:e},i){let n=Cs(t.selection,i);return!n.eq(t.selection)&&(e(As(t,n)),!0)}function zs(t,e){return _.cursor(e?t.to:t.from)}function qs(e,i){return Ls(e,t=>t.empty?e.moveByChar(t,i):zs(t,i))}var Vs=t=>qs(t,t.textDirection!=ki.LTR),Ys=t=>qs(t,t.textDirection==ki.LTR);function Ms(e,i){return Ls(e,t=>t.empty?e.moveByGroup(t,i):zs(t,i))}function Zs(e,i,n){let r=Yr(e).resolve(i.head);var s,o,a,l=n?pr.closedBy:pr.openedBy;for(let t=i.head;;){var h=n?r.childAfter(t):r.childBefore(t);if(!h)break;s=e,a=l,(o=h).type.prop(a)||((a=o.to-o.from)&&(2t.empty?e.moveVertically(t,i):zs(t,i))}var Ds=t=>Es(t,!1),js=t=>Es(t,!0);function Hs(e,i){return Ls(e,t=>t.empty?e.moveVertically(t,i,e.dom.clientHeight):zs(t,i))}var Is=t=>Hs(t,!1),Gs=t=>Hs(t,!0);function Bs(t,e,i){let n=t.visualLineAt(e.head),r=t.moveToLineBoundary(e,i);return r.head==e.head&&r.head!=(i?n.to:n.from)&&(r=t.moveToLineBoundary(e,i,!1)),i||r.head!=n.from||!n.length||(t=/^\s*/.exec(t.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length)&&e.head!=n.from+t&&(r=_.cursor(n.from+t)),r}var Ns=e=>Ls(e,t=>Bs(e,t,!0)),Us=e=>Ls(e,t=>Bs(e,t,!1));function Fs(t,i){let e=Cs(t.state.selection,t=>{var e=i(t);return _.range(t.anchor,e.head,e.goalColumn)});return!e.eq(t.state.selection)&&(t.dispatch(As(t.state,e)),!0)}function Js(e,i){return Fs(e,t=>e.moveByChar(t,i))}var Ks=t=>Js(t,t.textDirection!=ki.LTR),to=t=>Js(t,t.textDirection==ki.LTR);function eo(e,i){return Fs(e,t=>e.moveByGroup(t,i))}function io(e,i){return Fs(e,t=>e.moveVertically(t,i))}var no=t=>io(t,!1),Yt=t=>io(t,!0);function ro(e,i){return Fs(e,t=>e.moveVertically(t,i,e.dom.clientHeight))}Zt=t=>ro(t,!1),Et=t=>ro(t,!0),ve=e=>Fs(e,t=>Bs(e,t,!0)),me=e=>Fs(e,t=>Bs(e,t,!1)),ge=({state:t,dispatch:e})=>(e(As(t,{anchor:0})),!0),pe=({state:t,dispatch:e})=>(e(As(t,{anchor:t.doc.length})),!0),Qe=({state:t,dispatch:e})=>(e(As(t,{anchor:t.selection.main.anchor,head:0})),!0),we=({state:t,dispatch:e})=>(e(As(t,{anchor:t.selection.main.anchor,head:t.doc.length})),!0);function so({state:t,dispatch:e},r){var i=t.changeByRange(t=>{let{from:e,to:i}=t;var n;return e==i&&(n=r(e),e=Math.min(e,n),i=Math.max(i,n)),e==i?{range:t}:{changes:{from:e,to:i},range:_.cursor(e)}});return!i.changes.empty&&(e(t.update(i,{scrollIntoView:!0,annotations:st.userEvent.of("delete")})),!0)}const oo=(a,l,h)=>so(a,e=>{let{state:t}=a,i=t.doc.lineAt(e),n;if(!l&&e>i.from&&eoo(t,!1,!0),ye=t=>oo(t,!0,!1);const ao=(t,h)=>so(t,e=>{let i=e,{state:n}=t,r=n.doc.lineAt(i),s=n.charCategorizer(i);for(let t=null;;){if(i==(h?r.to:r.from)){i==e&&r.number!=(h?n.doc.lines:1)&&(i+=h?1:-1);break}var o=b(r.text,i-r.from,h)+r.from,a=r.text.slice(Math.min(i,o)-r.from,Math.max(i,o)-r.from),l=s(a);if(null!=t&&l!=t)break;" "==a&&i==e||(t=l),i=o}return i});$e=t=>ao(t,!1),fe=t=>ao(t,!0),Ir=i=>so(i,t=>{var e=i.visualLineAt(t).to;return t{var i=[];for(let t=e.from;t<=e.to;){var n=r.doc.lineAt(t);n.number>o&&(e.empty||e.to>n.from)&&(s(n,i,e),o=n.number),t=n.to+1}let t=r.changes(i);return{changes:i,range:_.range(t.mapPos(e.anchor,1),t.mapPos(e.head,1))}})}Os=({state:o,dispatch:t})=>{let a=Object.create(null),l=new es(o,{overrideIndentation:t=>{t=a[t];return null==t?-1:t}});var e=Oo(o,(t,e,i)=>{var n,r,s=ts(l,t.from);null==s||((n=/^\s*/.exec(t.text)[0])!=(r=Kr(o,s))||i.from(t(i.update(Oo(i,(t,e)=>{e.push({from:t.from,insert:i.facet(Fr)})}))),!0);const fo=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:e=>Ls(e,t=>Zs(e.state,t,e.textDirection!=ki.LTR)),shift:e=>Fs(e,t=>Zs(e.state,t,e.textDirection!=ki.LTR))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>Ls(e,t=>Zs(e.state,t,e.textDirection==ki.LTR)),shift:e=>Fs(e,t=>Zs(e.state,t,e.textDirection==ki.LTR))},{key:"Alt-ArrowUp",run:({state:t,dispatch:e})=>ho(t,e,!1)},{key:"Shift-Alt-ArrowUp",run:({state:t,dispatch:e})=>co(t,e,!1)},{key:"Alt-ArrowDown",run:({state:t,dispatch:e})=>ho(t,e,!0)},{key:"Shift-Alt-ArrowDown",run:({state:t,dispatch:e})=>co(t,e,!0)},{key:"Escape",run:({state:t,dispatch:e})=>{let i=t.selection,n=null;return 1{var e=lo(i).map(({from:t,to:e})=>_.range(t,Math.min(e+1,i.doc.length)));return t(i.update({selection:_.create(e),annotations:st.userEvent.of("keyboardselection")})),!0}},{key:"Mod-i",run:({state:n,dispatch:t})=>{var e=Cs(n.selection,t=>{var e;let i=Yr(n).resolve(t.head,1);for(;!(i.from=t.to||i.to>t.to&&i.from<=t.from||null===(e=i.parent)||void 0===e)&&e.parent;)i=i.parent;return _.range(i.to,i.from)});return t(As(n,e)),!0},preventDefault:!0},{key:"Mod-[",run:({state:o,dispatch:t})=>(t(o.update(Oo(o,(n,r)=>{let s=/^\s*/.exec(n.text)[0];if(s){let t=x(s,0,o.tabSize),e=0,i=Kr(o,Math.max(0,t-Jr(o)));for(;e{let{state:i}=e,t=i.changes(lo(i).map(({from:t,to:e})=>(0e.moveVertically(t,!0)).map(t);return e.dispatch({changes:t,selection:n,scrollIntoView:!0}),!0}},{key:"Shift-Mod-\\",run:({state:t,dispatch:e})=>function(i,t,n){let r=!1,e=Cs(i.selection,t=>{var e=Qs(i,t.head,-1)||Qs(i,t.head,1)||0Ms(t,t.textDirection!=ki.LTR),shift:t=>eo(t,t.textDirection!=ki.LTR)},{mac:"Cmd-ArrowLeft",run:Us,shift:me},{key:"ArrowRight",run:Ys,shift:to},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:t=>Ms(t,t.textDirection==ki.LTR),shift:t=>eo(t,t.textDirection==ki.LTR)},{mac:"Cmd-ArrowRight",run:Ns,shift:ve},{key:"ArrowUp",run:Ds,shift:no},{mac:"Cmd-ArrowUp",run:ge,shift:Qe},{mac:"Ctrl-ArrowUp",run:Is,shift:Zt},{key:"ArrowDown",run:js,shift:Yt},{mac:"Cmd-ArrowDown",run:pe,shift:we},{mac:"Ctrl-ArrowDown",run:Gs,shift:Et},{key:"PageUp",run:Is,shift:Zt},{key:"PageDown",run:Gs,shift:Et},{key:"Home",run:Us,shift:me},{key:"Mod-Home",run:ge,shift:Qe},{key:"End",run:Ns,shift:ve},{key:"Mod-End",run:pe,shift:we},{key:"Enter",run:({state:a,dispatch:t})=>{var e=a.changeByRange(({from:t,to:e})=>{var i=t==e&&function(t,e){if(/\(\)|\[\]|\{\}/.test(t.sliceDoc(e-1,e+1)))return{from:e,to:e};let i=Yr(t).resolve(e),n=i.childBefore(e),r=i.childAfter(e),s;return n&&r&&n.to<=e&&r.from>=e&&(s=n.type.prop(pr.closedBy))&&-1s.from&&t(e(t.update({selection:{anchor:0,head:t.doc.length},annotations:st.userEvent.of("keyboardselection")})),!0)},{key:"Backspace",run:ue,shift:ue},{key:"Delete",run:ye,shift:ye},{key:"Mod-Backspace",mac:"Alt-Backspace",run:$e},{key:"Mod-Delete",mac:"Alt-Delete",run:fe},{mac:"Mod-Backspace",run:i=>so(i,t=>{var e=i.visualLineAt(t).from;return eLs(e,t=>_.cursor(e.visualLineAt(t.head).from,1)),shift:e=>Fs(e,t=>_.cursor(e.visualLineAt(t.head).from))},{key:"Ctrl-e",run:e=>Ls(e,t=>_.cursor(e.visualLineAt(t.head).to,-1)),shift:e=>Fs(e,t=>_.cursor(e.visualLineAt(t.head).to))},{key:"Ctrl-d",run:ye},{key:"Ctrl-h",run:t=>oo(t,!1,!1)},{key:"Ctrl-k",run:Ir},{key:"Alt-d",run:fe},{key:"Ctrl-Alt-h",run:$e},{key:"Ctrl-o",run:({state:t,dispatch:e})=>{var i=t.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:d.of(["",""])},range:_.cursor(t.from)}));return e(t.update(i,{scrollIntoView:!0,annotations:st.userEvent.of("input")})),!0}},{key:"Ctrl-t",run:({state:n,dispatch:t})=>{var e=n.changeByRange(t=>{if(!t.empty||0==t.from||t.from==n.doc.length)return{range:t};var e=t.from,i=n.doc.lineAt(e),t=e==i.from?e-1:b(i.text,e-i.from,!1)+i.from,i=e==i.to?e+1:b(i.text,e-i.from,!0)+i.from;return{changes:{from:t,to:i,insert:n.doc.slice(e,i).append(n.doc.slice(t,e))},range:_.cursor(i)}});return!e.changes.empty&&(t(n.update(e,{scrollIntoView:!0})),!0)}},{key:"Alt-f",run:t=>Ms(t,!0),shift:t=>eo(t,!0)},{key:"Alt-b",run:t=>Ms(t,!1),shift:t=>eo(t,!1)},{key:"Alt-<",run:ge},{key:"Alt->",run:pe},{key:"Ctrl-v",run:Gs},{key:"Alt-v",run:Is}].map(t=>({mac:t.key,run:t.run,shift:t.shift})))),po={key:"Tab",run:({state:t,dispatch:e})=>t.selection.ranges.some(t=>!t.empty)?uo({state:t,dispatch:e}):(e(t.update(t.replaceSelection("\t"),{scrollIntoView:!0,annotations:st.userEvent.of("input")})),!0),shift:Os},mo=et.define(),go=et.define(),vo=L.define(),Qo=L.define({combine(t){return mt(t,{minDepth:100,newGroupDelay:500},{minDepth:Math.max,newGroupDelay:Math.min})}}),wo=M.define({create(){return Ro.empty},update(e,i){var n=i.state.facet(Qo),r=i.annotation(mo);if(r){var s=xo.fromTransaction(i),o=r.side;let t=0==o?e.undone:e.done;return t=s?ko(t,t.length,n.minDepth,s):Wo(t,i.startState.selection),new Ro(0==o?r.rest:t,0==o?t:r.rest)}var t=i.annotation(go);if("full"!=t&&"before"!=t||(e=e.isolate()),!1===i.annotation(st.addToHistory))return i.changes.empty?e:e.addMapping(i.changes.desc);s=xo.fromTransaction(i),o=i.annotation(st.time),r=i.annotation(st.userEvent);return s?e=e.addChanges(s,o,r,n.newGroupDelay,n.minDepth):i.selection&&(e=e.addSelection(i.startState.selection,o,r,n.newGroupDelay)),e="full"==t||"after"==t?e.isolate():e},toJSON(t){return{done:t.done.map(t=>t.toJSON()),undone:t.undone.map(t=>t.toJSON())}},fromJSON(t){return new Ro(t.done.map(xo.fromJSON),t.undone.map(xo.fromJSON))}});function $o(n,r){return function({state:t,dispatch:e}){let i=t.field(wo,!1);if(!i)return!1;t=i.pop(n,t,r);return!!t&&(e(t),!0)}}const yo=$o(0,!1),bo=$o(1,!1);Ds=$o(0,!0),no=$o(1,!0);class xo{constructor(t,e,i,n,r){this.changes=t,this.effects=e,this.mapped=i,this.startSelection=n,this.selectionsAfter=r}setSelAfter(t){return new xo(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t;return{changes:null===(t=this.changes)||void 0===t?void 0:t.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(t=this.startSelection)||void 0===t?void 0:t.toJSON(),selectionsAfter:this.selectionsAfter.map(t=>t.toJSON())}}static fromJSON(t){return new xo(t.changes&&k.fromJSON(t.changes),[],t.mapped&&y.fromJSON(t.mapped),t.startSelection&&_.fromJSON(t.startSelection),t.selectionsAfter.map(_.fromJSON))}static fromTransaction(t){let e=Po;for(var i of t.startState.facet(vo)){i=i(t);i.length&&(e=e.concat(i))}return!e.length&&t.changes.empty?null:new xo(t.changes.invert(t.startState.doc),e,void 0,t.startState.selection,Po)}static selection(t){return new xo(void 0,Po,void 0,void 0,t)}}function ko(t,e,i,n){let r=t.slice(i+20t.map(e)):Po,i);if(!t.changes)return xo.selection(n);var r=t.changes.map(e),s=e.mapDesc(t.changes,!0),i=t.mapped?t.mapped.composeDesc(s):s;return new xo(r,rt.mapEffects(t.effects,e),i,t.startSelection.map(s),n)}(e[i-1],t,n);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,i);return t[i-1]=r,t}t=r.mapped,i--,n=r.selectionsAfter}return n.length?[xo.selection(n)]:Po}class Ro{constructor(t,e,i=0,n=void 0){this.done=t,this.undone=e,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new Ro(this.done,this.undone):this}addChanges(t,e,i,n,r){let s=this.done,o=s[s.length-1];return s=o&&o.changes&&e-this.prevTimeo.push(t,e)),e.iterChangedRanges((t,e,i,n)=>{for(let t=0;tt.empty!=r.ranges[e].empty).length)?this:new Ro(Wo(this.done,t),this.undone,e,i)}addMapping(t){return new Ro(Xo(this.done,t),Xo(this.undone,t),this.prevTime,this.prevUserEvent)}pop(e,i,t){let n=0==e?this.done:this.undone;if(0==n.length)return null;var r=n[n.length-1];if(t&&r.selectionsAfter.length)return i.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:mo.of({side:e,rest:function(t){let e=t[t.length-1],i=t.slice();return i[t.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),i}(n)})});if(r.changes){let t=1==n.length?Po:n.slice(0,n.length-1);return r.mapped&&(t=Xo(t,r.mapped)),i.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:mo.of({side:e,rest:t}),filter:!1})}return null}}Ro.empty=new Ro(Po,Po);const _o=[{key:"Mod-z",run:yo,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:bo,preventDefault:!0},{key:"Mod-u",run:Ds,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:no,preventDefault:!0}];let Co=0;class Ao{constructor(t,e,i){this.set=t,this.base=e,this.modified=i,this.id=Co++}static define(t){if(null!=t&&t.base)throw new Error("Can not derive from a modified tag");let e=new Ao([],null,[]);if(e.set.push(e),t)for(var i of t.set)e.set.push(i);return e}static defineModifier(){let e=new zo;return t=>-1t.id-e.id))}}let Lo=0;class zo{constructor(){this.instances=[],this.id=Lo++}static get(e,i){if(!i.length)return e;var t,n=i[0].instances.find(t=>t.base==e&&function(t,i){return t.length==i.length&&t.every((t,e)=>t==i[e])}(i,t.modified));if(n)return n;let r=[],s=new Ao(r,e,i);for(t of i)t.instances.push(s);var o,a=function e(i){let n=[i];for(let t=0;tt.scope)?void 0:Object.create(null);return(t,e)=>{var i,n=a&&a[t.id];if(void 0!==n)return n;let r=null;for(i of o){var s=i.match(t,e);s&&(r=r?r+" "+s:s)}return a&&(a[t.id]=r),r}}static define(t,e){return new jo(t,e||{})}static get(t,e,i){return Eo(t)(e,i||gr.none)}}const Ho=E.fallback(hi.fromClass(class{constructor(t){this.markCache=Object.create(null),this.tree=Yr(t.state),this.decorations=this.buildDeco(t,Eo(t.state))}update(t){var e=Yr(t.state),i=Eo(t.state),n=i!=t.startState.facet(Yo);e.lengthr-1)){for(let t=r-1,e=i.length-1;0<=e;e--,t--){var s=i[e];if(s&&s!=n[t])return}return 1}}(e.context,Io,s)){for(var h of e.tags)(h=d(h,o))&&(t&&(t+=" "),t+=h,1==e.mode?r+=(r?" ":"")+h:0==e.mode&&(i=!0));break}e=e.next}if(t!=p&&(l>f&&p&&u(f,m.from,p),f=l,p=t),!i&&m.firstChild()){do{var c=m.to;n(r,s+1,o),p!=t&&((c=Math.min(O,c))>f&&p&&u(f,c,p),f=c,p=t)}while(m.nextSibling());m.parent()}}}("",0,t.type)}(this.tree,i,r,e,(t,e,i)=>{n.add(t,e,this.markCache[i]||(this.markCache[i]=Ye.mark({class:i})))});return n.finish()}},{decorations:t=>t.decorations})),Io=[""];const Go=Ao.define;var Bo,js=Go(),Yt=Go(),ye=Go(Yt),Ir=Go(),fe=Go(Ir),$e=Go(Ir),ge=Go(),pe=Go(ge),Gs=Go(),Is=Go(),Os=Go(),Ds=Go(Os),no=Go();const No={comment:js,lineComment:Go(js),blockComment:Go(js),docComment:Go(js),name:Yt,variableName:Go(Yt),typeName:ye,tagName:Go(ye),propertyName:Go(Yt),className:Go(Yt),labelName:Go(Yt),namespace:Go(Yt),macroName:Go(Yt),literal:Ir,string:fe,docString:Go(fe),character:Go(fe),number:$e,integer:Go($e),float:Go($e),bool:Go(Ir),regexp:Go(Ir),escape:Go(Ir),color:Go(Ir),url:Go(Ir),keyword:Gs,self:Go(Gs),null:Go(Gs),atom:Go(Gs),unit:Go(Gs),modifier:Go(Gs),operatorKeyword:Go(Gs),controlKeyword:Go(Gs),definitionKeyword:Go(Gs),operator:Is,derefOperator:Go(Is),arithmeticOperator:Go(Is),logicOperator:Go(Is),bitwiseOperator:Go(Is),compareOperator:Go(Is),updateOperator:Go(Is),definitionOperator:Go(Is),typeOperator:Go(Is),controlOperator:Go(Is),punctuation:Os,separator:Go(Os),bracket:Ds,angleBracket:Go(Ds),squareBracket:Go(Ds),paren:Go(Ds),brace:Go(Ds),content:ge,heading:pe,heading1:Go(pe),heading2:Go(pe),heading3:Go(pe),heading4:Go(pe),heading5:Go(pe),heading6:Go(pe),contentSeparator:Go(ge),list:Go(ge),quote:Go(ge),emphasis:Go(ge),strong:Go(ge),link:Go(ge),monospace:Go(ge),inserted:Go(),deleted:Go(),changed:Go(),invalid:Go(),meta:no,documentMeta:Go(no),annotation:Go(no),processingInstruction:Go(no),definition:Ao.defineModifier(),constant:Ao.defineModifier(),function:Ao.defineModifier(),standard:Ao.defineModifier(),local:Ao.defineModifier(),special:Ao.defineModifier()};jo.define([{tag:No.link,textDecoration:"underline"},{tag:No.heading,textDecoration:"underline",fontWeight:"bold"},{tag:No.emphasis,fontStyle:"italic"},{tag:No.strong,fontWeight:"bold"},{tag:No.keyword,color:"#708"},{tag:[No.atom,No.bool,No.url,No.contentSeparator,No.labelName],color:"#219"},{tag:[No.literal,No.inserted],color:"#164"},{tag:[No.string,No.deleted],color:"#a11"},{tag:[No.regexp,No.escape,No.special(No.string)],color:"#e40"},{tag:No.definition(No.variableName),color:"#00f"},{tag:No.local(No.variableName),color:"#30a"},{tag:[No.typeName,No.namespace],color:"#085"},{tag:No.className,color:"#167"},{tag:[No.special(No.variableName),No.macroName],color:"#256"},{tag:No.definition(No.propertyName),color:"#00c"},{tag:No.comment,color:"#940"},{tag:No.meta,color:"#7a757a"},{tag:No.invalid,color:"#f00"}]);const Uo=jo.define([{tag:No.link,class:"cmt-link"},{tag:No.heading,class:"cmt-heading"},{tag:No.emphasis,class:"cmt-emphasis"},{tag:No.strong,class:"cmt-strong"},{tag:No.keyword,class:"cmt-keyword"},{tag:No.atom,class:"cmt-atom"},{tag:No.bool,class:"cmt-bool"},{tag:No.url,class:"cmt-url"},{tag:No.labelName,class:"cmt-labelName"},{tag:No.inserted,class:"cmt-inserted"},{tag:No.deleted,class:"cmt-deleted"},{tag:No.literal,class:"cmt-literal"},{tag:No.string,class:"cmt-string"},{tag:No.number,class:"cmt-number"},{tag:[No.regexp,No.escape,No.special(No.string)],class:"cmt-string2"},{tag:No.variableName,class:"cmt-variableName"},{tag:No.local(No.variableName),class:"cmt-variableName cmt-local"},{tag:No.definition(No.variableName),class:"cmt-variableName cmt-definition"},{tag:No.special(No.variableName),class:"cmt-variableName2"},{tag:No.typeName,class:"cmt-typeName"},{tag:No.namespace,class:"cmt-namespace"},{tag:No.macroName,class:"cmt-macroName"},{tag:No.propertyName,class:"cmt-propertyName"},{tag:No.operator,class:"cmt-operator"},{tag:No.comment,class:"cmt-comment"},{tag:No.meta,class:"cmt-meta"},{tag:No.invalid,class:"cmt-invalid"},{tag:No.punctuation,class:"cmt-punctuation"}]);class Fo{constructor(t,e,i,n,r,s,o){this.type=t,this.value=e,this.from=i,this.hash=n,this.end=r,this.children=s,this.positions=o}static create(t,e,i,n,r){n=n+(n<<8)+t+(e<<4)|0;return new Fo(t,e,i,n,r,[],[])}toTree(t,e=this.end){var i=this.children.length-1;0<=i&&(e=Math.max(e,this.positions[i]+this.children[i].length+this.from));e=new Qr(t.types[this.type],this.children,this.positions,e-this.from).balance(2048);return function t(e,i){for(var n of e)Na.set(n,i),n instanceof Qr&&n.type.isAnonymous&&t(n.children,i)}(e.children,this.hash),e}copy(){return new Fo(this.type,this.value,this.from,this.hash,this.end,this.children.slice(),this.positions.slice())}}(Ir=Bo=Bo||{})[Ir.Document=1]="Document",Ir[Ir.CodeBlock=2]="CodeBlock",Ir[Ir.FencedCode=3]="FencedCode",Ir[Ir.Blockquote=4]="Blockquote",Ir[Ir.HorizontalRule=5]="HorizontalRule",Ir[Ir.BulletList=6]="BulletList",Ir[Ir.OrderedList=7]="OrderedList",Ir[Ir.ListItem=8]="ListItem",Ir[Ir.ATXHeading1=9]="ATXHeading1",Ir[Ir.ATXHeading2=10]="ATXHeading2",Ir[Ir.ATXHeading3=11]="ATXHeading3",Ir[Ir.ATXHeading4=12]="ATXHeading4",Ir[Ir.ATXHeading5=13]="ATXHeading5",Ir[Ir.ATXHeading6=14]="ATXHeading6",Ir[Ir.SetextHeading1=15]="SetextHeading1",Ir[Ir.SetextHeading2=16]="SetextHeading2",Ir[Ir.HTMLBlock=17]="HTMLBlock",Ir[Ir.LinkReference=18]="LinkReference",Ir[Ir.Paragraph=19]="Paragraph",Ir[Ir.CommentBlock=20]="CommentBlock",Ir[Ir.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",Ir[Ir.Escape=22]="Escape",Ir[Ir.Entity=23]="Entity",Ir[Ir.HardBreak=24]="HardBreak",Ir[Ir.Emphasis=25]="Emphasis",Ir[Ir.StrongEmphasis=26]="StrongEmphasis",Ir[Ir.Link=27]="Link",Ir[Ir.Image=28]="Image",Ir[Ir.InlineCode=29]="InlineCode",Ir[Ir.HTMLTag=30]="HTMLTag",Ir[Ir.Comment=31]="Comment",Ir[Ir.ProcessingInstruction=32]="ProcessingInstruction",Ir[Ir.URL=33]="URL",Ir[Ir.HeaderMark=34]="HeaderMark",Ir[Ir.QuoteMark=35]="QuoteMark",Ir[Ir.ListMark=36]="ListMark",Ir[Ir.LinkMark=37]="LinkMark",Ir[Ir.EmphasisMark=38]="EmphasisMark",Ir[Ir.CodeMark=39]="CodeMark",Ir[Ir.CodeInfo=40]="CodeInfo",Ir[Ir.LinkTitle=41]="LinkTitle",Ir[Ir.LinkLabel=42]="LinkLabel";class Jo{constructor(t,e){this.start=t,this.content=e,this.marks=[],this.parsers=[]}}class Ko{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){var t=this.skipSpace(this.basePos);this.indent=this.countIndent(t,this.pos,this.indent),this.pos=t,this.next=t==this.text.length?-1:this.text.charCodeAt(t)}skipSpace(t){return na(this.text,t)}reset(t){for(this.text=t,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(t){this.basePos=t,this.baseIndent=this.countIndent(t,this.pos,this.indent)}moveBaseColumn(t){this.baseIndent=t,this.basePos=this.findColumn(t)}addMarker(t){this.markers.push(t)}countIndent(e,i=0,n=0){for(let t=i;t=e.stack[i.depth+1].value+i.baseIndent)return!0;if(i.indent>=i.baseIndent+4)return!1;var n=(t.type==Bo.OrderedList?ca:ha)(i,e,!1);return 0t.pos+9||46!=r&&41!=r||nt.pos+1||49!=t.next)?-1:n+1-t.pos}function Oa(t){if(35!=t.next)return-1;let e=t.pos+1;for(;e=t.baseIndent+4)return-1;let e=t.pos+1;for(;e/,pa=/\?>/,ma=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*/i.exec(r);if(t)return e.append(La(Bo.Comment,n,n+1+t[0].length));t=/^\?[^]*?\?>/.exec(r);if(t)return e.append(La(Bo.ProcessingInstruction,n,n+1+t[0].length));r=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);if(!r)return-1;let s=[];if(e.parser.htmlParser){let t=e.parser.htmlParser.startParse(_r(e.slice(n,n+1+r[0].length)),0,{}),i;for(;!(i=t.advance()););s=i.children.map((t,e)=>new Aa(t,n+i.positions[e]))}return e.append(La(Bo.HTMLTag,n,n+1+r[0].length,s))},Emphasis(t,e,i){if(95!=e&&42!=e)return-1;let n=i+1;for(;t.char(n)==e;)n++;var r=t.slice(i-1,i),s=t.slice(n,n+1),o=Ea.test(r),a=Ea.test(s),l=/\s|^$/.test(r),r=/\s|^$/.test(s),s=!r&&(!a||l||o),r=!l&&(!o||r||a),o=s&&(42==e||!r||o),a=r&&(42==e||!s||a);return t.append(new Ma(95==e?za:qa,i,n,(o?1:0)|(a?2:0)))},HardBreak(e,t,i){if(92==t&&10==e.char(i+1))return e.append(La(Bo.HardBreak,i,i+2));if(32==t){let t=i+1;for(;32==e.char(t);)t++;if(10==e.char(t)&&t>=i+2)return e.append(La(Bo.HardBreak,i,t+1))}return-1},Link(t,e,i){return 91==e?t.append(new Ma(Va,i,i+1,1)):-1},Image(t,e,i){return 33==e&&91==t.char(i+1)?t.append(new Ma(Ya,i,i+2,1)):-1},LinkEnd(i,t,e){if(93!=t)return-1;for(let t=i.parts.length-1;0<=t;t--){var n=i.parts[t];if(n instanceof Ma&&(n.type==Va||n.type==Ya)){if(!n.side||i.skipSpace(n.to)==e&&!/[(\[]/.test(i.slice(e+1,e+2)))return i.parts[t]=null,-1;var r=i.takeContent(t),r=i.parts[t]=function(n,r,t,e,s){let{text:o}=n,i=n.char(s),a=s;if(r.unshift(La(Bo.LinkMark,e,e+(t==Bo.Image?2:1))),r.push(La(Bo.LinkMark,s-1,s)),40==i){let t=n.skipSpace(s+1),e=ja(o,t-n.offset,n.offset),i;e&&(t=n.skipSpace(e.to),i=Ha(o,t-n.offset,n.offset),i&&(t=n.skipSpace(i.to))),41==n.char(t)&&(r.push(La(Bo.LinkMark,s,s+1)),a=t+1,e&&r.push(e),i&&r.push(i),r.push(La(Bo.LinkMark,t,a)))}else 91!=i||(n=Ia(o,s-n.offset,n.offset,!1))&&(r.push(n),a=n.to);return La(t,e,a,r)}(i,r,n.type==Va?Bo.Link:Bo.Image,n.from,e+1);if(n.type==Va)for(let e=0;er?La(Bo.URL,r+s,i+s):i==n.length&&null}}function Ha(i,n,r){var t=i.charCodeAt(n);if(39!=t&&34!=t&&40!=t)return!1;var s=40==t?41:t;for(let t=n+1,e=!1;t=this.end?-1:this.text.charCodeAt(t-this.offset)}get end(){return this.offset+this.text.length}slice(t,e){return this.text.slice(t-this.offset,e-this.offset)}append(t){return this.parts.push(t),t.to}addDelimiter(t,e,i,n,r){return this.append(new Ma(t,e,i,(n?1:0)|(r?2:0)))}addElement(t){return this.append(t)}resolveMarkers(e){for(let o=e;o=e;s--){var t=this.parts[s];if(t instanceof Ma&&1&t.side&&t.type==a.type&&!(l&&(1&a.side||2&t.side)&&(t.to-t.from+h)%3==0&&((t.to-t.from)%3||h%3))){r=t;break}}if(r){let t=a.type.resolve,e=[],i=r.from,n=a.to;l&&(c=Math.min(2,r.to-r.from,h),i=r.to-c,n=a.from+c,t=1==c?"Emphasis":"StrongEmphasis"),r.type.mark&&e.push(this.elt(r.type.mark,i,r.to));for(let t=s+1;t(t?t-1:0))return!1;if(this.fragmentEnd<0){let t=this.fragment.to;for(;0=n)return this.fragment.from<=e;if(!i.childAfter(n))return!1}}matches(t){var e=this.cursor.tree;return e&&Na.get(e)==t}takeNodes(t){let e=this.cursor,i=this.fragment.offset,n=t.lineStart,r=n,s=t.block.children.length,o=r,a=s;for(;;){if(e.to-i>=this.fragmentEnd){if(e.type.isAnonymous&&e.firstChild())continue;break}if(t.addNode(e.tree,e.from-i),e.type.is("Block")&&(Ua.indexOf(e.type.id)<0?(r=e.to-i,s=t.block.children.length):(r=o,s=a,o=e.to-i,a=t.block.children.length)),!e.nextSibling())break}for(;t.block.children.length>s;)t.block.children.pop(),t.block.positions.pop();return r-n}}const Ja=new Sa(new vr(Wa),null,null,Object.keys(Qa).map(t=>Qa[t]),Object.keys(Qa).map(t=>ba[t]),Object.keys(Qa),Gs,ea,Object.keys(Da).map(t=>Da[t]),Object.keys(Da)),Ka={resolve:"Strikethrough",mark:"StrikethroughMark"};function tl(e,i,n=0,r,s=0){let o=0,a=!0,l=-1,h=-1,c=!1;var O=()=>{r.push(e.elt("TableCell",s+l,s+h,e.parser.parseInline(i.slice(l,h),s+l)))};for(let t=n;t{if(t!=s||e.char(i+1)==s)return-1;let n=[e.elt(a,i,i+1)];for(let t=i+1;te%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,i=0){var n=t.parser.context;return new rl(t,[],e,i,i,0,[],0,n?new sl(n,n.start):null,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var e=t>>19,i=65535&t;let{parser:n}=this.p;var r=n.dynamicPrecedence(i);if(r&&(this.score+=r),0==e)return is;)this.stack.pop();this.reduceContext(i)}storeNode(e,i,n,r=4,t=!1){if(0==e){let t=this,e=this.buffer.length;if(0==e&&t.parent&&(e=t.bufferBase-t.parent.bufferBase,t=t.parent),0=i)return void(t.buffer[e-2]=n)}}if(t&&this.pos!=n){let t=this.buffer.length;if(0n;)this.buffer[t]=this.buffer[t-4],this.buffer[t+1]=this.buffer[t-3],this.buffer[t+2]=this.buffer[t-2],this.buffer[t+3]=this.buffer[t-1],t-=4,4this.pos||r<=i.maxNode)&&(this.pos=s,i.stateFlag(e,1)||(this.reducePos=s)),this.pushState(e,t),r<=i.maxNode&&this.buffer.push(r,t,s,4),this.shiftContext(r)}else r<=this.p.parser.maxNode&&this.buffer.push(r,this.pos,s,4),this.pos=s}apply(t,e,i){65536&t?this.reduce(t):this.shift(t,e,i)}useNode(t,e){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=t)&&(this.p.reused.push(t),i++);var n=this.pos;this.reducePos=this.pos=n+t.length,this.pushState(e,n),this.buffer.push(i,n,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this.p.input,this))}split(){let t=this,e=t.buffer.length;for(;0t.reducePos;)e-=4;for(var i=t.buffer.slice(e),n=t.bufferBase+e;t&&n==t.bufferBase;)t=t.parent;return new rl(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,n,this.curContext,t)}recoverByDelete(t,e){var i=t<=this.p.parser.maxNode;i&&this.storeNode(t,this.pos,e),this.storeNode(0,this.pos,e,i?8:4),this.pos=this.reducePos=e,this.score-=200}canShift(e){for(let t=new ol(this);;){var i=this.p.parser.stateSlot(t.top,4)||this.p.parser.hasAction(t.top,e);if(0==(65536&i))return!0;if(0==i)return!1;t.reduce(i)}}get ruleStart(){for(let t=this.state,e=this.stack.length;;){var i=this.p.parser.stateSlot(t,5);if(!(65536&i))return 0;if(e-=3*(i>>19),(65535&i)>19,a=65535&s;if(-1>19),s=this.stack[1+s];if(null==e||s1&e&&t==i)||n.push(r[t],i)}r=n}let n=[];for(let e=0;e>19;0==t?(this.rest==this.stack.stack&&(this.rest=this.rest.slice()),this.rest.push(this.top,0,0),this.offset+=3):this.offset-=3*(t-1);e=this.stack.p.parser.getGoto(this.rest[this.offset-3],e,!0);this.top=e}}class al{constructor(t,e,i){this.stack=t,this.pos=e,this.index=i,this.buffer=t.buffer,0==this.index&&this.maybeNext()}static create(t){return new al(t,t.bufferBase+t.buffer.length,t.buffer.length)}maybeNext(){var t=this.stack.parent;null!=t&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,0==this.index&&this.maybeNext()}fork(){return new al(this.stack,this.pos,this.index)}}class ll{constructor(){this.start=-1,this.value=-1,this.end=-1}accept(t,e){this.value=t,this.end=e}}class hl{constructor(t,e){this.data=t,this.id=e}token(t,e,i){!function(i,t,n,r,e){let s=0,o=1<>1,d=l+O+(O<<1),u=i[d],f=i[d+1];if(c=e)&&!n.type.isError)return i<0?Math.max(0,Math.min(n.to-1,e-5)):Math.min(t.length,Math.max(n.from+1,e+5));if(i<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return i<0?0:t.length}}class pl{constructor(t){this.fragments=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){var t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?fl(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?fl(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t=this.safeFrom?r:null;r instanceof $r?(this.index[e]++,this.nextStart=n+r.length):(this.index[e]++,n+r.length>=t&&(this.trees.push(r),this.start.push(n),this.index.push(0)))}else this.trees.pop(),this.start.pop(),this.index.pop()}}}class ml extends ll{constructor(){super(...arguments),this.extended=-1,this.mask=0,this.context=0}clear(t){this.start=t,this.value=this.extended=-1}}const gl=new ll;class vl{constructor(t){this.tokens=[],this.mainToken=gl,this.actions=[],this.tokens=t.tokenizers.map(t=>new ml)}getActions(n,r){let s=0,o=null,{parser:t}=n.p,{tokenizers:a}=t;var l=t.stateSlot(n.state,3),h=n.curContext?n.curContext.hash:0;for(let i=0;ic))break}}for(;this.actions.length>s;)this.actions.pop();return o||(o=gl,o.start=n.pos,n.pos==r.length?o.accept(n.p.parser.eofTerm,n.pos):o.accept(0,n.pos+1)),this.mainToken=o,this.actions}updateCachedToken(i,t,n,r){if(i.clear(n.pos),t.token(r,i,n),-1>1)){0==(1&s)?i.value=s>>1:i.extended=s>>1;break}}}else n.pos==r.length?i.accept(n.p.parser.eofTerm,n.pos):i.accept(0,n.pos+1)}putAction(e,t,i,n){for(let t=0;ti)n.push(a);else if(l=this.checkNest(a))(!o||o.stack.scoreh)for(n.sort((t,e)=>e.score-t.score);n.length>h;)n.pop();n.some(t=>t.reducePos>i)&&this.recovering--}else if(1 ":"";if(this.fragments){var e=i.curContext&&i.curContext.tracker.strict,l=e?i.curContext.hash:0;for(let t=this.fragments.nodeAt(s);t;){var h=this.parser.nodeSet.types[t.type.id]==t.type?o.getGoto(i.state,t.type.id):-1;if(-1s?n:r).push(t)}return!1}advanceFully(t,e){for(var i=t.pos;;){var n=this.checkNest(t);if(n)return n;if(!this.advanceStack(t,null,null))return!1;if(t.pos>i)return wl(t,e),!0}}runRecovery(o,a,l){let h=null,c=!1,O;for(let s=0;s ":"";if(t.deadEnd){if(c)continue;c=!0,t.restart(),dl&&console.log(u+this.stackID(t)+" (restarted)");var f=this.advanceFully(t,l);if(f){!0!==f&&(O=f);continue}}let n=t.split(),r=u;for(let t=0;n.forceReduce()&&t<10;t++){dl&&console.log(r+this.stackID(n)+" (via force-reduce)");var p=this.advanceFully(n,l);if(p){!0!==p&&(O=p);break}dl&&(r=this.stackID(n)+" -> ")}for(d of t.recoverByInsert(e))dl&&console.log(u+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,l);this.input.length>t.pos?(i==t.pos&&(i++,e=0),t.recoverByDelete(e,i),dl&&console.log(u+this.stackID(t)+` (via recover-delete ${this.parser.getName(e)})`),wl(t,l)):(!h||h.scoreO.stack.score){O=void 0;break}return O&&this.startNested(O),null}forceFinish(){let t=this.stacks[0].split();return this.nested&&this.finishNested(t,this.nested.forceFinish()),this.stackToTree(t.forceAll())}stackToTree(t,e=t.pos){return this.parser.context&&t.emitContext(),Qr.build({buffer:al.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.startPos,length:e-this.startPos,minRepeatType:this.parser.minRepeatTerm})}checkNest(t){var e=this.parser.findNested(t.state);if(!e)return null;let i=e.value;return"function"==typeof i&&(i=i(this.input,t)),i?{stack:t,info:e,spec:i}:null}startNested(t){let{stack:e,info:i,spec:n}=t;this.stacks=[e],this.nestEnd=this.scanForNestEnd(e,i.end,n.filterEnd),this.nestWrap="number"==typeof n.wrapType?this.parser.nodeSet.types[n.wrapType]:n.wrapType||null,n.startParse?this.nested=n.startParse(this.input.clip(this.nestEnd),e.pos,this.context):this.finishNested(e)}scanForNestEnd(e,i,n){for(let t=e.pos;tt;class bl{constructor(i){if(this.bufferLength=1024,this.strict=!1,this.cachedDialect=null,13!=i.version)throw new RangeError(`Parser version (${i.version}) doesn't match runtime version (13)`);let e=Ol(i.tokenData),n=i.nodeNames.split(" ");this.minRepeatTerm=n.length,this.context=i.context;for(let t=0;ti.topRules[t][1]);this.nodeSet=new vr(n.map((t,e)=>gr.define({name:e>=this.minRepeatTerm?void 0:t,id:e,props:r[e],top:-1"number"==typeof t?new hl(e,t):t),this.topRules=i.topRules,this.nested=(i.nested||[]).map(([t,e,i,n])=>({name:t,value:e,end:new hl(Ol(i),0),placeholder:n})),this.dialects=i.dialects||{},this.dynamicPrecedences=i.dynamicPrecedences||null,this.tokenPrecTable=i.tokenPrec,this.termNames=i.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}parse(t,e=0,i={}){"string"==typeof t&&(t=_r(t));let n=new Ql(this,t,e,i);for(;;){var r=n.advance();if(r)return r}}startParse(t,e=0,i={}){return"string"==typeof t&&(t=_r(t)),new Ql(this,t,e,i)}getGoto(e,i,n=!1){var r=this.goto;if(i>=r[0])return-1;for(let t=r[i+1];;){var s=r[t++],o=1&s,a=r[t++];if(o&&n)return a;for(var l=t+(s>>1);t>10]:null}validAction(e,i){if(i==this.stateSlot(e,4))return!0;for(let t=this.stateSlot(e,1);;t+=3){if(65535==this.data[t]){if(1!=this.data[t+1])return!1;t=xl(this.data,t+2)}if(i==xl(this.data,t+1))return!0}}nextStates(e){let n=[];for(let t=this.stateSlot(e,1);;t+=3){if(65535==this.data[t]){if(1!=this.data[t+1])break;t=xl(this.data,t+2)}if(0==(1&this.data[t+2])){let i=this.data[t+1];n.some((t,e)=>1&e&&t==i)||n.push(this.data[t],i)}}return n}overrides(t,e){e=kl(this.data,this.tokenPrecTable,e);return e<0||kl(this.data,this.tokenPrecTable,t){var t=i.tokenizers.find(t=>t.from==e);return t?t.to:e})),i.dialect&&(t.dialect=this.parseDialect(i.dialect)),i.nested&&(t.nested=this.nested.map(t=>Object.prototype.hasOwnProperty.call(i.nested,t.name)?{name:t.name,value:i.nested[t.name],end:t.end,placeholder:t.placeholder}:t)),null!=i.strict&&(t.strict=i.strict),null!=i.bufferLength&&(t.bufferLength=i.bufferLength),t}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get hasNested(){return 0!1);if(t)for(var i of t.split(" ")){i=n.indexOf(i);0<=i&&(e[i]=!0)}let r=null;for(let i=0;i{let n=e.start,r=t.get(n),s;if(r<0&&i.context&&e.accept(33,e.start),60==r){n++,(s=47==t.get(n))&&n++;var o=Cl(t,n);if(void 0!==o){if(!o)return e.accept(s?4:1,n);t=i.context?i.context.name:null;if(s){if(o==t)return e.accept(2,n);if(t&&Tl[t])return e.accept(33,e.start);if(i.dialectEnabled(0))return e.accept(2,n);for(let t=i.context;t;t=t.parent)if(t.name==o)return;e.accept(3,n)}else t&&Wl[t]&&Wl[t][o]?e.accept(33,e.start):e.accept(1,n)}}}),Gs=new cl((t,e,i)=>{let n=t.get(e.start),r=e.start+1;if(47==n){if(62!=t.get(r))return;r++}else if(62!=n)return;i.context&&Pl[i.context.name]&&e.accept(5,r)}),pe=new cl((t,e)=>{let i=e.start,n=0;for(;;){var r=t.get(i);if(r<0)break;if(i++,r=="--\x3e".charCodeAt(n)){if(n++,3==n){i-=3;break}}else n=0}i>e.start&&e.accept(34,i)});const Ll=/^<\/?\s*([\.\-\:\w\xa1-\uffff]+)/;function zl(t){let e=Ll.exec(t);return e?e[1].toLowerCase():null}function ql(e){return t=>zl(t)==e}function Vl(t){let a=null;for(var e of t)a=a||Object.create(null),(a[e.tag]||(a[e.tag]=[])).push({attrs:e.attrs,value:{filterEnd:ql(e.tag),startParse:e.parser.startParse.bind(e.parser)}});return function(t,e){var i=t.read(e.ruleStart,e.pos);let n=zl(i),r,s;if(!n)return null;if(a&&(r=a[n]))for(var o of r)if(!o.attrs||o.attrs(s=s||function(i){let n=Ll.exec(i),r={};if(n){let t=/\s*([\.\-\:\w\xa1-\uffff]+)\s*(?:=\s*(?:"([^"]*)"|'([^']*)'|([^\s=<>"'/]+)))?/g,e;for(t.lastIndex=n.index+n[0].length;e=t.exec(i);)r[e[1]]=e[4]||e[3]||e[2]||e[1]}return r}(i)))return o.value;return"script"==n||"textarea"==n||"style"==n?{filterEnd:ql(n),wrapType:Sl}:null}}ge=Vl([]);function Yl(t){return{elementContent:Vl(t)}}no=bl.deserialize({version:13,states:"'OOVOXOOOtQ`O'#CgS!eOXO'#CfOOOP'#Cf'#CfO!oOdO'#CqO!wQ`O'#CsOOOP'#DR'#DROOOP'#Cv'#CvQVOXOOO!|QrO,59ROOOP'#Cz'#CzO#XOXO'#DWO#cOPO,59QOOOS'#C{'#C{O#kOdO,59]OOOP,59],59]O#sQ`O,59_OOOP-E6t-E6tO#xQrO'#CiOOQQ'#Cw'#CwO$WQrO1G.mOOOP1G.m1G.mOOOP1G.v1G.vOOOP-E6x-E6xO$cQ`O'#CoOOOP1G.l1G.lOOOS-E6y-E6yOOOP1G.w1G.wOOOP1G.y1G.yO$hQ!bO,59TOOQQ-E6u-E6uOOOP7+$X7+$XOOOP7+$b7+$bO$sQ`O,59ZO$xO#tO'#ClO%WO&jO'#ClOOQQ1G.o1G.oOOOP1G.u1G.uOOOO'#Cx'#CxO%fO#tO,59WOOQQ,59W,59WOOOO'#Cy'#CyO%tO&jO,59WOOOO-E6v-E6vOOQQ1G.r1G.rOOOO-E6w-E6w",stateData:"&X~OtOS~OPPORTOSUOVUOWUOXUOfUOhVO{SO~O[XO~OPPORTOSUOVUOWUOXUOfUO{SO~OQzPqzP~PyOr]O|_O~O[`O~OTfO^bObeO~OQzXqzX~PyOQhOqiO~Or]O|kO~OblO~O_mOT]X^]Xb]X~OTpO^bOboO~O[qO~OatOvrOxsO~ObuO~OWvOXvOvxOwvO~OWyOXyOxxOyyO~OWvOXvOv|OwvO~OWyOXyOx|OyyO~O{fhf~",goto:"#k{PPPPPPPPPP|!SP!YPP!^PP!a!d|P|PP!j!p!v!|#S#YPPPPP#`PPPP#hXUOQWZXQOQWZTcXdRtmRi[XROQWZQWORaWQdXRndQwrR{wQzsR}zQZQRgZQ^SRj^SVOWTYQZR[Q",nodeNames:"⚠ StartTag StartCloseTag StartCloseTag IncompleteCloseTag SelfCloseEndTag Document Text EntityReference CharacterReference Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue EndTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag DoctypeDecl RawText",maxTerm:44,context:no,nodeProps:[[pr.closedBy,-2,1,2,"EndTag SelfCloseEndTag",11,"CloseTag"],[pr.openedBy,5,"StartTag",18,"StartTag StartCloseTag",19,"OpenTag"]],skippedNodes:[0,25],repeatNodeCount:6,tokenData:"!#`!aR!WOX$kXY)sYZ)sZ]$k]^)s^p$kpq)sqr$krs*zsv$kvw+dwx2wx}$k}!O3d!O!P$k!P!Q7]!Q![$k![!]8s!]!^$k!^!_>`!_!`!!n!`!a8R!a!c$k!c!}8s!}#R$k#R#S8s#S#T$k#T#o8s#o$f$k$f$g&R$g%W$k%W%o8s%o%p$k%p&a8s&a&b$k&b1p8s1p4U$k4U4d8s4d4e$k4e$IS8s$IS$I`$k$I`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!aMV!a~LmPM[OfPqMaTypOvLXvxLmx!`LX!`!aMp!a~LXqMwQypfPOv'gx~'gaNSVw`OrM}rsLmsvM}vwLmw!aM}!a!bNi!b~M}aNnVw`OrM}rsLmsvM}vwLmw!`M}!`!a! T!a~M}a! [Rw`fPOr(]sv(]w~(]!R! lWw`ypOrKhrsLXsvKhvwLmwxM}x!`Kh!`!a!!U!a~Kh!R!!_Tw`ypfPOr(krs'gsv(kwx(]x~(k!V!!yV_SVPw`ypOr&Rrs&qsv&Rwx'rx!^&R!^!_(k!_~&R",tokenizers:[Ir,Gs,pe,0,1,2,3,4,5],topRules:{Document:[0,6]},nested:[["elementContent",ge,"%S~RP!^!_U~XP!P!Q[~_dXY[YZ[]^[pq[![!]!m!c!}!m#R#S!m#T#o!m%W%o!m%p&a!m&b1p!m4U4d!m4e$IS!m$I`$Ib!m$Kh%#t!m&/x&Et!m&FV;'S!m;'S;:j$|?&r?Ah!m?BY?Mn!m~!pkXY$eYZ$e]^$epq$e}!O!m!O!P!m!Q![!m![!]!m!`!a$w!c!}!m#R#S!m#T#o!m$}%O!m%W%o!m%p&a!m&b1p!m1p4U!m4U4d!m4e$IS!m$I`$Ib!m$Je$Jg!m$Kh%#t!m&/x&Et!m&FV;'S!m;'S;:j$|?&r?Ah!m?BY?Mn!m~$hTXY$eYZ$e]^$epq$e!`!a$w~$|Op~~%PP;=`<%l!m",42]],dialects:{noMatch:0},tokenPrec:234});const Ml=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288];function Zl(t){return 65<=t&&t<=90||97<=t&&t<=122||161<=t}Ir=new cl((t,e)=>{let i=e.start,n=i,r=!1;for(;;){var s=t.get(n);if(!(Zl(s)||45==s||95==s||r&&(48<=(o=s)&&o<=57))){r&&e.accept(40==s?93:94,n);break}!r&&(45!=s||n>i)&&(r=!0),n++}var o}),Gs=new cl((t,e)=>{Ml.includes(t.get(e.start-1))&&(!Zl(t=t.get(e.start))&&95!=t&&35!=t&&46!=t&&91!=t&&58!=t&&45!=t||e.accept(92,e.start))}),pe=new cl((e,i)=>{var{start:n}=i;if(!Ml.includes(e.get(n-1))){var t=e.get(n);if(37==t&&i.accept(1,n+1),Zl(t)){let t=n+1;for(;Zl(e.get(t));)t++;i.accept(1,t)}}});const El={__proto__:null,not:30,url:64,"url-prefix":64,domain:64,regexp:64,selector:132},Dl={__proto__:null,"@import":112,"@media":136,"@charset":140,"@namespace":144,"@keyframes":150,"@supports":162},jl={__proto__:null,not:126,only:126,from:156,to:158},Hl=bl.deserialize({version:13,states:"7WOYQ[OOOOQP'#Cc'#CcOOQP'#Cb'#CbO!ZQ[O'#CeO!}QXO'#C`O#UQ[O'#CgO#aQ[O'#DOO#fQ[O'#DSOOQP'#Eb'#EbO#kQdO'#DdO$SQ[O'#DqO#kQdO'#DsO$eQ[O'#DuO$pQ[O'#DxO$uQ[O'#EOO%TQ[O'#EQOOQS'#Ea'#EaOOQS'#ER'#ERQYQ[OOOOQP'#Cf'#CfOOQP,59P,59PO!ZQ[O,59PO%[Q[O'#ESO%vQWO,58zO&OQ[O,59RO#aQ[O,59jO#fQ[O,59nO%[Q[O,59rO%[Q[O,59tO%[Q[O,59uO'[Q[O'#D_OOQS,58z,58zOOQP'#Cj'#CjOOQO'#Cp'#CpOOQP,59R,59RO'cQWO,59RO'hQWO,59ROOQP'#DQ'#DQOOQP,59j,59jOOQO'#DU'#DUO'mQ`O,59nOOQS'#Cr'#CrO#kQdO'#CsO'uQvO'#CuO(|QtO,5:OOOQO'#Cz'#CzO'hQWO'#CyO)bQWO'#C{OOQS'#Ef'#EfOOQO'#Dg'#DgO)gQ[O'#DnO)uQWO'#EhO$uQ[O'#DlO*TQWO'#DoOOQO'#Ei'#EiO%yQWO,5:]O*YQpO,5:_OOQS'#Dw'#DwO*bQWO,5:aO*gQ[O,5:aOOQO'#Dz'#DzO*oQWO,5:dO*tQWO,5:jO*|QWO,5:lOOQS-E8P-E8POOQP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#T#o?U#o~%QX@QQwPOy%Qz~%Q^@]QuUOy%Qz~%QX@fSOy%Qz#b%Q#b#c@r#c~%QX@wSqWOy%Qz#W%Q#W#XAT#X~%QXA[Q!_PqWOy%Qz~%QXAeSOy%Qz#f%Q#f#gAT#g~%QXAvQ!QPOy%Qz~%Q_BRQ!PVOy%Qz~%QZB^S!OPOy%Qz!_%Q!_!`2e!`~%Q",tokenizers:[Gs,pe,Ir,0,1,2,3],topRules:{StyleSheet:[0,3]},specialized:[{term:93,get:t=>El[t]||-1},{term:55,get:t=>Dl[t]||-1},{term:94,get:t=>jl[t]||-1}],tokenPrec:1060});let Il=null;function Gl(){if(!Il&&"object"==typeof document&&document.body){let t=[];for(var e in document.body.style)/[A-Z]|^-|^(item|length)$/.test(e)||t.push(e);Il=t.sort().map(t=>({type:"property",label:t}))}return Il||[]}const Bl=["active","after","before","checked","default","disabled","empty","enabled","first-child","first-letter","first-line","first-of-type","focus","hover","in-range","indeterminate","invalid","lang","last-child","last-of-type","link","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-of-type","only-child","optional","out-of-range","placeholder","read-only","read-write","required","root","selection","target","valid","visited"].map(t=>({type:"class",label:t})),Nl=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(t=>({type:"keyword",label:t})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(t=>({type:"constant",label:t}))),Ul=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(t=>({type:"type",label:t})),Fl=/^[\w-]*/;const Jl=Vr.define({parser:Hl.configure({props:[is.add({Declaration:ls()}),hs.add({Block:cs}),qo({"import charset namespace keyframes":No.definitionKeyword,"media supports":No.controlKeyword,"from to":No.keyword,NamespaceName:No.namespace,KeyframeName:No.labelName,TagName:No.typeName,ClassName:No.className,PseudoClassName:No.constant(No.className),not:No.operatorKeyword,IdName:No.labelName,"FeatureName PropertyName AttributeName":No.propertyName,NumberLiteral:No.number,KeywordQuery:No.keyword,UnaryQueryOp:No.operatorKeyword,callee:No.keyword,"CallTag ValueName":No.atom,Callee:No.variableName,Unit:No.unit,"UniversalSelector NestingSelector":No.definitionOperator,AtKeyword:No.keyword,MatchOp:No.compareOperator,"ChildOp SiblingOp, LogicOp":No.logicOperator,BinOp:No.arithmeticOperator,Important:No.modifier,Comment:No.blockComment,ParenthesizedContent:No.special(No.name),ColorLiteral:No.color,StringLiteral:No.string,":":No.punctuation,"PseudoOp #":No.derefOperator,"; ,":No.separator,"( )":No.paren,"[ ]":No.squareBracket,"{ }":No.brace})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/}});Jl.data.of({autocomplete:t=>{let{state:e,pos:i}=t,n=Yr(e).resolve(i,-1);if("PropertyName"==n.name)return{from:n.from,options:Gl(),span:Fl};if("ValueName"==n.name)return{from:n.from,options:Nl,span:Fl};if("PseudoClassName"==n.name)return{from:n.from,options:Bl,span:Fl};if("TagName"==n.name){for(let{parent:t}=n;t;t=t.parent)if("Block"==t.name)return{from:n.from,options:Gl(),span:Fl};return{from:n.from,options:Ul,span:Fl}}if(!t.explicit)return null;let r=n.resolve(i),s=r.childBefore(i);return s&&":"==s.name&&"PseudoClassSelector"==r.name?{from:i,options:Bl,span:Fl}:s&&":"==s.name&&"Declaration"==r.name||"ArgList"==r.name?{from:i,options:Nl,span:Fl}:"Block"==r.name?{from:i,options:Gl(),span:Fl}:null}});const Kl=[10,13,8232,8233],th=[9,11,12,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8239,8287,12288];function eh(e,i){for(let t=i-1;0<=t;t--){var n=e.get(t);if(-1{var n=e.start,r=t.get(n);(125==r||-1==r||eh(t,n))&&i.canShift(273)&&e.accept(273,e.start)},{contextual:!0,fallback:!0}),Gs=new cl((t,e,i)=>{var n=e.start,r=t.get(n++);if(!(-1{var n=e.start,r=t.get(n);43!=r&&45!=r||r!=t.get(n+1)||(i=!eh(t,e.start)&&i.canShift(1),e.accept(i?1:2,n+2))},{contextual:!0}),Ir=new cl((t,e)=>{let i=e.start,n=!1;for(;;){var r=t.get(i++);if(r<0){i-1>e.start&&e.accept(270,i-1);break}if(96==r){i==e.start+1?e.accept(272,i):e.accept(270,i-1);break}if(123==r&&n){i==e.start+2?e.accept(271,i):e.accept(270,i-2);break}if(10==r&&i>e.start+1){e.accept(270,i);break}92==r&&i!=t.length&&i++,n=36==r}});const ih={__proto__:null,export:16,as:21,from:25,default:30,async:35,function:36,this:46,true:54,false:54,void:58,typeof:62,null:76,super:78,new:112,await:129,yield:131,delete:132,class:142,extends:144,public:181,private:181,protected:181,readonly:183,in:202,instanceof:204,const:206,import:238,keyof:289,unique:293,infer:299,is:333,abstract:353,implements:355,type:357,let:360,var:362,interface:369,enum:373,namespace:379,module:381,declare:385,global:389,for:410,of:419,while:422,with:426,do:430,if:434,else:436,switch:440,case:446,try:452,catch:454,finally:456,return:460,throw:464,break:468,continue:472,debugger:476},nh={__proto__:null,async:99,get:101,set:103,public:151,private:151,protected:151,static:153,abstract:155,readonly:159,new:337},rh={__proto__:null,"<":119},sh=bl.deserialize({version:13,states:"$,lO]QYOOO&zQ!LdO'#CgO'ROSO'#DRO)ZQYO'#DWO)kQYO'#DcO)rQYO'#DmO-iQYO'#DsOOQO'#ET'#ETO-|QWO'#ESO.RQWO'#ESO0QQ!LdO'#IgO2hQ!LdO'#IhO3UQWO'#EqO3ZQpO'#FWOOQ!LS'#Ey'#EyO3cO!bO'#EyO3qQWO'#F_O4{QWO'#F^OOQ!LS'#Ih'#IhOOQ!LQ'#Ig'#IgOOQQ'#JR'#JRO5QQWO'#HeO5VQ!LYO'#HfOOQQ'#I['#I[OOQQ'#Hg'#HgQ]QYOOO)rQYO'#DeO5_QWO'#GRO5dQ#tO'#ClO5rQWO'#ERO5}Q#tO'#ExO6iQWO'#GRO6nQWO'#GVO6yQWO'#GVO7XQWO'#GYO7XQWO'#GZO7XQWO'#G]O5_QWO'#G`O7xQWO'#GcO9WQWO'#CcO9hQWO'#GpO9pQWO'#GvO9pQWO'#GxO]QYO'#GzO9pQWO'#G|O9pQWO'#HPO9uQWO'#HVO9zQ!LZO'#HZO)rQYO'#H]O:VQ!LZO'#H_O:bQ!LZO'#HaO5VQ!LYO'#HcO)rQYO'#IjOOOS'#Hh'#HhO:mOSO,59mOOQ!LS,59m,59mO=OQbO'#CgO=YQYO'#HiO=gQWO'#IlO?fQbO'#IlO'^QYO'#IlO?mQWO,59rO@TQ&jO'#D]O@|QWO'#ETOAZQWO'#IvOAfQWO'#IuOAnQWO,5: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_#R$t#R#S!2j#S#o$t#p~$ty!3]Z#{WO!Q$t!Q![!4O![!^$t!_!c$t!c!i!4O!i#R$t#R#S!4O#S#T$t#T#Z!4O#Z#o$t#p~$ty!4VZ#{WjqO!Q$t!Q![!4O![!^$t!_!c$t!c!i!4O!i#R$t#R#S!4O#S#T$t#T#Z!4O#Z#o$t#p~$t%w!5RR!WV#{W#d%hO!^$t!_#o$t#p~$t!P!5cR^w#{WO!^$t!_#o$t#p~$t+c!5wR'Ud![%Y#o&s'qP!P!Q!6Q!^!_!6V!_!`!6dW!6VO#}W#v!6[P#V#v!_!`!6_#v!6dO#f#v#v!6iO#W#v%w!6pT!t%o#{WO!^$t!_!`'V!`!a!7P!a#o$t#p~$t$P!7WR#O#w#{WO!^$t!_#o$t#p~$t%w!7lT'T!s#W#v#xS#{WO!^$t!_!`!7{!`!a!8]!a#o$t#p~$t$O!8SR#W#v#{WO!^$t!_#o$t#p~$t$O!8dT#V#v#{WO!^$t!_!`2l!`!a!8s!a#o$t#p~$t$O!8zS#V#v#{WO!^$t!_!`2l!`#o$t#p~$t%w!9_V'e%o#{WO!O$t!O!P!9t!P!^$t!_!a$t!a!b!:U!b#o$t#p~$t$`!9{Rr$W#{WO!^$t!_#o$t#p~$t$O!:]S#{W#a#vO!^$t!_!`2l!`#o$t#p~$t&e!:pRt&]#{WO!^$t!_#o$t#p~$tZ!;QRyR#{WO!^$t!_#o$t#p~$t$O!;bS#^#v#{WO!^$t!_!`2l!`#o$t#p~$t$P!;uR#{W']#wO!^$t!_#o$t#p~$t~!function(t,e){return"extends"==t&&e.dialectEnabled(1)?3:-1}(t,e)<<1|1},{term:277,get:t=>ih[t]||-1},{term:286,get:t=>nh[t]||-1},{term:58,get:t=>rh[t]||-1}],tokenPrec:11096});const oh=tr.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",maxHeight:"10em",listStyle:"none",margin:0,padding:0,"& > li":{cursor:"pointer",padding:"1px 1em 1px 3px",lineHeight:1.2},"& > li[aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"}}},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"300px"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class ah{constructor(t,e,i,n){this.field=t,this.line=e,this.from=i,this.to=n}}class lh{constructor(t,e,i){this.field=t,this.from=e,this.to=i}map(t){return new lh(this.field,t.mapPos(this.from,-1),t.mapPos(this.to,1))}}class hh{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(n,t){let e=[],r=[t];var s,i=n.doc.lineAt(t),o=/^\s*/.exec(i.text)[0];for(s of this.lines){if(e.length){let e=o,i=/^\t*/.exec(s)[0].length;for(let t=0;tnew lh(t.field,r[t.line]+t.from,r[t.line]+t.to));return{text:e,ranges:i}}static parse(t){let r=[],s=[],o=[],a;for(var l of t.split(/\r\n?|\n/)){for(;a=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(l);){let e=a[1]?+a[1]:null,i=a[2]||a[3],n=-1;for(let t=0;t=n&&h.field++}o.push(new ah(n,s.length,a.index,a.index+i.length)),l=l.slice(0,a.index)+i+l.slice(a.index+a[0].length)}s.push(l)}return new hh(s,o)}}let ch=Ye.widget({widget:new class extends qe{toDOM(){let t=document.createElement("span");return t.className="cm-snippetFieldPosition",t}ignoreEvent(){return!1}}}),Oh=Ye.mark({class:"cm-snippetField"});class dh{constructor(t,e){this.ranges=t,this.active=e,this.deco=Ye.set(t.map(t=>(t.from==t.to?ch:Oh).range(t.from,t.to)))}map(e){return new dh(this.ranges.map(t=>t.map(e)),this.active)}selectionInsideField(t){return t.ranges.every(e=>this.ranges.some(t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))}}const uh=rt.define({map(t,e){return t&&t.map(e)}}),fh=rt.define(),ph=M.define({create(){return null},update(t,e){for(var i of e.effects){if(i.is(uh))return i.value;if(i.is(fh)&&t)return new dh(t.ranges,i.value)}return t=(t=t&&e.docChanged?t.map(e.changes):t)&&e.selection&&!t.selectionInsideField(e.selection)?null:t},provide:t=>tr.decorations.from(t,t=>t?t.deco:Ye.none)});function mh(t,e){return _.create(t.filter(t=>t.field==e).map(t=>_.range(t.from,t.to)))}function gh(s){return({state:t,dispatch:e})=>{let i=t.field(ph,!1);if(!i||s<0&&0==i.active)return!1;let n=i.active+s,r=0t.field==n+s);return e(t.update({selection:mh(i.ranges,n),effects:uh.of(r?null:new dh(i.ranges,n))})),!0}}var vh,Qh,wh;const $h=[{key:"Tab",run:gh(1),shift:gh(-1)},{key:"Escape",run:({state:t,dispatch:e})=>{return!!t.field(ph,!1)&&(e(t.update({effects:uh.of(null)})),!0)}}],yh=L.define({combine(t){return t.length?t[0]:$h}}),bh=E.override(hr.compute([yh],t=>t.facet(yh)));function xh(t,e){return Object.assign(Object.assign({},e),{apply:function(t){let a=hh.parse(t);return(i,t,e,n)=>{var{text:r,ranges:s}=a.instantiate(i.state,e);let o={changes:{from:e,to:n,insert:d.of(r)}};if(s.length&&(o.selection=mh(s,0)),1t),bh,kh,oh]))}i.dispatch(i.state.update(o))}}(t)})}const kh=tr.domEventHandlers({mousedown(t,e){let i=e.state.field(ph,!1),n;if(!i||null==(n=e.posAtCoords({x:t.clientX,y:t.clientY})))return!1;let r=i.ranges.find(t=>t.from<=n&&t.to>=n);return!(!r||r.field==i.active)&&(e.dispatch({selection:mh(i.ranges,r.field),effects:uh.of(i.ranges.some(t=>t.field>r.field)?new dh(i.ranges,r.field):null)}),!0)}});xh("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),xh("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),xh("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),xh("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"block",type:"keyword"}),xh("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),xh('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),xh('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"});const Sh=Vr.define({parser:sh.configure({props:[is.add({IfStatement:ls({except:/^\s*({|else\b)/}),TryStatement:ls({except:/^\s*({|catch|finally)\b/}),LabeledStatement:t=>t.baseIndent,SwitchBody:t=>{var e=t.textAfter,i=/^\s*\}/.test(e),e=/^\s*(case|default)\b/.test(e);return t.baseIndent+(i?0:e?1:2)*t.unit},Block:([{closing:vh,align:Qh=!0,units:wh=1}]=[{closing:"}"}],t=>as(t,Qh,wh,vh)),ArrowFunction:t=>t.baseIndent+t.unit,"TemplateString BlockComment":()=>-1,"Statement Property":ls({except:/^{/}),JSXElement(t){var e=/^\s*<\//.test(t.textAfter);return t.lineIndent(t.state.doc.lineAt(t.node.from))+(e?0:t.unit)},JSXEscape(t){var e=/\s*\}/.test(t.textAfter);return t.lineIndent(t.state.doc.lineAt(t.node.from))+(e?0:t.unit)},"JSXOpenTag JSXSelfClosingTag"(t){return t.column(t.node.from)+t.unit}}),hs.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression":cs,BlockComment(t){return{from:t.from+2,to:t.to-2}}}),qo({"get set async static":No.modifier,"for while do if else switch try catch finally return throw break continue default case":No.controlKeyword,"in of await yield void typeof delete instanceof":No.operatorKeyword,"export import let var const function class extends":No.definitionKeyword,"with debugger from as new":No.keyword,TemplateString:No.special(No.string),Super:No.atom,BooleanLiteral:No.bool,this:No.self,null:No.null,Star:No.modifier,VariableName:No.variableName,"CallExpression/VariableName":No.function(No.variableName),VariableDefinition:No.definition(No.variableName),Label:No.labelName,PropertyName:No.propertyName,"CallExpression/MemberExpression/PropertyName":No.function(No.propertyName),"FunctionDeclaration/VariableDefinition":No.function(No.definition(No.variableName)),"ClassDeclaration/VariableDefinition":No.definition(No.className),PropertyNameDefinition:No.definition(No.propertyName),UpdateOp:No.updateOperator,LineComment:No.lineComment,BlockComment:No.blockComment,Number:No.number,String:No.string,ArithOp:No.arithmeticOperator,LogicOp:No.logicOperator,BitOp:No.bitwiseOperator,CompareOp:No.compareOperator,RegExp:No.regexp,Equals:No.definitionOperator,"Arrow : Spread":No.punctuation,"( )":No.paren,"[ ]":No.squareBracket,"{ }":No.brace,".":No.derefOperator,", ;":No.separator,TypeName:No.typeName,TypeDefinition:No.definition(No.typeName),"type enum interface implements namespace module declare":No.definitionKeyword,"abstract global privacy readonly":No.modifier,"is keyof unique infer":No.operatorKeyword,JSXAttributeValue:No.string,JSXText:No.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":No.angleBracket,"JSXIdentifier JSXNameSpacedName":No.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":No.propertyName})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}});Sh.configure({dialect:"ts"}),Sh.configure({dialect:"jsx"}),Sh.configure({dialect:"jsx ts"});no=Vr.define({parser:no.configure({props:[is.add({Element(t){var e=/^(\s*)(<\/)?/.exec(t.textAfter);return t.node.to<=t.pos+e[0].length?t.continue():t.lineIndent(t.state.doc.lineAt(t.node.from))+(e[2]?0:t.unit)},"OpenTag CloseTag SelfClosingTag"(t){return t.column(t.node.from)+t.unit},Document(e){if(e.pos+/\s*/.exec(e.textAfter)[0].length{if(t.is("Block")&&!t.is("Document"))return(t,e)=>({from:e.doc.lineAt(t.from).to,to:t.to})}),is.add({Document:()=>null}),Ar.add({Document:Ph})],htmlParser:no.parser.configure({dialect:"noMatch"})});const Th=Xh(no),Wh=Xh(no.configure([Is,Ds,Os,{defineNodes:["Emoji"],parseInline:[{name:"Emoji",parse(t,e,i){let n;return 58==e&&(n=/^[a-zA-Z_0-9]+:/.exec(t.slice(i+1,t.end)))?t.addElement(t.elt("Emoji",i,i+1+n[0].length)):-1}}]},{props:[qo({"TableDelimiter SubscriptMark SuperscriptMark StrikethroughMark":No.processingInstruction,"TableHeader/...":No.heading,"Strikethrough/...":No.deleted,TaskMarker:No.atom,Task:No.list,Emoji:No.character,"Subscript Superscript":No.special(No.content),TableCell:No.content})]}]));function Xh(t){return new zr(Ph,t,t.nodeSet.types.find(t=>"Document"==t.name))}function Rh(t,e){return e.sliceString(t.from,t.from+50)}function _h(e,n,r){let s=[];for(let t=e;t&&"Document"!=t.name;t=t.parent)"ListItem"!=t.name&&"Blockquote"!=t.name||s.push(t);let o=[],a=0;for(let i=s.length-1;0<=i;i--){let t=s[i],e;var l;"Blockquote"==t.name&&(e=/^\s*> ?/.exec(n.slice(a)))?(o.push({from:a,string:e[0],node:t}),a+=e[0].length):"ListItem"==t.name&&"OrderedList"==t.parent.name&&(e=/^\s*\d+([.)])\s*/.exec(Rh(t,r)))?(l=4<=e[1].length?e[0].length-e[1].length+1:e[0].length,o.push({from:a,string:n.slice(a,a+l).replace(/\S/g," "),node:t}),a+=l):"ListItem"==t.name&&"BulletList"==t.parent.name&&(e=/^\s*[-+*] (\s*)/.exec(Rh(t,r)))&&(l=4<=e[1].length?e[0].length-e[1].length:e[0].length,o.push({from:a,string:n.slice(a,a+l).replace(/\S/g," "),node:t}),a+=l)}return o}const Ch=[{key:"Enter",run:({state:a,dispatch:t})=>{let i=Yr(a),e=null,n=a.changeByRange(o=>{if(o.empty&&Wh.isActiveAt(a,o.from)){let n=a.doc.lineAt(o.from),t=_h(i.resolve(o.from,-1),n.text,a.doc),r=o.from,s=[];if(t.length){let e=t[t.length-1],i=e.from+e.string.length;if(o.from-n.from>=i&&!/\S/.test(n.text.slice(i,o.from-n.from))){let t=/List/.test(e.node.name)?e.from:i;for(;0=n.from?e.string=n.text.slice(e.from,e.from+e.string.length):e.string=/^\s*/.exec(n.text)[0].slice(0,e.string.length),"OrderedList"==e.node.parent.name&&r==o.from&&(e.string=e.string.replace(/\d+/,t=>+t+1),function(i,n,r){for(let t=-1,e=i;;){if("ListItem"==e.name){var s=/^(\s*)(\d+)(?=[.)])/.exec(n.sliceString(e.from,e.from+10));if(!s)return;var o=+s[2];if(0<=t){if(o!=t+1)return;r.push({from:e.from+s[1].length,to:e.from+s[0].length,insert:String(t+2)})}t=o}o=e.nextSibling;if(!o)break;e=o}}(e.node,a.doc,s))))}let e=t.map(t=>t.string).join("");return o.from-n.from{let o=Yr(s),a=null,e=s.changeByRange(e=>{if(e.empty&&Wh.isActiveAt(s,e.from)){let t=s.doc.lineAt(e.from);var i=_h(o.resolve(e.from,-1),t.text,s.doc);if(i.length){var n=i[i.length-1],r=n.from+n.string.length;if(e.from>r+t.from&&!/\S/.test(t.text.slice(r,e.from-t.from)))return{range:_.cursor(r+t.from),changes:{from:r+t.from,to:e.from}};if(e.from-t.from==r){i=t.from+n.from;return"ListItem"==n.node.name&&n.node.parent.from'},{type:"redo",title:"重做",innerHTML:''},{type:"bold",title:"加粗",innerHTML:''},{type:"italic",title:"倾斜",innerHTML:''},{type:"delete",title:"删除",innerHTML:''},{type:"code-inline",title:"行内代码",innerHTML:''},{type:"hr",title:"横线",innerHTML:''},{type:"quote",title:"引用",innerHTML:''},{type:"title",title:"标题",innerHTML:''},{type:"ordered-list",title:"有序列表",innerHTML:''},{type:"unordered-list",title:"无序列表",innerHTML:''},{type:"link",title:"超链接",innerHTML:''},{type:"image",title:"插入图片",innerHTML:''},{type:"table",title:"表格",innerHTML:''},{type:"code-block",title:"代码块",innerHTML:''},{type:"html",title:"原生HTML",innerHTML:''},{type:"time",title:"当前时间",innerHTML:''},{type:"indent",title:"缩进",innerHTML:''},{type:"character",title:"实体符号",innerHTML:''},{type:"emoji",title:"符号表情",innerHTML:''},{type:"expression",title:"图片表情",innerHTML:''},{type:"task-no",title:"任务 - 未完成",innerHTML:''},{type:"task-yes",title:"任务 - 已完成",innerHTML:''},{type:"mtitle",title:"居中标题",innerHTML:''},{type:"dplayer",title:"M3U8/MP4视频",innerHTML:''},{type:"bilibili",title:"哔哩哔哩视频",innerHTML:''},{type:"netease-list",title:"网易云列表",innerHTML:''},{type:"netease-single",title:"网易云单首",innerHTML:''},{type:"abtn",title:"多彩按钮",innerHTML:''},{type:"anote",title:"便条按钮",innerHTML:''},{type:"dotted",title:"彩色虚线",innerHTML:''},{type:"hide",title:"回复可见",innerHTML:''},{type:"card-default",title:"默认卡片",innerHTML:''},{type:"message",title:"消息提示",innerHTML:''},{type:"progress",title:"进度条",innerHTML:''},{type:"callout",title:"标注",innerHTML:''},{type:"mp3",title:"外部音乐",innerHTML:''},{type:"tabs",title:"标签页",innerHTML:''},{type:"card-list",title:"卡片列表",innerHTML:''},{type:"timeline",title:"时间轴",innerHTML:''},{type:"copy",title:"复制文本",innerHTML:''},{type:"card-describe",title:"描述卡片",innerHTML:''},{type:"lamp",title:"跑马灯",innerHTML:''},{type:"collapse",title:"折叠面板",innerHTML:''},{type:"cloud",title:"云盘下载",innerHTML:''},{type:"gird",title:"宫格",innerHTML:''},{type:"alert",title:"提示",innerHTML:''},{type:"clean",title:"清屏",innerHTML:''},{type:"download",title:"下载",innerHTML:''},{type:"fullScreen",title:"全屏/取消全屏",innerHTML:''},{type:"preview",title:"预览/取消预览",innerHTML:''},{type:"draft",title:"保存草稿",innerHTML:''},{type:"publish",title:"发布文章",innerHTML:''},{type:"about",title:"关于",innerHTML:''}];const zh=new HyperDown,qh=window.JoeConfig.playerAPI;function Vh(t){if(!window.JoeConfig.canPreview)return $(".cm-preview-content").html("1. 预览已默认关闭
2. 点击上方预览按钮启用预览
3. 若编辑器卡顿可尝试关闭预览");-1!==t.indexOf(" ")&&(t=t.replace(/ /g," ")),-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=-1!==(t=(t=(t=zh.makeHtml(t)).replace(/\:\:\(\s*(呵呵|哈哈|吐舌|太开心|笑眼|花心|小乖|乖|捂嘴笑|滑稽|你懂的|不高兴|怒|汗|黑线|泪|真棒|喷|惊哭|阴险|鄙视|酷|啊|狂汗|what|疑问|酸爽|呀咩爹|委屈|惊讶|睡觉|笑尿|挖鼻|吐|犀利|小红脸|懒得理|勉强|爱心|心碎|玫瑰|礼物|彩虹|太阳|星星月亮|钱币|茶杯|蛋糕|大拇指|胜利|haha|OK|沙发|手纸|香蕉|便便|药丸|红领巾|蜡烛|音乐|灯泡|开心|钱|咦|呼|冷|生气|弱|吐血|狗头)\s*\)/g,function(t,e){return e=encodeURI(e).replace(/%/g,""),``})).replace(/\:\@\(\s*(高兴|小怒|脸红|内伤|装大款|赞一个|害羞|汗|吐血倒地|深思|不高兴|无语|亲亲|口水|尴尬|中指|想一想|哭泣|便便|献花|皱眉|傻笑|狂汗|吐|喷水|看不见|鼓掌|阴暗|长草|献黄瓜|邪恶|期待|得意|吐舌|喷血|无所谓|观察|暗地观察|肿包|中枪|大囧|呲牙|抠鼻|不说话|咽气|欢呼|锁眉|蜡烛|坐等|击掌|惊喜|喜极而泣|抽烟|不出所料|愤怒|无奈|黑线|投降|看热闹|扇耳光|小眼睛|中刀)\s*\)/g,function(t,e){return e=encodeURI(e).replace(/%/g,""),``})).indexOf("{lamp")?t.replace(/{lamp\/}/g,''):t).indexOf("{x}")?t.replace(/{x}/g,''):t).indexOf("{ }")?t.replace(/{ }/g,''):t).indexOf("{mtitle")?t.replace(/{mtitle([^}]*)\/}/g,""):t).indexOf("{dplayer")?t.replace(/{dplayer([^}]*)\/}/g,''):t).indexOf("{bilibili")?t.replace(/{bilibili([^}]*)\/}/g,""):t).indexOf("{music-list")?t.replace(/{music-list([^}]*)\/}/g,""):t).indexOf("{music")?t.replace(/{music([^}]*)\/}/g,""):t).indexOf("{mp3")?t.replace(/{mp3([^}]*)\/}/g,""):t).indexOf("{abtn")?t.replace(/{abtn([^}]*)\/}/g,""):t).indexOf("{anote")?t.replace(/{anote([^}]*)\/}/g,""):t).indexOf("{copy")?t.replace(/{copy([^}]*)\/}/g,""):t).indexOf("{dotted")?t.replace(/{dotted([^}]*)\/}/g,""):t).indexOf("{message")?t.replace(/{message([^}]*)\/}/g,""):t).indexOf("{progress")?t.replace(/{progress([^}]*)\/}/g,""):t).indexOf("{cloud")?t.replace(/{cloud([^}]*)\/}/g,""):t).indexOf("{hide")?t.replace(/{hide[^}]*}([\s\S]*?){\/hide}/g,""):t).indexOf("{card-default")?t.replace(/{card-default([^}]*)}([\s\S]*?){\/card-default}/g,'
'):t).indexOf("{callout")?t.replace(/{callout([^}]*)}([\s\S]*?){\/callout}/g,'
'):t).indexOf("{card-describe")?t.replace(/{card-describe([^}]*)}([\s\S]*?){\/card-describe}/g,'
'):t).indexOf("{tabs")?t.replace(/{tabs}([\s\S]*?){\/tabs}/g,'
'):t).indexOf("{card-list")?t.replace(/{card-list}([\s\S]*?){\/card-list}/g,'
'):t).indexOf("{timeline")?t.replace(/{timeline}([\s\S]*?){\/timeline}/g,'
'):t).indexOf("{collapse")?t.replace(/{collapse}([\s\S]*?){\/collapse}/g,'
'):t).indexOf("{alert")?t.replace(/{alert([^}]*)}([\s\S]*?){\/alert}/g,'
'):t).indexOf("{gird")&&(t=t.replace(/{gird([^}]*)}([\s\S]*?){\/gird}/g,'
')),$(".cm-preview-content").html(t),$(".cm-preview-content p:empty").remove(),$(".cm-preview-content pre code").each((t,e)=>Prism.highlightElement(e))}class Yh extends class{constructor(){$("body").append(`
@@ -281,4 +281,4 @@
- `),Mh($("#text").val());let e=null;const s=new tr({state:pt.create({doc:$("#text").val(),extensions:[...this.plugins,zh({base:Rh}),hr.of([po,...fo,..._o,...Ws]),tr.updateListener.of(t=>{t.docChanged&&e!==t.state.doc.toString()&&(e=t.state.doc.toString(),window.requestAnimationFrame?window.requestAnimationFrame(()=>Mh(t.state.doc.toString())):Mh(t.state.doc.toString()))}),tr.domEventHandlers({paste:e=>{var n=e.clipboardData;if(n&&n.items){const r=n.items;if(r.length){let i=null;for(let t=0;t{const t=$.ajaxSettings.xhr();if(t.upload)return t.upload.addEventListener("progress",t=>{t=t.loaded/t.total*100;$(".cm-progress-left").width(t/2+"%"),$(".cm-progress-right").width(t/2+"%")},!1),t},success:t=>{$(".cm-progress-left").width(0),$(".cm-progress-right").width(0),this._isPasting=!1;t=`${super._getLineCh(s)?"\n":""}![${t[1].title}](${t[0]})\n`;super._replaceSelection(s,t),s.focus()},error:()=>{$(".cm-progress-left").width(0),$(".cm-progress-right").width(0),this._isPasting=!1}})}}}}}}})],tabSize:4})});$(".cm-mainer").prepend(s.dom),$("#text")[0].form&&$("#text")[0].form.addEventListener("submit",()=>$("#text").val(s.state.doc.toString())),this.cm=s}init_Preview(){const n=(t,e,i)=>{let n=e+(t-i);n<=0&&(n=0),n>=$(".cm-mainer").outerWidth()-16&&(n=$(".cm-mainer").outerWidth()-16),$(".cm-preview").width(n)};$(".cm-resize").on({mousedown:t=>{t.preventDefault(),t.stopPropagation();const e=$(".cm-preview").outerWidth(),i=t.clientX;return $(".cm-preview").addClass("move"),document.onmousemove=t=>{window.requestAnimationFrame?requestAnimationFrame(()=>n(i,e,t.clientX)):n(i,e,t.clientX)},!(document.onmouseup=()=>{document.onmousemove=null,document.onmouseup=null,$(".cm-preview").removeClass("move")})},touchstart:t=>{t.preventDefault(),t.stopPropagation();const e=$(".cm-preview").outerWidth(),i=t.originalEvent.targetTouches[0].clientX;return $(".cm-preview").addClass("move"),document.ontouchmove=t=>{window.requestAnimationFrame?requestAnimationFrame(()=>n(i,e,t.targetTouches[0].clientX)):n(i,e,t.targetTouches[0].clientX)},!(document.ontouchend=()=>{document.ontouchmove=null,document.ontouchend=null,$(".cm-preview").removeClass("move")})}})}init_Tools(){qh.forEach(e=>{if("title"===e.type)super.handleTitle(this.cm,e);else{const i=$(`
${e.innerHTML}
`);i.on("click",t=>{switch(t.preventDefault(),e.type){case"fullScreen":super.handleFullScreen(i);break;case"publish":super.handlePublish();break;case"undo":super.handleUndo(this.cm);break;case"redo":super.handleRedo(this.cm);break;case"time":super.handleTime(this.cm);break;case"bold":super._insetAmboText(this.cm,"**");break;case"italic":super._insetAmboText(this.cm,"*");break;case"delete":super._insetAmboText(this.cm,"~~");break;case"code-inline":super._insetAmboText(this.cm,"`");break;case"indent":super.handleIndent(this.cm);break;case"hr":super.handleHr(this.cm);break;case"clean":super.handleClean(this.cm);break;case"ordered-list":super.handleOrdered(this.cm);break;case"unordered-list":super.handleUnordered(this.cm);break;case"quote":super.handleQuote(this.cm);break;case"download":super.handleDownload(this.cm);break;case"link":super.handleLink(this.cm);break;case"image":super.handleImage(this.cm);break;case"table":super.handleTable(this.cm);break;case"code-block":super.handleCodeBlock(this.cm);break;case"about":super.handleAbout();break;case"character":super._createTableLists(this.cm,JoeConfig.characterAPI,"星星符号","字符大全");break;case"emoji":super._createTableLists(this.cm,JoeConfig.emojiAPI,"表情","符号表情(需数据库支持)");break;case"task-no":super.handleTask(this.cm,!1);break;case"task-yes":super.handleTask(this.cm,!0);break;case"netease-list":super.handleNetease(this.cm,!0);break;case"netease-single":super.handleNetease(this.cm,!1);break;case"bilibili":super.handleBilibili(this.cm);break;case"dplayer":super.handleDplayer(this.cm);break;case"draft":super.handleDraft();break;case"expression":super.handleExpression(this.cm);break;case"mtitle":super.handleMtitle(this.cm);break;case"html":super.handleHtml(this.cm);break;case"abtn":super.handleAbtn(this.cm);break;case"anote":super.handleAnote(this.cm);break;case"dotted":super.handleDotted(this.cm);break;case"hide":super.handleHide(this.cm);break;case"card-default":super.handleCardDefault(this.cm);break;case"message":super.handleMessage(this.cm);break;case"progress":super.handleProgress(this.cm);break;case"callout":super.handleCallout(this.cm);break;case"mp3":super.handleMp3(this.cm);break;case"tabs":super.handleTabs(this.cm);break;case"card-list":super.handleCardList(this.cm);break;case"timeline":super.handleTimeline(this.cm);break;case"copy":super.handleCopy(this.cm);break;case"card-describe":super.handleCardDescribe(this.cm);break;case"lamp":super.handleLamp(this.cm);break;case"collapse":super.handleCollapse(this.cm);break;case"cloud":super.handleCloud(this.cm);break;case"gird":super.handleGird(this.cm);break;case"alert":super.handleAlert(this.cm);break;case"preview":i.toggleClass("active"),i.hasClass("active")?window.JoeConfig.canPreview=!0:window.JoeConfig.canPreview=!1,Mh(this.cm.state.doc.toString())}}),$(".cm-tools").append(i)}})}init_Insert(){Typecho.insertFileToEditor=(t,e,i)=>{e=`${super._getLineCh(this.cm)?"\n":""}${i?"!":""}[${t}](${e})\n`;super._replaceSelection(this.cm,e),this.cm.focus()}}init_AutoSave(){if(1===window.JoeConfig.autoSave){const t=$("#text")[0].form;let n=$('input[name="cid"]').val(),r=null;setInterval(()=>{$('input[name="cid"]').val(n),$("#text").val(this.cm.state.doc.toString());let i=$(t).serialize();i!==r&&($(".cm-autosave").addClass("active"),$.ajax({url:t.action,type:"POST",data:i+"&do=save",dataType:"json",success:t=>{n=t.cid,r=i;let e=setTimeout(()=>{$(".cm-autosave").removeClass("active"),clearTimeout(e)},1e3)}}))},5e3)}}}document.addEventListener("DOMContentLoaded",()=>new Zh)}(); + `),Vh($("#text").val());let e=null;const s=new tr({state:pt.create({doc:$("#text").val(),extensions:[...this.plugins,Ah({base:Wh}),hr.of([po,...Ws,...fo,..._o]),tr.updateListener.of(t=>{t.docChanged&&e!==t.state.doc.toString()&&(e=t.state.doc.toString(),window.requestAnimationFrame?window.requestAnimationFrame(()=>Vh(t.state.doc.toString())):Vh(t.state.doc.toString()))}),tr.domEventHandlers({paste:e=>{var n=e.clipboardData;if(n&&n.items){const r=n.items;if(r.length){let i=null;for(let t=0;t{const t=$.ajaxSettings.xhr();if(t.upload)return t.upload.addEventListener("progress",t=>{t=t.loaded/t.total*100;$(".cm-progress-left").width(t/2+"%"),$(".cm-progress-right").width(t/2+"%")},!1),t},success:t=>{$(".cm-progress-left").width(0),$(".cm-progress-right").width(0),this._isPasting=!1;t=`${super._getLineCh(s)?"\n":""}![${t[1].title}](${t[0]})\n`;super._replaceSelection(s,t),s.focus()},error:()=>{$(".cm-progress-left").width(0),$(".cm-progress-right").width(0),this._isPasting=!1}})}}}}}}})],tabSize:4})});$(".cm-mainer").prepend(s.dom),$("#text")[0].form&&$("#text")[0].form.addEventListener("submit",()=>$("#text").val(s.state.doc.toString())),this.cm=s}init_Preview(){const n=(t,e,i)=>{let n=e+(t-i);n<=0&&(n=0),n>=$(".cm-mainer").outerWidth()-16&&(n=$(".cm-mainer").outerWidth()-16),$(".cm-preview").width(n)};$(".cm-resize").on({mousedown:t=>{t.preventDefault(),t.stopPropagation();const e=$(".cm-preview").outerWidth(),i=t.clientX;return $(".cm-preview").addClass("move"),document.onmousemove=t=>{window.requestAnimationFrame?requestAnimationFrame(()=>n(i,e,t.clientX)):n(i,e,t.clientX)},!(document.onmouseup=()=>{document.onmousemove=null,document.onmouseup=null,$(".cm-preview").removeClass("move")})},touchstart:t=>{t.preventDefault(),t.stopPropagation();const e=$(".cm-preview").outerWidth(),i=t.originalEvent.targetTouches[0].clientX;return $(".cm-preview").addClass("move"),document.ontouchmove=t=>{window.requestAnimationFrame?requestAnimationFrame(()=>n(i,e,t.targetTouches[0].clientX)):n(i,e,t.targetTouches[0].clientX)},!(document.ontouchend=()=>{document.ontouchmove=null,document.ontouchend=null,$(".cm-preview").removeClass("move")})}})}init_Tools(){Lh.forEach(e=>{if("title"===e.type)super.handleTitle(this.cm,e);else{const i=$(`
${e.innerHTML}
`);i.on("click",t=>{switch(t.preventDefault(),e.type){case"fullScreen":super.handleFullScreen(i);break;case"publish":super.handlePublish();break;case"undo":super.handleUndo(this.cm);break;case"redo":super.handleRedo(this.cm);break;case"time":super.handleTime(this.cm);break;case"bold":super._insetAmboText(this.cm,"**");break;case"italic":super._insetAmboText(this.cm,"*");break;case"delete":super._insetAmboText(this.cm,"~~");break;case"code-inline":super._insetAmboText(this.cm,"`");break;case"indent":super.handleIndent(this.cm);break;case"hr":super.handleHr(this.cm);break;case"clean":super.handleClean(this.cm);break;case"ordered-list":super.handleOrdered(this.cm);break;case"unordered-list":super.handleUnordered(this.cm);break;case"quote":super.handleQuote(this.cm);break;case"download":super.handleDownload(this.cm);break;case"link":super.handleLink(this.cm);break;case"image":super.handleImage(this.cm);break;case"table":super.handleTable(this.cm);break;case"code-block":super.handleCodeBlock(this.cm);break;case"about":super.handleAbout();break;case"character":super._createTableLists(this.cm,JoeConfig.characterAPI,"星星符号","字符大全");break;case"emoji":super._createTableLists(this.cm,JoeConfig.emojiAPI,"表情","符号表情(需数据库支持)");break;case"task-no":super.handleTask(this.cm,!1);break;case"task-yes":super.handleTask(this.cm,!0);break;case"netease-list":super.handleNetease(this.cm,!0);break;case"netease-single":super.handleNetease(this.cm,!1);break;case"bilibili":super.handleBilibili(this.cm);break;case"dplayer":super.handleDplayer(this.cm);break;case"draft":super.handleDraft();break;case"expression":super.handleExpression(this.cm);break;case"mtitle":super.handleMtitle(this.cm);break;case"html":super.handleHtml(this.cm);break;case"abtn":super.handleAbtn(this.cm);break;case"anote":super.handleAnote(this.cm);break;case"dotted":super.handleDotted(this.cm);break;case"hide":super.handleHide(this.cm);break;case"card-default":super.handleCardDefault(this.cm);break;case"message":super.handleMessage(this.cm);break;case"progress":super.handleProgress(this.cm);break;case"callout":super.handleCallout(this.cm);break;case"mp3":super.handleMp3(this.cm);break;case"tabs":super.handleTabs(this.cm);break;case"card-list":super.handleCardList(this.cm);break;case"timeline":super.handleTimeline(this.cm);break;case"copy":super.handleCopy(this.cm);break;case"card-describe":super.handleCardDescribe(this.cm);break;case"lamp":super.handleLamp(this.cm);break;case"collapse":super.handleCollapse(this.cm);break;case"cloud":super.handleCloud(this.cm);break;case"gird":super.handleGird(this.cm);break;case"alert":super.handleAlert(this.cm);break;case"preview":i.toggleClass("active"),i.hasClass("active")?window.JoeConfig.canPreview=!0:window.JoeConfig.canPreview=!1,Vh(this.cm.state.doc.toString())}}),$(".cm-tools").append(i)}})}init_Insert(){Typecho.insertFileToEditor=(t,e,i)=>{e=`${super._getLineCh(this.cm)?"\n":""}${i?"!":""}[${t}](${e})\n`;super._replaceSelection(this.cm,e),this.cm.focus()}}init_AutoSave(){if(1===window.JoeConfig.autoSave){const t=$("#text")[0].form;let n=$('input[name="cid"]').val(),r=null;setInterval(()=>{$('input[name="cid"]').val(n),$("#text").val(this.cm.state.doc.toString());let i=$(t).serialize();i!==r&&($(".cm-autosave").addClass("active"),$.ajax({url:t.action,type:"POST",data:i+"&do=save",dataType:"json",success:t=>{n=t.cid,r=i;let e=setTimeout(()=>{$(".cm-autosave").removeClass("active"),clearTimeout(e)},1e3)}}))},5e3)}}}document.addEventListener("DOMContentLoaded",()=>new Yh)}(); diff --git a/typecho/write/js/joe.write.js b/typecho/write/js/joe.write.js index a78b809..31b635b 100644 --- a/typecho/write/js/joe.write.js +++ b/typecho/write/js/joe.write.js @@ -51,9 +51,9 @@ class Joe extends JoeAction { extensions: [ ...this.plugins, markdown({ - base: markdownLanguage, + base: markdownLanguage }), - keymap.of([defaultTabBinding, ...defaultKeymap, ...historyKeymap, ...closeBracketsKeymap]), + keymap.of([defaultTabBinding, ...closeBracketsKeymap, ...defaultKeymap, ...historyKeymap]), EditorView.updateListener.of(update => { if (!update.docChanged) return; if (_temp !== update.state.doc.toString()) { diff --git a/typecho/write/package.json b/typecho/write/package.json index e5b1454..d265372 100644 --- a/typecho/write/package.json +++ b/typecho/write/package.json @@ -4,11 +4,10 @@ }, "dependencies": { "@codemirror/closebrackets": "^0.18.0", - "@codemirror/commands": "^0.18.1", + "@codemirror/commands": "^0.18.2", "@codemirror/highlight": "^0.18.3", "@codemirror/history": "^0.18.1", - "@codemirror/lang-markdown": "^0.18.1", - "@codemirror/language-data": "^0.18.0", + "@codemirror/lang-markdown": "^0.18.2", "@codemirror/matchbrackets": "^0.18.0", "@codemirror/state": "^0.18.7", "@codemirror/view": "^0.18.11",