diff --git a/package-lock.json b/package-lock.json index 724cfa5cfe..b8b9e23329 100644 --- a/package-lock.json +++ b/package-lock.json @@ -26,6 +26,7 @@ "@tiptap/extension-code": "3.0.0-beta.5", "@tiptap/extension-code-block": "3.0.0-beta.5", "@tiptap/extension-document": "3.0.0-beta.5", + "@tiptap/extension-dropcursor": "3.0.0-beta.5", "@tiptap/extension-heading": "3.0.0-beta.5", "@tiptap/extension-image": "3.0.0-beta.5", "@tiptap/extension-italic": "3.0.0-beta.5", @@ -1763,9 +1764,9 @@ } }, "node_modules/@codemirror/view": { - "version": "6.36.8", - "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.36.8.tgz", - "integrity": "sha512-yoRo4f+FdnD01fFt4XpfpMCcCAo9QvZOtbrXExn4SqzH32YC6LgzqxfLZw/r6Ge65xyY03mK/UfUqrVw1gFiFg==", + "version": "6.37.0", + "resolved": "https://registry.npmjs.org/@codemirror/view/-/view-6.37.0.tgz", + "integrity": "sha512-ghHIeRGfWB8h9Tc3sMdr7D5zp4sZvlCzG36Xjdh2ymmfAwvSaCJAAsL3HLyLEnHcE953+5Uox1bx5OS+YCW/7Q==", "dev": true, "dependencies": { "@codemirror/state": "^6.5.0", @@ -2526,6 +2527,19 @@ "@tiptap/core": "3.0.0-beta.5" } }, + "node_modules/@tiptap/extension-dropcursor": { + "version": "3.0.0-beta.5", + "resolved": "https://registry.npmjs.org/@tiptap/extension-dropcursor/-/extension-dropcursor-3.0.0-beta.5.tgz", + "integrity": "sha512-KHt81vuiatLhRcHXE7QTAihAi+dOnr0u472K8RlajnWe7BA0RUZZGOoos+rAhVTJPTDGdNH4m6nVZnjIS/+ozw==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extensions": "3.0.0-beta.5" + } + }, "node_modules/@tiptap/extension-heading": { "version": "3.0.0-beta.5", "resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-3.0.0-beta.5.tgz", @@ -3983,9 +3997,9 @@ } }, "node_modules/browserslist": { - "version": "4.24.5", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.24.5.tgz", - "integrity": "sha512-FDToo4Wo82hIdgc1CQ+NQD0hEhmpPjrZ3hiUgwgOG6IuTdlpr8jdjyG24P6cNP1yJpTLzS5OcGgSw0xmDU1/Tw==", + "version": "4.25.0", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.25.0.tgz", + "integrity": "sha512-PJ8gYKeS5e/whHBh8xrwYK+dAvEj7JXtz6uTucnMRB8OiGTsKccFekoRrjajPBHV8oOY+2tI4uxeceSimKwMFA==", "dev": true, "funding": [ { @@ -4002,8 +4016,8 @@ } ], "dependencies": { - "caniuse-lite": "^1.0.30001716", - "electron-to-chromium": "^1.5.149", + "caniuse-lite": "^1.0.30001718", + "electron-to-chromium": "^1.5.160", "node-releases": "^2.0.19", "update-browserslist-db": "^1.1.3" }, @@ -4131,9 +4145,9 @@ } }, "node_modules/caniuse-lite": { - "version": "1.0.30001718", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001718.tgz", - "integrity": "sha512-AflseV1ahcSunK53NfEs9gFWgOEmzr0f+kaMFA4xiLZlr9Hzt7HxcSpIFcnNCUkz6R6dWKa54rUz3HUmI3nVcw==", + "version": "1.0.30001720", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001720.tgz", + "integrity": "sha512-Ec/2yV2nNPwb4DnTANEV99ZWwm3ZWfdlfkQbWSDDt+PsXEVYwlhPH8tdMaPunYTKKmz7AnHi2oNEi1GcmKCD8g==", "dev": true, "funding": [ { @@ -5253,9 +5267,9 @@ "dev": true }, "node_modules/electron-to-chromium": { - "version": "1.5.159", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.159.tgz", - "integrity": "sha512-CEvHptWAMV5p6GJ0Lq8aheyvVbfzVrv5mmidu1D3pidoVNkB3tTBsTMVtPJ+rzRK5oV229mCLz9Zj/hNvU8GBA==", + "version": "1.5.161", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.161.tgz", + "integrity": "sha512-hwtetwfKNZo/UlwHIVBlKZVdy7o8bIZxxKs0Mv/ROPiQQQmDgdm5a+KvKtBsxM8ZjFzTaCeLoodZ8jiBE3o9rA==", "dev": true }, "node_modules/elliptic": { @@ -5347,9 +5361,9 @@ } }, "node_modules/es-abstract": { - "version": "1.23.10", - "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.23.10.tgz", - "integrity": "sha512-MtUbM072wlJNyeYAe0mhzrD+M6DIJa96CZAOBBrhDbgKnB4MApIKefcyAB1eOdYn8cUNZgvwBvEzdoAYsxgEIw==", + "version": "1.24.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.24.0.tgz", + "integrity": "sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==", "dev": true, "dependencies": { "array-buffer-byte-length": "^1.0.2", @@ -5379,7 +5393,9 @@ "is-array-buffer": "^3.0.5", "is-callable": "^1.2.7", "is-data-view": "^1.0.2", + "is-negative-zero": "^2.0.3", "is-regex": "^1.2.1", + "is-set": "^2.0.3", "is-shared-array-buffer": "^1.0.4", "is-string": "^1.1.1", "is-typed-array": "^1.1.15", @@ -5394,6 +5410,7 @@ "safe-push-apply": "^1.0.0", "safe-regex-test": "^1.1.0", "set-proto": "^1.0.0", + "stop-iteration-iterator": "^1.1.0", "string.prototype.trim": "^1.2.10", "string.prototype.trimend": "^1.0.9", "string.prototype.trimstart": "^1.0.8", @@ -7250,6 +7267,18 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/is-negative-zero": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.3.tgz", + "integrity": "sha512-5KoIu2Ngpyek75jXodFvnafB6DJgr3u8uuK0LEZJjrU19DrMD3EVERaR8sjz8CCGgpZvxPl9SuE1GMVPFHx1mw==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", @@ -8901,9 +8930,9 @@ } }, "node_modules/postcss": { - "version": "8.5.3", - "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.3.tgz", - "integrity": "sha512-dle9A3yYxlBSrt8Fu+IpjGT8SY8hN0mlaA6GY8t0P5PjIOZemULz/E2Bnm/2dcUOena75OTNkHI76uZBNUUq3A==", + "version": "8.5.4", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.4.tgz", + "integrity": "sha512-QSa9EBe+uwlGTFmHsPKokv3B/oEMQZxfqW0QqNCyhpa6mB1afzulwn8hihglqAb2pOw+BJgNlmXQ8la2VeHB7w==", "dev": true, "funding": [ { @@ -8920,7 +8949,7 @@ } ], "dependencies": { - "nanoid": "^3.3.8", + "nanoid": "^3.3.11", "picocolors": "^1.1.1", "source-map-js": "^1.2.1" }, @@ -10985,6 +11014,19 @@ "integrity": "sha512-UGvjygr6F6tpH7o2qyqR6QYpwraIjKSdtzyBdyytFOHmPZY917kwdwLG0RbOjWOnKmnm3PeHjaoLLMie7kPLQw==", "dev": true }, + "node_modules/stop-iteration-iterator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/stop-iteration-iterator/-/stop-iteration-iterator-1.1.0.tgz", + "integrity": "sha512-eLoXW/DHyl62zxY4SCaIgnRhuMr6ri4juEYARS8E6sCEqzKpOiE521Ucofdx+KnDZl5xmvGYaaKCk5FEOxJCoQ==", + "dev": true, + "dependencies": { + "es-errors": "^1.3.0", + "internal-slot": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + } + }, "node_modules/stream-browserify": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/stream-browserify/-/stream-browserify-2.0.2.tgz", diff --git a/package.json b/package.json index ebcca81793..2e45dd6f0c 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,7 @@ "@tiptap/extension-code": "3.0.0-beta.5", "@tiptap/extension-code-block": "3.0.0-beta.5", "@tiptap/extension-document": "3.0.0-beta.5", + "@tiptap/extension-dropcursor": "3.0.0-beta.5", "@tiptap/extension-heading": "3.0.0-beta.5", "@tiptap/extension-image": "3.0.0-beta.5", "@tiptap/extension-italic": "3.0.0-beta.5", diff --git a/packages/forms/dist/components/code-editor.js b/packages/forms/dist/components/code-editor.js index a02a9a1bd8..2d83344c85 100644 --- a/packages/forms/dist/components/code-editor.js +++ b/packages/forms/dist/components/code-editor.js @@ -1,15 +1,15 @@ var Yr=[],sO=[];(()=>{let i="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e>1;if(i=sO[n])e=n+1;else return!0;if(e==t)return!1}}function tO(i){return i>=127462&&i<=127487}var iO=8205;function rO(i,e,t=!0,n=!0){return(t?oO:op)(i,e,n)}function oO(i,e,t){if(e==i.length)return e;e&&lO(i.charCodeAt(e))&&aO(i.charCodeAt(e-1))&&e--;let n=Cr(i,e);for(e+=nO(n);e=0&&tO(Cr(i,o));)r++,o-=2;if(r%2==0)break;e+=2}else break}return e}function op(i,e,t){for(;e>0;){let n=oO(i,e-2,t);if(n=56320&&i<57344}function aO(i){return i>=55296&&i<56320}function nO(i){return i<65536?1:2}var Y=class i{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=pi(this,e,t);let s=[];return this.decompose(0,e,s,2),n.length&&n.decompose(0,n.length,s,3),this.decompose(t,this.length,s,1),fi.from(s,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=pi(this,e,t);let n=[];return this.decompose(e,t,n,0),fi.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),s=new Bt(this),r=new Bt(e);for(let o=t,l=t;;){if(s.next(o),r.next(o),o=0,s.lineBreak!=r.lineBreak||s.done!=r.done||s.value!=r.value)return!1;if(l+=s.value.length,s.done||l>=n)return!0}}iter(e=1){return new Bt(this,e)}iterRange(e,t=this.length){return new Nn(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;n=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Fn(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?i.empty:e.length<=32?new Te(e):fi.from(Te.split(e,[]))}},Te=class i extends Y{constructor(e,t=lp(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,s){for(let r=0;;r++){let o=this.text[r],l=s+o.length;if((t?n:l)>=e)return new Ar(s,l,n,o);s=l+1,n++}}decompose(e,t,n,s){let r=e<=0&&t>=this.length?this:new i(OO(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=n.pop(),l=In(r.text,o.text.slice(),0,r.length);if(l.length<=32)n.push(new i(l,o.length+r.length));else{let a=l.length>>1;n.push(new i(l.slice(0,a)),new i(l.slice(a)))}}else n.push(r)}replace(e,t,n){if(!(n instanceof i))return super.replace(e,t,n);[e,t]=pi(this,e,t);let s=In(this.text,In(n.text,OO(this.text,0,e)),t),r=this.length+n.length-(t-e);return s.length<=32?new i(s,r):fi.from(i.split(s,[]),r)}sliceString(e,t=this.length,n=` `){[e,t]=pi(this,e,t);let s="";for(let r=0,o=0;r<=t&&oe&&o&&(s+=n),er&&(s+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],s=-1;for(let r of e)n.push(r),s+=r.length+1,n.length==32&&(t.push(new i(n,s)),n=[],s=-1);return s>-1&&t.push(new i(n,s)),t}},fi=class i extends Y{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,s){for(let r=0;;r++){let o=this.children[r],l=s+o.length,a=n+o.lines-1;if((t?a:l)>=e)return o.lineInner(e,t,n,s);s=l+1,n=a+1}}decompose(e,t,n,s){for(let r=0,o=0;o<=t&&r=o){let O=s&((o<=e?1:0)|(a>=t?2:0));o>=e&&a<=t&&!O?n.push(l):l.decompose(e-o,t-o,n,O)}o=a+1}}replace(e,t,n){if([e,t]=pi(this,e,t),n.lines=r&&t<=l){let a=o.replace(e-r,t-r,n),O=this.lines-o.lines+a.lines;if(a.lines>4&&a.lines>O>>6){let h=this.children.slice();return h[s]=a,new i(h,this.length-(t-e)+n.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=` `){[e,t]=pi(this,e,t);let s="";for(let r=0,o=0;re&&r&&(s+=n),eo&&(s+=l.sliceString(e-o,t-o,n)),o=a+1}return s}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof i))return 0;let n=0,[s,r,o,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;s+=t,r+=t){if(s==o||r==l)return n;let a=this.children[s],O=e.children[r];if(a!=O)return n+a.scanIdentical(O,t);n+=a.length+1}}static from(e,t=e.reduce((n,s)=>n+s.length+1,-1)){let n=0;for(let u of e)n+=u.lines;if(n<32){let u=[];for(let d of e)d.flatten(u);return new Te(u,t)}let s=Math.max(32,n>>5),r=s<<1,o=s>>1,l=[],a=0,O=-1,h=[];function c(u){let d;if(u.lines>r&&u instanceof i)for(let m of u.children)c(m);else u.lines>o&&(a>o||!a)?(f(),l.push(u)):u instanceof Te&&a&&(d=h[h.length-1])instanceof Te&&u.lines+d.lines<=32?(a+=u.lines,O+=u.length+1,h[h.length-1]=new Te(d.text.concat(u.text),d.length+1+u.length)):(a+u.lines>s&&f(),a+=u.lines,O+=u.length+1,h.push(u))}function f(){a!=0&&(l.push(h.length==1?h[0]:i.from(h,O)),O=-1,a=h.length=0)}for(let u of e)c(u);return f(),l.length==1?l[0]:new i(l,t)}};Y.empty=new Te([""],0);function lp(i){let e=-1;for(let t of i)e+=t.length+1;return e}function In(i,e,t=0,n=1e9){for(let s=0,r=0,o=!0;r=t&&(a>n&&(l=l.slice(0,n-s)),s0?1:(e instanceof Te?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,s=this.nodes[n],r=this.offsets[n],o=r>>1,l=s instanceof Te?s.text.length:s.children.length;if(o==(t>0?l:0)){if(n==0)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(t>0?0:1)){if(this.offsets[n]+=t,e==0)return this.lineBreak=!0,this.value=` -`,this;e--}else if(s instanceof Te){let a=s.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof Te?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},Nn=class{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new Bt(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=n?s:t<0?s.slice(s.length-n):s.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}},Fn=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:s}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<"u"&&(Y.prototype[Symbol.iterator]=function(){return this.iter()},Bt.prototype[Symbol.iterator]=Nn.prototype[Symbol.iterator]=Fn.prototype[Symbol.iterator]=function(){return this});var Ar=class{constructor(e,t,n,s){this.from=e,this.to=t,this.number=n,this.text=s}get length(){return this.to-this.from}};function pi(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function se(i,e,t=!0,n=!0){return rO(i,e,t,n)}function ap(i){return i>=56320&&i<57344}function Op(i){return i>=55296&&i<56320}function Oe(i,e){let t=i.charCodeAt(e);if(!Op(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return ap(n)?(t-55296<<10)+(n-56320)+65536:t}function Di(i){return i<=65535?String.fromCharCode(i):(i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320))}function Xe(i){return i<65536?1:2}var Ur=/\r\n?|\n/,oe=function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i}(oe||(oe={})),Qt=class i{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-s);r+=l}else{if(n!=oe.Simple&&O>=e&&(n==oe.TrackDel&&se||n==oe.TrackBefore&&se))return null;if(O>e||O==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=O}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let n=0,s=0;n=0&&s<=t&&l>=e)return st?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new i(e)}static create(e){return new i(e)}},ge=class i extends Qt{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Mr(this,(t,n,s,r,o)=>e=e.replace(s,s+(n-t),o),!1),e}mapDesc(e,t=!1){return jr(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let s=0,r=0;s=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;n.length0&&wt(n,t,r.text),r.forward(h),l+=h}let O=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,n){let s=[],r=[],o=0,l=null;function a(h=!1){if(!h&&!s.length)return;of||c<0||f>t)throw new RangeError(`Invalid change range ${c} to ${f} (in doc of length ${t})`);let d=u?typeof u=="string"?Y.of(u.split(n||Ur)):u:Y.empty,m=d.length;if(c==f&&m==0)return;co&&ue(s,c-o,-1),ue(s,f-c,m),wt(r,s,d),o=f}}return O(e),a(!l),l}static empty(e){return new i(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;n.length=0&&t<=0&&t==i[s+1]?i[s]+=e:s>=0&&e==0&&i[s]==0?i[s+1]+=t:n?(i[s]+=e,i[s+1]+=t):i.push(e,t)}function wt(i,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n>1])),!(t||o==i.sections.length||i.sections[o+1]<0);)l=i.sections[o++],a=i.sections[o++];e(s,O,r,h,c),s=O,r=h}}}function jr(i,e,t,n=!1){let s=[],r=n?[]:null,o=new It(i),l=new It(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let O=Math.min(o.len,l.len);ue(s,O,-1),o.forward(O),l.forward(O)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let O=0,h=o.len;for(;h;)if(l.ins==-1){let c=Math.min(h,l.len);O+=c,h-=c,l.forward(c)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||n.length>O),r.forward2(a),o.forward(a)}}}}var It=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?Y.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?Y.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},ci=class i{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let n,s;return this.empty?n=s=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),n==this.from&&s==this.to?this:new i(n,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return Q.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Q.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Q.range(e.anchor,e.head)}static create(e,t,n){return new i(e,t,n)}},Q=class i{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:i.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new i(e.ranges.map(t=>ci.fromJSON(t)),e.main)}static single(e,t=e){return new i([i.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,s=0;se?8:0)|r)}static normalized(e,t=0){let n=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(n);for(let s=1;sr.head?i.range(a,l):i.range(l,a))}}return new i(e,t)}};function pO(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}var Kr=0,T=class i{constructor(e,t,n,s,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=s,this.id=Kr++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(e={}){return new i(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:Jr),!!e.static,e.enables)}of(e){return new ui([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new ui(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new ui(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}};function Jr(i,e){return i==e||i.length==e.length&&i.every((t,n)=>t===e[n])}var ui=class{constructor(e,t,n,s){this.dependencies=e,this.facet=t,this.type=n,this.value=s,this.id=Kr++}dynamicSlot(e){var t;let n=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,O=!1,h=[];for(let c of this.dependencies)c=="doc"?a=!0:c=="selection"?O=!0:(((t=e[c.id])!==null&&t!==void 0?t:1)&1)==0&&h.push(e[c.id]);return{create(c){return c.values[o]=n(c),1},update(c,f){if(a&&f.docChanged||O&&(f.docChanged||f.selection)||Gr(c,h)){let u=n(c);if(l?!hO(u,c.values[o],s):!s(u,c.values[o]))return c.values[o]=u,1}return 0},reconfigure:(c,f)=>{let u,d=f.config.address[r];if(d!=null){let m=es(f,d);if(this.dependencies.every(g=>g instanceof T?f.facet(g)===c.facet(g):g instanceof J?f.field(g,!1)==c.field(g,!1):!0)||(l?hO(u=n(c),m,s):s(u=n(c),m)))return c.values[o]=m,0}else u=n(c);return c.values[o]=u,1}}}};function hO(i,e,t){if(i.length!=e.length)return!1;for(let n=0;ni[a.id]),s=t.map(a=>a.type),r=n.filter(a=>!(a&1)),o=i[e.id]>>1;function l(a){let O=[];for(let h=0;hn===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Ln).find(n=>n.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,s)=>{let r=n.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(n.values[t]=o,1)},reconfigure:(n,s)=>{let r=n.facet(Ln),o=s.facet(Ln),l;return(l=r.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(n.values[t]=l.create(n),1):s.config.address[this.id]!=null?(n.values[t]=s.field(this),0):(n.values[t]=this.create(n),1)}}}init(e){return[this,Ln.of({field:this,create:e})]}get extension(){return this}},Lt={lowest:4,low:3,default:2,high:1,highest:0};function Mi(i){return e=>new Hn(e,i)}var Me={highest:Mi(Lt.highest),high:Mi(Lt.high),default:Mi(Lt.default),low:Mi(Lt.low),lowest:Mi(Lt.lowest)},Hn=class{constructor(e,t){this.inner=e,this.prec=t}},Kn=class i{of(e){return new Gi(this,e)}reconfigure(e){return i.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}},Gi=class{constructor(e,t){this.compartment=e,this.inner=t}},Jn=class i{constructor(e,t,n,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let s=[],r=Object.create(null),o=new Map;for(let f of cp(e,t,o))f instanceof J?s.push(f):(r[f.facet.id]||(r[f.facet.id]=[])).push(f);let l=Object.create(null),a=[],O=[];for(let f of s)l[f.id]=O.length<<1,O.push(u=>f.slot(u));let h=n?.config.facets;for(let f in r){let u=r[f],d=u[0].facet,m=h&&h[f]||[];if(u.every(g=>g.type==0))if(l[d.id]=a.length<<1|1,Jr(m,u))a.push(n.facet(d));else{let g=d.combine(u.map($=>$.value));a.push(n&&d.compare(g,n.facet(d))?n.facet(d):g)}else{for(let g of u)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=O.length<<1,O.push($=>g.dynamicSlot($)));l[d.id]=O.length<<1,O.push(g=>hp(g,d,u))}}let c=O.map(f=>f(l));return new i(e,o,c,l,a,r)}};function cp(i,e,t){let n=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let O=n[a].indexOf(o);O>-1&&n[a].splice(O,1),o instanceof Gi&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let O of o)r(O,l);else if(o instanceof Gi){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let O=e.get(o.compartment)||o.inner;t.set(o.compartment,O),r(O,l)}else if(o instanceof Hn)r(o.inner,o.prec);else if(o instanceof J)n[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof ui)n[l].push(o),o.facet.extensions&&r(o.facet.extensions,Lt.default);else{let O=o.extension;if(!O)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(O,l)}}return r(i,Lt.default),n.reduce((o,l)=>o.concat(l))}function ji(i,e){if(e&1)return 2;let t=e>>1,n=i.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;i.status[t]=4;let s=i.computeSlot(i,i.config.dynamicSlots[t]);return i.status[t]=2|s}function es(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}var mO=T.define(),Er=T.define({combine:i=>i.some(e=>e),static:!0}),gO=T.define({combine:i=>i.length?i[0]:void 0,static:!0}),$O=T.define(),QO=T.define(),yO=T.define(),SO=T.define({combine:i=>i.length?i[0]:!1}),Se=class{constructor(e,t){this.type=e,this.value=t}static define(){return new Lr}},Lr=class{of(e){return new Se(this,e)}},Dr=class{constructor(e){this.map=e}of(e){return new q(this,e)}},q=class i{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new i(this.type,t)}is(e){return this.type==e}static define(e={}){return new Dr(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let s of e){let r=s.map(t);r&&n.push(r)}return n}};q.reconfigure=q.define();q.appendConfig=q.define();var ne=class i{constructor(e,t,n,s,r,o){this.startState=e,this.changes=t,this.selection=n,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,n&&pO(n,t.newLength),r.some(l=>l.type==i.time)||(this.annotations=r.concat(i.time.of(Date.now())))}static create(e,t,n,s,r,o){return new i(e,t,n,s,r,o)}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(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(i.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}};ne.time=Se.define();ne.userEvent=Se.define();ne.addToHistory=Se.define();ne.remote=Se.define();function fp(i,e){let t=[];for(let n=0,s=0;;){let r,o;if(n=i[n]))r=i[n++],o=i[n++];else if(s=0;s--){let r=n[s](i);r instanceof ne?i=r:Array.isArray(r)&&r.length==1&&r[0]instanceof ne?i=r[0]:i=xO(e,di(r),!1)}return i}function dp(i){let e=i.startState,t=e.facet(yO),n=i;for(let s=t.length-1;s>=0;s--){let r=t[s](i);r&&Object.keys(r).length&&(n=bO(n,Br(e,r,i.changes.newLength),!0))}return n==i?i:ne.create(e,i.changes,i.selection,n.effects,n.annotations,n.scrollIntoView)}var pp=[];function di(i){return i==null?pp:Array.isArray(i)?i:[i]}var L=function(i){return i[i.Word=0]="Word",i[i.Space=1]="Space",i[i.Other=2]="Other",i}(L||(L={})),mp=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ir;try{Ir=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function gp(i){if(Ir)return Ir.test(i);for(let e=0;e"\x80"&&(t.toUpperCase()!=t.toLowerCase()||mp.test(t)))return!0}return!1}function $p(i){return e=>{if(!/\S/.test(e))return L.Space;if(gp(e))return L.Word;for(let t=0;t-1)return L.Word;return L.Other}}var U=class i{constructor(e,t,n,s,r,o){this.config=e,this.doc=t,this.selection=n,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ls.set(O,a)),t=null),s.set(l.value.compartment,l.value.extension)):l.is(q.reconfigure)?(t=null,n=l.value):l.is(q.appendConfig)&&(t=null,n=di(n).concat(l.value));let r;t?r=e.startState.values.slice():(t=Jn.resolve(n,s,this),r=new i(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,O)=>O.reconfigure(a,this),null).values);let o=e.startState.facet(Er)?e.newSelection:e.newSelection.asSingle();new i(t,e.newDoc,o,r,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:Q.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),s=this.changes(n.changes),r=[n.range],o=di(n.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return i.create({doc:e.doc,selection:Q.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=Jn.resolve(e.extensions||[],new Map),n=e.doc instanceof Y?e.doc:Y.of((e.doc||"").split(t.staticFacet(i.lineSeparator)||Ur)),s=e.selection?e.selection instanceof Q?e.selection:Q.single(e.selection.anchor,e.selection.head):Q.single(0);return pO(s,n.length),t.staticFacet(Er)||(s=s.asSingle()),new i(t,n,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(i.tabSize)}get lineBreak(){return this.facet(i.lineSeparator)||` -`}get readOnly(){return this.facet(SO)}phrase(e,...t){for(let n of this.facet(i.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?n:t[r-1]})),e}languageDataAt(e,t,n=-1){let s=[];for(let r of this.facet(mO))for(let o of r(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return $p(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-n,l=e-n;for(;o>0;){let a=se(t,o,!1);if(r(t.slice(a,o))!=L.Word)break;o=a}for(;li.length?i[0]:4});U.lineSeparator=gO;U.readOnly=SO;U.phrases=T.define({compare(i,e){let t=Object.keys(i),n=Object.keys(e);return t.length==n.length&&t.every(s=>i[s]==e[s])}});U.languageData=mO;U.changeFilter=$O;U.transactionFilter=QO;U.transactionExtender=yO;Kn.reconfigure=q.define();function de(i,e,t={}){let n={};for(let s of i)for(let r of Object.keys(s)){let o=s[r],l=n[r];if(l===void 0)n[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))n[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)n[s]===void 0&&(n[s]=e[s]);return n}var He=class{eq(e){return this==e}range(e,t=e){return Ei.create(e,t,this)}};He.prototype.startSide=He.prototype.endSide=0;He.prototype.point=!1;He.prototype.mapMode=oe.TrackDel;var Ei=class i{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new i(e,t,n)}};function Nr(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}var Fr=class i{constructor(e,t,n,s){this.from=e,this.to=t,this.value=n,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,s=0){let r=n?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,O=r[a]-e||(n?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return O>=0?o:l;O>=0?l=a:o=a+1}}between(e,t,n,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,r);ru||f==u&&O.startSide>0&&O.endSide<=0)continue;(u-f||O.endSide-O.startSide)<0||(o<0&&(o=f),O.point&&(l=Math.max(l,u-f)),n.push(O),s.push(f-o),r.push(u-o))}return{mapped:n.length?new i(s,r,n,l):null,pos:o}}},M=class i{constructor(e,t,n,s){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=s}static create(e,t,n,s){return new i(e,t,n,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(n&&(t=t.slice().sort(Nr)),this.isEmpty)return t.length?i.of(t):this;let l=new ts(this,null,-1).goto(0),a=0,O=[],h=new ze;for(;l.value||a=0){let c=t[a++];h.addInner(c.from,c.to,c.value)||O.push(c)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+o.length&&o.between(r,e-r,t-r,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return Li.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Li.from(e).goto(t)}static compare(e,t,n,s,r=-1){let o=e.filter(c=>c.maxPoint>0||!c.isEmpty&&c.maxPoint>=r),l=t.filter(c=>c.maxPoint>0||!c.isEmpty&&c.maxPoint>=r),a=cO(o,l,n),O=new Dt(o,a,r),h=new Dt(l,a,r);n.iterGaps((c,f,u)=>fO(O,c,h,f,u,s)),n.empty&&n.length==0&&fO(O,0,h,0,0,s)}static eq(e,t,n=0,s){s==null&&(s=999999999);let r=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0),o=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=cO(r,o),a=new Dt(r,l,0).goto(n),O=new Dt(o,l,0).goto(n);for(;;){if(a.to!=O.to||!Hr(a.active,O.active)||a.point&&(!O.point||!a.point.eq(O.point)))return!1;if(a.to>s)return!0;a.next(),O.next()}}static spans(e,t,n,s,r=-1){let o=new Dt(e,null,r).goto(t),l=t,a=o.openStart;for(;;){let O=Math.min(o.to,n);if(o.point){let h=o.activeForPoint(o.to),c=o.pointFroml&&(s.span(l,O,o.active,a),a=o.openEnd(O));if(o.to>n)return a+(o.point&&o.to>n?1:0);l=o.to,o.next()}}static of(e,t=!1){let n=new ze;for(let s of e instanceof Ei?[e]:t?Qp(e):e)n.add(s.from,s.to,s.value);return n.finish()}static join(e){if(!e.length)return i.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let s=e[n];s!=i.empty;s=s.nextLayer)t=new i(s.chunkPos,s.chunk,t,Math.max(s.maxPoint,t.maxPoint));return t}};M.empty=new M([],[],null,-1);function Qp(i){if(i.length>1)for(let e=i[0],t=1;t0)return i.slice().sort(Nr);e=n}return i}M.empty.nextLayer=M.empty;var ze=class i{finishChunk(e){this.chunks.push(new Fr(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,e&&(this.from=[],this.to=[],this.value=[])}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}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new i)).add(e,t,n)}addInner(e,t,n){let s=e-this.lastTo||n.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(M.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=M.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function cO(i,e,t){let n=new Map;for(let r of i)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&s.push(new ts(o,t,n,r));return s.length==1?s[0]:new i(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)_r(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)_r(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),_r(this.heap,0)}}};function _r(i,e){for(let t=i[e];;){let n=(e<<1)+1;if(n>=i.length)break;let s=i[n];if(n+1=0&&(s=i[n+1],n++),t.compare(s)<0)break;i[n]=t,i[e]=s,e=n}}var Dt=class{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Li.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Dn(this.active,e),Dn(this.activeTo,e),Dn(this.activeRank,e),this.minActive=uO(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:s,rank:r}=this.cursor;for(;t0;)t++;Bn(this.active,t,n),Bn(this.activeTo,t,s),Bn(this.activeRank,t,r),e&&Bn(e,t,this.cursor.from),this.minActive=uO(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),n&&Dn(n,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&n[s]=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}};function fO(i,e,t,n,s,r){i.goto(e),t.goto(n);let o=n+s,l=n,a=n-e;for(;;){let O=i.to+a-t.to,h=O||i.endSide-t.endSide,c=h<0?i.to+a:t.to,f=Math.min(c,o);if(i.point||t.point?i.point&&t.point&&(i.point==t.point||i.point.eq(t.point))&&Hr(i.activeForPoint(i.to),t.activeForPoint(t.to))||r.comparePoint(l,f,i.point,t.point):f>l&&!Hr(i.active,t.active)&&r.compareRange(l,f,i.active,t.active),c>o)break;(O||i.openEnd!=t.openEnd)&&r.boundChange&&r.boundChange(c),l=c,h<=0&&i.next(),h>=0&&t.next()}}function Hr(i,e){if(i.length!=e.length)return!1;for(let t=0;t=e;n--)i[n+1]=i[n];i[e]=t}function uO(i,e){let t=-1,n=1e9;for(let s=0;s=e)return s;if(s==i.length)break;r+=i.charCodeAt(s)==9?t-r%t:1,s=se(i,s)}return n===!0?-1:i.length}var eo="\u037C",PO=typeof Symbol>"u"?"__"+eo:Symbol.for(eo),to=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),kO=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},je=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,O){let h=[],c=/^@(\w+)\b/.exec(o[0]),f=c&&c[1]=="keyframes";if(c&&l==null)return a.push(o[0]+";");for(let u in l){let d=l[u];if(/&/.test(u))r(u.split(/,\s*/).map(m=>o.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),d,a);else if(d&&typeof d=="object"){if(!c)throw new RangeError("The value of a property ("+u+") should be a primitive value.");r(s(u),d,h,f)}else d!=null&&h.push(u.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+d+";")}(h.length||f)&&a.push((n&&!c&&!O?o.map(n):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join(` +`,this;e--}else if(s instanceof Te){let a=s.text[o+(t<0?-1:0)];if(this.offsets[n]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=s.children[o+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof Te?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}},Nn=class{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new Bt(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:s}=this.cursor.next(e);return this.pos+=(s.length+e)*t,this.value=s.length<=n?s:t<0?s.slice(s.length-n):s.slice(0,n),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}},Fn=class{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:s}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=s,this.afterBreak=!1),this}get lineBreak(){return!1}};typeof Symbol<"u"&&(Y.prototype[Symbol.iterator]=function(){return this.iter()},Bt.prototype[Symbol.iterator]=Nn.prototype[Symbol.iterator]=Fn.prototype[Symbol.iterator]=function(){return this});var Ar=class{constructor(e,t,n,s){this.from=e,this.to=t,this.number=n,this.text=s}get length(){return this.to-this.from}};function pi(i,e,t){return e=Math.max(0,Math.min(i.length,e)),[e,Math.max(e,Math.min(i.length,t))]}function se(i,e,t=!0,n=!0){return rO(i,e,t,n)}function ap(i){return i>=56320&&i<57344}function Op(i){return i>=55296&&i<56320}function Oe(i,e){let t=i.charCodeAt(e);if(!Op(t)||e+1==i.length)return t;let n=i.charCodeAt(e+1);return ap(n)?(t-55296<<10)+(n-56320)+65536:t}function Bi(i){return i<=65535?String.fromCharCode(i):(i-=65536,String.fromCharCode((i>>10)+55296,(i&1023)+56320))}function Xe(i){return i<65536?1:2}var Ur=/\r\n?|\n/,oe=function(i){return i[i.Simple=0]="Simple",i[i.TrackDel=1]="TrackDel",i[i.TrackBefore=2]="TrackBefore",i[i.TrackAfter=3]="TrackAfter",i}(oe||(oe={})),Qt=class i{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-s);r+=l}else{if(n!=oe.Simple&&O>=e&&(n==oe.TrackDel&&se||n==oe.TrackBefore&&se))return null;if(O>e||O==e&&t<0&&!l)return e==s||t<0?r:r+a;r+=a}s=O}if(e>s)throw new RangeError(`Position ${e} is out of range for changeset of length ${s}`);return r}touchesRange(e,t=e){for(let n=0,s=0;n=0&&s<=t&&l>=e)return st?"cover":!0;s=l}return!1}toString(){let e="";for(let t=0;t=0?":"+s:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new i(e)}static create(e){return new i(e)}},ge=class i extends Qt{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Mr(this,(t,n,s,r,o)=>e=e.replace(s,s+(n-t),o),!1),e}mapDesc(e,t=!1){return jr(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let s=0,r=0;s=0){t[s]=l,t[s+1]=o;let a=s>>1;for(;n.length0&&wt(n,t,r.text),r.forward(h),l+=h}let O=e[o++];for(;l>1].toJSON()))}return e}static of(e,t,n){let s=[],r=[],o=0,l=null;function a(h=!1){if(!h&&!s.length)return;of||c<0||f>t)throw new RangeError(`Invalid change range ${c} to ${f} (in doc of length ${t})`);let d=u?typeof u=="string"?Y.of(u.split(n||Ur)):u:Y.empty,m=d.length;if(c==f&&m==0)return;co&&ue(s,c-o,-1),ue(s,f-c,m),wt(r,s,d),o=f}}return O(e),a(!l),l}static empty(e){return new i(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let s=0;sl&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)t.push(r[0],0);else{for(;n.length=0&&t<=0&&t==i[s+1]?i[s]+=e:s>=0&&e==0&&i[s]==0?i[s+1]+=t:n?(i[s]+=e,i[s+1]+=t):i.push(e,t)}function wt(i,e,t){if(t.length==0)return;let n=e.length-2>>1;if(n>1])),!(t||o==i.sections.length||i.sections[o+1]<0);)l=i.sections[o++],a=i.sections[o++];e(s,O,r,h,c),s=O,r=h}}}function jr(i,e,t,n=!1){let s=[],r=n?[]:null,o=new It(i),l=new It(e);for(let a=-1;;){if(o.done&&l.len||l.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&l.ins==-1){let O=Math.min(o.len,l.len);ue(s,O,-1),o.forward(O),l.forward(O)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len=0&&a=0){let O=0,h=o.len;for(;h;)if(l.ins==-1){let c=Math.min(h,l.len);O+=c,h-=c,l.forward(c)}else if(l.ins==0&&l.lena||o.ins>=0&&o.len>a)&&(l||n.length>O),r.forward2(a),o.forward(a)}}}}var It=class{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?Y.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?Y.empty:t[n].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}},ci=class i{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let n,s;return this.empty?n=s=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),s=e.mapPos(this.to,-1)),n==this.from&&s==this.to?this:new i(n,s,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return Q.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return Q.range(this.anchor,n)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return Q.range(e.anchor,e.head)}static create(e,t,n){return new i(e,t,n)}},Q=class i{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:i.create(this.ranges.map(n=>n.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let n=0;ne.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new i(e.ranges.map(t=>ci.fromJSON(t)),e.main)}static single(e,t=e){return new i([i.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let n=0,s=0;se?8:0)|r)}static normalized(e,t=0){let n=e[t];e.sort((s,r)=>s.from-r.from),t=e.indexOf(n);for(let s=1;sr.head?i.range(a,l):i.range(l,a))}}return new i(e,t)}};function pO(i,e){for(let t of i.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}var Kr=0,T=class i{constructor(e,t,n,s,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=s,this.id=Kr++,this.default=e([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(e={}){return new i(e.combine||(t=>t),e.compareInput||((t,n)=>t===n),e.compare||(e.combine?(t,n)=>t===n:Jr),!!e.static,e.enables)}of(e){return new ui([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new ui(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new ui(e,this,2,t)}from(e,t){return t||(t=n=>n),this.compute([e],n=>t(n.field(e)))}};function Jr(i,e){return i==e||i.length==e.length&&i.every((t,n)=>t===e[n])}var ui=class{constructor(e,t,n,s){this.dependencies=e,this.facet=t,this.type=n,this.value=s,this.id=Kr++}dynamicSlot(e){var t;let n=this.value,s=this.facet.compareInput,r=this.id,o=e[r]>>1,l=this.type==2,a=!1,O=!1,h=[];for(let c of this.dependencies)c=="doc"?a=!0:c=="selection"?O=!0:(((t=e[c.id])!==null&&t!==void 0?t:1)&1)==0&&h.push(e[c.id]);return{create(c){return c.values[o]=n(c),1},update(c,f){if(a&&f.docChanged||O&&(f.docChanged||f.selection)||Gr(c,h)){let u=n(c);if(l?!hO(u,c.values[o],s):!s(u,c.values[o]))return c.values[o]=u,1}return 0},reconfigure:(c,f)=>{let u,d=f.config.address[r];if(d!=null){let m=es(f,d);if(this.dependencies.every(g=>g instanceof T?f.facet(g)===c.facet(g):g instanceof J?f.field(g,!1)==c.field(g,!1):!0)||(l?hO(u=n(c),m,s):s(u=n(c),m)))return c.values[o]=m,0}else u=n(c);return c.values[o]=u,1}}}};function hO(i,e,t){if(i.length!=e.length)return!1;for(let n=0;ni[a.id]),s=t.map(a=>a.type),r=n.filter(a=>!(a&1)),o=i[e.id]>>1;function l(a){let O=[];for(let h=0;hn===s),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Ln).find(n=>n.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:n=>(n.values[t]=this.create(n),1),update:(n,s)=>{let r=n.values[t],o=this.updateF(r,s);return this.compareF(r,o)?0:(n.values[t]=o,1)},reconfigure:(n,s)=>{let r=n.facet(Ln),o=s.facet(Ln),l;return(l=r.find(a=>a.field==this))&&l!=o.find(a=>a.field==this)?(n.values[t]=l.create(n),1):s.config.address[this.id]!=null?(n.values[t]=s.field(this),0):(n.values[t]=this.create(n),1)}}}init(e){return[this,Ln.of({field:this,create:e})]}get extension(){return this}},Lt={lowest:4,low:3,default:2,high:1,highest:0};function ji(i){return e=>new Hn(e,i)}var Me={highest:ji(Lt.highest),high:ji(Lt.high),default:ji(Lt.default),low:ji(Lt.low),lowest:ji(Lt.lowest)},Hn=class{constructor(e,t){this.inner=e,this.prec=t}},Kn=class i{of(e){return new Ei(this,e)}reconfigure(e){return i.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}},Ei=class{constructor(e,t){this.compartment=e,this.inner=t}},Jn=class i{constructor(e,t,n,s,r,o){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=s,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let s=[],r=Object.create(null),o=new Map;for(let f of cp(e,t,o))f instanceof J?s.push(f):(r[f.facet.id]||(r[f.facet.id]=[])).push(f);let l=Object.create(null),a=[],O=[];for(let f of s)l[f.id]=O.length<<1,O.push(u=>f.slot(u));let h=n?.config.facets;for(let f in r){let u=r[f],d=u[0].facet,m=h&&h[f]||[];if(u.every(g=>g.type==0))if(l[d.id]=a.length<<1|1,Jr(m,u))a.push(n.facet(d));else{let g=d.combine(u.map($=>$.value));a.push(n&&d.compare(g,n.facet(d))?n.facet(d):g)}else{for(let g of u)g.type==0?(l[g.id]=a.length<<1|1,a.push(g.value)):(l[g.id]=O.length<<1,O.push($=>g.dynamicSlot($)));l[d.id]=O.length<<1,O.push(g=>hp(g,d,u))}}let c=O.map(f=>f(l));return new i(e,o,c,l,a,r)}};function cp(i,e,t){let n=[[],[],[],[],[]],s=new Map;function r(o,l){let a=s.get(o);if(a!=null){if(a<=l)return;let O=n[a].indexOf(o);O>-1&&n[a].splice(O,1),o instanceof Ei&&t.delete(o.compartment)}if(s.set(o,l),Array.isArray(o))for(let O of o)r(O,l);else if(o instanceof Ei){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let O=e.get(o.compartment)||o.inner;t.set(o.compartment,O),r(O,l)}else if(o instanceof Hn)r(o.inner,o.prec);else if(o instanceof J)n[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof ui)n[l].push(o),o.facet.extensions&&r(o.facet.extensions,Lt.default);else{let O=o.extension;if(!O)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);r(O,l)}}return r(i,Lt.default),n.reduce((o,l)=>o.concat(l))}function Gi(i,e){if(e&1)return 2;let t=e>>1,n=i.status[t];if(n==4)throw new Error("Cyclic dependency between fields and/or facets");if(n&2)return n;i.status[t]=4;let s=i.computeSlot(i,i.config.dynamicSlots[t]);return i.status[t]=2|s}function es(i,e){return e&1?i.config.staticValues[e>>1]:i.values[e>>1]}var mO=T.define(),Er=T.define({combine:i=>i.some(e=>e),static:!0}),gO=T.define({combine:i=>i.length?i[0]:void 0,static:!0}),$O=T.define(),QO=T.define(),yO=T.define(),SO=T.define({combine:i=>i.length?i[0]:!1}),Se=class{constructor(e,t){this.type=e,this.value=t}static define(){return new Lr}},Lr=class{of(e){return new Se(this,e)}},Dr=class{constructor(e){this.map=e}of(e){return new q(this,e)}},q=class i{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new i(this.type,t)}is(e){return this.type==e}static define(e={}){return new Dr(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let s of e){let r=s.map(t);r&&n.push(r)}return n}};q.reconfigure=q.define();q.appendConfig=q.define();var ne=class i{constructor(e,t,n,s,r,o){this.startState=e,this.changes=t,this.selection=n,this.effects=s,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,n&&pO(n,t.newLength),r.some(l=>l.type==i.time)||(this.annotations=r.concat(i.time.of(Date.now())))}static create(e,t,n,s,r,o){return new i(e,t,n,s,r,o)}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(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(i.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}};ne.time=Se.define();ne.userEvent=Se.define();ne.addToHistory=Se.define();ne.remote=Se.define();function fp(i,e){let t=[];for(let n=0,s=0;;){let r,o;if(n=i[n]))r=i[n++],o=i[n++];else if(s=0;s--){let r=n[s](i);r instanceof ne?i=r:Array.isArray(r)&&r.length==1&&r[0]instanceof ne?i=r[0]:i=xO(e,di(r),!1)}return i}function dp(i){let e=i.startState,t=e.facet(yO),n=i;for(let s=t.length-1;s>=0;s--){let r=t[s](i);r&&Object.keys(r).length&&(n=bO(n,Br(e,r,i.changes.newLength),!0))}return n==i?i:ne.create(e,i.changes,i.selection,n.effects,n.annotations,n.scrollIntoView)}var pp=[];function di(i){return i==null?pp:Array.isArray(i)?i:[i]}var L=function(i){return i[i.Word=0]="Word",i[i.Space=1]="Space",i[i.Other=2]="Other",i}(L||(L={})),mp=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ir;try{Ir=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function gp(i){if(Ir)return Ir.test(i);for(let e=0;e"\x80"&&(t.toUpperCase()!=t.toLowerCase()||mp.test(t)))return!0}return!1}function $p(i){return e=>{if(!/\S/.test(e))return L.Space;if(gp(e))return L.Word;for(let t=0;t-1)return L.Word;return L.Other}}var M=class i{constructor(e,t,n,s,r,o){this.config=e,this.doc=t,this.selection=n,this.values=s,this.status=e.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;ls.set(O,a)),t=null),s.set(l.value.compartment,l.value.extension)):l.is(q.reconfigure)?(t=null,n=l.value):l.is(q.appendConfig)&&(t=null,n=di(n).concat(l.value));let r;t?r=e.startState.values.slice():(t=Jn.resolve(n,s,this),r=new i(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(a,O)=>O.reconfigure(a,this),null).values);let o=e.startState.facet(Er)?e.newSelection:e.newSelection.asSingle();new i(t,e.newDoc,o,r,(l,a)=>a.update(l,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:Q.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),s=this.changes(n.changes),r=[n.range],o=di(n.effects);for(let l=1;lo.spec.fromJSON(l,a)))}}return i.create({doc:e.doc,selection:Q.fromJSON(e.selection),extensions:t.extensions?s.concat([t.extensions]):s})}static create(e={}){let t=Jn.resolve(e.extensions||[],new Map),n=e.doc instanceof Y?e.doc:Y.of((e.doc||"").split(t.staticFacet(i.lineSeparator)||Ur)),s=e.selection?e.selection instanceof Q?e.selection:Q.single(e.selection.anchor,e.selection.head):Q.single(0);return pO(s,n.length),t.staticFacet(Er)||(s=s.asSingle()),new i(t,n,s,t.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(i.tabSize)}get lineBreak(){return this.facet(i.lineSeparator)||` +`}get readOnly(){return this.facet(SO)}phrase(e,...t){for(let n of this.facet(i.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(n,s)=>{if(s=="$")return"$";let r=+(s||1);return!r||r>t.length?n:t[r-1]})),e}languageDataAt(e,t,n=-1){let s=[];for(let r of this.facet(mO))for(let o of r(this,t,n))Object.prototype.hasOwnProperty.call(o,e)&&s.push(o[e]);return s}charCategorizer(e){return $p(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:s}=this.doc.lineAt(e),r=this.charCategorizer(e),o=e-n,l=e-n;for(;o>0;){let a=se(t,o,!1);if(r(t.slice(a,o))!=L.Word)break;o=a}for(;li.length?i[0]:4});M.lineSeparator=gO;M.readOnly=SO;M.phrases=T.define({compare(i,e){let t=Object.keys(i),n=Object.keys(e);return t.length==n.length&&t.every(s=>i[s]==e[s])}});M.languageData=mO;M.changeFilter=$O;M.transactionFilter=QO;M.transactionExtender=yO;Kn.reconfigure=q.define();function de(i,e,t={}){let n={};for(let s of i)for(let r of Object.keys(s)){let o=s[r],l=n[r];if(l===void 0)n[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(t,r))n[r]=t[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let s in e)n[s]===void 0&&(n[s]=e[s]);return n}var He=class{eq(e){return this==e}range(e,t=e){return Li.create(e,t,this)}};He.prototype.startSide=He.prototype.endSide=0;He.prototype.point=!1;He.prototype.mapMode=oe.TrackDel;var Li=class i{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(e,t,n){return new i(e,t,n)}};function Nr(i,e){return i.from-e.from||i.value.startSide-e.value.startSide}var Fr=class i{constructor(e,t,n,s){this.from=e,this.to=t,this.value=n,this.maxPoint=s}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,s=0){let r=n?this.to:this.from;for(let o=s,l=r.length;;){if(o==l)return o;let a=o+l>>1,O=r[a]-e||(n?this.value[a].endSide:this.value[a].startSide)-t;if(a==o)return O>=0?o:l;O>=0?l=a:o=a+1}}between(e,t,n,s){for(let r=this.findIndex(t,-1e9,!0),o=this.findIndex(n,1e9,!1,r);ru||f==u&&O.startSide>0&&O.endSide<=0)continue;(u-f||O.endSide-O.startSide)<0||(o<0&&(o=f),O.point&&(l=Math.max(l,u-f)),n.push(O),s.push(f-o),r.push(u-o))}return{mapped:n.length?new i(s,r,n,l):null,pos:o}}},j=class i{constructor(e,t,n,s){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=s}static create(e,t,n,s){return new i(e,t,n,s)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:n=!1,filterFrom:s=0,filterTo:r=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(n&&(t=t.slice().sort(Nr)),this.isEmpty)return t.length?i.of(t):this;let l=new ts(this,null,-1).goto(0),a=0,O=[],h=new ze;for(;l.value||a=0){let c=t[a++];h.addInner(c.from,c.to,c.value)||O.push(c)}else l.rangeIndex==1&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+o.length&&o.between(r,e-r,t-r,n)===!1)return}this.nextLayer.between(e,t,n)}}iter(e=0){return Di.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Di.from(e).goto(t)}static compare(e,t,n,s,r=-1){let o=e.filter(c=>c.maxPoint>0||!c.isEmpty&&c.maxPoint>=r),l=t.filter(c=>c.maxPoint>0||!c.isEmpty&&c.maxPoint>=r),a=cO(o,l,n),O=new Dt(o,a,r),h=new Dt(l,a,r);n.iterGaps((c,f,u)=>fO(O,c,h,f,u,s)),n.empty&&n.length==0&&fO(O,0,h,0,0,s)}static eq(e,t,n=0,s){s==null&&(s=999999999);let r=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0),o=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=cO(r,o),a=new Dt(r,l,0).goto(n),O=new Dt(o,l,0).goto(n);for(;;){if(a.to!=O.to||!Hr(a.active,O.active)||a.point&&(!O.point||!a.point.eq(O.point)))return!1;if(a.to>s)return!0;a.next(),O.next()}}static spans(e,t,n,s,r=-1){let o=new Dt(e,null,r).goto(t),l=t,a=o.openStart;for(;;){let O=Math.min(o.to,n);if(o.point){let h=o.activeForPoint(o.to),c=o.pointFroml&&(s.span(l,O,o.active,a),a=o.openEnd(O));if(o.to>n)return a+(o.point&&o.to>n?1:0);l=o.to,o.next()}}static of(e,t=!1){let n=new ze;for(let s of e instanceof Li?[e]:t?Qp(e):e)n.add(s.from,s.to,s.value);return n.finish()}static join(e){if(!e.length)return i.empty;let t=e[e.length-1];for(let n=e.length-2;n>=0;n--)for(let s=e[n];s!=i.empty;s=s.nextLayer)t=new i(s.chunkPos,s.chunk,t,Math.max(s.maxPoint,t.maxPoint));return t}};j.empty=new j([],[],null,-1);function Qp(i){if(i.length>1)for(let e=i[0],t=1;t0)return i.slice().sort(Nr);e=n}return i}j.empty.nextLayer=j.empty;var ze=class i{finishChunk(e){this.chunks.push(new Fr(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,e&&(this.from=[],this.to=[],this.value=[])}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}add(e,t,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new i)).add(e,t,n)}addInner(e,t,n){let s=e-this.lastTo||n.startSide-this.last.endSide;if(s<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return s<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(j.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=j.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}};function cO(i,e,t){let n=new Map;for(let r of i)for(let o=0;o=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&s.push(new ts(o,t,n,r));return s.length==1?s[0]:new i(s)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)_r(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)_r(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),_r(this.heap,0)}}};function _r(i,e){for(let t=i[e];;){let n=(e<<1)+1;if(n>=i.length)break;let s=i[n];if(n+1=0&&(s=i[n+1],n++),t.compare(s)<0)break;i[n]=t,i[e]=s,e=n}}var Dt=class{constructor(e,t,n){this.minPoint=n,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=Di.from(e,t,n)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){Dn(this.active,e),Dn(this.activeTo,e),Dn(this.activeRank,e),this.minActive=uO(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:s,rank:r}=this.cursor;for(;t0;)t++;Bn(this.active,t,n),Bn(this.activeTo,t,s),Bn(this.activeRank,t,r),e&&Bn(e,t,this.cursor.from),this.minActive=uO(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let n=this.openStart<0?[]:null;for(;;){let s=this.minActive;if(s>-1&&(this.activeTo[s]-this.cursor.from||this.active[s].endSide-this.cursor.startSide)<0){if(this.activeTo[s]>e){this.to=this.activeTo[s],this.endSide=this.active[s].endSide;break}this.removeActive(s),n&&Dn(n,s)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(n),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&n[s]=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}};function fO(i,e,t,n,s,r){i.goto(e),t.goto(n);let o=n+s,l=n,a=n-e;for(;;){let O=i.to+a-t.to,h=O||i.endSide-t.endSide,c=h<0?i.to+a:t.to,f=Math.min(c,o);if(i.point||t.point?i.point&&t.point&&(i.point==t.point||i.point.eq(t.point))&&Hr(i.activeForPoint(i.to),t.activeForPoint(t.to))||r.comparePoint(l,f,i.point,t.point):f>l&&!Hr(i.active,t.active)&&r.compareRange(l,f,i.active,t.active),c>o)break;(O||i.openEnd!=t.openEnd)&&r.boundChange&&r.boundChange(c),l=c,h<=0&&i.next(),h>=0&&t.next()}}function Hr(i,e){if(i.length!=e.length)return!1;for(let t=0;t=e;n--)i[n+1]=i[n];i[e]=t}function uO(i,e){let t=-1,n=1e9;for(let s=0;s=e)return s;if(s==i.length)break;r+=i.charCodeAt(s)==9?t-r%t:1,s=se(i,s)}return n===!0?-1:i.length}var eo="\u037C",PO=typeof Symbol>"u"?"__"+eo:Symbol.for(eo),to=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),kO=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{},je=class{constructor(e,t){this.rules=[];let{finish:n}=t||{};function s(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,O){let h=[],c=/^@(\w+)\b/.exec(o[0]),f=c&&c[1]=="keyframes";if(c&&l==null)return a.push(o[0]+";");for(let u in l){let d=l[u];if(/&/.test(u))r(u.split(/,\s*/).map(m=>o.map(g=>m.replace(/&/,g))).reduce((m,g)=>m.concat(g)),d,a);else if(d&&typeof d=="object"){if(!c)throw new RangeError("The value of a property ("+u+") should be a primitive value.");r(s(u),d,h,f)}else d!=null&&h.push(u.replace(/_.*/,"").replace(/[A-Z]/g,m=>"-"+m.toLowerCase())+": "+d+";")}(h.length||f)&&a.push((n&&!c&&!O?o.map(n):o).join(", ")+" {"+h.join(" ")+"}")}for(let o in e)r(s(o),e[o],this.rules)}getRules(){return this.rules.join(` `)}static newName(){let e=kO[PO]||1;return kO[PO]=e+1,eo+e.toString(36)}static mount(e,t,n){let s=e[to],r=n&&n.nonce;s?r&&s.setNonce(r):s=new io(e,r),s.mount(Array.isArray(t)?t:[t],e)}},vO=new Map,io=class{constructor(e,t){let n=e.ownerDocument||e,s=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&s.CSSStyleSheet){let r=vO.get(n);if(r)return e[to]=r;this.sheet=new s.CSSStyleSheet,vO.set(n,this)}else this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[to]=this}mount(e,t){let n=this.sheet,s=0,r=0;for(let o=0;o-1&&(this.modules.splice(a,1),r--,a=-1),a==-1){if(this.modules.splice(r++,0,l),n)for(let O=0;O",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},yp=typeof navigator<"u"&&/Mac/.test(navigator.platform),Sp=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(re=0;re<10;re++)St[48+re]=St[96+re]=String(re);var re;for(re=1;re<=24;re++)St[re+111]="F"+re;var re;for(re=65;re<=90;re++)St[re]=String.fromCharCode(re+32),mi[re]=String.fromCharCode(re);var re;for(ns in St)mi.hasOwnProperty(ns)||(mi[ns]=St[ns]);var ns;function wO(i){var e=yp&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||Sp&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?mi:St)[i.keyCode]||i.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function ln(i){let e;return i.nodeType==11?e=i.getSelection?i:i.ownerDocument:e=i,e.getSelection()}function ho(i,e){return e?i==e||i.contains(e.nodeType!=1?e.parentNode:e):!1}function us(i,e){if(!e.anchorNode)return!1;try{return ho(i,e.anchorNode)}catch{return!1}}function an(i){return i.nodeType==3?Ht(i,0,i.nodeValue.length).getClientRects():i.nodeType==1?i.getClientRects():[]}function Ji(i,e,t,n){return t?TO(i,e,t,n,-1)||TO(i,e,t,n,1):!1}function Ft(i){for(var e=0;;e++)if(i=i.previousSibling,!i)return e}function ys(i){return i.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(i.nodeName)}function TO(i,e,t,n,s){for(;;){if(i==t&&e==n)return!0;if(e==(s<0?0:ft(i))){if(i.nodeName=="DIV")return!1;let r=i.parentNode;if(!r||r.nodeType!=1)return!1;e=Ft(i)+(s<0?0:1),i=r}else if(i.nodeType==1){if(i=i.childNodes[e+(s<0?-1:0)],i.nodeType==1&&i.contentEditable=="false")return!1;e=s<0?ft(i):0}else return!1}}function ft(i){return i.nodeType==3?i.nodeValue.length:i.childNodes.length}function Vs(i,e){let t=e?i.left:i.right;return{left:t,right:t,top:i.top,bottom:i.bottom}}function bp(i){let e=i.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:i.innerWidth,top:0,bottom:i.innerHeight}}function mh(i,e){let t=e.width/i.offsetWidth,n=e.height/i.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-i.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-i.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function xp(i,e,t,n,s,r,o,l){let a=i.ownerDocument,O=a.defaultView||window;for(let h=i,c=!1;h&&!c;)if(h.nodeType==1){let f,u=h==a.body,d=1,m=1;if(u)f=bp(O);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(c=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let y=h.getBoundingClientRect();({scaleX:d,scaleY:m}=mh(h,y)),f={left:y.left,right:y.left+h.clientWidth*d,top:y.top,bottom:y.top+h.clientHeight*m}}let g=0,$=0;if(s=="nearest")e.top0&&e.bottom>f.bottom+$&&($=e.bottom-f.bottom+o)):e.bottom>f.bottom&&($=e.bottom-f.bottom+o,t<0&&e.top-$0&&e.right>f.right+g&&(g=e.right-f.right+r)):e.right>f.right&&(g=e.right-f.right+r,t<0&&e.leftf.bottom||e.leftf.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function Pp(i){let e=i.ownerDocument,t,n;for(let s=i.parentNode;s&&!(s==e.body||t&&n);)if(s.nodeType==1)!n&&s.scrollHeight>s.clientHeight&&(n=s),!t&&s.scrollWidth>s.clientWidth&&(t=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:t,y:n}}var co=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?ft(t):0),n,Math.min(e.focusOffset,n?ft(n):0))}set(e,t,n,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=s}},gi=null;function gh(i){if(i.setActive)return i.setActive();if(gi)return i.focus(gi);let e=[];for(let t=i;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(i.focus(gi==null?{get preventScroll(){return gi={preventScroll:!0},!0}}:void 0),!gi){gi=!1;for(let t=0;tMath.max(1,i.scrollHeight-i.clientHeight-4)}function yh(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&n>0)return{node:t,offset:n};if(t.nodeType==1&&n>0){if(t.contentEditable=="false")return null;t=t.childNodes[n-1],n=ft(t)}else if(t.parentNode&&!ys(t))n=Ft(t),t=t.parentNode;else return null}}function Sh(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&nt)return c.domBoundsAround(e,t,O);if(f>=e&&s==-1&&(s=a,r=O),O>t&&c.dom.parentNode==this.dom){o=a,l=h;break}h=f,O=f+c.breakAfter}return{from:r,to:l<0?n+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=Ko){this.markDirty();for(let s=e;sthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}};function bh(i,e,t,n,s,r,o,l,a){let{children:O}=i,h=O.length?O[e]:null,c=r.length?r[r.length-1]:null,f=c?c.breakAfter:o;if(!(e==n&&h&&!o&&!f&&r.length<2&&h.merge(t,s,r.length?c:null,t==0,l,a))){if(n0&&(!o&&r.length&&h.merge(t,h.length,r[0],!1,l,0)?h.breakAfter=r.shift().breakAfter:(t2),z={mac:WO||/Mac/.test(be.platform),windows:/Win/.test(be.platform),linux:/Linux|X11/.test(be.platform),ie:Cs,ie_version:Ph?fo.documentMode||6:po?+po[1]:uo?+uo[1]:0,gecko:RO,gecko_version:RO?+(/Firefox\/(\d+)/.exec(be.userAgent)||[0,0])[1]:0,chrome:!!no,chrome_version:no?+no[1]:0,ios:WO,android:/Android\b/.test(be.userAgent),webkit:qO,safari:kh,webkit_version:qO?+(/\bAppleWebKit\/(\d+)/.exec(be.userAgent)||[0,0])[1]:0,tabSize:fo.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"},wp=256,ut=class i extends H{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,n){return this.flags&8||n&&(!(n instanceof i)||this.length-(t-e)+n.length>wp||n.flags&8)?!1:(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new i(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new $e(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return Tp(this.dom,e,t)}},Xt=class i extends H{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let s of t)s.setParent(this)}setAttrs(e){if($h(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,s,r,o){return n&&(!(n instanceof i&&n.mark.eq(this.mark))||e&&r<=0||te&&t.push(n=e&&(s=r),n=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new i(this.mark,t,o)}domAtPos(e){return vh(this,e)}coordsAt(e,t){return Th(this,e,t)}};function Tp(i,e,t){let n=i.nodeValue.length;e>n&&(e=n);let s=e,r=e,o=0;e==0&&t<0||e==n&&t>=0?z.chrome||z.gecko||(e?(s--,o=1):r=0)?0:l.length-1];return z.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,O=>O.width)||a),o?Vs(a,o<0):a||null}var On=class i extends H{static create(e,t,n){return new i(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=i.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,s,r,o){return n&&(!(n instanceof i)||!this.widget.compare(n.widget)||e>0&&r<=0||t0)?$e.before(this.dom):$e.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let s=this.dom.getClientRects(),r=null;if(!s.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?s.length-1:0;r=s[l],!(e>0?l==0:l==s.length-1||r.top0?$e.before(this.dom):$e.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Y.empty}get isHidden(){return!0}};ut.prototype.children=On.prototype.children=hn.prototype.children=Ko;function vh(i,e){let t=i.dom,{children:n}=i,s=0;for(let r=0;sr&&e0;r--){let o=n[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r0&&e instanceof Xt&&s.length&&(n=s[s.length-1])instanceof Xt&&n.mark.eq(e.mark)?wh(n,e.children[0],t-1):(s.push(e),e.setParent(i)),i.length+=e.length}function Th(i,e,t){let n=null,s=-1,r=null,o=-1;function l(O,h){for(let c=0,f=0;c=h&&(u.children.length?l(u,h-f):(!r||r.isHidden&&(t>0||Xp(r,u)))&&(d>h||f==d&&u.getSide()>0)?(r=u,o=h-f):(f-1?1:0)!=s.length-(t&&s.indexOf(t)>-1?1:0))return!1;for(let r of n)if(r!=t&&(s.indexOf(r)==-1||i[r]!==e[r]))return!1;return!0}function go(i,e,t){let n=!1;if(e)for(let s in e)t&&s in t||(n=!0,s=="style"?i.style.cssText="":i.removeAttribute(s));if(t)for(let s in t)e&&e[s]==t[s]||(n=!0,s=="style"?i.style.cssText=t[s]:i.setAttribute(s,t[s]));return n}function Rp(i){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new Rt(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,s;if(e.isBlockGap)n=-5e8,s=4e8;else{let{start:r,end:o}=zh(e,t);n=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new Rt(e,n,s,t,e.widget||null,!0)}static line(e){return new fn(e)}static set(e,t=!1){return M.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};X.none=M.empty;var cn=class i extends X{constructor(e){let{start:t,end:n}=zh(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof i&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((n=e.attrs)===null||n===void 0?void 0:n.class))&&bs(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}};cn.prototype.point=!1;var fn=class i extends X{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof i&&this.spec.class==e.spec.class&&bs(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}};fn.prototype.mapMode=oe.TrackBefore;fn.prototype.point=!0;var Rt=class i extends X{constructor(e,t,n,s,r,o){super(t,n,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?oe.TrackBefore:oe.TrackAfter:oe.TrackDel}get type(){return this.startSide!=this.endSide?Qe.WidgetRange:this.startSide<=0?Qe.WidgetBefore:Qe.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof i&&qp(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}};Rt.prototype.point=!0;function zh(i,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=i;return t==null&&(t=i.inclusive),n==null&&(n=i.inclusive),{start:t??e,end:n??e}}function qp(i,e){return i==e||!!(i&&e&&i.compare(e))}function ds(i,e,t,n=0){let s=t.length-1;s>=0&&t[s]+n>=i?t[s]=Math.max(t[s],e):t.push(i,e)}var he=class i extends H{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,n,s,r,o){if(n){if(!(n instanceof i))return!1;this.dom||n.transferDOM(this)}return s&&this.setDeco(n?n.attrs:null),xh(this,e,t,n?n.children.slice():[],r,o),!0}split(e){let t=new i;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:n,off:s}=this.childPos(e);s&&(t.append(this.children[n].split(s),0),this.children[n].merge(s,this.children[n].length,null,!1,0,0),n++);for(let r=n;r0&&this.children[n-1].length==0;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){bs(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){wh(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=mo(t,this.attrs||{})),n&&(this.attrs=mo({class:n},this.attrs||{}))}domAtPos(e){return vh(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?this.flags&4&&($h(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(go(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let s=this.dom.lastChild;for(;s&&H.get(s)instanceof Xt;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((n=H.get(s))===null||n===void 0?void 0:n.isEditable)==!1&&(!z.ios||!this.children.some(r=>r instanceof ut))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let n of this.children){if(!(n instanceof ut)||/[^ -~]/.test(n.text))return null;let s=an(n.dom);if(s.length!=1)return null;e+=s[0].width,t=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let n=Th(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=n.bottom-n.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight=t){if(r instanceof i)return r;if(o>t)break}s=o+r.breakAfter}return null}},Nt=class i extends H{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,s,r,o){return n&&(!(n instanceof i)||!this.widget.compare(n.widget)||e>0&&r<=0||t0}},un=class extends xe{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},en=class i{constructor(e,t,n,s){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Nt&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new he),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(ss(new hn(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Nt)&&this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(ss(new ut(this.text.slice(this.textOff,this.textOff+s)),t),n),this.atCursorPos=!0,this.textOff+=s,e-=s,n=0}}span(e,t,n,s){this.buildText(t-e,n,s),this.pos=t,this.openStart<0&&(this.openStart=s)}point(e,t,n,s,r,o){if(this.disallowBlockEffectsFor[o]&&n instanceof Rt){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(n instanceof Rt)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Nt(n.widget||qt.block,l,n));else{let a=On.create(n.widget||qt.inline,l,l?0:n.startSide),O=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e0),h=!a.isEditable&&(es.length||n.startSide<=0),c=this.getLine();this.pendingBuffer==2&&!O&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),O&&(c.append(ss(new hn(1),s),r),r=s.length+Math.max(0,r-s.length)),c.append(ss(a,s),r),this.atCursorPos=h,this.pendingBuffer=h?es.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,n,s,r){let o=new i(e,t,n,r);return o.openEnd=M.spans(s,t,n,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}};function ss(i,e){for(let t of e)i=new Xt(t,[i],i.length);return i}var qt=class extends xe{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};qt.inline=new qt("span");qt.block=new qt("div");var D=function(i){return i[i.LTR=0]="LTR",i[i.RTL=1]="RTL",i}(D||(D={})),Kt=D.LTR,Jo=D.RTL;function Xh(i){let e=[];for(let t=0;t=t){if(l.level==n)return o;(r<0||(s!=0?s<0?l.fromt:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}};function qh(i,e){if(i.length!=e.length)return!1;for(let t=0;t=0;m-=3)if(at[m+1]==-u){let g=at[m+2],$=g&2?s:g&4?g&1?r:s:0;$&&(I[c]=I[at[m]]=$),l=m;break}}else{if(at.length==189)break;at[l++]=c,at[l++]=f,at[l++]=a}else if((d=I[c])==2||d==1){let m=d==s;a=m?0:1;for(let g=l-3;g>=0;g-=3){let $=at[g+2];if($&2)break;if(m)at[g+2]|=2;else{if($&4)break;at[g+2]|=4}}}}}function _p(i,e,t,n){for(let s=0,r=n;s<=t.length;s++){let o=s?t[s-1].to:i,l=sa;)d==g&&(d=t[--m].from,g=m?t[m-1].to:i),I[--d]=u;a=h}else r=O,a++}}}function Qo(i,e,t,n,s,r,o){let l=n%2?2:1;if(n%2==s%2)for(let a=e,O=0;aa&&o.push(new ht(a,m.from,u));let g=m.direction==Kt!=!(u%2);yo(i,g?n+1:n,s,m.inner,m.from,m.to,o),a=m.to}d=m.to}else{if(d==t||(h?I[d]!=l:I[d]==l))break;d++}f?Qo(i,a,d,n+1,s,f,o):ae;){let h=!0,c=!1;if(!O||a>r[O-1].to){let m=I[a-1];m!=l&&(h=!1,c=m==16)}let f=!h&&l==1?[]:null,u=h?n:n+1,d=a;e:for(;;)if(O&&d==r[O-1].to){if(c)break e;let m=r[--O];if(!h)for(let g=m.from,$=O;;){if(g==e)break e;if($&&r[$-1].to==g)g=r[--$].from;else{if(I[g-1]==l)break e;break}}if(f)f.push(m);else{m.toI.length;)I[I.length]=256;let n=[],s=e==Kt?0:1;return yo(i,s,s,t,0,i.length,n),n}function Wh(i){return[new ht(0,i,0)]}var Zh="";function Up(i,e,t,n,s){var r;let o=n.head-i.from,l=ht.find(e,o,(r=n.bidiLevel)!==null&&r!==void 0?r:-1,n.assoc),a=e[l],O=a.side(s,t);if(o==O){let f=l+=s?1:-1;if(f<0||f>=e.length)return null;a=e[l=f],o=a.side(!s,t),O=a.side(s,t)}let h=se(i.text,o,a.forward(s,t));(ha.to)&&(h=O),Zh=i.text.slice(Math.min(o,h),Math.max(o,h));let c=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return c&&h==O&&c.level+(s?0:1)i.some(e=>e)}),jh=T.define({combine:i=>i.some(e=>e)}),Gh=T.define(),tn=class i{constructor(e,t="nearest",n="nearest",s=5,r=5,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=s,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new i(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new i(Q.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},rs=q.define({map:(i,e)=>i.map(e)}),Eh=q.define();function ce(i,e,t){let n=i.facet(_h);n.length?n[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}var bt=T.define({combine:i=>i.length?i[0]:!0}),jp=0,Ii=T.define(),te=class i{constructor(e,t,n,s,r){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=s,this.extension=r(this)}static define(e,t){let{eventHandlers:n,eventObservers:s,provide:r,decorations:o}=t||{};return new i(jp++,e,n,s,l=>{let a=[Ii.of(l)];return o&&a.push(dn.of(O=>{let h=O.plugin(l);return h?o(h):X.none})),r&&a.push(r(l)),a})}static fromClass(e,t){return i.define(n=>new e(n),t)}},nn=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(n){if(ce(t.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){ce(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(n){ce(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}},Lh=T.define(),il=T.define(),dn=T.define(),Dh=T.define(),nl=T.define(),Bh=T.define();function VO(i,e){let t=i.state.facet(Bh);if(!t.length)return t;let n=t.map(r=>r instanceof Function?r(i):r),s=[];return M.spans(n,e.from,e.to,{point(){},span(r,o,l,a){let O=r-e.from,h=o-e.from,c=s;for(let f=l.length-1;f>=0;f--,a--){let u=l[f].spec.bidiIsolate,d;if(u==null&&(u=Mp(e.text,O,h)),a>0&&c.length&&(d=c[c.length-1]).to==O&&d.direction==u)d.to=h,c=d.inner;else{let m={from:O,to:h,direction:u,inner:[]};c.push(m),c=m.inner}}}}),s}var Ih=T.define();function sl(i){let e=0,t=0,n=0,s=0;for(let r of i.state.facet(Ih)){let o=r(i);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(n=Math.max(n,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:n,bottom:s}}var Ni=T.define(),ct=class i{constructor(e,t,n,s){this.fromA=e,this.toA=t,this.fromB=n,this.toB=s}join(e){return new i(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>n.toA)){if(s.toAh)break;r+=2}if(!a)return n;new i(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),o=a.toA,l=a.toB}}},xs=class i{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=ge.empty(this.startState.doc.length);for(let r of n)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new ct(r,o,l,a))),this.changedRanges=s}static create(e,t,n){return new i(e,t,n)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},Ps=class extends H{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=X.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new he],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new ct(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:O,toA:h})=>hthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?s=this.domChanged.newSel.head:!Np(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let r=s>-1?Ep(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:O,to:h}=this.hasComposition;n=new ct(O,h,e.changes.mapPos(O,-1),e.changes.mapPos(h,1)).addToSet(n.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(z.ie||z.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=Bp(o,l,e.changes);return n=ct.extendWithRanges(n,a),!(this.flags&7)&&n.length==0?!1:(this.updateInner(n,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:s}=this.view;s.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=z.chrome||z.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to=0?s[o]:null;if(!l)break;let{fromA:a,toA:O,fromB:h,toB:c}=l,f,u,d,m;if(n&&n.range.fromBh){let x=en.build(this.view.state.doc,h,n.range.fromB,this.decorations,this.dynamicDecorationMap),S=en.build(this.view.state.doc,n.range.toB,c,this.decorations,this.dynamicDecorationMap);u=x.breakAtStart,d=x.openStart,m=S.openEnd;let P=this.compositionView(n);S.breakAtStart?P.breakAfter=1:S.content.length&&P.merge(P.length,P.length,S.content[0],!1,S.openStart,0)&&(P.breakAfter=S.content[0].breakAfter,S.content.shift()),x.content.length&&P.merge(0,0,x.content[x.content.length-1],!0,0,x.openEnd)&&x.content.pop(),f=x.content.concat(P).concat(S.content)}else({content:f,breakAtStart:u,openStart:d,openEnd:m}=en.build(this.view.state.doc,h,c,this.decorations,this.dynamicDecorationMap));let{i:g,off:$}=r.findPos(O,1),{i:y,off:b}=r.findPos(a,-1);bh(this,y,b,g,$,f,u,d,m)}n&&this.fixCompositionDOM(n)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let n of t.effects)n.is(Eh)&&(this.editContextFormatting=n.value)}compositionView(e){let t=new ut(e.text.nodeValue);t.flags|=8;for(let{deco:s}of e.marks)t=new Xt(s,[t],t.length);let n=new he;return n.append(t,0),n}fixCompositionDOM(e){let t=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=H.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},n=this.childPos(e.range.fromB,1),s=this.children[n.i];t(e.line,s);for(let r=e.marks.length-1;r>=-1;r--)n=s.childPos(n.off,1),s=s.children[n.i],t(r>=0?e.marks[r].node:e.text,s)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let n=this.view.root.activeElement,s=n==this.dom,r=!s&&!(this.view.state.facet(bt)||this.dom.tabIndex>-1)&&us(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(s||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),O=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(z.gecko&&l.empty&&!this.hasComposition&&Gp(a)){let c=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(c,a.node.childNodes[a.offset]||null)),a=O=new $e(c,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!Ji(a.node,a.offset,h.anchorNode,h.anchorOffset)||!Ji(O.node,O.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{z.android&&z.chrome&&this.dom.contains(h.focusNode)&&Ip(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let c=ln(this.view.root);if(c)if(l.empty){if(z.gecko){let f=Lp(a.node,a.offset);if(f&&f!=3){let u=(f==1?yh:Sh)(a.node,a.offset);u&&(a=new $e(u.node,u.offset))}}c.collapse(a.node,a.offset),l.bidiLevel!=null&&c.caretBidiLevel!==void 0&&(c.caretBidiLevel=l.bidiLevel)}else if(c.extend){c.collapse(a.node,a.offset);try{c.extend(O.node,O.offset)}catch{}}else{let f=document.createRange();l.anchor>l.head&&([a,O]=[O,a]),f.setEnd(O.node,O.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(a,O)),this.impreciseAnchor=a.precise?null:new $e(h.anchorNode,h.anchorOffset),this.impreciseHead=O.precise?null:new $e(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Ji(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=ln(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=he.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),O=this.coordsAt(t.head,1);if(!a||!O||a.bottom>O.top)return;let h=this.domAtPos(t.head+t.assoc);n.collapse(h.node,h.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let c=e.observer.selectionRange;e.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=t.from&&n.collapse(s,r)}moveToLine(e){let t=this.dom,n;if(e.node!=t)return e;for(let s=e.offset;!n&&s=0;s--){let r=H.get(t.childNodes[s]);r instanceof he&&(n=r.domAtPos(r.length))}return n?new $e(n.node,n.offset,!0):e}nearest(e){for(let t=e;t;){let n=H.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t=0;o--){let l=this.children[o],a=r-l.breakAfter,O=a-l.length;if(ae||l.covers(1))&&(!n||l instanceof he&&!(n instanceof he&&t>=0)))n=l,s=O;else if(n&&O==e&&a==e&&l instanceof Nt&&Math.abs(t)<2){if(l.deco.startSide<0)break;o&&(n=null)}r=O}return n?n.coordsAt(e-s,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),s=this.children[t];if(!(s instanceof he))return null;for(;s.children.length;){let{i:l,off:a}=s.childPos(n,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}n=a}if(!(s instanceof ut))return null;let r=se(s.text,n);if(r==n)return null;let o=Ht(s.dom,n,r).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==D.LTR;for(let O=0,h=0;hs)break;if(O>=n){let u=c.dom.getBoundingClientRect();if(t.push(u.height),o){let d=c.dom.lastChild,m=d?an(d):[];if(m.length){let g=m[m.length-1],$=a?g.right-u.left:u.right-g.left;$>l&&(l=$,this.minWidth=r,this.minWidthFrom=O,this.minWidthTo=f)}}}O=f+c.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?D.RTL:D.LTR}measureTextSize(){for(let r of this.children)if(r instanceof he){let o=r.measureTextSize();if(o)return o}let e=document.createElement("div"),t,n,s;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let r=an(e.firstChild)[0];t=e.getBoundingClientRect().height,n=r?r.width/27:7,s=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:n,textHeight:s}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Ss(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>n){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(X.replace({widget:new un(l),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!r)break;n=r.to+1}return X.set(e)}updateDeco(){let e=1,t=this.view.state.facet(dn).map(r=>(this.dynamicDecorationMap[e++]=typeof r=="function")?r(this.view):r),n=!1,s=this.view.state.facet(Dh).map((r,o)=>{let l=typeof r=="function";return l&&(n=!0),l?r(this.view):r});for(s.length&&(this.dynamicDecorationMap[e++]=n,t.push(M.join(s))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];et.anchor?-1:1),s;if(!n)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,s.left),top:Math.min(n.top,s.top),right:Math.max(n.right,s.right),bottom:Math.max(n.bottom,s.bottom)});let r=sl(this.view),o={left:n.left-r.left,top:n.top-r.top,right:n.right+r.right,bottom:n.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;xp(this.view.scrollDOM,o,t.head{ne.from&&(t=!0)}),t}function Fp(i,e,t=1){let n=i.charCategorizer(e),s=i.doc.lineAt(e),r=e-s.from;if(s.length==0)return Q.cursor(e);r==0?t=1:r==s.length&&(t=-1);let o=r,l=r;t<0?o=se(s.text,r,!1):l=se(s.text,r);let a=n(s.text.slice(o,l));for(;o>0;){let O=se(s.text,o,!1);if(n(s.text.slice(O,o))!=a)break;o=O}for(;li?e.left-i:Math.max(0,i-e.right)}function Kp(i,e){return e.top>i?e.top-i:Math.max(0,i-e.bottom)}function so(i,e){return i.tope.top+1}function CO(i,e){return ei.bottom?{top:i.top,left:i.left,right:i.right,bottom:e}:i}function bo(i,e,t){let n,s,r,o,l=!1,a,O,h,c;for(let d=i.firstChild;d;d=d.nextSibling){let m=an(d);for(let g=0;gb||o==b&&r>y){n=d,s=$,r=y,o=b;let x=b?t<$.top?-1:1:y?e<$.left?-1:1:0;l=!x||(x>0?g0)}y==0?t>$.bottom&&(!h||h.bottom<$.bottom)?(a=d,h=$):t<$.top&&(!c||c.top>$.top)&&(O=d,c=$):h&&so(h,$)?h=YO(h,$.bottom):c&&so(c,$)&&(c=CO(c,$.top))}}if(h&&h.bottom>=t?(n=a,s=h):c&&c.top<=t&&(n=O,s=c),!n)return{node:i,offset:0};let f=Math.max(s.left,Math.min(s.right,e));if(n.nodeType==3)return _O(n,f,t);if(l&&n.contentEditable!="false")return bo(n,f,t);let u=Array.prototype.indexOf.call(i.childNodes,n)+(e>=(s.left+s.right)/2?1:0);return{node:i,offset:u}}function _O(i,e,t){let n=i.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;lt?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&c=(h.left+h.right)/2,u=f;if((z.chrome||z.gecko)&&Ht(i,l).getBoundingClientRect().left==h.right&&(u=!f),c<=0)return{node:i,offset:l+(u?1:0)};s=l+(u?1:0),r=c}}}return{node:i,offset:s>-1?s:o>0?i.nodeValue.length:0}}function Fh(i,e,t,n=-1){var s,r;let o=i.contentDOM.getBoundingClientRect(),l=o.top+i.viewState.paddingTop,a,{docHeight:O}=i.viewState,{x:h,y:c}=e,f=c-l;if(f<0)return 0;if(f>O)return i.state.doc.length;for(let x=i.viewState.heightOracle.textHeight/2,S=!1;a=i.elementAtHeight(f),a.type!=Qe.Text;)for(;f=n>0?a.bottom+x:a.top-x,!(f>=0&&f<=O);){if(S)return t?null:0;S=!0,n=-n}c=l+f;let u=a.from;if(ui.viewport.to)return i.viewport.to==i.state.doc.length?i.state.doc.length:t?null:AO(i,o,a,h,c);let d=i.dom.ownerDocument,m=i.root.elementFromPoint?i.root:d,g=m.elementFromPoint(h,c);g&&!i.contentDOM.contains(g)&&(g=null),g||(h=Math.max(o.left+1,Math.min(o.right-1,h)),g=m.elementFromPoint(h,c),g&&!i.contentDOM.contains(g)&&(g=null));let $,y=-1;if(g&&((s=i.docView.nearest(g))===null||s===void 0?void 0:s.isEditable)!=!1){if(d.caretPositionFromPoint){let x=d.caretPositionFromPoint(h,c);x&&({offsetNode:$,offset:y}=x)}else if(d.caretRangeFromPoint){let x=d.caretRangeFromPoint(h,c);x&&({startContainer:$,startOffset:y}=x,(!i.contentDOM.contains($)||z.safari&&Jp($,y,h)||z.chrome&&em($,y,h))&&($=void 0))}$&&(y=Math.min(ft($),y))}if(!$||!i.docView.dom.contains($)){let x=he.find(i.docView,u);if(!x)return f>a.top+a.height/2?a.to:a.from;({node:$,offset:y}=bo(x.dom,h,c))}let b=i.docView.nearest($);if(!b)return null;if(b.isWidget&&((r=b.dom)===null||r===void 0?void 0:r.nodeType)==1){let x=b.dom.getBoundingClientRect();return e.yi.defaultLineHeight*1.5){let l=i.viewState.heightOracle.textHeight,a=Math.floor((s-t.top-(i.defaultLineHeight-l)*.5)/l);r+=a*i.viewState.heightOracle.lineLength}let o=i.state.sliceDoc(t.from,t.to);return t.from+is(o,r,i.state.tabSize)}function Jp(i,e,t){let n;if(i.nodeType!=3||e!=(n=i.nodeValue.length))return!1;for(let s=i.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return Ht(i,n-1,n).getBoundingClientRect().left>t}function em(i,e,t){if(e!=0)return!1;for(let s=i;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let n=i.nodeType==1?i.getBoundingClientRect():Ht(i,0,Math.max(i.nodeValue.length,1)).getBoundingClientRect();return t-n.left>5}function xo(i,e,t){let n=i.lineBlockAt(e);if(Array.isArray(n.type)){let s;for(let r of n.type){if(r.from>e)break;if(!(r.toe)return r;(!s||r.type==Qe.Text&&(s.type!=r.type||(t<0?r.frome)))&&(s=r)}}return s||n}return n}function tm(i,e,t,n){let s=xo(i,e.head,e.assoc||-1),r=!n||s.type!=Qe.Text||!(i.lineWrapping||s.widgetLineBreaks)?null:i.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=i.dom.getBoundingClientRect(),l=i.textDirectionAt(s.from),a=i.posAtCoords({x:t==(l==D.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return Q.cursor(a,t?-1:1)}return Q.cursor(t?s.to:s.from,t?-1:1)}function UO(i,e,t,n){let s=i.state.doc.lineAt(e.head),r=i.bidiSpans(s),o=i.textDirectionAt(s.from);for(let l=e,a=null;;){let O=Up(s,r,o,l,t),h=Zh;if(!O){if(s.number==(t?i.state.doc.lines:1))return l;h=` -`,s=i.state.doc.line(s.number+(t?1:-1)),r=i.bidiSpans(s),O=i.visualLineSide(s,!t)}if(a){if(!a(h))return l}else{if(!n)return O;a=n(h)}l=O}}function im(i,e,t){let n=i.state.charCategorizer(e),s=n(t);return r=>{let o=n(r);return s==L.Space&&(s=o),s==o}}function nm(i,e,t,n){let s=e.head,r=t?1:-1;if(s==(t?i.state.doc.length:0))return Q.cursor(s,e.assoc);let o=e.goalColumn,l,a=i.contentDOM.getBoundingClientRect(),O=i.coordsAtPos(s,e.assoc||-1),h=i.documentTop;if(O)o==null&&(o=O.left-a.left),l=r<0?O.top:O.bottom;else{let u=i.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,i.defaultCharacterWidth*(s-u.from))),l=(r<0?u.top:u.bottom)+h}let c=a.left+o,f=n??i.viewState.heightOracle.textHeight>>1;for(let u=0;;u+=10){let d=l+(f+u)*r,m=Fh(i,{x:c,y:d},!1,r);if(da.bottom||(r<0?ms)){let g=i.docView.coordsForChar(m),$=!g||d{if(e>r&&es(i)),t.from,e.head>t.from?-1:1);return n==t.from?t:Q.cursor(n,nr)&&this.lineBreak(),s=o}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(n,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);n=r+o}}readNode(e){if(e.cmIgnore)return;let t=H.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let s=n.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(sm(e,n.node,n.offset)?t:0))}};function sm(i,e,t){for(;;){if(!e||t-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let l=r||o?[]:lm(e),a=new Po(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=am(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!ho(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),O=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!ho(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((z.ios||z.chrome)&&e.state.selection.main.empty&&a!=O&&(h.from>0||h.toDate.now()-100?i.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=s.from,O=null;(r===8||z.android&&e.text.length=s.from&&t.to<=s.to&&(t.from!=s.from||t.to!=s.to)&&s.to-s.from-(t.to-t.from)<=4?t={from:s.from,to:s.to,insert:i.state.doc.slice(s.from,t.from).append(t.insert).append(i.state.doc.slice(t.to,s.to))}:z.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` - `&&i.lineWrapping&&(n&&(n=Q.single(n.main.anchor-1,n.main.head-1)),t={from:s.from,to:s.to,insert:Y.of([" "])}),t)return rl(i,t,n,r);if(n&&!n.main.eq(s)){let o=!1,l="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(o=!0),l=i.inputState.lastSelectionOrigin),i.dispatch({selection:n,scrollIntoView:o,userEvent:l}),!0}else return!1}function rl(i,e,t,n=-1){if(z.ios&&i.inputState.flushIOSKey(e))return!0;let s=i.state.selection.main;if(z.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&i.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Si(i.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||n==8&&e.insert.lengths.head)&&Si(i.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&Si(i.contentDOM,"Delete",46)))return!0;let r=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,l=()=>o||(o=rm(i,e,t));return i.state.facet(Ah).some(a=>a(i,e.from,e.to,r,l))||i.dispatch(l()),!0}function rm(i,e,t){let n,s=i.state,r=s.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&i.inputState.composing<0){let l=r.frome.to?s.sliceDoc(e.to,r.to):"";n=s.replaceSelection(i.state.toText(l+e.insert.sliceString(0,void 0,i.state.lineBreak)+a))}else{let l=s.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(s.selection.ranges.length>1&&i.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let O=i.state.sliceDoc(e.from,e.to),h,c=t&&Nh(i,t.main.head);if(c){let d=e.insert.length-(e.to-e.from);h={from:c.from,to:c.to-d}}else h=i.state.doc.lineAt(r.head);let f=r.to-e.to,u=r.to-r.from;n=s.changeByRange(d=>{if(d.from==r.from&&d.to==r.to)return{changes:l,range:a||d.map(l)};let m=d.to-f,g=m-O.length;if(d.to-d.from!=u||i.state.sliceDoc(g,m)!=O||d.to>=h.from&&d.from<=h.to)return{range:d};let $=s.changes({from:g,to:m,insert:e.insert}),y=d.to-r.to;return{changes:$,range:a?Q.range(Math.max(0,a.anchor+y),Math.max(0,a.head+y)):d.map($)}})}else n={changes:l,selection:a&&s.selection.replaceRange(a)}}let o="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,o+=".compose",i.inputState.compositionFirstChange&&(o+=".start",i.inputState.compositionFirstChange=!1)),s.update(n,{userEvent:o,scrollIntoView:!0})}function om(i,e,t,n){let s=Math.min(i.length,e.length),r=0;for(;r0&&l>0&&i.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(n=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function lm(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:s,focusOffset:r}=i.observer.selectionRange;return t&&(e.push(new ks(t,n)),(s!=t||r!=n)&&e.push(new ks(s,r))),e}function am(i,e){if(i.length==0)return null;let t=i[0].pos,n=i.length==2?i[1].pos:t;return t>-1&&n>-1?Q.single(t+e,n+e):null}var vo=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,z.safari&&e.contentDOM.addEventListener("input",()=>null),z.gecko&&xm(e.contentDOM.ownerDocument)}handleEvent(e){!pm(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let s of n.observers)s(this.view,t);for(let s of n.handlers){if(t.defaultPrevented)break;if(s(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Om(e),n=this.handlers,s=this.view.contentDOM;for(let r in t)if(r!="scroll"){let o=!t[r].handlers.length,l=n[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in n)r!="scroll"&&!t[r]&&s.removeEventListener(r,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&Jh.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),z.android&&z.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return z.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=Kh.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||hm.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from0?!0:z.safari&&!z.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function MO(i,e){return(t,n)=>{try{return e.call(i,n,t)}catch(s){ce(t.state,s)}}}function Om(i){let e=Object.create(null);function t(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of i){let s=n.spec;if(s&&s.domEventHandlers)for(let r in s.domEventHandlers){let o=s.domEventHandlers[r];o&&t(r).handlers.push(MO(n.value,o))}if(s&&s.domEventObservers)for(let r in s.domEventObservers){let o=s.domEventObservers[r];o&&t(r).observers.push(MO(n.value,o))}}for(let n in Ke)t(n).handlers.push(Ke[n]);for(let n in Ee)t(n).observers.push(Ee[n]);return e}var Kh=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],hm="dthko",Jh=[16,17,18,20,91,92,224,225],os=6;function ls(i){return Math.max(0,i)*.7+8}function cm(i,e){return Math.max(Math.abs(i.clientX-e.clientX),Math.abs(i.clientY-e.clientY))}var wo=class{constructor(e,t,n,s){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=Pp(e.contentDOM),this.atoms=e.state.facet(nl).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(U.allowMultipleSelections)&&fm(e,t),this.dragging=dm(e,t)&&ic(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&cm(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,s=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=sl(this.view);e.clientX-a.left<=s+os?t=-ls(s-e.clientX):e.clientX+a.right>=o-os&&(t=ls(e.clientX-o)),e.clientY-a.top<=r+os?n=-ls(r-e.clientY):e.clientY+a.bottom>=l-os&&(n=ls(e.clientY-l)),this.setScrollSpeed(t,n)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;nt.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function fm(i,e){let t=i.state.facet(Vh);return t.length?t[0](e):z.mac?e.metaKey:e.ctrlKey}function um(i,e){let t=i.state.facet(Ch);return t.length?t[0](e):z.mac?!e.altKey:!e.ctrlKey}function dm(i,e){let{main:t}=i.state.selection;if(t.empty)return!1;let n=ln(i.root);if(!n||n.rangeCount==0)return!0;let s=n.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function pm(i,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,n;t!=i.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(n=H.get(t))&&n.ignoreEvent(e))return!1;return!0}var Ke=Object.create(null),Ee=Object.create(null),ec=z.ie&&z.ie_version<15||z.ios&&z.webkit_version<604;function mm(i){let e=i.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{i.focus(),t.remove(),tc(i,t.value)},50)}function Ys(i,e,t){for(let n of i.facet(e))t=n(t,i);return t}function tc(i,e){e=Ys(i.state,el,e);let{state:t}=i,n,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(To!=null&&t.selection.ranges.every(a=>a.empty)&&To==r.toString()){let a=-1;n=t.changeByRange(O=>{let h=t.doc.lineAt(O.from);if(h.from==a)return{range:O};a=h.from;let c=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:c},range:Q.cursor(O.from+c.length)}})}else o?n=t.changeByRange(a=>{let O=r.line(s++);return{changes:{from:a.from,to:a.to,insert:O.text},range:Q.cursor(a.from+O.length)}}):n=t.replaceSelection(r);i.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Ee.scroll=i=>{i.inputState.lastScrollTop=i.scrollDOM.scrollTop,i.inputState.lastScrollLeft=i.scrollDOM.scrollLeft};Ke.keydown=(i,e)=>(i.inputState.setSelectionOrigin("select"),e.keyCode==27&&i.inputState.tabFocusMode!=0&&(i.inputState.tabFocusMode=Date.now()+2e3),!1);Ee.touchstart=(i,e)=>{i.inputState.lastTouchTime=Date.now(),i.inputState.setSelectionOrigin("select.pointer")};Ee.touchmove=i=>{i.inputState.setSelectionOrigin("select.pointer")};Ke.mousedown=(i,e)=>{if(i.observer.flush(),i.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let n of i.state.facet(Yh))if(t=n(i,e),t)break;if(!t&&e.button==0&&(t=Qm(i,e)),t){let n=!i.hasFocus;i.inputState.startMouseSelection(new wo(i,e,t,n)),n&&i.observer.ignore(()=>{gh(i.contentDOM);let r=i.root.activeElement;r&&!r.contains(i.contentDOM)&&r.blur()});let s=i.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}return!1};function jO(i,e,t,n){if(n==1)return Q.cursor(e,t);if(n==2)return Fp(i.state,e,t);{let s=he.find(i.docView,e),r=i.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return le>=t.top&&e<=t.bottom&&i>=t.left&&i<=t.right;function gm(i,e,t,n){let s=he.find(i.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&GO(t,n,o))return-1;let l=s.coordsAt(r,1);return l&&GO(t,n,l)?1:o&&o.bottom>=n?-1:1}function EO(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:gm(i,t,e.clientX,e.clientY)}}var $m=z.ie&&z.ie_version<=11,LO=null,DO=0,BO=0;function ic(i){if(!$m)return i.detail;let e=LO,t=BO;return LO=i,BO=Date.now(),DO=!e||t>Date.now()-400&&Math.abs(e.clientX-i.clientX)<2&&Math.abs(e.clientY-i.clientY)<2?(DO+1)%3:1}function Qm(i,e){let t=EO(i,e),n=ic(e),s=i.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=EO(i,r),O,h=jO(i,a.pos,a.bias,n);if(t.pos!=a.pos&&!o){let c=jO(i,t.pos,t.bias,n),f=Math.min(c.from,h.from),u=Math.max(c.to,h.to);h=f1&&(O=ym(s,a.pos))?O:l?s.addRange(h):Q.create([h])}}}function ym(i,e){for(let t=0;t=e)return Q.create(i.ranges.slice(0,t).concat(i.ranges.slice(t+1)),i.mainIndex==t?0:i.mainIndex-(i.mainIndex>t?1:0))}return null}Ke.dragstart=(i,e)=>{let{selection:{main:t}}=i.state;if(e.target.draggable){let s=i.docView.nearest(e.target);if(s&&s.isWidget){let r=s.posAtStart,o=r+s.length;(r>=t.to||o<=t.from)&&(t=Q.range(r,o))}}let{inputState:n}=i;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",Ys(i.state,tl,i.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Ke.dragend=i=>(i.inputState.draggedContent=null,!1);function IO(i,e,t,n){if(t=Ys(i.state,el,t),!t)return;let s=i.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=i.inputState,o=n&&r&&um(i,e)?{from:r.from,to:r.to}:null,l={from:s,insert:t},a=i.state.changes(o?[o,l]:l);i.focus(),i.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),i.inputState.draggedContent=null}Ke.drop=(i,e)=>{if(!e.dataTransfer)return!1;if(i.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let n=Array(t.length),s=0,r=()=>{++s==t.length&&IO(i,e,n.filter(o=>o!=null).join(i.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(n[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return IO(i,e,n,!0),!0}return!1};Ke.paste=(i,e)=>{if(i.state.readOnly)return!0;i.observer.flush();let t=ec?null:e.clipboardData;return t?(tc(i,t.getData("text/plain")||t.getData("text/uri-list")),!0):(mm(i),!1)};function Sm(i,e){let t=i.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),i.focus()},50)}function bm(i){let e=[],t=[],n=!1;for(let s of i.selection.ranges)s.empty||(e.push(i.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:r}of i.selection.ranges){let o=i.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(i.doc.length,o.to+1)})),s=o.number}n=!0}return{text:Ys(i,tl,e.join(i.lineBreak)),ranges:t,linewise:n}}var To=null;Ke.copy=Ke.cut=(i,e)=>{let{text:t,ranges:n,linewise:s}=bm(i.state);if(!t&&!s)return!1;To=s?t:null,e.type=="cut"&&!i.state.readOnly&&i.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let r=ec?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(Sm(i,t),!1)};var nc=Se.define();function sc(i,e){let t=[];for(let n of i.facet(Uh)){let s=n(i,e);s&&t.push(s)}return t.length?i.update({effects:t,annotations:nc.of(!0)}):null}function rc(i){setTimeout(()=>{let e=i.hasFocus;if(e!=i.inputState.notifiedFocused){let t=sc(i.state,e);t?i.dispatch(t):i.update([])}},10)}Ee.focus=i=>{i.inputState.lastFocusTime=Date.now(),!i.scrollDOM.scrollTop&&(i.inputState.lastScrollTop||i.inputState.lastScrollLeft)&&(i.scrollDOM.scrollTop=i.inputState.lastScrollTop,i.scrollDOM.scrollLeft=i.inputState.lastScrollLeft),rc(i)};Ee.blur=i=>{i.observer.clearSelectionRange(),rc(i)};Ee.compositionstart=Ee.compositionupdate=i=>{i.observer.editContext||(i.inputState.compositionFirstChange==null&&(i.inputState.compositionFirstChange=!0),i.inputState.composing<0&&(i.inputState.composing=0))};Ee.compositionend=i=>{i.observer.editContext||(i.inputState.composing=-1,i.inputState.compositionEndedAt=Date.now(),i.inputState.compositionPendingKey=!0,i.inputState.compositionPendingChange=i.observer.pendingRecords().length>0,i.inputState.compositionFirstChange=null,z.chrome&&z.android?i.observer.flushSoon():i.inputState.compositionPendingChange?Promise.resolve().then(()=>i.observer.flush()):setTimeout(()=>{i.inputState.composing<0&&i.docView.hasComposition&&i.update([])},50))};Ee.contextmenu=i=>{i.inputState.lastContextMenu=Date.now()};Ke.beforeinput=(i,e)=>{var t,n;if(e.inputType=="insertReplacementText"&&i.observer.editContext){let r=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(r&&o.length){let l=o[0],a=i.posAtDOM(l.startContainer,l.startOffset),O=i.posAtDOM(l.endContainer,l.endOffset);return rl(i,{from:a,to:O,insert:i.state.toText(r)},null),!0}}let s;if(z.chrome&&z.android&&(s=Kh.find(r=>r.inputType==e.inputType))&&(i.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let r=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>r+10&&i.hasFocus&&(i.contentDOM.blur(),i.focus())},100)}return z.ios&&e.inputType=="deleteContentForward"&&i.observer.flushSoon(),z.safari&&e.inputType=="insertText"&&i.inputState.composing>=0&&setTimeout(()=>Ee.compositionend(i,e),20),!1};var NO=new Set;function xm(i){NO.has(i)||(NO.add(i),i.addEventListener("copy",()=>{}),i.addEventListener("cut",()=>{}))}var FO=["pre-wrap","normal","pre-line","break-spaces"],bi=!1;function HO(){bi=!1}var zo=class{constructor(e){this.lineWrapping=e,this.doc=Y.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return FO.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=n,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let O=0;O0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>ms&&(bi=!0),this.height=e)}replace(e,t,n){return i.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,s){let r=this,o=n.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:O,fromB:h,toB:c}=s[l],f=r.lineAt(a,K.ByPosNoHeight,n.setDoc(t),0,0),u=f.to>=O?f:r.lineAt(O,K.ByPosNoHeight,n,0,0);for(c+=u.to-O,O=u.to;l>0&&f.from<=s[l-1].toA;)a=s[l-1].fromA,h=s[l-1].fromB,l--,ar*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),n+=1+l.break,s-=l.size}else if(r>s*2){let l=e[n];l.break?e.splice(n,1,l.left,null,l.right):e.splice(n,1,l.left,l.right),n+=2+l.break,r-=l.size}else break;else if(s=r&&o(this.blockAt(0,n,s,r))}updateHeight(e,t=0,n=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}},Ge=class i extends ws{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,s){return new Ot(s,this.length,n,this.height,this.breaks)}replace(e,t,n){let s=n[0];return n.length==1&&(s instanceof i||s instanceof zt&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof zt?s=new i(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):Re.of(n)}updateHeight(e,t=0,n=!1,s){return s&&s.from<=t&&s.more?this.setHeight(s.heights[s.index++]):(n||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}},zt=class i extends Re{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-n+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:n,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,n,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,s);if(t.lineWrapping){let O=s+(e0){let r=n[n.length-1];r instanceof i?n[n.length-1]=new i(r.length+s):n.push(null,new i(s-1))}if(e>0){let r=n[0];r instanceof i?n[0]=new i(e+r.length):n.unshift(new i(e-1),null)}return Re.of(n)}decomposeLeft(e,t){t.push(new i(e-1),null)}decomposeRight(e,t){t.push(null,new i(this.length-e-1))}updateHeight(e,t=0,n=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1;for(s.from>t&&o.push(new i(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let h=e.doc.lineAt(l).length;o.length&&o.push(null);let c=s.heights[s.index++];a==-1?a=c:Math.abs(c-a)>=ms&&(a=-2);let f=new Ge(h,c);f.outdated=!1,o.push(f),l+=h+1}l<=r&&o.push(null,new i(r-l).updateHeight(e,l));let O=Re.of(o);return(a<0||Math.abs(O.height-this.height)>=ms||Math.abs(a-this.heightMetrics(e,t).perLine)>=ms)&&(bi=!0),vs(this,O)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},Ro=class extends Re{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,s){let r=n+this.left.height;return el))return O;let h=t==K.ByPosNoHeight?K.ByPosNoHeight:K.ByPos;return a?O.join(this.right.lineAt(l,h,n,o,l)):this.left.lineAt(l,h,n,s,r).join(O)}forEachLine(e,t,n,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,n,l,a,o);else{let O=this.lineAt(a,K.ByPos,n,s,r);e=e&&O.from<=t&&o(O),t>O.to&&this.right.forEachLine(O.to+1,t,n,l,a,o)}}replace(e,t,n){let s=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,n));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of n)r.push(l);if(e>0&&KO(r,o-1),t=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,s=n+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e2*t.size||t.size>2*e.size?Re.of(this.break?[e,null,t]:[e,t]):(this.left=vs(this.left,e),this.right=vs(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,s){let{left:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,n,s):r.updateHeight(e,t,n),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,n,s):o.updateHeight(e,l,n),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}};function KO(i,e){let t,n;i[e]==null&&(t=i[e-1])instanceof zt&&(n=i[e+1])instanceof zt&&i.splice(e-1,3,new zt(t.length+1+n.length))}var Pm=5,qo=class i{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let n=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Ge?s.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new Ge(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e=Pm)&&this.addLineDeco(s,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Ge(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new zt(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ge)return e;let t=new Ge(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let s=this.ensureLine();s.length+=n,s.collapsed+=n,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Ge)&&!this.isCovered?this.nodes.push(new Ge(0,-1)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&c.overflow!="visible"){let f=h.getBoundingClientRect();r=Math.max(r,f.left),o=Math.min(o,f.right),l=Math.max(l,f.top),a=Math.min(O==i.parentNode?s.innerHeight:a,f.bottom)}O=c.position=="absolute"||c.position=="fixed"?h.offsetParent:h.parentNode}else if(O.nodeType==11)O=O.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function wm(i){let e=i.getBoundingClientRect(),t=i.ownerDocument.defaultView||window;return e.left0&&e.top0}function Tm(i,e){let t=i.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}var sn=class{constructor(e,t,n,s){this.from=e,this.to=t,this.size=n,this.displaySize=s}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;ntypeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new zo(t),this.stateDeco=e.facet(dn).filter(n=>typeof n!="function"),this.heightMap=Re.empty().applyChanges(this.stateDeco,Y.empty,this.heightOracle.setDoc(e.doc),[new ct(0,0,0,e.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=X.set(this.lineGaps.map(n=>n.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let s=n?t.head:t.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new $i(r,o))}}return this.viewports=e.sort((n,s)=>n.from-s.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?JO:new Vo(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Hi(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(dn).filter(h=>typeof h!="function");let s=e.changedRanges,r=ct.extendWithRanges(s,km(n,this.stateDeco,e?e.changes:ge.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);HO(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=o||bi)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let O=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(O||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(jh)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),s=this.heightOracle,r=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?D.RTL:D.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let O=0,h=0;if(l.width&&l.height){let{scaleX:x,scaleY:S}=mh(t,l);(x>.005&&Math.abs(this.scaleX-x)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=x,this.scaleY=S,O|=16,o=a=!0)}let c=(parseInt(n.paddingTop)||0)*this.scaleY,f=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=c||this.paddingBottom!=f)&&(this.paddingTop=c,this.paddingBottom=f,O|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,O|=16);let u=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=u&&(this.scrollAnchorHeight=-1,this.scrollTop=u),this.scrolledToBottom=Qh(e.scrollDOM);let d=(this.printing?Tm:vm)(t,this.paddingTop),m=d.top-this.pixelViewport.top,g=d.bottom-this.pixelViewport.bottom;this.pixelViewport=d;let $=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if($!=this.inView&&(this.inView=$,$&&(a=!0)),!this.inView&&!this.scrollTarget&&!wm(e.dom))return 0;let y=l.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,O|=16),a){let x=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(x)&&(o=!0),o||s.lineWrapping&&Math.abs(y-this.contentDOMWidth)>s.charWidth){let{lineHeight:S,charWidth:P,textHeight:w}=e.docView.measureTextSize();o=S>0&&s.refresh(r,S,P,w,y/P,x),o&&(e.docView.minWidth=0,O|=16)}m>0&&g>0?h=Math.max(m,g):m<0&&g<0&&(h=Math.min(m,g)),HO();for(let S of this.viewports){let P=S.from==this.viewport.from?x:e.docView.measureVisibleLineHeights(S);this.heightMap=(o?Re.empty().applyChanges(this.stateDeco,Y.empty,this.heightOracle,[new ct(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new Xo(S.from,P))}bi&&(O|=2)}let b=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return b&&(O&2&&(O|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),O|=this.updateForViewport()),(O&2||b)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),O|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),O}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new $i(s.lineAt(o-n*1e3,K.ByHeight,r,0,0).from,s.lineAt(l+(1-n)*1e3,K.ByHeight,r,0,0).to);if(t){let{head:O}=t.range;if(Oa.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),c=s.lineAt(O,K.ByPos,r,0,0),f;t.y=="center"?f=(c.top+c.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&O=l+Math.max(10,Math.min(n,250)))&&s>o-2*1e3&&r>1,o=s<<1;if(this.defaultTextDirection!=D.LTR&&!n)return[];let l=[],a=(h,c,f,u)=>{if(c-hh&&$$.from>=f.from&&$.to<=f.to&&Math.abs($.from-h)$.fromy));if(!g){if(cb.from<=c&&b.to>=c)){let b=t.moveToLineBoundary(Q.cursor(c),!1,!0).head;b>h&&(c=b)}let $=this.gapSize(f,h,c,u),y=n||$<2e6?$:2e6;g=new sn(h,c,$,y)}l.push(g)},O=h=>{if(h.length2e6)for(let P of e)P.from>=h.from&&P.fromh.from&&a(h.from,u,h,c),dt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];M.spans(t,this.viewport.from,this.viewport.to,{span(r,o){n.push({from:r,to:o})},point(){}},20);let s=0;if(n.length!=this.visibleRanges.length)s=12;else for(let r=0;r=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Hi(this.heightMap.lineAt(e,K.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Hi(this.heightMap.lineAt(this.scaler.fromDOM(e),K.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Hi(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},$i=class{constructor(e,t){this.from=e,this.to=t}};function zm(i,e,t){let n=[],s=i,r=0;return M.spans(t,i,e,{span(){},point(o,l){o>s&&(n.push({from:s,to:o}),r+=o-s),s=l}},20),s=1)return e[e.length-1].to;let n=Math.floor(i*t);for(let s=0;;s++){let{from:r,to:o}=e[s],l=o-r;if(n<=l)return r+n;n-=l}}function Os(i,e){let t=0;for(let{from:n,to:s}of i.ranges){if(e<=s){t+=e-n;break}t+=s-n}return t/i.total}function Xm(i,e){for(let t of i)if(e(t))return t}var JO={toDOM(i){return i},fromDOM(i){return i},scale:1,eq(i){return i==this}},Vo=class i{constructor(e,t,n){let s=0,r=0,o=0;this.viewports=n.map(({from:l,to:a})=>{let O=t.lineAt(l,K.ByPos,e,0,0).top,h=t.lineAt(a,K.ByPos,e,0,0).bottom;return s+=h-O,{from:l,to:a,top:O,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,n=0,s=0;;t++){let r=tt.from==e.viewports[n].from&&t.to==e.viewports[n].to):!1}};function Hi(i,e){if(e.scale==1)return i;let t=e.toDOM(i.top),n=e.toDOM(i.bottom);return new Ot(i.from,i.length,t,n-t,Array.isArray(i._content)?i._content.map(s=>Hi(s,e)):i._content)}var hs=T.define({combine:i=>i.join(" ")}),Co=T.define({combine:i=>i.indexOf(!0)>-1}),Yo=je.newName(),oc=je.newName(),lc=je.newName(),ac={"&light":"."+oc,"&dark":"."+lc};function _o(i,e,t){return new je(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,s=>{if(s=="&")return i;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):i+" "+n}})}var Rm=_o("."+Yo,{"&":{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,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&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"}},ac),qm={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},oo=z.ie&&z.ie_version<=11,Ao=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new co,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let n of t)this.queue.push(n);(z.ie&&z.ie_version<=11||z.ios&&e.composing)&&t.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(z.chrome&&z.chrome_version<126)&&(this.editContext=new Uo(e),e.state.facet(bt)&&(e.contentDOM.editContext=this.editContext.editContext)),oo&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,s=this.selectionRange;if(n.state.facet(bt)?n.root.activeElement!=this.dom:!us(this.dom,s))return;let r=s.anchorNode&&n.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(z.ie&&z.ie_version<=11||z.android&&z.chrome)&&!n.state.selection.main.empty&&s.focusNode&&Ji(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=ln(e.root);if(!t)return!1;let n=z.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Wm(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let s=us(this.dom,n);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Si(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,s=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:n}=o:(t=Math.min(o.from,t),n=Math.max(o.to,n)))}return{from:t,to:n,typeOver:s}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),s=this.selectionChanged&&us(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new ko(this.view,e,t,n);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,s=Hh(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),s}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let n=eh(t,e.previousSibling||e.target.previousSibling,-1),s=eh(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(bt)!=e.state.facet(bt)&&(e.view.contentDOM.editContext=e.state.facet(bt)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function eh(i,e,t){for(;e;){let n=H.get(e);if(n&&n.parent==i)return n;let s=e.parentNode;e=s!=i.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function th(i,e){let t=e.startContainer,n=e.startOffset,s=e.endContainer,r=e.endOffset,o=i.docView.domAtPos(i.state.selection.main.anchor);return Ji(o.node,o.offset,s,r)&&([t,n,s,r]=[s,r,t,n]),{anchorNode:t,anchorOffset:n,focusNode:s,focusOffset:r}}function Wm(i,e){if(e.getComposedRanges){let s=e.getComposedRanges(i.root)[0];if(s)return th(i,s)}let t=null;function n(s){s.preventDefault(),s.stopImmediatePropagation(),t=s.getTargetRanges()[0]}return i.contentDOM.addEventListener("beforeinput",n,!0),i.dom.ownerDocument.execCommand("indent"),i.contentDOM.removeEventListener("beforeinput",n,!0),t?th(i,t):null}var Uo=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let s=e.state.selection.main,{anchor:r,head:o}=s,l=this.toEditorPos(n.updateRangeStart),a=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:l,drifted:!1});let O={from:l,to:a,insert:Y.of(n.text.split(` -`))};if(O.from==this.from&&rthis.to&&(O.to=r),O.from==O.to&&!O.insert.length){let h=Q.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));h.main.eq(s)||e.dispatch({selection:h,userEvent:"select"});return}if((z.mac||z.android)&&O.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(O={from:l,to:a,insert:Y.of([n.text.replace("."," ")])}),this.pendingContextChange=O,!e.state.readOnly){let h=this.to-this.from+(O.to-O.from+O.insert.length);rl(e,O,Q.single(this.toEditorPos(n.selectionStart,h),this.toEditorPos(n.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=n=>{let s=[],r=null;for(let o=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);o{let s=[];for(let r of n.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(o!="None"&&l!="None"){let a=this.toEditorPos(r.rangeStart),O=this.toEditorPos(r.rangeEnd);if(a{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let s=ln(n.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,s=this.pendingContextChange;return e.changes.iterChanges((r,o,l,a,O)=>{if(n)return;let h=O.length-(o-r);if(s&&o>=s.to)if(s.from==r&&s.to==o&&s.insert.eq(O)){s=this.pendingContextChange=null,t+=h,this.to+=h;return}else s=null,this.revertPending(e.state);if(r+=t,o+=t,o<=this.from)this.from+=h,this.to+=h;else if(rthis.to||this.to-this.from+O.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),O.toString()),this.to+=h}t+=h}),s&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(s=>!s.isUserEvent("input.type")&&s.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),s=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(n,s)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},k=class i{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!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,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.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(s=>s.forEach(r=>n(r,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||kp(e.parent)||document,this.viewState=new Ts(e.state||U.create(e)),e.scrollTo&&e.scrollTo.is(rs)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ii).map(s=>new nn(s));for(let s of this.plugins)s.update(this);this.observer=new Ao(this),this.inputState=new vo(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Ps(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof ne?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,s,r=this.state;for(let f of e){if(f.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=f.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(f=>f.annotation(nc))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=sc(r,o),a||(l=1));let O=this.observer.delayedAndroidKey,h=null;if(O?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(h=null)):this.observer.clear(),r.facet(U.phrases)!=this.state.facet(U.phrases))return this.setState(r);s=xs.create(this,r,e),s.flags|=l;let c=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(c&&(c=c.map(f.changes)),f.scrollIntoView){let{main:u}=f.state.selection;c=new tn(u.empty?u:Q.cursor(u.head,u.head>u.anchor?-1:1))}for(let u of f.effects)u.is(rs)&&(c=u.value.clip(this.state))}this.viewState.update(s,c),this.bidiCache=zs.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(Ni)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(hs)!=s.state.facet(hs)&&(this.viewState.mustMeasureContent=!0),(t||n||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!s.empty)for(let f of this.state.facet(So))try{f(s)}catch(u){ce(this.state,u,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!Hh(this,h)&&O.force&&Si(this.contentDOM,O.key,O.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new Ts(e),this.plugins=e.facet(Ii).map(n=>new nn(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new Ps(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Ii),n=e.state.facet(Ii);if(t!=n){let s=[];for(let r of n){let o=t.indexOf(r);if(o<0)s.push(new nn(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,s=n.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(Qh(n))r=-1,o=this.viewState.heightMap.height;else{let u=this.viewState.scrollAnchorAt(s);r=u.from,o=u.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let O=[];a&4||([this.measureRequests,O]=[O,this.measureRequests]);let h=O.map(u=>{try{return u.read(this)}catch(d){return ce(this.state,d),ih}}),c=xs.create(this,this.state,[]),f=!1;c.flags|=a,t?t.flags|=a:t=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),f=this.docView.update(c),f&&this.docViewUpdate());for(let u=0;u1||d<-1){s=s+d,n.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(So))l(t)}get themeClasses(){return Yo+" "+(this.state.facet(Co)?lc:oc)+" "+this.state.facet(hs)}updateAttrs(){let e=nh(this,Lh,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(bt)?"true":"false",class:"cm-content",style:`${z.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),nh(this,il,t);let n=this.observer.ignore(()=>{let s=go(this.contentDOM,this.contentAttrs,t),r=go(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let s of n.effects)if(s.is(i.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(Ni);let e=this.state.facet(i.cspNonce);je.mount(this.root,this.styleModules.concat(Rm).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;tn.spec==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return ro(this,e,UO(this,e,t,n))}moveByGroup(e,t){return ro(this,e,UO(this,e,t,n=>im(this,e.head,n)))}visualLineSide(e,t){let n=this.bidiSpans(e),s=this.textDirectionAt(e.from),r=n[t?n.length-1:0];return Q.cursor(r.side(t,s)+e.from,r.forward(!t,s)?1:-1)}moveToLineBoundary(e,t,n=!0){return tm(this,e,t,n)}moveVertically(e,t,n){return ro(this,e,nm(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),Fh(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[ht.find(r,e-s.from,-1,t)];return Vs(n,o.dir==D.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(Mh)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Zm)return Wh(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||qh(r.isolates,n=VO(this,e))))return r.order;n||(n=VO(this,e));let s=Ap(e.text,t,n);return this.bidiCache.push(new zs(e.from,e.to,t,n,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||z.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{gh(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return rs.of(new tn(typeof e=="number"?Q.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return rs.of(new tn(Q.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return te.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return te.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=je.newName(),s=[hs.of(n),Ni.of(_o(`.${n}`,e))];return t&&t.dark&&s.push(Co.of(!0)),s}static baseTheme(e){return Me.lowest(Ni.of(_o("."+Yo,e,ac)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),s=n&&H.get(n)||H.get(e);return((t=s?.rootView)===null||t===void 0?void 0:t.view)||null}};k.styleModule=Ni;k.inputHandler=Ah;k.clipboardInputFilter=el;k.clipboardOutputFilter=tl;k.scrollHandler=Gh;k.focusChangeEffect=Uh;k.perLineTextDirection=Mh;k.exceptionSink=_h;k.updateListener=So;k.editable=bt;k.mouseSelectionStyle=Yh;k.dragMovesSelection=Ch;k.clickAddsSelectionRange=Vh;k.decorations=dn;k.outerDecorations=Dh;k.atomicRanges=nl;k.bidiIsolatedRanges=Bh;k.scrollMargins=Ih;k.darkTheme=Co;k.cspNonce=T.define({combine:i=>i.length?i[0]:""});k.contentAttributes=il;k.editorAttributes=Lh;k.lineWrapping=k.contentAttributes.of({class:"cm-lineWrapping"});k.announce=q.define();var Zm=4096,ih={},zs=class i{constructor(e,t,n,s,r,o){this.from=e,this.to=t,this.dir=n,this.isolates=s,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let n=[],s=e.length?e[e.length-1].dir:D.LTR;for(let r=Math.max(0,e.length-10);r=0;s--){let r=n[s],o=typeof r=="function"?r(i):r;o&&mo(o,t)}return t}var Vm=z.mac?"mac":z.windows?"win":z.linux?"linux":"key";function Cm(i,e){let t=i.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let s,r,o,l;for(let a=0;an.concat(s),[]))),t}function hc(i,e,t){return cc(Oc(i.state),e,i,t)}var Tt=null,_m=4e3;function Am(i,e=Vm){let t=Object.create(null),n=Object.create(null),s=(o,l)=>{let a=n[o];if(a==null)n[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,O,h)=>{var c,f;let u=t[o]||(t[o]=Object.create(null)),d=l.split(/ (?!$)/).map($=>Cm($,e));for(let $=1;${let x=Tt={view:b,prefix:y,scope:o};return setTimeout(()=>{Tt==x&&(Tt=null)},_m),!0}]})}let m=d.join(" ");s(m,!1);let g=u[m]||(u[m]={preventDefault:!1,stopPropagation:!1,run:((f=(c=u._any)===null||c===void 0?void 0:c.run)===null||f===void 0?void 0:f.slice())||[]});a&&g.run.push(a),O&&(g.preventDefault=!0),h&&(g.stopPropagation=!0)};for(let o of i){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let O of l){let h=t[O]||(t[O]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:c}=o;for(let f in h)h[f].run.push(u=>c(u,Mo))}let a=o[e]||o.key;if(a)for(let O of l)r(O,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(O,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}var Mo=null;function cc(i,e,t,n){Mo=e;let s=wO(e),r=Oe(s,0),o=Xe(r)==s.length&&s!=" ",l="",a=!1,O=!1,h=!1;Tt&&Tt.view==t&&Tt.scope==n&&(l=Tt.prefix+" ",Jh.indexOf(e.keyCode)<0&&(O=!0,Tt=null));let c=new Set,f=g=>{if(g){for(let $ of g.run)if(!c.has($)&&(c.add($),$(t)))return g.stopPropagation&&(h=!0),!0;g.preventDefault&&(g.stopPropagation&&(h=!0),O=!0)}return!1},u=i[n],d,m;return u&&(f(u[l+cs(s,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(z.windows&&e.ctrlKey&&e.altKey)&&(d=St[e.keyCode])&&d!=s?(f(u[l+cs(d,e,!0)])||e.shiftKey&&(m=mi[e.keyCode])!=s&&m!=d&&f(u[l+cs(m,e,!1)]))&&(a=!0):o&&e.shiftKey&&f(u[l+cs(s,e,!0)])&&(a=!0),!a&&f(u._any)&&(a=!0)),O&&(a=!0),a&&h&&e.stopPropagation(),Mo=null,a}var pn=class i{constructor(e,t,n,s,r){this.className=e,this.left=t,this.top=n,this.width=s,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let s=e.coordsAtPos(n.head,n.assoc||1);if(!s)return[];let r=fc(e);return[new i(t,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return Um(e,t,n)}};function fc(i){let e=i.scrollDOM.getBoundingClientRect();return{left:(i.textDirection==D.LTR?e.left:e.right-i.scrollDOM.clientWidth*i.scaleX)-i.scrollDOM.scrollLeft*i.scaleX,top:e.top-i.scrollDOM.scrollTop*i.scaleY}}function rh(i,e,t,n){let s=i.coordsAtPos(e,t*2);if(!s)return n;let r=i.dom.getBoundingClientRect(),o=(s.top+s.bottom)/2,l=i.posAtCoords({x:r.left+1,y:o}),a=i.posAtCoords({x:r.right-1,y:o});return l==null||a==null?n:{from:Math.max(n.from,Math.min(l,a)),to:Math.min(n.to,Math.max(l,a))}}function Um(i,e,t){if(t.to<=i.viewport.from||t.from>=i.viewport.to)return[];let n=Math.max(t.from,i.viewport.from),s=Math.min(t.to,i.viewport.to),r=i.textDirection==D.LTR,o=i.contentDOM,l=o.getBoundingClientRect(),a=fc(i),O=o.querySelector(".cm-line"),h=O&&window.getComputedStyle(O),c=l.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),f=l.right-(h?parseInt(h.paddingRight):0),u=xo(i,n,1),d=xo(i,s,-1),m=u.type==Qe.Text?u:null,g=d.type==Qe.Text?d:null;if(m&&(i.lineWrapping||u.widgetLineBreaks)&&(m=rh(i,n,1,m)),g&&(i.lineWrapping||d.widgetLineBreaks)&&(g=rh(i,s,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return y(b(t.from,t.to,m));{let S=m?b(t.from,null,m):x(u,!1),P=g?b(null,t.to,g):x(d,!0),w=[];return(m||u).to<(g||d).from-(m&&g?1:0)||u.widgetLineBreaks>1&&S.bottom+i.defaultLineHeight/2W&&A.from=me)break;Ae>F&&C(Math.max(ae,F),S==null&&ae<=W,Math.min(Ae,me),P==null&&Ae>=E,ot.dir)}if(F=we.to+1,F>=me)break}return B.length==0&&C(W,S==null,E,P==null,i.textDirection),{top:V,bottom:_,horizontal:B}}function x(S,P){let w=l.top+(P?S.top:S.bottom);return{top:w,bottom:w,horizontal:[]}}}function Mm(i,e){return i.constructor==e.constructor&&i.eq(e)}var jo=class{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(gs)!=e.state.facet(gs)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(gs);for(;t!Mm(t,this.drawn[n]))){let t=this.dom.firstChild,n=0;for(let s of e)s.update&&t&&s.constructor&&this.drawn[n].constructor&&s.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(s.draw(),t);for(;t;){let s=t.nextSibling;t.remove(),t=s}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},gs=T.define();function uc(i){return[te.define(e=>new jo(e,i)),gs.of(i)]}var mn=T.define({combine(i){return de(i,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function dc(i={}){return[mn.of(i),jm,Gm,Em,jh.of(!0)]}function pc(i){return i.startState.facet(mn)!=i.state.facet(mn)}var jm=uc({above:!0,markers(i){let{state:e}=i,t=e.facet(mn),n=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty||t.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:Q.cursor(s.head,s.head>s.anchor?-1:1);for(let a of pn.forRange(i,o,l))n.push(a)}}return n},update(i,e){i.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=pc(i);return t&&oh(i.state,e),i.docChanged||i.selectionSet||t},mount(i,e){oh(e.state,i)},class:"cm-cursorLayer"});function oh(i,e){e.style.animationDuration=i.facet(mn).cursorBlinkRate+"ms"}var Gm=uc({above:!1,markers(i){return i.state.selection.ranges.map(e=>e.empty?[]:pn.forRange(i,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(i,e){return i.docChanged||i.selectionSet||i.viewportChanged||pc(i)},class:"cm-selectionLayer"}),Em=Me.highest(k.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),mc=q.define({map(i,e){return i==null?null:e.mapPos(i)}}),Ki=J.define({create(){return null},update(i,e){return i!=null&&(i=e.changes.mapPos(i)),e.effects.reduce((t,n)=>n.is(mc)?n.value:t,i)}}),Lm=te.fromClass(class{constructor(i){this.view=i,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(i){var e;let t=i.state.field(Ki);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(i.startState.field(Ki)!=t||i.docChanged||i.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:i}=this,e=i.state.field(Ki),t=e!=null&&i.coordsAtPos(e);if(!t)return null;let n=i.scrollDOM.getBoundingClientRect();return{left:t.left-n.left+i.scrollDOM.scrollLeft*i.scaleX,top:t.top-n.top+i.scrollDOM.scrollTop*i.scaleY,height:t.bottom-t.top}}drawCursor(i){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;i?(this.cursor.style.left=i.left/e+"px",this.cursor.style.top=i.top/t+"px",this.cursor.style.height=i.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(i){this.view.state.field(Ki)!=i&&this.view.dispatch({effects:mc.of(i)})}},{eventObservers:{dragover(i){this.setDropPos(this.view.posAtCoords({x:i.clientX,y:i.clientY}))},dragleave(i){(i.target==this.view.contentDOM||!this.view.contentDOM.contains(i.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function gc(){return[Ki,Lm]}function lh(i,e,t,n,s){e.lastIndex=0;for(let r=i.iterRange(t,n),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function Dm(i,e){let t=i.visibleRanges;if(t.length==1&&t[0].from==i.viewport.from&&t[0].to==i.viewport.to)return t;let n=[];for(let{from:s,to:r}of t)s=Math.max(i.state.doc.lineAt(s).from,s-e),r=Math.min(i.state.doc.lineAt(r).to,r+e),n.length&&n[n.length-1].to>=s?n[n.length-1].to=r:n.push({from:s,to:r});return n}var Go=class{constructor(e){let{regexp:t,decoration:n,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(l,a,O,h)=>s(h,O,O+l[0].length,l,a);else if(typeof n=="function")this.addMatch=(l,a,O,h)=>{let c=n(l,a,O);c&&h(O,O+l[0].length,c)};else if(n)this.addMatch=(l,a,O,h)=>h(O,O+l[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new ze,n=t.add.bind(t);for(let{from:s,to:r}of Dm(e,this.maxLength))lh(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,n));return t.finish()}updateDeco(e,t){let n=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,a)=>{a>=e.view.viewport.from&&l<=e.view.viewport.to&&(n=Math.min(l,n),s=Math.max(a,s))}),e.viewportMoved||s-n>1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),n,s):t}updateRange(e,t,n,s){for(let r of e.visibleRanges){let o=Math.max(r.from,n),l=Math.min(r.to,s);if(l>=o){let a=e.state.doc.lineAt(o),O=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){h=o;break}for(;lf.push($.range(m,g));if(a==O)for(this.regexp.lastIndex=h-a.from;(u=this.regexp.exec(a.text))&&u.indexthis.addMatch(g,e,m,d));t=t.update({filterFrom:h,filterTo:c,filter:(m,g)=>mc,add:f})}}return t}},Eo=/x/.unicode!=null?"gu":"g",Bm=new RegExp(`[\0-\b --\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,Eo),Im={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},lo=null;function Nm(){var i;if(lo==null&&typeof document<"u"&&document.body){let e=document.body.style;lo=((i=e.tabSize)!==null&&i!==void 0?i:e.MozTabSize)!=null}return lo||!1}var $s=T.define({combine(i){let e=de(i,{render:null,specialChars:Bm,addSpecialChars:null});return(e.replaceTabs=!Nm())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Eo)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Eo)),e}});function $c(i={}){return[$s.of(i),Fm()]}var ah=null;function Fm(){return ah||(ah=te.fromClass(class{constructor(i){this.view=i,this.decorations=X.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(i.state.facet($s)),this.decorations=this.decorator.createDeco(i)}makeDecorator(i){return new Go({regexp:i.specialChars,decoration:(e,t,n)=>{let{doc:s}=t.state,r=Oe(e[0],0);if(r==9){let o=s.lineAt(n),l=t.state.tabSize,a=yt(o.text,l,n-o.from);return X.replace({widget:new Do((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=X.replace({widget:new Lo(i,r)}))},boundary:i.replaceTabs?void 0:/[^]/})}update(i){let e=i.state.facet($s);i.startState.facet($s)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(i.view)):this.decorations=this.decorator.updateDeco(i,this.decorations)}},{decorations:i=>i.decorations}))}var Hm="\u2022";function Km(i){return i>=32?Hm:i==10?"\u2424":String.fromCharCode(9216+i)}var Lo=class extends xe{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Km(this.code),n=e.state.phrase("Control character")+" "+(Im[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,n,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=n,r.setAttribute("aria-label",n),r.className="cm-specialChar",r}ignoreEvent(){return!1}},Do=class extends xe{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}};function Qc(){return eg}var Jm=X.line({class:"cm-activeLine"}),eg=te.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.docChanged||i.selectionSet)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=-1,t=[];for(let n of i.state.selection.ranges){let s=i.lineBlockAt(n.head);s.from>e&&(t.push(Jm.range(s.from)),e=s.from)}return X.set(t)}},{decorations:i=>i.decorations});var Bo=2e3;function tg(i,e,t){let n=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Bo||t.off>Bo||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=n;a<=s;a++){let O=i.doc.line(a);O.length<=l&&r.push(Q.range(O.from+o,O.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=n;a<=s;a++){let O=i.doc.line(a),h=is(O.text,o,i.tabSize,!0);if(h<0)r.push(Q.cursor(O.to));else{let c=is(O.text,l,i.tabSize);r.push(Q.range(O.from+h,O.from+c))}}}return r}function ig(i,e){let t=i.coordsAtPos(i.viewport.from);return t?Math.round(Math.abs((t.left-e)/i.defaultCharacterWidth)):-1}function Oh(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1),n=i.state.doc.lineAt(t),s=t-n.from,r=s>Bo?-1:s==n.length?ig(i,e.clientX):yt(n.text,i.state.tabSize,t-n.from);return{line:n.number,col:r,off:s}}function ng(i,e){let t=Oh(i,e),n=i.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},n=n.map(s.changes)}},get(s,r,o){let l=Oh(i,s);if(!l)return n;let a=tg(i.state,t,l);return a.length?o?Q.create(a.concat(n.ranges)):Q.create(a):n}}:null}function yc(i){let e=i?.eventFilter||(t=>t.altKey&&t.button==0);return k.mouseSelectionStyle.of((t,n)=>e(n)?ng(t,n):null)}var sg={Alt:[18,i=>!!i.altKey],Control:[17,i=>!!i.ctrlKey],Shift:[16,i=>!!i.shiftKey],Meta:[91,i=>!!i.metaKey]},rg={style:"cursor: crosshair"};function Sc(i={}){let[e,t]=sg[i.key||"Alt"],n=te.fromClass(class{constructor(s){this.view=s,this.isDown=!1}set(s){this.isDown!=s&&(this.isDown=s,this.view.update([]))}},{eventObservers:{keydown(s){this.set(s.keyCode==e||t(s))},keyup(s){(s.keyCode==e||!t(s))&&this.set(!1)},mousemove(s){this.set(t(s))}}});return[n,k.contentAttributes.of(s=>{var r;return!((r=s.plugin(n))===null||r===void 0)&&r.isDown?rg:null})]}var Bi="-10000px",Xs=class{constructor(e,t,n,s){this.facet=t,this.createTooltipView=n,this.removeTooltipView=s,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let r=null;this.tooltipViews=this.tooltips.map(o=>r=n(o,r))}update(e,t){var n;let s=e.state.facet(this.facet),r=s.filter(a=>a);if(s===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=t?[]:null;for(let a=0;at[O]=a),t.length=l.length),this.input=s,this.tooltips=r,this.tooltipViews=o,!0}};function og(i){let e=i.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}var ao=T.define({combine:i=>{var e,t,n;return{position:z.ios?"absolute":((e=i.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=i.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((n=i.find(s=>s.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||og}}}),hh=new WeakMap,ol=te.fromClass(class{constructor(i){this.view=i,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=i.state.facet(ao);this.position=e.position,this.parent=e.parent,this.classes=i.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Xs(i,gn,(t,n)=>this.createTooltip(t,n),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),i.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let i of this.manager.tooltipViews)this.intersectionObserver.observe(i.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(i){i.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(i,this.above);e&&this.observeIntersection();let t=e||i.geometryChanged,n=i.state.facet(ao);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(i,e){let t=i.create(this.view),n=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),i.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",t.dom.appendChild(s)}return t.dom.style.position=this.position,t.dom.style.top=Bi,t.dom.style.left="0px",this.container.insertBefore(t.dom,n),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var i,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(i=n.destroy)===null||i===void 0||i.call(n);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let i=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(z.gecko)t=r.offsetParent!=this.container.ownerDocument.body;else if(r.style.top==Bi&&r.style.left=="0px"){let o=r.getBoundingClientRect();t=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(t||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(i=r.width/this.parent.offsetWidth,e=r.height/this.parent.offsetHeight)}else({scaleX:i,scaleY:e}=this.view.viewState);let n=this.view.scrollDOM.getBoundingClientRect(),s=sl(this.view);return{visible:{left:n.left+s.left,top:n.top+s.top,right:n.right-s.right,bottom:n.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((r,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(ao).tooltipSpace(this.view),scaleX:i,scaleY:e,makeAbsolute:t}}writeMeasure(i){var e;if(i.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:t,space:n,scaleX:s,scaleY:r}=i,o=[];for(let l=0;l=Math.min(t.bottom,n.bottom)||c.rightMath.min(t.right,n.right)+.1)){h.style.top=Bi;continue}let u=a.arrow?O.dom.querySelector(".cm-tooltip-arrow"):null,d=u?7:0,m=f.right-f.left,g=(e=hh.get(O))!==null&&e!==void 0?e:f.bottom-f.top,$=O.offset||ag,y=this.view.textDirection==D.LTR,b=f.width>n.right-n.left?y?n.left:n.right-f.width:y?Math.max(n.left,Math.min(c.left-(u?14:0)+$.x,n.right-m)):Math.min(Math.max(n.left,c.left-m+(u?14:0)-$.x),n.right-m),x=this.above[l];!a.strictSide&&(x?c.top-g-d-$.yn.bottom)&&x==n.bottom-c.bottom>c.top-n.top&&(x=this.above[l]=!x);let S=(x?c.top-n.top:n.bottom-c.bottom)-d;if(Sb&&V.topP&&(P=x?V.top-g-2-d:V.bottom+d+2);if(this.position=="absolute"?(h.style.top=(P-i.parent.top)/r+"px",ch(h,(b-i.parent.left)/s)):(h.style.top=P/r+"px",ch(h,b/s)),u){let V=c.left+(y?$.x:-$.x)-(b+14-7);u.style.left=V/s+"px"}O.overlap!==!0&&o.push({left:b,top:P,right:w,bottom:P+g}),h.classList.toggle("cm-tooltip-above",x),h.classList.toggle("cm-tooltip-below",!x),O.positioned&&O.positioned(i.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let i of this.manager.tooltipViews)i.dom.style.top=Bi}},{eventObservers:{scroll(){this.maybeMeasure()}}});function ch(i,e){let t=parseInt(i.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(i.style.left=e+"px")}var lg=k.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),ag={x:0,y:0},gn=T.define({enables:[ol,lg]}),Rs=T.define({combine:i=>i.reduce((e,t)=>e.concat(t),[])}),qs=class i{static create(e){return new i(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Xs(e,Rs,(t,n)=>this.createHostedView(t,n),t=>t.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let s=n[e];if(s!==void 0){if(t===void 0)t=s;else if(t!==s)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}},Og=gn.compute([Rs],i=>{let e=i.facet(Rs);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var n;return(n=t.end)!==null&&n!==void 0?n:t.pos})),create:qs.create,above:e[0].above,arrow:e.some(t=>t.arrow)}}),Io=class{constructor(e,t,n,s,r){this.view=e,this.source=t,this.field=n,this.setHover=s,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;el.bottom||t.xl.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(s)).find(h=>h.from<=s&&h.to>=s),O=a&&a.dir==D.RTL?-1:1;r=t.x{this.pending==l&&(this.pending=null,a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])}))},a=>ce(e.state,a,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(ol),t=e?e.manager.tooltips.findIndex(n=>n.create==qs.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:s,tooltip:r}=this;if(s.length&&r&&!hg(r.dom,e)||this.pending){let{pos:o}=s[0]||this.pending,l=(n=(t=s[0])===null||t===void 0?void 0:t.end)!==null&&n!==void 0?n:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!cg(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:n}=this;n&&n.dom.contains(e.relatedTarget)?this.watchTooltipLeave(n.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}},fs=4;function hg(i,e){let{left:t,right:n,top:s,bottom:r}=i.getBoundingClientRect(),o;if(o=i.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();s=Math.min(l.top,s),r=Math.max(l.bottom,r)}return e.clientX>=t-fs&&e.clientX<=n+fs&&e.clientY>=s-fs&&e.clientY<=r+fs}function cg(i,e,t,n,s,r){let o=i.scrollDOM.getBoundingClientRect(),l=i.documentTop+i.documentPadding.top+i.contentHeight;if(o.left>n||o.rights||Math.min(o.bottom,l)=e&&a<=t}function bc(i,e={}){let t=q.define(),n=J.define({create(){return[]},update(s,r){if(s.length&&(e.hideOnChange&&(r.docChanged||r.selection)?s=[]:e.hideOn&&(s=s.filter(o=>!e.hideOn(r,o))),r.docChanged)){let o=[];for(let l of s){let a=r.changes.mapPos(l.pos,-1,oe.TrackDel);if(a!=null){let O=Object.assign(Object.create(null),l);O.pos=a,O.end!=null&&(O.end=r.changes.mapPos(O.end)),o.push(O)}}s=o}for(let o of r.effects)o.is(t)&&(s=o.value),o.is(fg)&&(s=[]);return s},provide:s=>Rs.from(s)});return{active:n,extension:[n,te.define(s=>new Io(s,i,n,t,e.hoverTime||300)),Og]}}function ll(i,e){let t=i.plugin(ol);if(!t)return null;let n=t.manager.tooltips.indexOf(e);return n<0?null:t.manager.tooltipViews[n]}var fg=q.define();var fh=T.define({combine(i){let e,t;for(let n of i)e=e||n.topContainer,t=t||n.bottomContainer;return{topContainer:e,bottomContainer:t}}});function ei(i,e){let t=i.plugin(xc),n=t?t.specs.indexOf(e):-1;return n>-1?t.panels[n]:null}var xc=te.fromClass(class{constructor(i){this.input=i.state.facet(Jt),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(i));let e=i.state.facet(fh);this.top=new Qi(i,!0,e.topContainer),this.bottom=new Qi(i,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(i){let e=i.state.facet(fh);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Qi(i.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Qi(i.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=i.state.facet(Jt);if(t!=this.input){let n=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of n){let O=this.specs.indexOf(a),h;O<0?(h=a(i.view),l.push(h)):(h=this.panels[O],h.update&&h.update(i)),s.push(h),(h.top?r:o).push(h)}this.specs=n,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let n of this.panels)n.update&&n.update(i)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:i=>k.scrollMargins.of(e=>{let t=e.plugin(i);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})}),Qi=class{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=uh(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=uh(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}};function uh(i){let e=i.nextSibling;return i.remove(),e}var Jt=T.define({enables:xc}),qe=class extends He{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};qe.prototype.elementClass="";qe.prototype.toDOM=void 0;qe.prototype.mapMode=oe.TrackBefore;qe.prototype.startSide=qe.prototype.endSide=-1;qe.prototype.point=!0;var Qs=T.define(),ug=T.define(),dg={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>M.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},rn=T.define();function al(i){return[Pc(),rn.of(Object.assign(Object.assign({},dg),i))]}var No=T.define({combine:i=>i.some(e=>e)});function Pc(i){let e=[pg];return i&&i.fixed===!1&&e.push(No.of(!0)),e}var pg=te.fromClass(class{constructor(i){this.view=i,this.prevViewport=i.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=i.state.facet(rn).map(e=>new Ws(i,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!i.state.facet(No),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),i.scrollDOM.insertBefore(this.dom,i.contentDOM)}update(i){if(this.updateGutters(i)){let e=this.prevViewport,t=i.view.viewport,n=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(n<(t.to-t.from)*.8)}i.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(No)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=i.view.viewport}syncGutters(i){let e=this.dom.nextSibling;i&&this.dom.remove();let t=M.iter(this.view.state.facet(Qs),this.view.viewport.from),n=[],s=this.gutters.map(r=>new Ho(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(r.type)){let o=!0;for(let l of r.type)if(l.type==Qe.Text&&o){Fo(t,n,l.from);for(let a of s)a.line(this.view,l,n);o=!1}else if(l.widget)for(let a of s)a.widget(this.view,l)}else if(r.type==Qe.Text){Fo(t,n,r.from);for(let o of s)o.line(this.view,r,n)}else if(r.widget)for(let o of s)o.widget(this.view,r);for(let r of s)r.finish();i&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(i){let e=i.startState.facet(rn),t=i.state.facet(rn),n=i.docChanged||i.heightChanged||i.viewportChanged||!M.eq(i.startState.facet(Qs),i.state.facet(Qs),i.view.viewport.from,i.view.viewport.to);if(e==t)for(let s of this.gutters)s.update(i)&&(n=!0);else{n=!0;let s=[];for(let r of t){let o=e.indexOf(r);o<0?s.push(new Ws(this.view,r)):(this.gutters[o].update(i),s.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),s.indexOf(r)<0&&r.destroy();for(let r of s)this.dom.appendChild(r.dom);this.gutters=s}return n}destroy(){for(let i of this.gutters)i.destroy();this.dom.remove()}},{provide:i=>k.scrollMargins.of(e=>{let t=e.plugin(i);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==D.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function dh(i){return Array.isArray(i)?i:[i]}function Fo(i,e,t){for(;i.value&&i.from<=t;)i.from==t&&e.push(i.value),i.next()}var Ho=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=M.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:s}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==s.elements.length){let l=new Zs(e,o,r,n);s.elements.push(l),s.dom.appendChild(l.dom)}else s.elements[this.i].update(e,o,r,n);this.height=t.bottom,this.i++}line(e,t,n){let s=[];Fo(this.cursor,s,t.from),n.length&&(s=s.concat(n));let r=this.gutter.config.lineMarker(e,t,s);r&&s.unshift(r);let o=this.gutter;s.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,s)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),s=n?[n]:null;for(let r of e.state.facet(ug)){let o=r(e,t.widget,t);o&&(s||(s=[])).push(o)}s&&this.addElement(e,t,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},Ws=class{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,s=>{let r=s.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let a=r.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=s.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,l,s)&&s.preventDefault()});this.markers=dh(t.markers(e)),t.initialSpacer&&(this.spacer=new Zs(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=dh(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let n=e.view.viewport;return!M.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},Zs=class{constructor(e,t,n,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,s)}update(e,t,n,s){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),mg(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,t){let n="cm-gutterElement",s=this.dom.firstChild;for(let r=0,o=0;;){let l=o,a=rr(l,a,O)||o(l,a,O):o}return n}})}}),on=class extends qe{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function Oo(i,e){return i.state.facet(yi).formatNumber(e,i.state)}var Qg=rn.compute([yi],i=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(gg)},lineMarker(e,t,n){return n.some(s=>s.toDOM)?null:new on(Oo(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let s of e.state.facet($g)){let r=s(e,t,n);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(yi)!=e.state.facet(yi),initialSpacer(e){return new on(Oo(e,ph(e.state.doc.lines)))},updateSpacer(e,t){let n=Oo(t.view,ph(t.view.state.doc.lines));return n==e.number?e:new on(n)},domEventHandlers:i.facet(yi).domEventHandlers}));function kc(i={}){return[yi.of(i),Pc(),Qg]}function ph(i){let e=9;for(;e{let e=[],t=-1;for(let n of i.selection.ranges){let s=i.doc.lineAt(n.head).from;s>t&&(t=s,e.push(yg.range(s)))}return M.of(e)});function vc(){return Sg}var bg=0,Pe=class{constructor(e,t){this.from=e,this.to=t}},Z=class{constructor(e={}){this.id=bg++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=fe.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};Z.closedBy=new Z({deserialize:i=>i.split(" ")});Z.openedBy=new Z({deserialize:i=>i.split(" ")});Z.group=new Z({deserialize:i=>i.split(" ")});Z.isolate=new Z({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});Z.contextHash=new Z({perNode:!0});Z.lookAhead=new Z({perNode:!0});Z.mounted=new Z({perNode:!0});var ti=class{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[Z.mounted.id]}},xg=Object.create(null),fe=class i{constructor(e,t,n,s=0){this.name=e,this.props=t,this.id=n,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):xg,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new i(e.name||"",t,e.id,n);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(Z.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let s of n.split(" "))t[s]=e[n];return n=>{for(let s=n.prop(Z.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?n.name:s[r]];if(o)return o}}}};fe.none=new fe("",Object.create(null),0,8);var $n=class i{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|j.IncludeAnonymous);;){let O=!1;if(a.from<=r&&a.to>=s&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;O=!0}for(;O&&n&&(l||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;O=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Ql(fe.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,s)=>new i(this.type,t,n,s,this.propValues),e.makeTree||((t,n,s)=>new i(fe.none,t,n,s)))}static build(e){return kg(e)}};ee.empty=new ee(fe.none,[],[],0);var Ol=class i{constructor(e,t){this.buffer=e,this.index=t}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 i(this.buffer,this.index)}},Zt=class i{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return fe.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,n){let s=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function Qn(i,e,t,n){for(var s;i.from==i.to||(t<1?i.from>=e:i.from>e)||(t>-1?i.to<=e:i.to0?l.length:-1;e!=O;e+=t){let h=l[e],c=a[e]+o.from;if(Zc(s,n,c,c+h.length)){if(h instanceof Zt){if(r&j.ExcludeBuffers)continue;let f=h.findChild(0,h.buffer.length,t,n-c,s);if(f>-1)return new ii(new cl(o,h,e,c),null,f)}else if(r&j.IncludeAnonymous||!h.type.isAnonymous||$l(h)){let f;if(!(r&j.IgnoreMounts)&&(f=ti.get(h))&&!f.overlay)return new i(f.tree,c,e,o);let u=new i(h,c,e,o);return r&j.IncludeAnonymous||!u.type.isAnonymous?u:u.nextChild(t<0?h.children.length-1:0,t,n,s)}}}if(r&j.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let s;if(!(n&j.IgnoreOverlays)&&(s=ti.get(this._tree))&&s.overlay){let r=e-this.from;for(let{from:o,to:l}of s.overlay)if((t>0?o<=r:o=r:l>r))return new i(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function Tc(i,e,t,n){let s=i.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(let o=!1;!o;)if(o=s.type.is(t),!s.nextSibling())return r}for(;;){if(n!=null&&s.type.is(n))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return n==null?r:[]}}function hl(i,e,t=e.length-1){for(let n=i;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}var cl=class{constructor(e,t,n,s){this.parent=e,this.buffer=t,this.index=n,this.start=s}},ii=class i extends Us{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new i(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&j.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new i(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new i(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new i(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,s=this.index+4,r=n.buffer[this.index+3];if(r>s){let o=n.buffer[this.index+1];e.push(n.slice(s,r,o)),t.push(0)}return new ee(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function Vc(i){if(!i.length)return null;let e=0,t=i[0];for(let r=1;rt.from||o.to=e){let l=new ke(o.tree,o.overlay[0].from+r.from,-1,r);(s||(s=[n])).push(Qn(l,e,t,!1))}}return s?Vc(s):n}var xi=class{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof ke)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=n+s.buffer[e+1],this.to=n+s.buffer[e+2],!0}yield(e){return e?e instanceof ke?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,n);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&j.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&j.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&j.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let s=n<0?0:this.stack[n]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(s)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:n._tree.children.length;r!=o;r+=e){let l=n._tree.children[r];if(this.mode&j.IncludeAnonymous||l instanceof Zt||!l.type.isAnonymous||$l(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,n=r+1;break e}s=this.stack[--r]}for(let s=n;s=0;r--){if(r<0)return hl(this._tree,e,s);let o=n[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}};function $l(i){return i.children.some(e=>e instanceof Zt||!e.type.isAnonymous||$l(e))}function kg(i){var e;let{buffer:t,nodeSet:n,maxBufferLength:s=1024,reused:r=[],minRepeatType:o=n.types.length}=i,l=Array.isArray(t)?new Ol(t,t.length):t,a=n.types,O=0,h=0;function c(S,P,w,V,_,B){let{id:C,start:W,end:E,size:A}=l,F=h,me=O;for(;A<0;)if(l.next(),A==-1){let $t=r[C];w.push($t),V.push(W-S);return}else if(A==-3){O=C;return}else if(A==-4){h=C;return}else throw new RangeError(`Unrecognized record size: ${A}`);let we=a[C],ot,ae,Ae=W-S;if(E-W<=s&&(ae=g(l.pos-P,_))){let $t=new Uint16Array(ae.size-ae.skip),Ue=l.pos-ae.size,lt=$t.length;for(;l.pos>Ue;)lt=$(ae.start,$t,lt);ot=new Zt($t,E-ae.start,n),Ae=ae.start-S}else{let $t=l.pos-A;l.next();let Ue=[],lt=[],Et=C>=o?C:-1,hi=0,En=E;for(;l.pos>$t;)Et>=0&&l.id==Et&&l.size>=0?(l.end<=En-s&&(d(Ue,lt,W,hi,l.end,En,Et,F,me),hi=Ue.length,En=l.end),l.next()):B>2500?f(W,$t,Ue,lt):c(W,$t,Ue,lt,Et,B+1);if(Et>=0&&hi>0&&hi-1&&hi>0){let eO=u(we,me);ot=Ql(we,Ue,lt,0,Ue.length,0,E-W,eO,eO)}else ot=m(we,Ue,lt,E-W,F-E,me)}w.push(ot),V.push(Ae)}function f(S,P,w,V){let _=[],B=0,C=-1;for(;l.pos>P;){let{id:W,start:E,end:A,size:F}=l;if(F>4)l.next();else{if(C>-1&&E=0;A-=3)W[F++]=_[A],W[F++]=_[A+1]-E,W[F++]=_[A+2]-E,W[F++]=F;w.push(new Zt(W,_[2]-E,n)),V.push(E-S)}}function u(S,P){return(w,V,_)=>{let B=0,C=w.length-1,W,E;if(C>=0&&(W=w[C])instanceof ee){if(!C&&W.type==S&&W.length==_)return W;(E=W.prop(Z.lookAhead))&&(B=V[C]+W.length+E)}return m(S,w,V,_,B,P)}}function d(S,P,w,V,_,B,C,W,E){let A=[],F=[];for(;S.length>V;)A.push(S.pop()),F.push(P.pop()+w-_);S.push(m(n.types[C],A,F,B-_,W-B,E)),P.push(_-w)}function m(S,P,w,V,_,B,C){if(B){let W=[Z.contextHash,B];C=C?[W].concat(C):[W]}if(_>25){let W=[Z.lookAhead,_];C=C?[W].concat(C):[W]}return new ee(S,P,w,V,C)}function g(S,P){let w=l.fork(),V=0,_=0,B=0,C=w.end-s,W={size:0,start:0,skip:0};e:for(let E=w.pos-S;w.pos>E;){let A=w.size;if(w.id==P&&A>=0){W.size=V,W.start=_,W.skip=B,B+=4,V+=4,w.next();continue}let F=w.pos-A;if(A<0||F=o?4:0,we=w.start;for(w.next();w.pos>F;){if(w.size<0)if(w.size==-3)me+=4;else break e;else w.id>=o&&(me+=4);w.next()}_=we,V+=A,B+=me}return(P<0||V==S)&&(W.size=V,W.start=_,W.skip=B),W.size>4?W:void 0}function $(S,P,w){let{id:V,start:_,end:B,size:C}=l;if(l.next(),C>=0&&V4){let E=l.pos-(C-4);for(;l.pos>E;)w=$(S,P,w)}P[--w]=W,P[--w]=B-S,P[--w]=_-S,P[--w]=V}else C==-3?O=V:C==-4&&(h=V);return w}let y=[],b=[];for(;l.pos>0;)c(i.start||0,i.bufferStart||0,y,b,-1,0);let x=(e=i.length)!==null&&e!==void 0?e:y.length?b[0]+y[0].length:0;return new ee(a[i.topID],y.reverse(),b.reverse(),x)}var zc=new WeakMap;function As(i,e){if(!i.isAnonymous||e instanceof Zt||e.type!=i)return 1;let t=zc.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=i||!(n instanceof ee)){t=1;break}t+=As(i,n)}zc.set(e,t)}return t}function Ql(i,e,t,n,s,r,o,l,a){let O=0;for(let d=n;d=h)break;P+=w}if(b==x+1){if(P>h){let w=d[x];u(w.children,w.positions,0,w.children.length,m[x]+y);continue}c.push(d[x])}else{let w=m[b-1]+d[b-1].length-S;c.push(Ql(i,d,m,x,b,S,w,null,a))}f.push(S+y-r)}}return u(e,t,n,s,0),(l||a)(c,f,o)}var Pi=class{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof ii?this.setBuffer(e.context.buffer,e.index,t):e instanceof ke&&this.map.set(e.tree,t)}get(e){return e instanceof ii?this.getBuffer(e.context.buffer,e.index):e instanceof ke?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}},xt=class i{constructor(e,t,n,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let s=[new i(0,e.length,e,0,!1,n)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,n=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,O=0;;l++){let h=l=n)for(;o&&o.from=f.from||c<=f.to||O){let u=Math.max(f.from,a)-O,d=Math.min(f.to,c)-O;f=u>=d?null:new i(u,d,f.tree,f.offset+O,l>0,!!h)}if(f&&s.push(f),o.to>c)break;o=rnew Pe(s.from,s.to)):[new Pe(0,0)]:[new Pe(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let s=this.startParse(e,t,n);for(;;){let r=s.advance();if(r)return r}}},ul=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};function Gs(i){return(e,t,n,s)=>new ml(e,i,t,n,s)}var Ms=class{constructor(e,t,n,s,r){this.parser=e,this.parse=t,this.overlay=n,this.target=s,this.from=r}};function Xc(i){if(!i.length||i.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(i))}var dl=class{constructor(e,t,n,s,r,o,l){this.parser=e,this.predicate=t,this.mounts=n,this.index=s,this.start=r,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}},pl=new Z({perNode:!0}),ml=class{constructor(e,t,n,s,r){this.nest=t,this.input=n,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new ee(n.type,n.children,n.positions,n.length,n.propValues.concat([[pl,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[Z.mounted.id]=new ti(t,e.overlay,e.parser),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)l=!1;else if(e.hasNode(s)){if(t){let O=t.mounts.find(h=>h.frag.from<=s.from&&h.frag.to>=s.to&&h.mount.overlay);if(O)for(let h of O.mount.overlay){let c=h.from+O.pos,f=h.to+O.pos;c>=s.from&&f<=s.to&&!t.ranges.some(u=>u.fromc)&&t.ranges.push({from:c,to:f})}}l=!1}else if(n&&(o=vg(n.ranges,s.from,s.to)))l=o!=2;else if(!s.type.isAnonymous&&(r=this.nest(s,this.input))&&(s.fromnew Pe(c.from-s.from,c.to-s.from)):null,s.tree,h.length?h[0].from:s.from)),r.overlay?h.length&&(n={ranges:h,depth:0,prev:n}):l=!1}}else if(t&&(a=t.predicate(s))&&(a===!0&&(a=new Pe(s.from,s.to)),a.from=0&&t.ranges[O].to==a.from?t.ranges[O]={from:t.ranges[O].from,to:a.to}:t.ranges.push(a)}if(l&&s.firstChild())t&&t.depth++,n&&n.depth++;else for(;!s.nextSibling();){if(!s.parent())break e;if(t&&!--t.depth){let O=qc(this.ranges,t.ranges);O.length&&(Xc(O),this.inner.splice(t.index,0,new Ms(t.parser,t.parser.startParse(this.input,Wc(t.mounts,O),O),t.ranges.map(h=>new Pe(h.from-t.start,h.to-t.start)),t.target,O[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}};function vg(i,e,t){for(let n of i){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function Rc(i,e,t,n,s,r){if(e=e&&t.enter(n,1,j.IgnoreOverlays|j.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof ee)t=t.children[0];else break}return!1}},gl=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(pl))!==null&&t!==void 0?t:n.to,this.inner=new js(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(pl))!==null&&e!==void 0?e:t.to,this.inner=new js(t.tree,-t.offset)}}findMounts(e,t){var n;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(n=r.tree)===null||n===void 0?void 0:n.prop(Z.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=r.to)break;a.tree==this.curFrag.tree&&s.push({frag:a,pos:r.from-a.offset,mount:o})}}}return s}};function qc(i,e){let t=null,n=e;for(let s=1,r=0;s=l)break;a.to<=o||(t||(n=t=e.slice()),a.froml&&t.splice(r+1,0,new Pe(l,a.to))):a.to>l?t[r--]=new Pe(l,a.to):t.splice(r--,1))}}return n}function Tg(i,e,t,n){let s=0,r=0,o=!1,l=!1,a=-1e9,O=[];for(;;){let h=s==i.length?1e9:o?i[s].to:i[s].from,c=r==e.length?1e9:l?e[r].to:e[r].from;if(o!=l){let f=Math.max(a,t),u=Math.min(h,c,n);fnew Pe(f.from+n,f.to+n)),c=Tg(e,h,a,O);for(let f=0,u=a;;f++){let d=f==c.length,m=d?O:c[f].from;if(m>u&&t.push(new xt(u,m,s.tree,-o,r.from>=u||r.openStart,r.to<=m||r.openEnd)),d)break;u=c[f].to}}else t.push(new xt(a,O,s.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return t}var zg=0,Je=class i{constructor(e,t,n,s){this.name=e,this.set=t,this.base=n,this.modified=s,this.id=zg++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n=typeof e=="string"?e:"?";if(e instanceof i&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let s=new i(n,[],null,[]);if(s.set.push(s),t)for(let r of t.set)s.set.push(r);return s}static defineModifier(e){let t=new Bs(e);return n=>n.modified.indexOf(t)>-1?n:Bs.get(n.base||n,n.modified.concat(t).sort((s,r)=>s.id-r.id))}},Xg=0,Bs=class i{constructor(e){this.name=e,this.instances=[],this.id=Xg++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(l=>l.base==e&&Rg(t,l.modified));if(n)return n;let s=[],r=new Je(e.name,s,e,t);for(let l of t)l.instances.push(r);let o=qg(t);for(let l of e.set)if(!l.modified.length)for(let a of o)s.push(i.get(l,a));return r}};function Rg(i,e){return i.length==e.length&&i.every((t,n)=>t==e[n])}function qg(i){let e=[[]];for(let t=0;tn.length-t.length)}function Le(i){let e=Object.create(null);for(let t in i){let n=i[t];Array.isArray(n)||(n=[n]);for(let s of t.split(" "))if(s){let r=[],o=2,l=s;for(let c=0;;){if(l=="..."&&c>0&&c+3==s.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!f)throw new RangeError("Invalid path: "+s);if(r.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),c+=f[0].length,c==s.length)break;let u=s[c++];if(c==s.length&&u=="!"){o=0;break}if(u!="/")throw new RangeError("Invalid path: "+s);l=s.slice(c)}let a=r.length-1,O=r[a];if(!O)throw new RangeError("Invalid path: "+s);let h=new vi(n,o,a>0?r.slice(0,a):null);e[O]=h.sort(e[O])}}return _c.add(e)}var _c=new Z,vi=class{constructor(e,t,n,s){this.tags=e,this.mode=t,this.context=n,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=s;for(let l of r)for(let a of l.set){let O=t[a.id];if(O){o=o?o+" "+O:O;break}}return o},scope:n}}function Wg(i,e){let t=null;for(let n of i){let s=n.style(e);s&&(t=t?t+" "+s:s)}return t}function Ac(i,e,t,n=0,s=i.length){let r=new Sl(n,Array.isArray(e)?e:[e],t);r.highlightRange(i.cursor(),n,s,"",r.highlighters),r.flush(s)}var Sl=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,s,r){let{type:o,from:l,to:a}=e;if(l>=n||a<=t)return;o.isTop&&(r=this.highlighters.filter(u=>!u.scope||u.scope(o)));let O=s,h=Zg(e)||vi.empty,c=Wg(r,h.tags);if(c&&(O&&(O+=" "),O+=c,h.mode==1&&(s+=(s?" ":"")+c)),this.startSpan(Math.max(t,l),O),h.opaque)return;let f=e.tree&&e.tree.prop(Z.mounted);if(f&&f.overlay){let u=e.node.enter(f.overlay[0].from+l,1),d=this.highlighters.filter(g=>!g.scope||g.scope(f.tree.type)),m=e.firstChild();for(let g=0,$=l;;g++){let y=g=b||!e.nextSibling())););if(!y||b>n)break;$=y.to+l,$>t&&(this.highlightRange(u.cursor(),Math.max(t,y.from+l),Math.min(n,$),"",d),this.startSpan(Math.min(n,$),O))}m&&e.parent()}else if(e.firstChild()){f&&(s="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,s,r),this.startSpan(Math.min(n,e.to),O)}while(e.nextSibling());e.parent()}}};function Zg(i){let e=i.type.prop(_c);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}var v=Je.define,Es=v(),Vt=v(),Cc=v(Vt),Yc=v(Vt),Ct=v(),Ls=v(Ct),yl=v(Ct),mt=v(),ni=v(mt),dt=v(),pt=v(),bl=v(),yn=v(bl),Ds=v(),p={comment:Es,lineComment:v(Es),blockComment:v(Es),docComment:v(Es),name:Vt,variableName:v(Vt),typeName:Cc,tagName:v(Cc),propertyName:Yc,attributeName:v(Yc),className:v(Vt),labelName:v(Vt),namespace:v(Vt),macroName:v(Vt),literal:Ct,string:Ls,docString:v(Ls),character:v(Ls),attributeValue:v(Ls),number:yl,integer:v(yl),float:v(yl),bool:v(Ct),regexp:v(Ct),escape:v(Ct),color:v(Ct),url:v(Ct),keyword:dt,self:v(dt),null:v(dt),atom:v(dt),unit:v(dt),modifier:v(dt),operatorKeyword:v(dt),controlKeyword:v(dt),definitionKeyword:v(dt),moduleKeyword:v(dt),operator:pt,derefOperator:v(pt),arithmeticOperator:v(pt),logicOperator:v(pt),bitwiseOperator:v(pt),compareOperator:v(pt),updateOperator:v(pt),definitionOperator:v(pt),typeOperator:v(pt),controlOperator:v(pt),punctuation:bl,separator:v(bl),bracket:yn,angleBracket:v(yn),squareBracket:v(yn),paren:v(yn),brace:v(yn),content:mt,heading:ni,heading1:v(ni),heading2:v(ni),heading3:v(ni),heading4:v(ni),heading5:v(ni),heading6:v(ni),contentSeparator:v(mt),list:v(mt),quote:v(mt),emphasis:v(mt),strong:v(mt),link:v(mt),monospace:v(mt),strikethrough:v(mt),inserted:v(),deleted:v(),changed:v(),invalid:v(),meta:Ds,documentMeta:v(Ds),annotation:v(Ds),processingInstruction:v(Ds),definition:Je.defineModifier("definition"),constant:Je.defineModifier("constant"),function:Je.defineModifier("function"),standard:Je.defineModifier("standard"),local:Je.defineModifier("local"),special:Je.defineModifier("special")};for(let i in p){let e=p[i];e instanceof Je&&(e.name=i)}var Yb=xl([{tag:p.link,class:"tok-link"},{tag:p.heading,class:"tok-heading"},{tag:p.emphasis,class:"tok-emphasis"},{tag:p.strong,class:"tok-strong"},{tag:p.keyword,class:"tok-keyword"},{tag:p.atom,class:"tok-atom"},{tag:p.bool,class:"tok-bool"},{tag:p.url,class:"tok-url"},{tag:p.labelName,class:"tok-labelName"},{tag:p.inserted,class:"tok-inserted"},{tag:p.deleted,class:"tok-deleted"},{tag:p.literal,class:"tok-literal"},{tag:p.string,class:"tok-string"},{tag:p.number,class:"tok-number"},{tag:[p.regexp,p.escape,p.special(p.string)],class:"tok-string2"},{tag:p.variableName,class:"tok-variableName"},{tag:p.local(p.variableName),class:"tok-variableName tok-local"},{tag:p.definition(p.variableName),class:"tok-variableName tok-definition"},{tag:p.special(p.variableName),class:"tok-variableName2"},{tag:p.definition(p.propertyName),class:"tok-propertyName tok-definition"},{tag:p.typeName,class:"tok-typeName"},{tag:p.namespace,class:"tok-namespace"},{tag:p.className,class:"tok-className"},{tag:p.macroName,class:"tok-macroName"},{tag:p.propertyName,class:"tok-propertyName"},{tag:p.operator,class:"tok-operator"},{tag:p.comment,class:"tok-comment"},{tag:p.meta,class:"tok-meta"},{tag:p.invalid,class:"tok-invalid"},{tag:p.punctuation,class:"tok-punctuation"}]);var Pl,wi=new Z;function Cl(i){return T.define({combine:i?e=>e.concat(i):void 0})}var Hs=new Z,We=class{constructor(e,t,n=[],s=""){this.data=e,this.name=s,U.prototype.hasOwnProperty("tree")||Object.defineProperty(U.prototype,"tree",{get(){return N(this)}}),this.parser=t,this.extension=[Yt.of(this),U.languageData.of((r,o,l)=>{let a=Uc(r,o,l),O=a.type.prop(wi);if(!O)return[];let h=r.facet(O),c=a.type.prop(Hs);if(c){let f=a.resolve(o-a.from,l);for(let u of c)if(u.test(f,r)){let d=r.facet(u.facet);return u.type=="replace"?d:d.concat(h)}}return h})].concat(n)}isActiveAt(e,t,n=-1){return Uc(e,t,n).type.prop(wi)==this.data}findRegions(e){let t=e.facet(Yt);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],s=(r,o)=>{if(r.prop(wi)==this.data){n.push({from:o,to:o+r.length});return}let l=r.prop(Z.mounted);if(l){if(l.tree.prop(wi)==this.data){if(l.overlay)for(let a of l.overlay)n.push({from:a.from+o,to:a.to+o});else n.push({from:o,to:o+r.length});return}else if(l.overlay){let a=n.length;if(s(l.tree,l.overlay[0].from+o),n.length>a)return}}for(let a=0;an.isTop?t:void 0)]}),e.name)}configure(e,t){return new i(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function N(i){let e=i.field(We.state,!1);return e?e.tree:ee.empty}var Tl=class{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},Sn=null,zl=class i{constructor(e,t,n=[],s,r,o,l,a){this.parser=e,this.state=t,this.fragments=n,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new i(e,t,[],ee.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Tl(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=ee.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(xt.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Sn;Sn=this;try{return e()}finally{Sn=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=Mc(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((O,h,c,f)=>a.push({fromA:O,toA:h,fromB:c,toB:f})),n=xt.applyChanges(n,a),s=ee.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let O of this.skipped){let h=e.mapPos(O.from,1),c=e.mapPos(O.to,-1);he.from&&(this.fragments=Mc(this.fragments,s,r),this.skipped.splice(n--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends ki{createParse(t,n,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=Sn;if(a){for(let O of s)a.tempSkipped.push(O);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new ee(fe.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Sn}};function Mc(i,e,t){return xt.applyChanges(i,[{fromA:e,toA:t,fromB:e,toB:t}])}var xn=class i{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new i(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=zl.create(e.facet(Yt).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new i(n)}};We.state=J.define({create:xn.init,update(i,e){for(let t of e.effects)if(t.is(We.setState))return t.value;return e.startState.facet(Yt)!=e.state.facet(Yt)?xn.init(e.state):i.apply(e)}});var Dc=i=>{let e=setTimeout(()=>i(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Dc=i=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(i,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});var kl=typeof navigator<"u"&&(!((Pl=navigator.scheduling)===null||Pl===void 0)&&Pl.isInputPending)?()=>navigator.scheduling.isInputPending():null,Vg=te.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(We.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(We.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Dc(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnds+1e3,a=r.context.work(()=>kl&&kl()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:We.setState.of(new xn(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>ce(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Yt=T.define({combine(i){return i.length?i[0]:null},enables:i=>[We.state,Vg,k.contentAttributes.compute([i],e=>{let t=e.facet(i);return t&&t.name?{"data-language":t.name}:{}})]}),Be=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}};var Cg=T.define(),Ti=T.define({combine:i=>{if(!i.length)return" ";let e=i[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(i[0]));return e}});function Pn(i){let e=i.facet(Ti);return e.charCodeAt(0)==9?i.tabSize*e.length:e.length}function zi(i,e){let t="",n=i.tabSize,s=i.facet(Ti)[0];if(s==" "){for(;e>=n;)t+=" ",e-=n;s=" "}for(let r=0;r=e?Yg(i,t,e):null}var si=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=Pn(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:r}=this.options;return s!=null&&s>=n.from&&s<=n.to?r&&s==e?{text:"",from:e}:(t<0?s-1&&(r+=o-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return yt(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},tt=new Z;function Yg(i,e,t){let n=e.resolveStack(t),s=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(s!=n.node){let r=[];for(let o=s;o&&!(o.from==n.node.from&&o.type==n.node.type);o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)n={node:r[o],next:n}}return Bc(n,i,t)}function Bc(i,e,t){for(let n=i;n;n=n.next){let s=Ag(n.node);if(s)return s(Xl.create(e,t,n))}return 0}function _g(i){return i.pos==i.options.simulateBreak&&i.options.simulateDoubleBreak}function Ag(i){let e=i.type.prop(tt);if(e)return e;let t=i.firstChild,n;if(t&&(n=t.type.prop(Z.closedBy))){let s=i.lastChild,r=s&&n.indexOf(s.name)>-1;return o=>Ic(o,!0,1,void 0,r&&!_g(o)?s.from:void 0)}return i.parent==null?Ug:null}function Ug(){return 0}var Xl=class i extends si{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new i(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(Mg(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return Bc(this.context.next,this.base,this.pos)}};function Mg(i,e){for(let t=e;t;t=t.parent)if(i==t)return!0;return!1}function jg(i){let e=i.node,t=e.childAfter(e.from),n=e.lastChild;if(!t)return null;let s=i.options.simulateBreak,r=i.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==n)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let O=/^ */.exec(r.text.slice(t.to-r.from))[0].length;return{from:t.from,to:t.to+O}}l=a.to}}function Js({closing:i,align:e=!0,units:t=1}){return n=>Ic(n,e,t,i)}function Ic(i,e,t,n,s){let r=i.textAfter,o=r.match(/^\s*/)[0].length,l=n&&r.slice(o,o+n.length)==n||s==i.pos+o,a=e?jg(i):null;return a?l?i.column(a.from):i.column(a.to):i.baseIndent+(l?0:i.unit*t)}var Nc=i=>i.baseIndent;function Ze({except:i,units:e=1}={}){return t=>{let n=i&&i.test(t.textAfter);return t.baseIndent+(n?0:e*t.unit)}}var Gg=200;function Fc(){return U.transactionFilter.of(i=>{if(!i.docChanged||!i.isUserEvent("input.type")&&!i.isUserEvent("input.complete"))return i;let e=i.startState.languageDataAt("indentOnInput",i.startState.selection.main.head);if(!e.length)return i;let t=i.newDoc,{head:n}=i.newSelection.main,s=t.lineAt(n);if(n>s.from+Gg)return i;let r=t.sliceString(s.from,n);if(!e.some(O=>O.test(r)))return i;let{state:o}=i,l=-1,a=[];for(let{head:O}of o.selection.ranges){let h=o.doc.lineAt(O);if(h.from==l)continue;l=h.from;let c=Ks(o,h.from);if(c==null)continue;let f=/^\s*/.exec(h.text)[0],u=zi(o,c);f!=u&&a.push({from:h.from,to:h.from+f.length,insert:u})}return a.length?[i,{changes:a,sequential:!0}]:i})}var Eg=T.define(),it=new Z;function _t(i){let e=i.firstChild,t=i.lastChild;return e&&e.tot)continue;if(r&&l.from=e&&O.to>t&&(r=O)}}return r}function Dg(i){let e=i.lastChild;return e&&e.to==i.to&&e.type.isError}function Is(i,e,t){for(let n of i.facet(Eg)){let s=n(i,e,t);if(s)return s}return Lg(i,e,t)}function Hc(i,e){let t=e.mapPos(i.from,1),n=e.mapPos(i.to,-1);return t>=n?void 0:{from:t,to:n}}var er=q.define({map:Hc}),kn=q.define({map:Hc});function Kc(i){let e=[];for(let{head:t}of i.state.selection.ranges)e.some(n=>n.from<=t&&n.to>=t)||e.push(i.lineBlockAt(t));return e}var ri=J.define({create(){return X.none},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(er)&&!Bg(i,t.value.from,t.value.to)){let{preparePlaceholder:n}=e.state.facet(Yl),s=n?X.replace({widget:new Rl(n(e.state,t.value))}):jc;i=i.update({add:[s.range(t.value.from,t.value.to)]})}else t.is(kn)&&(i=i.update({filter:(n,s)=>t.value.from!=n||t.value.to!=s,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:n}=e.selection.main;i.between(n,n,(s,r)=>{sn&&(t=!0)}),t&&(i=i.update({filterFrom:n,filterTo:n,filter:(s,r)=>r<=n||s>=n}))}return i},provide:i=>k.decorations.from(i),toJSON(i,e){let t=[];return i.between(0,e.doc.length,(n,s)=>{t.push(n,s)}),t},fromJSON(i){if(!Array.isArray(i)||i.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!s||s.from>r)&&(s={from:r,to:o})}),s}function Bg(i,e,t){let n=!1;return i.between(e,e,(s,r)=>{s==e&&r==t&&(n=!0)}),n}function Jc(i,e){return i.field(ri,!1)?e:e.concat(q.appendConfig.of(nf()))}var Ig=i=>{for(let e of Kc(i)){let t=Is(i.state,e.from,e.to);if(t)return i.dispatch({effects:Jc(i.state,[er.of(t),ef(i,t)])}),!0}return!1},Ng=i=>{if(!i.state.field(ri,!1))return!1;let e=[];for(let t of Kc(i)){let n=Ns(i.state,t.from,t.to);n&&e.push(kn.of(n),ef(i,n,!1))}return e.length&&i.dispatch({effects:e}),e.length>0};function ef(i,e,t=!0){let n=i.state.doc.lineAt(e.from).number,s=i.state.doc.lineAt(e.to).number;return k.announce.of(`${i.state.phrase(t?"Folded lines":"Unfolded lines")} ${n} ${i.state.phrase("to")} ${s}.`)}var Fg=i=>{let{state:e}=i,t=[];for(let n=0;n{let e=i.state.field(ri,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,i.state.doc.length,(n,s)=>{t.push(kn.of({from:n,to:s}))}),i.dispatch({effects:t}),!0};var tf=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Ig},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Ng},{key:"Ctrl-Alt-[",run:Fg},{key:"Ctrl-Alt-]",run:Hg}],Kg={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},Yl=T.define({combine(i){return de(i,Kg)}});function nf(i){let e=[ri,e$];return i&&e.push(Yl.of(i)),e}function sf(i,e){let{state:t}=i,n=t.facet(Yl),s=o=>{let l=i.lineBlockAt(i.posAtDOM(o.target)),a=Ns(i.state,l.from,l.to);a&&i.dispatch({effects:kn.of(a)}),o.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(i,s,e);let r=document.createElement("span");return r.textContent=n.placeholderText,r.setAttribute("aria-label",t.phrase("folded code")),r.title=t.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=s,r}var jc=X.replace({widget:new class extends xe{toDOM(i){return sf(i,null)}}}),Rl=class extends xe{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return sf(e,this.value)}},Jg={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},bn=class extends qe{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}};function rf(i={}){let e=Object.assign(Object.assign({},Jg),i),t=new bn(e,!0),n=new bn(e,!1),s=te.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(Yt)!=o.state.facet(Yt)||o.startState.field(ri,!1)!=o.state.field(ri,!1)||N(o.startState)!=N(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new ze;for(let a of o.viewportLineBlocks){let O=Ns(o.state,a.from,a.to)?n:Is(o.state,a.from,a.to)?t:null;O&&l.add(a.from,a.from,O)}return l.finish()}}),{domEventHandlers:r}=e;return[s,al({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(s))===null||l===void 0?void 0:l.markers)||M.empty},initialSpacer(){return new bn(e,!1)},domEventHandlers:Object.assign(Object.assign({},r),{click:(o,l,a)=>{if(r.click&&r.click(o,l,a))return!0;let O=Ns(o.state,l.from,l.to);if(O)return o.dispatch({effects:kn.of(O)}),!0;let h=Is(o.state,l.from,l.to);return h?(o.dispatch({effects:er.of(h)}),!0):!1}})}),nf()]}var e$=k.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}}),Fs=class i{constructor(e,t){this.specs=e;let n;function s(l){let a=je.newName();return(n||(n=Object.create(null)))["."+a]=l,a}let r=typeof t.all=="string"?t.all:t.all?s(t.all):void 0,o=t.scope;this.scope=o instanceof We?l=>l.prop(wi)==o.data:o?l=>l==o:void 0,this.style=xl(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=n?new je(n):null,this.themeType=t.themeType}static define(e,t){return new i(e,t||{})}},ql=T.define(),of=T.define({combine(i){return i.length?[i[0]]:null}});function vl(i){let e=i.facet(ql);return e.length?e:i.facet(of)}function lf(i,e){let t=[t$],n;return i instanceof Fs&&(i.module&&t.push(k.styleModule.of(i.module)),n=i.themeType),e?.fallback?t.push(of.of(i)):n?t.push(ql.computeN([k.darkTheme],s=>s.facet(k.darkTheme)==(n=="dark")?[i]:[])):t.push(ql.of(i)),t}var Wl=class{constructor(e){this.markCache=Object.create(null),this.tree=N(e.state),this.decorations=this.buildDeco(e,vl(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=N(e.state),n=vl(e.state),s=n!=vl(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||s)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return X.none;let n=new ze;for(let{from:s,to:r}of e.visibleRanges)Ac(this.tree,t,(o,l,a)=>{n.add(o,l,this.markCache[a]||(this.markCache[a]=X.mark({class:a})))},s,r);return n.finish()}},t$=Me.high(te.fromClass(Wl,{decorations:i=>i.decorations})),af=Fs.define([{tag:p.meta,color:"#404740"},{tag:p.link,textDecoration:"underline"},{tag:p.heading,textDecoration:"underline",fontWeight:"bold"},{tag:p.emphasis,fontStyle:"italic"},{tag:p.strong,fontWeight:"bold"},{tag:p.strikethrough,textDecoration:"line-through"},{tag:p.keyword,color:"#708"},{tag:[p.atom,p.bool,p.url,p.contentSeparator,p.labelName],color:"#219"},{tag:[p.literal,p.inserted],color:"#164"},{tag:[p.string,p.deleted],color:"#a11"},{tag:[p.regexp,p.escape,p.special(p.string)],color:"#e40"},{tag:p.definition(p.variableName),color:"#00f"},{tag:p.local(p.variableName),color:"#30a"},{tag:[p.typeName,p.namespace],color:"#085"},{tag:p.className,color:"#167"},{tag:[p.special(p.variableName),p.macroName],color:"#256"},{tag:p.definition(p.propertyName),color:"#00c"},{tag:p.comment,color:"#940"},{tag:p.invalid,color:"#f00"}]),i$=k.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Of=1e4,hf="()[]{}",cf=T.define({combine(i){return de(i,{afterCursor:!0,brackets:hf,maxScanDistance:Of,renderMatch:r$})}}),n$=X.mark({class:"cm-matchingBracket"}),s$=X.mark({class:"cm-nonmatchingBracket"});function r$(i){let e=[],t=i.matched?n$:s$;return e.push(t.range(i.start.from,i.start.to)),i.end&&e.push(t.range(i.end.from,i.end.to)),e}var o$=J.define({create(){return X.none},update(i,e){if(!e.docChanged&&!e.selection)return i;let t=[],n=e.state.facet(cf);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=et(e.state,s.head,-1,n)||s.head>0&&et(e.state,s.head-1,1,n)||n.afterCursor&&(et(e.state,s.head,1,n)||s.headk.decorations.from(i)}),l$=[o$,i$];function ff(i={}){return[cf.of(i),l$]}var _l=new Z;function Zl(i,e,t){let n=i.prop(e<0?Z.openedBy:Z.closedBy);if(n)return n;if(i.name.length==1){let s=t.indexOf(i.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function Vl(i){let e=i.type.prop(_l);return e?e(i.node):i}function et(i,e,t,n={}){let s=n.maxScanDistance||Of,r=n.brackets||hf,o=N(i),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let O=Zl(a.type,t,r);if(O&&a.from0?e>=h.from&&eh.from&&e<=h.to))return a$(i,e,t,a,h,O,r)}}return O$(i,e,t,o,l.type,s,r)}function a$(i,e,t,n,s,r,o){let l=n.parent,a={from:s.from,to:s.to},O=0,h=l?.cursor();if(h&&(t<0?h.childBefore(n.from):h.childAfter(n.to)))do if(t<0?h.to<=n.from:h.from>=n.to){if(O==0&&r.indexOf(h.type.name)>-1&&h.from0)return null;let O={from:t<0?e-1:e,to:t>0?e+1:e},h=i.doc.iterRange(e,t>0?i.doc.length:0),c=0;for(let f=0;!h.next().done&&f<=r;){let u=h.value;t<0&&(f+=u.length);let d=e+f*t;for(let m=t>0?0:u.length-1,g=t>0?u.length:-1;m!=g;m+=t){let $=o.indexOf(u[m]);if(!($<0||n.resolveInner(d+m,1).type!=s))if($%2==0==t>0)c++;else{if(c==1)return{start:O,end:{from:d+m,to:d+m+1},matched:$>>1==a>>1};c--}}t>0&&(f+=u.length)}return h.done?{start:O,matched:!1}:null}var h$=Object.create(null),Gc=[fe.none];var Ec=[],Lc=Object.create(null),c$=Object.create(null);for(let[i,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])c$[i]=f$(h$,e);function wl(i,e){Ec.indexOf(i)>-1||(Ec.push(i),console.warn(e))}function f$(i,e){let t=[];for(let l of e.split(" ")){let a=[];for(let O of l.split(".")){let h=i[O]||p[O];h?typeof h=="function"?a.length?a=a.map(h):wl(O,`Modifier ${O} used at start of tag`):a.length?wl(O,`Tag ${O} used as modifier`):a=Array.isArray(h)?h:[h]:wl(O,`Unknown highlighting tag ${O}`)}for(let O of a)t.push(O)}if(!t.length)return 0;let n=e.replace(/ /g,"_"),s=n+" "+t.map(l=>l.id),r=Lc[s];if(r)return r.id;let o=Lc[s]=fe.define({id:Gc.length,name:n,props:[Le({[n]:t})]});return Gc.push(o),o.id}var Lb={rtl:X.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:D.RTL}),ltr:X.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:D.LTR}),auto:X.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var u$=i=>{let{state:e}=i,t=e.doc.lineAt(e.selection.main.from),n=Ll(i.state,t.from);return n.line?d$(i):n.block?m$(i):!1};function El(i,e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let s=i(e,t);return s?(n(t.update(s)),!0):!1}}var d$=El(Q$,0);var p$=El(Sf,0);var m$=El((i,e)=>Sf(i,e,$$(e)),0);function Ll(i,e){let t=i.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}var vn=50;function g$(i,{open:e,close:t},n,s){let r=i.sliceDoc(n-vn,n),o=i.sliceDoc(s,s+vn),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,O=r.length-l;if(r.slice(O-e.length,O)==e&&o.slice(a,a+t.length)==t)return{open:{pos:n-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let h,c;s-n<=2*vn?h=c=i.sliceDoc(n,s):(h=i.sliceDoc(n,n+vn),c=i.sliceDoc(s-vn,s));let f=/^\s*/.exec(h)[0].length,u=/\s*$/.exec(c)[0].length,d=c.length-u-t.length;return h.slice(f,f+e.length)==e&&c.slice(d,d+t.length)==t?{open:{pos:n+f+e.length,margin:/\s/.test(h.charAt(f+e.length))?1:0},close:{pos:s-u-t.length,margin:/\s/.test(c.charAt(d-1))?1:0}}:null}function $$(i){let e=[];for(let t of i.selection.ranges){let n=i.doc.lineAt(t.from),s=t.to<=n.to?n:i.doc.lineAt(t.to);s.from>n.from&&s.from==t.to&&(s=t.to==n.to+1?n:i.doc.lineAt(t.to-1));let r=e.length-1;r>=0&&e[r].to>n.from?e[r].to=s.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:s.to})}return e}function Sf(i,e,t=e.selection.ranges){let n=t.map(r=>Ll(e,r.from).block);if(!n.every(r=>r))return null;let s=t.map((r,o)=>g$(e,n[o],r.from,r.to));if(i!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:n[o].open+" "},{from:r.to,insert:" "+n[o].close}]))};if(i!=1&&s.some(r=>r)){let r=[];for(let o=0,l;os&&(r==o||o>c.from)){s=c.from;let f=/^\s*/.exec(c.text)[0].length,u=f==c.length,d=c.text.slice(f,f+O.length)==O?f:-1;fr.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:O,empty:h,single:c}of n)(c||!h)&&r.push({from:l.from+O,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(i!=1&&n.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of n)if(l>=0){let O=o.from+l,h=O+a.length;o.text[h-o.from]==" "&&h++,r.push({from:O,to:h})}return{changes:r}}return null}var Ul=Se.define(),y$=Se.define(),S$=T.define(),bf=T.define({combine(i){return de(i,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,s)=>e(n,s)||t(n,s)})}}),xf=J.define({create(){return oi.empty},update(i,e){let t=e.state.facet(bf),n=e.annotation(Ul);if(n){let a=nt.fromTransaction(e,n.selection),O=n.side,h=O==0?i.undone:i.done;return a?h=ir(h,h.length,t.minDepth,a):h=wf(h,e.startState.selection),new oi(O==0?n.rest:h,O==0?h:n.rest)}let s=e.annotation(y$);if((s=="full"||s=="before")&&(i=i.isolate()),e.annotation(ne.addToHistory)===!1)return e.changes.empty?i:i.addMapping(e.changes.desc);let r=nt.fromTransaction(e),o=e.annotation(ne.time),l=e.annotation(ne.userEvent);return r?i=i.addChanges(r,o,l,t,e):e.selection&&(i=i.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s=="full"||s=="after")&&(i=i.isolate()),i},toJSON(i){return{done:i.done.map(e=>e.toJSON()),undone:i.undone.map(e=>e.toJSON())}},fromJSON(i){return new oi(i.done.map(nt.fromJSON),i.undone.map(nt.fromJSON))}});function Pf(i={}){return[xf,bf.of(i),k.domEventHandlers({beforeinput(e,t){let n=e.inputType=="historyUndo"?kf:e.inputType=="historyRedo"?Ml:null;return n?(e.preventDefault(),n(t)):!1}})]}function nr(i,e){return function({state:t,dispatch:n}){if(!e&&t.readOnly)return!1;let s=t.field(xf,!1);if(!s)return!1;let r=s.pop(i,t,e);return r?(n(r),!0):!1}}var kf=nr(0,!1),Ml=nr(1,!1),b$=nr(0,!0),x$=nr(1,!0);var nt=class i{constructor(e,t,n,s,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new i(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new i(e.changes&&ge.fromJSON(e.changes),[],e.mapped&&Qt.fromJSON(e.mapped),e.startSelection&&Q.fromJSON(e.startSelection),e.selectionsAfter.map(Q.fromJSON))}static fromTransaction(e,t){let n=Ie;for(let s of e.startState.facet(S$)){let r=s(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new i(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,Ie)}static selection(e){return new i(void 0,Ie,void 0,void 0,e)}};function ir(i,e,t,n){let s=e+1>t+20?e-t-1:0,r=i.slice(s,e);return r.push(n),r}function P$(i,e){let t=[],n=!1;return i.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a=O&&o<=h&&(n=!0)}}),n}function k$(i,e){return i.ranges.length==e.ranges.length&&i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length===0}function vf(i,e){return i.length?e.length?i.concat(e):i:e}var Ie=[],v$=200;function wf(i,e){if(i.length){let t=i[i.length-1],n=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-v$));return n.length&&n[n.length-1].eq(e)?i:(n.push(e),ir(i,i.length-1,1e9,t.setSelAfter(n)))}else return[nt.selection([e])]}function w$(i){let e=i[i.length-1],t=i.slice();return t[i.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Al(i,e){if(!i.length)return i;let t=i.length,n=Ie;for(;t;){let s=T$(i[t-1],e,n);if(s.changes&&!s.changes.empty||s.effects.length){let r=i.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,n=s.selectionsAfter}return n.length?[nt.selection(n)]:Ie}function T$(i,e,t){let n=vf(i.selectionsAfter.length?i.selectionsAfter.map(l=>l.map(e)):Ie,t);if(!i.changes)return nt.selection(n);let s=i.changes.map(e),r=e.mapDesc(i.changes,!0),o=i.mapped?i.mapped.composeDesc(r):r;return new nt(s,q.mapEffects(i.effects,e),o,i.startSelection.map(r),n)}var z$=/^(input\.type|delete)($|\.)/,oi=class i{constructor(e,t,n=0,s=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=s}isolate(){return this.prevTime?new i(this.done,this.undone):this}addChanges(e,t,n,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!n||z$.test(n))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?i.moveByChar(t,e):sr(t,e))}function pe(i){return i.textDirectionAt(i.state.selection.main.head)==D.LTR}var Xf=i=>zf(i,!pe(i)),Rf=i=>zf(i,pe(i));function qf(i,e){return st(i,t=>t.empty?i.moveByGroup(t,e):sr(t,e))}var X$=i=>qf(i,!pe(i)),R$=i=>qf(i,pe(i));var ex=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function q$(i,e,t){if(e.type.prop(t))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(i.sliceDoc(e.from,e.to)))||e.firstChild}function rr(i,e,t){let n=N(i).resolveInner(e.head),s=t?Z.closedBy:Z.openedBy;for(let a=e.head;;){let O=t?n.childAfter(a):n.childBefore(a);if(!O)break;q$(i,O,s)?n=O:a=t?O.to:O.from}let r=n.type.prop(s),o,l;return r&&(o=t?et(i,n.from,1):et(i,n.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?n.to:n.from,Q.cursor(l,t?-1:1)}var W$=i=>st(i,e=>rr(i.state,e,!pe(i))),Z$=i=>st(i,e=>rr(i.state,e,pe(i)));function Wf(i,e){return st(i,t=>{if(!t.empty)return sr(t,e);let n=i.moveVertically(t,e);return n.head!=t.head?n:i.moveToLineBoundary(t,e)})}var Zf=i=>Wf(i,!1),Vf=i=>Wf(i,!0);function Cf(i){let e=i.scrollDOM.clientHeighto.empty?i.moveVertically(o,e,t.height):sr(o,e));if(s.eq(n.selection))return!1;let r;if(t.selfScroll){let o=i.coordsAtPos(n.selection.main.head),l=i.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,O=l.bottom-t.marginBottom;o&&o.top>a&&o.bottomYf(i,!1),jl=i=>Yf(i,!0);function At(i,e,t){let n=i.lineBlockAt(e.head),s=i.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?n.to:n.from)&&(s=i.moveToLineBoundary(e,t,!1)),!t&&s.head==n.from&&n.length){let r=/^\s*/.exec(i.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;r&&e.head!=n.from+r&&(s=Q.cursor(n.from+r))}return s}var V$=i=>st(i,e=>At(i,e,!0)),C$=i=>st(i,e=>At(i,e,!1)),Y$=i=>st(i,e=>At(i,e,!pe(i))),_$=i=>st(i,e=>At(i,e,pe(i))),A$=i=>st(i,e=>Q.cursor(i.lineBlockAt(e.head).from,1)),U$=i=>st(i,e=>Q.cursor(i.lineBlockAt(e.head).to,-1));function M$(i,e,t){let n=!1,s=Xi(i.selection,r=>{let o=et(i,r.head,-1)||et(i,r.head,1)||r.head>0&&et(i,r.head-1,1)||r.headM$(i,e,!1);function Ne(i,e){let t=Xi(i.state.selection,n=>{let s=e(n);return Q.range(n.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(i.state.selection)?!1:(i.dispatch(gt(i.state,t)),!0)}function _f(i,e){return Ne(i,t=>i.moveByChar(t,e))}var Af=i=>_f(i,!pe(i)),Uf=i=>_f(i,pe(i));function Mf(i,e){return Ne(i,t=>i.moveByGroup(t,e))}var G$=i=>Mf(i,!pe(i)),E$=i=>Mf(i,pe(i));var L$=i=>Ne(i,e=>rr(i.state,e,!pe(i))),D$=i=>Ne(i,e=>rr(i.state,e,pe(i)));function jf(i,e){return Ne(i,t=>i.moveVertically(t,e))}var Gf=i=>jf(i,!1),Ef=i=>jf(i,!0);function Lf(i,e){return Ne(i,t=>i.moveVertically(t,e,Cf(i).height))}var df=i=>Lf(i,!1),pf=i=>Lf(i,!0),B$=i=>Ne(i,e=>At(i,e,!0)),I$=i=>Ne(i,e=>At(i,e,!1)),N$=i=>Ne(i,e=>At(i,e,!pe(i))),F$=i=>Ne(i,e=>At(i,e,pe(i))),H$=i=>Ne(i,e=>Q.cursor(i.lineBlockAt(e.head).from)),K$=i=>Ne(i,e=>Q.cursor(i.lineBlockAt(e.head).to)),mf=({state:i,dispatch:e})=>(e(gt(i,{anchor:0})),!0),gf=({state:i,dispatch:e})=>(e(gt(i,{anchor:i.doc.length})),!0),$f=({state:i,dispatch:e})=>(e(gt(i,{anchor:i.selection.main.anchor,head:0})),!0),Qf=({state:i,dispatch:e})=>(e(gt(i,{anchor:i.selection.main.anchor,head:i.doc.length})),!0),J$=({state:i,dispatch:e})=>(e(i.update({selection:{anchor:0,head:i.doc.length},userEvent:"select"})),!0),eQ=({state:i,dispatch:e})=>{let t=or(i).map(({from:n,to:s})=>Q.range(n,Math.min(s+1,i.doc.length)));return e(i.update({selection:Q.create(t),userEvent:"select"})),!0},tQ=({state:i,dispatch:e})=>{let t=Xi(i.selection,n=>{let s=N(i),r=s.resolveStack(n.from,1);if(n.empty){let o=s.resolveStack(n.from,-1);o.node.from>=r.node.from&&o.node.to<=r.node.to&&(r=o)}for(let o=r;o;o=o.next){let{node:l}=o;if((l.from=n.to||l.to>n.to&&l.from<=n.from)&&o.next)return Q.range(l.to,l.from)}return n});return t.eq(i.selection)?!1:(e(gt(i,t)),!0)},iQ=({state:i,dispatch:e})=>{let t=i.selection,n=null;return t.ranges.length>1?n=Q.create([t.main]):t.main.empty||(n=Q.create([Q.cursor(t.main.head)])),n?(e(gt(i,n)),!0):!1};function wn(i,e){if(i.state.readOnly)return!1;let t="delete.selection",{state:n}=i,s=n.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(r);ao&&(t="delete.forward",a=tr(i,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=tr(i,o,!1),l=tr(i,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:Q.cursor(o,os(i)))n.between(e,e,(s,r)=>{se&&(e=t?r:s)});return e}var Df=(i,e,t)=>wn(i,n=>{let s=n.from,{state:r}=i,o=r.doc.lineAt(s),l,a;if(t&&!e&&s>o.from&&sDf(i,!1,!0);var Bf=i=>Df(i,!0,!1),If=(i,e)=>wn(i,t=>{let n=t.head,{state:s}=i,r=s.doc.lineAt(n),o=s.charCategorizer(n);for(let l=null;;){if(n==(e?r.to:r.from)){n==t.head&&r.number!=(e?s.doc.lines:1)&&(n+=e?1:-1);break}let a=se(r.text,n-r.from,e)+r.from,O=r.text.slice(Math.min(n,a)-r.from,Math.max(n,a)-r.from),h=o(O);if(l!=null&&h!=l)break;(O!=" "||n!=t.head)&&(l=h),n=a}return n}),Nf=i=>If(i,!1),nQ=i=>If(i,!0),sQ=i=>wn(i,e=>{let t=i.lineBlockAt(e.head).to;return e.headwn(i,e=>{let t=i.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),oQ=i=>wn(i,e=>{let t=i.moveToLineBoundary(e,!0).head;return e.head{if(i.readOnly)return!1;let t=i.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:Y.of(["",""])},range:Q.cursor(n.from)}));return e(i.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},aQ=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=i.changeByRange(n=>{if(!n.empty||n.from==0||n.from==i.doc.length)return{range:n};let s=n.from,r=i.doc.lineAt(s),o=s==r.from?s-1:se(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:se(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:i.doc.slice(s,l).append(i.doc.slice(o,s))},range:Q.cursor(l)}});return t.changes.empty?!1:(e(i.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function or(i){let e=[],t=-1;for(let n of i.selection.ranges){let s=i.doc.lineAt(n.from),r=i.doc.lineAt(n.to);if(!n.empty&&n.to==r.from&&(r=i.doc.lineAt(n.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(n)}else e.push({from:s.from,to:r.to,ranges:[n]});t=r.number+1}return e}function Ff(i,e,t){if(i.readOnly)return!1;let n=[],s=[];for(let r of or(i)){if(t?r.to==i.doc.length:r.from==0)continue;let o=i.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){n.push({from:r.to,to:o.to},{from:r.from,insert:o.text+i.lineBreak});for(let a of r.ranges)s.push(Q.range(Math.min(i.doc.length,a.anchor+l),Math.min(i.doc.length,a.head+l)))}else{n.push({from:o.from,to:r.from},{from:r.to,insert:i.lineBreak+o.text});for(let a of r.ranges)s.push(Q.range(a.anchor-l,a.head-l))}}return n.length?(e(i.update({changes:n,scrollIntoView:!0,selection:Q.create(s,i.selection.mainIndex),userEvent:"move.line"})),!0):!1}var OQ=({state:i,dispatch:e})=>Ff(i,e,!1),hQ=({state:i,dispatch:e})=>Ff(i,e,!0);function Hf(i,e,t){if(i.readOnly)return!1;let n=[];for(let s of or(i))t?n.push({from:s.from,insert:i.doc.slice(s.from,s.to)+i.lineBreak}):n.push({from:s.to,insert:i.lineBreak+i.doc.slice(s.from,s.to)});return e(i.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}var cQ=({state:i,dispatch:e})=>Hf(i,e,!1),fQ=({state:i,dispatch:e})=>Hf(i,e,!0),uQ=i=>{if(i.state.readOnly)return!1;let{state:e}=i,t=e.changes(or(e).map(({from:s,to:r})=>(s>0?s--:r{let r;if(i.lineWrapping){let o=i.lineBlockAt(s.head),l=i.coordsAtPos(s.head,s.assoc||1);l&&(r=o.bottom+i.documentTop-l.bottom+i.defaultLineHeight/2)}return i.moveVertically(s,!0,r)}).map(t);return i.dispatch({changes:t,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function dQ(i,e){if(/\(\)|\[\]|\{\}/.test(i.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=N(i).resolveInner(e),n=t.childBefore(e),s=t.childAfter(e),r;return n&&s&&n.to<=e&&s.from>=e&&(r=n.type.prop(Z.closedBy))&&r.indexOf(s.name)>-1&&i.doc.lineAt(n.to).from==i.doc.lineAt(s.from).from&&!/\S/.test(i.sliceDoc(n.to,s.from))?{from:n.to,to:s.from}:null}var yf=Kf(!1),pQ=Kf(!0);function Kf(i){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!i&&r==o&&dQ(e,r);i&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let O=new si(e,{simulateBreak:r,simulateDoubleBreak:!!a}),h=Ks(O,r);for(h==null&&(h=yt(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));ol.from&&r{let s=[];for(let o=n.from;o<=n.to;){let l=i.doc.lineAt(o);l.number>t&&(n.empty||n.to>l.from)&&(e(l,s,n),t=l.number),o=l.to+1}let r=i.changes(s);return{changes:s,range:Q.range(r.mapPos(n.anchor,1),r.mapPos(n.head,1))}})}var mQ=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=Object.create(null),n=new si(i,{overrideIndentation:r=>{let o=t[r];return o??-1}}),s=Dl(i,(r,o,l)=>{let a=Ks(n,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let O=/^\s*/.exec(r.text)[0],h=zi(i,a);(O!=h||l.fromi.readOnly?!1:(e(i.update(Dl(i,(t,n)=>{n.push({from:t.from,insert:i.facet(Ti)})}),{userEvent:"input.indent"})),!0),eu=({state:i,dispatch:e})=>i.readOnly?!1:(e(i.update(Dl(i,(t,n)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=yt(s,i.tabSize),o=0,l=zi(i,Math.max(0,r-Pn(i)));for(;o(i.setTabFocusMode(),!0);var $Q=[{key:"Ctrl-b",run:Xf,shift:Af,preventDefault:!0},{key:"Ctrl-f",run:Rf,shift:Uf},{key:"Ctrl-p",run:Zf,shift:Gf},{key:"Ctrl-n",run:Vf,shift:Ef},{key:"Ctrl-a",run:A$,shift:H$},{key:"Ctrl-e",run:U$,shift:K$},{key:"Ctrl-d",run:Bf},{key:"Ctrl-h",run:Gl},{key:"Ctrl-k",run:sQ},{key:"Ctrl-Alt-h",run:Nf},{key:"Ctrl-o",run:lQ},{key:"Ctrl-t",run:aQ},{key:"Ctrl-v",run:jl}],QQ=[{key:"ArrowLeft",run:Xf,shift:Af,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:X$,shift:G$,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Y$,shift:N$,preventDefault:!0},{key:"ArrowRight",run:Rf,shift:Uf,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:R$,shift:E$,preventDefault:!0},{mac:"Cmd-ArrowRight",run:_$,shift:F$,preventDefault:!0},{key:"ArrowUp",run:Zf,shift:Gf,preventDefault:!0},{mac:"Cmd-ArrowUp",run:mf,shift:$f},{mac:"Ctrl-ArrowUp",run:uf,shift:df},{key:"ArrowDown",run:Vf,shift:Ef,preventDefault:!0},{mac:"Cmd-ArrowDown",run:gf,shift:Qf},{mac:"Ctrl-ArrowDown",run:jl,shift:pf},{key:"PageUp",run:uf,shift:df},{key:"PageDown",run:jl,shift:pf},{key:"Home",run:C$,shift:I$,preventDefault:!0},{key:"Mod-Home",run:mf,shift:$f},{key:"End",run:V$,shift:B$,preventDefault:!0},{key:"Mod-End",run:gf,shift:Qf},{key:"Enter",run:yf,shift:yf},{key:"Mod-a",run:J$},{key:"Backspace",run:Gl,shift:Gl},{key:"Delete",run:Bf},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Nf},{key:"Mod-Delete",mac:"Alt-Delete",run:nQ},{mac:"Mod-Backspace",run:rQ},{mac:"Mod-Delete",run:oQ}].concat($Q.map(i=>({mac:i.key,run:i.run,shift:i.shift}))),tu=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:W$,shift:L$},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Z$,shift:D$},{key:"Alt-ArrowUp",run:OQ},{key:"Shift-Alt-ArrowUp",run:cQ},{key:"Alt-ArrowDown",run:hQ},{key:"Shift-Alt-ArrowDown",run:fQ},{key:"Escape",run:iQ},{key:"Mod-Enter",run:pQ},{key:"Alt-l",mac:"Ctrl-l",run:eQ},{key:"Mod-i",run:tQ,preventDefault:!0},{key:"Mod-[",run:eu},{key:"Mod-]",run:Jf},{key:"Mod-Alt-\\",run:mQ},{key:"Shift-Mod-k",run:uQ},{key:"Shift-Mod-\\",run:j$},{key:"Mod-/",run:u$},{key:"Alt-A",run:p$},{key:"Ctrl-m",mac:"Shift-Alt-m",run:gQ}].concat(QQ),iu={key:"Tab",run:Jf,shift:eu};function G(){var i=arguments[0];typeof i=="string"&&(i=document.createElement(i));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var s=t[n];typeof s=="string"?i.setAttribute(n,s):s!=null&&(i[n]=s)}e++}for(;ei.normalize("NFKD"):i=>i,Mt=class{constructor(e,t,n=0,s=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,s),this.bufferStart=n,this.normalize=r?l=>r(su(l)):su,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Oe(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Di(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Xe(e);let s=this.normalize(t);if(s.length)for(let r=0,o=n;;r++){let l=s.charCodeAt(r),a=this.match(l,o,this.bufferPos+this.bufferStart);if(r==s.length-1){if(a)return this.value=a,this;break}o==n&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,s=n+t[0].length;if(this.matchPos=fr(this.text,s+(n==s?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,s,t)))return this.value={from:n,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=n||s.to<=t){let l=new i(t,e.sliceString(t,n));return Bl.set(e,l),l}if(s.from==t&&s.to==n)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let n=this.flat.from+t.index,s=n+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,s,t)))return this.value={from:n,to:s,match:t},this.matchPos=fr(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=hr.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<"u"&&(Or.prototype[Symbol.iterator]=cr.prototype[Symbol.iterator]=function(){return this});function yQ(i){try{return new RegExp(i,Jl),!0}catch{return!1}}function fr(i,e){if(e>=i.length)return e;let t=i.lineAt(e),n;for(;e=56320&&n<57344;)e++;return e}function Il(i){let e=String(i.state.doc.lineAt(i.state.selection.main.head).number),t=G("input",{class:"cm-textfield",name:"line",value:e}),n=G("form",{class:"cm-gotoLine",onkeydown:r=>{r.keyCode==27?(r.preventDefault(),i.dispatch({effects:Tn.of(!1)}),i.focus()):r.keyCode==13&&(r.preventDefault(),s())},onsubmit:r=>{r.preventDefault(),s()}},G("label",i.state.phrase("Go to line"),": ",t)," ",G("button",{class:"cm-button",type:"submit"},i.state.phrase("go")),G("button",{name:"close",onclick:()=>{i.dispatch({effects:Tn.of(!1)}),i.focus()},"aria-label":i.state.phrase("close"),type:"button"},["\xD7"]));function s(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!r)return;let{state:o}=i,l=o.doc.lineAt(o.selection.main.head),[,a,O,h,c]=r,f=h?+h.slice(1):0,u=O?+O:l.number;if(O&&c){let g=u/100;a&&(g=g*(a=="-"?-1:1)+l.number/o.doc.lines),u=Math.round(o.doc.lines*g)}else O&&a&&(u=u*(a=="-"?-1:1)+l.number);let d=o.doc.line(Math.max(1,Math.min(o.doc.lines,u))),m=Q.cursor(d.from+Math.max(0,Math.min(f,d.length)));i.dispatch({effects:[Tn.of(!1),k.scrollIntoView(m.from,{y:"center"})],selection:m}),i.focus()}return{dom:n}}var Tn=q.define(),ru=J.define({create(){return!0},update(i,e){for(let t of e.effects)t.is(Tn)&&(i=t.value);return i},provide:i=>Jt.from(i,e=>e?Il:null)}),SQ=i=>{let e=ei(i,Il);if(!e){let t=[Tn.of(!0)];i.state.field(ru,!1)==null&&t.push(q.appendConfig.of([ru,bQ])),i.dispatch({effects:t}),e=ei(i,Il)}return e&&e.dom.querySelector("input").select(),!0},bQ=k.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),xQ={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Ou=T.define({combine(i){return de(i,xQ,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function hu(i){let e=[TQ,wQ];return i&&e.push(Ou.of(i)),e}var PQ=X.mark({class:"cm-selectionMatch"}),kQ=X.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function ou(i,e,t,n){return(t==0||i(e.sliceDoc(t-1,t))!=L.Word)&&(n==e.doc.length||i(e.sliceDoc(n,n+1))!=L.Word)}function vQ(i,e,t,n){return i(e.sliceDoc(t,t+1))==L.Word&&i(e.sliceDoc(n-1,n))==L.Word}var wQ=te.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.selectionSet||i.docChanged||i.viewportChanged)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=i.state.facet(Ou),{state:t}=i,n=t.selection;if(n.ranges.length>1)return X.none;let s=n.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return X.none;let a=t.wordAt(s.head);if(!a)return X.none;o=t.charCategorizer(s.head),r=t.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a200)return X.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(ou(o,t,s.from,s.to)&&vQ(o,t,s.from,s.to)))return X.none}else if(r=t.sliceDoc(s.from,s.to),!r)return X.none}let l=[];for(let a of i.visibleRanges){let O=new Mt(t.doc,r,a.from,a.to);for(;!O.next().done;){let{from:h,to:c}=O.value;if((!o||ou(o,t,h,c))&&(s.empty&&h<=s.from&&c>=s.to?l.push(kQ.range(h,c)):(h>=s.to||c<=s.from)&&l.push(PQ.range(h,c)),l.length>e.maxMatches))return X.none}}return X.set(l)}},{decorations:i=>i.decorations}),TQ=k.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),zQ=({state:i,dispatch:e})=>{let{selection:t}=i,n=Q.create(t.ranges.map(s=>i.wordAt(s.head)||Q.cursor(s.head)),t.mainIndex);return n.eq(t)?!1:(e(i.update({selection:n})),!0)};function XQ(i,e){let{main:t,ranges:n}=i.selection,s=i.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,l=new Mt(i.doc,e,n[n.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Mt(i.doc,e,0,Math.max(0,n[n.length-1].from-1)),o=!0}else{if(o&&n.some(a=>a.from==l.value.from))continue;if(r){let a=i.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}var RQ=({state:i,dispatch:e})=>{let{ranges:t}=i.selection;if(t.some(r=>r.from===r.to))return zQ({state:i,dispatch:e});let n=i.sliceDoc(t[0].from,t[0].to);if(i.selection.ranges.some(r=>i.sliceDoc(r.from,r.to)!=n))return!1;let s=XQ(i,n);return s?(e(i.update({selection:i.selection.addRange(Q.range(s.from,s.to),!1),effects:k.scrollIntoView(s.to)})),!0):!1},Wi=T.define({combine(i){return de(i,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Kl(e),scrollToMatch:e=>k.scrollIntoView(e)})}});var ur=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||yQ(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,n)=>n=="n"?` -`:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new Fl(this):new Nl(this)}getCursor(e,t=0,n){let s=e.doc?e:U.create({doc:e});return n==null&&(n=s.doc.length),this.regexp?qi(this,s,t,n):Ri(this,s,t,n)}},dr=class{constructor(e){this.spec=e}};function Ri(i,e,t,n){return new Mt(e.doc,i.unquoted,t,n,i.caseSensitive?void 0:s=>s.toLowerCase(),i.wholeWord?qQ(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function qQ(i,e){return(t,n,s,r)=>((r>t||r+s.length=t)return null;s.push(n.value)}return s}highlight(e,t,n,s){let r=Ri(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}};function qi(i,e,t,n){return new Or(e.doc,i.search,{ignoreCase:!i.caseSensitive,test:i.wholeWord?WQ(e.charCategorizer(e.selection.main.head)):void 0},t,n)}function pr(i,e){return i.slice(se(i,e,!1),e)}function mr(i,e){return i.slice(e,se(i,e))}function WQ(i){return(e,t,n)=>!n[0].length||(i(pr(n.input,n.index))!=L.Word||i(mr(n.input,n.index))!=L.Word)&&(i(mr(n.input,n.index+n[0].length))!=L.Word||i(pr(n.input,n.index+n[0].length))!=L.Word)}var Fl=class extends dr{nextMatch(e,t,n){let s=qi(this.spec,e,n,e.doc.length).next();return s.done&&(s=qi(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,n){for(let s=1;;s++){let r=Math.max(t,n-s*1e4),o=qi(this.spec,e,r,n),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let s=n.length;s>0;s--){let r=+n.slice(0,s);if(r>0&&r=t)return null;s.push(n.value)}return s}highlight(e,t,n,s){let r=qi(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}},Xn=q.define(),ea=q.define(),Ut=J.define({create(i){return new zn(Hl(i).create(),null)},update(i,e){for(let t of e.effects)t.is(Xn)?i=new zn(t.value.create(),i.panel):t.is(ea)&&(i=new zn(i.query,t.value?ta:null));return i},provide:i=>Jt.from(i,e=>e.panel)});var zn=class{constructor(e,t){this.query=e,this.panel=t}},ZQ=X.mark({class:"cm-searchMatch"}),VQ=X.mark({class:"cm-searchMatch cm-searchMatch-selected"}),CQ=te.fromClass(class{constructor(i){this.view=i,this.decorations=this.highlight(i.state.field(Ut))}update(i){let e=i.state.field(Ut);(e!=i.startState.field(Ut)||i.docChanged||i.selectionSet||i.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:i,panel:e}){if(!e||!i.spec.valid)return X.none;let{view:t}=this,n=new ze;for(let s=0,r=t.visibleRanges,o=r.length;sr[s+1].from-2*250;)a=r[++s].to;i.highlight(t.state,l,a,(O,h)=>{let c=t.state.selection.ranges.some(f=>f.from==O&&f.to==h);n.add(O,h,c?VQ:ZQ)})}return n.finish()}},{decorations:i=>i.decorations});function Rn(i){return e=>{let t=e.state.field(Ut,!1);return t&&t.query.spec.valid?i(e,t):uu(e)}}var gr=Rn((i,{query:e})=>{let{to:t}=i.state.selection.main,n=e.nextMatch(i.state,t,t);if(!n)return!1;let s=Q.single(n.from,n.to),r=i.state.facet(Wi);return i.dispatch({selection:s,effects:[ia(i,n),r.scrollToMatch(s.main,i)],userEvent:"select.search"}),fu(i),!0}),$r=Rn((i,{query:e})=>{let{state:t}=i,{from:n}=t.selection.main,s=e.prevMatch(t,n,n);if(!s)return!1;let r=Q.single(s.from,s.to),o=i.state.facet(Wi);return i.dispatch({selection:r,effects:[ia(i,s),o.scrollToMatch(r.main,i)],userEvent:"select.search"}),fu(i),!0}),YQ=Rn((i,{query:e})=>{let t=e.matchAll(i.state,1e3);return!t||!t.length?!1:(i.dispatch({selection:Q.create(t.map(n=>Q.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),_Q=({state:i,dispatch:e})=>{let t=i.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:n,to:s}=t.main,r=[],o=0;for(let l=new Mt(i.doc,i.sliceDoc(n,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==n&&(o=r.length),r.push(Q.range(l.value.from,l.value.to))}return e(i.update({selection:Q.create(r,o),userEvent:"select.search.matches"})),!0},lu=Rn((i,{query:e})=>{let{state:t}=i,{from:n,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,n,n);if(!r)return!1;let o=r,l=[],a,O,h=[];o.from==n&&o.to==s&&(O=t.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:O}),o=e.nextMatch(t,o.from,o.to),h.push(k.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(n).number)+".")));let c=i.state.changes(l);return o&&(a=Q.single(o.from,o.to).map(c),h.push(ia(i,o)),h.push(t.facet(Wi).scrollToMatch(a.main,i))),i.dispatch({changes:c,selection:a,effects:h,userEvent:"input.replace"}),!0}),AQ=Rn((i,{query:e})=>{if(i.state.readOnly)return!1;let t=e.matchAll(i.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let n=i.state.phrase("replaced $ matches",t.length)+".";return i.dispatch({changes:t,effects:k.announce.of(n),userEvent:"input.replace.all"}),!0});function ta(i){return i.state.facet(Wi).createPanel(i)}function Hl(i,e){var t,n,s,r,o;let l=i.selection.main,a=l.empty||l.to>l.from+100?"":i.sliceDoc(l.from,l.to);if(e&&!a)return e;let O=i.facet(Wi);return new ur({search:((t=e?.literal)!==null&&t!==void 0?t:O.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(n=e?.caseSensitive)!==null&&n!==void 0?n:O.caseSensitive,literal:(s=e?.literal)!==null&&s!==void 0?s:O.literal,regexp:(r=e?.regexp)!==null&&r!==void 0?r:O.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:O.wholeWord})}function cu(i){let e=ei(i,ta);return e&&e.dom.querySelector("[main-field]")}function fu(i){let e=cu(i);e&&e==i.root.activeElement&&e.select()}var uu=i=>{let e=i.state.field(Ut,!1);if(e&&e.panel){let t=cu(i);if(t&&t!=i.root.activeElement){let n=Hl(i.state,e.query.spec);n.valid&&i.dispatch({effects:Xn.of(n)}),t.focus(),t.select()}}else i.dispatch({effects:[ea.of(!0),e?Xn.of(Hl(i.state,e.query.spec)):q.appendConfig.of(MQ)]});return!0},du=i=>{let e=i.state.field(Ut,!1);if(!e||!e.panel)return!1;let t=ei(i,ta);return t&&t.dom.contains(i.root.activeElement)&&i.focus(),i.dispatch({effects:ea.of(!1)}),!0},pu=[{key:"Mod-f",run:uu,scope:"editor search-panel"},{key:"F3",run:gr,shift:$r,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:gr,shift:$r,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:du,scope:"editor search-panel"},{key:"Mod-Shift-l",run:_Q},{key:"Mod-Alt-g",run:SQ},{key:"Mod-d",run:RQ,preventDefault:!0}],Kl=class{constructor(e){this.view=e;let t=this.query=e.state.field(Ut).query.spec;this.commit=this.commit.bind(this),this.searchField=G("input",{value:t.search,placeholder:Ve(e,"Find"),"aria-label":Ve(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=G("input",{value:t.replace,placeholder:Ve(e,"Replace"),"aria-label":Ve(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=G("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=G("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=G("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function n(s,r,o){return G("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=G("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,n("next",()=>gr(e),[Ve(e,"next")]),n("prev",()=>$r(e),[Ve(e,"previous")]),n("select",()=>YQ(e),[Ve(e,"all")]),G("label",null,[this.caseField,Ve(e,"match case")]),G("label",null,[this.reField,Ve(e,"regexp")]),G("label",null,[this.wordField,Ve(e,"by word")]),...e.state.readOnly?[]:[G("br"),this.replaceField,n("replace",()=>lu(e),[Ve(e,"replace")]),n("replaceAll",()=>AQ(e),[Ve(e,"replace all")])],G("button",{name:"close",onclick:()=>du(e),"aria-label":Ve(e,"close"),type:"button"},["\xD7"])])}commit(){let e=new ur({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Xn.of(e)}))}keydown(e){hc(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?$r:gr)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),lu(this.view))}update(e){for(let t of e.transactions)for(let n of t.effects)n.is(Xn)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Wi).top}};function Ve(i,e){return i.state.phrase(e)}var lr=30,ar=/[\s\.,:;?!]/;function ia(i,{from:e,to:t}){let n=i.state.doc.lineAt(e),s=i.state.doc.lineAt(t).to,r=Math.max(n.from,e-lr),o=Math.min(s,t+lr),l=i.state.sliceDoc(r,o);if(r!=n.from){for(let a=0;al.length-lr;a--)if(!ar.test(l[a-1])&&ar.test(l[a])){l=l.slice(0,a);break}}return k.announce.of(`${i.state.phrase("current match")}. ${l} ${i.state.phrase("on line")} ${n.number}.`)}var UQ=k.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),MQ=[Ut,Me.low(CQ),UQ];var yr=class{constructor(e,t,n,s){this.state=e,this.pos=t,this.explicit=n,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=N(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),s=t.text.slice(n-t.from,this.pos-t.from),r=s.search(vu(e,!1));return r<0?null:{from:n+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function mu(i){let e=Object.keys(i).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function jQ(i){let e=Object.create(null),t=Object.create(null);for(let{label:s}of i){e[s[0]]=!0;for(let r=1;rtypeof s=="string"?{label:s}:s),[t,n]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:jQ(e);return s=>{let r=s.matchBefore(n);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}function ku(i,e){return t=>{for(let n=N(t.state).resolveInner(t.pos,-1);n;n=n.parent){if(i.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(t)}}var Sr=class{constructor(e,t,n,s){this.completion=e,this.source=t,this.match=n,this.score=s}};function ai(i){return i.selection.main.from}function vu(i,e){var t;let{source:n}=i,s=e&&n[0]!="^",r=n[n.length-1]!="$";return!s&&!r?i:new RegExp(`${s?"^":""}(?:${n})${r?"$":""}`,(t=i.flags)!==null&&t!==void 0?t:i.ignoreCase?"i":"")}var pa=Se.define();function GQ(i,e,t,n){let{main:s}=i.selection,r=t-s.from,o=n-s.from;return Object.assign(Object.assign({},i.changeByRange(l=>{if(l!=s&&t!=n&&i.sliceDoc(l.from+r,l.from+o)!=i.sliceDoc(t,n))return{range:l};let a=i.toText(e);return{changes:{from:l.from+r,to:n==s.from?l.to:l.from+o,insert:a},range:Q.cursor(l.from+r+a.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}var gu=new WeakMap;function EQ(i){if(!Array.isArray(i))return i;let e=gu.get(i);return e||gu.set(i,e=da(i)),e}var br=q.define(),qn=q.define(),ra=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(P=Di(S))!=P.toLowerCase()?1:P!=P.toUpperCase()?2:0;(!y||w==1&&g||x==0&&w!=0)&&(t[c]==S||n[c]==S&&(f=!0)?o[c++]=y:o.length&&($=!1)),x=w,y+=Xe(S)}return c==a&&o[0]==0&&$?this.result(-100+(f?-200:0),o,e):u==a&&d==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):u==a?this.ret(-900-e.length,[d,m]):c==a?this.result(-100+(f?-200:0)+-700+($?0:-1100),o,e):t.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,n){let s=[],r=0;for(let o of t){let l=o+(this.astral?Xe(Oe(n,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(e-n.length,s)}},oa=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:LQ,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>$u(e(n),t(n)),optionClass:(e,t)=>n=>$u(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function $u(i,e){return i?e?i+" "+e:i:e}function LQ(i,e,t,n,s,r){let o=i.textDirection==D.RTL,l=o,a=!1,O="top",h,c,f=e.left-s.left,u=s.right-e.right,d=n.right-n.left,m=n.bottom-n.top;if(l&&f=m||y>e.top?h=t.bottom-e.top:(O="bottom",h=e.bottom-t.top)}let g=(e.bottom-e.top)/r.offsetHeight,$=(e.right-e.left)/r.offsetWidth;return{style:`${O}: ${h/g}px; max-width: ${c/$}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}function DQ(i){let e=i.addToOptions.slice();return i.icons&&e.push({render(t){let n=document.createElement("div");return n.classList.add("cm-completionIcon"),t.type&&n.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),n.setAttribute("aria-hidden","true"),n},position:20}),e.push({render(t,n,s,r){let o=document.createElement("span");o.className="cm-completionLabel";let l=t.displayLabel||t.label,a=0;for(let O=0;Oa&&o.appendChild(document.createTextNode(l.slice(a,h)));let f=o.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(l.slice(h,c))),f.className="cm-completionMatchedText",a=c}return at.position-n.position).map(t=>t.render)}function na(i,e,t){if(i<=t)return{from:0,to:i};if(e<0&&(e=0),e<=i>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let n=Math.floor((i-e)/t);return{from:i-(n+1)*t,to:i-n*t}}var la=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:r,selected:o}=s.open,l=e.state.facet(le);this.optionContent=DQ(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=na(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:O}=e.state.field(t).open;for(let h=a.target,c;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(c=/-(\d+)$/.exec(h.id))&&+c[1]{let O=e.state.field(this.stateField,!1);O&&O.tooltip&&e.state.facet(le).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:qn.of(null)})}),this.showOptions(r,s.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=s){let{options:r,selected:o,disabled:l}=n.open;(!s.open||s.open.options!=r)&&(this.range=na(r.length,o,e.state.facet(le).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),l!=((t=s.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of t.split(" "))n&&this.dom.classList.add(n);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=na(t.options.length,t.selected,this.view.state.facet(le).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:s}=n;if(!s)return;let r=typeof s=="string"?document.createTextNode(s):s(n);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,n)}).catch(o=>ce(this.view.state,o,"completion info")):this.addInfoPane(r,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:r}=e;n.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,s=this.range.from;n;n=n.nextSibling,s++)n.nodeName!="LI"||!n.id?s--:s==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected");return t&&IQ(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.documentElement;r={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return s.top>Math.min(r.bottom,t.bottom)-10||s.bottom{o.target==s&&o.preventDefault()});let r=null;for(let o=n.from;on.from||n.from==0))if(r=f,typeof O!="string"&&O.header)s.appendChild(O.header(O));else{let u=s.appendChild(document.createElement("completion-section"));u.textContent=f}}let h=s.appendChild(document.createElement("li"));h.id=t+"-"+o,h.setAttribute("role","option");let c=this.optionClass(l);c&&(h.className=c);for(let f of this.optionContent){let u=f(l,this.view.state,this.view,a);u&&h.appendChild(u)}}return n.from&&s.classList.add("cm-completionListIncompleteTop"),n.tonew la(t,i,e)}function IQ(i,e){let t=i.getBoundingClientRect(),n=e.getBoundingClientRect(),s=t.height/i.offsetHeight;n.topt.bottom&&(i.scrollTop+=(n.bottom-t.bottom)/s)}function Qu(i){return(i.boost||0)*100+(i.apply?10:0)+(i.info?5:0)+(i.type?1:0)}function NQ(i,e){let t=[],n=null,s=O=>{t.push(O);let{section:h}=O.completion;if(h){n||(n=[]);let c=typeof h=="string"?h:h.name;n.some(f=>f.name==c)||n.push(typeof h=="string"?{name:c}:h)}},r=e.facet(le);for(let O of i)if(O.hasResult()){let h=O.result.getMatch;if(O.result.filter===!1)for(let c of O.result.options)s(new Sr(c,O.source,h?h(c):[],1e9-t.length));else{let c=e.sliceDoc(O.from,O.to),f,u=r.filterStrict?new oa(c):new ra(c);for(let d of O.result.options)if(f=u.match(d.label)){let m=d.displayLabel?h?h(d,f.matched):[]:f.matched;s(new Sr(d,O.source,m,f.score+(d.boost||0)))}}}if(n){let O=Object.create(null),h=0,c=(f,u)=>{var d,m;return((d=f.rank)!==null&&d!==void 0?d:1e9)-((m=u.rank)!==null&&m!==void 0?m:1e9)||(f.namec.score-h.score||a(h.completion,c.completion))){let h=O.completion;!l||l.label!=h.label||l.detail!=h.detail||l.type!=null&&h.type!=null&&l.type!=h.type||l.apply!=h.apply||l.boost!=h.boost?o.push(O):Qu(O.completion)>Qu(l)&&(o[o.length-1]=O),l=O.completion}return o}var aa=class i{constructor(e,t,n,s,r,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new i(this.options,yu(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,s,r,o){if(s&&!o&&e.some(O=>O.isPending))return s.setDisabled();let l=NQ(e,t);if(!l.length)return s&&e.some(O=>O.isPending)?s.setDisabled():null;let a=t.facet(le).selectOnOpen?0:-1;if(s&&s.selected!=a&&s.selected!=-1){let O=s.options[s.selected].completion;for(let h=0;hh.hasResult()?Math.min(O,h.from):O,1e8),create:ty,above:r.aboveCursor},s?s.timestamp:Date.now(),a,!1)}map(e){return new i(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new i(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},Oa=class i{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new i(JQ,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,n=t.facet(le),r=(n.override||t.languageDataAt("autocomplete",ai(t)).map(EQ)).map(a=>(this.active.find(h=>h.source==a)||new Pt(a,this.active.some(h=>h.state!=0)?1:0)).update(e,n));r.length==this.active.length&&r.every((a,O)=>a==this.active[O])&&(r=this.active);let o=this.open,l=e.effects.some(a=>a.is(ma));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!FQ(r,this.active)||l?o=aa.build(r,t,this.id,o,n,l):o&&o.disabled&&!r.some(a=>a.isPending)&&(o=null),!o&&r.every(a=>!a.isPending)&&r.some(a=>a.hasResult())&&(r=r.map(a=>a.hasResult()?new Pt(a.source,0):a));for(let a of e.effects)a.is(Tu)&&(o=o&&o.setSelected(a.value,this.id));return r==this.active&&o==this.open?this:new i(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?HQ:KQ}};function FQ(i,e){if(i==e)return!0;for(let t=0,n=0;;){for(;t-1&&(t["aria-activedescendant"]=i+"-"+e),t}var JQ=[];function wu(i,e){if(i.isUserEvent("input.complete")){let n=i.annotation(pa);if(n&&e.activateOnCompletion(n))return 12}let t=i.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:i.isUserEvent("delete.backward")?2:i.selection?8:i.docChanged?16:0}var Pt=class i{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let n=wu(e,t),s=this;(n&8||n&16&&this.touches(e))&&(s=new i(s.source,0)),n&4&&s.state==0&&(s=new i(this.source,1)),s=s.updateFor(e,n);for(let r of e.effects)if(r.is(br))s=new i(s.source,1,r.value);else if(r.is(qn))s=new i(s.source,0);else if(r.is(ma))for(let o of r.value)o.source==s.source&&(s=o);return s}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(ai(e.state))}},xr=class i extends Pt{constructor(e,t,n,s,r,o){super(e,3,t),this.limit=n,this.result=s,this.from=r,this.to=o}hasResult(){return!0}updateFor(e,t){var n;if(!(t&3))return this.map(e.changes);let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=ai(e.state);if(l>o||!s||t&2&&(ai(e.startState)==this.from||lt.map(e))}}),Tu=q.define(),ve=J.define({create(){return Oa.start()},update(i,e){return i.update(e)},provide:i=>[gn.from(i,e=>e.tooltip),k.contentAttributes.from(i,e=>e.attrs)]});function ga(i,e){let t=e.completion.apply||e.completion.label,n=i.state.field(ve).active.find(s=>s.source==e.source);return n instanceof xr?(typeof t=="string"?i.dispatch(Object.assign(Object.assign({},GQ(i.state,t,n.from,n.to)),{annotations:pa.of(e.completion)})):t(i,e.completion,n.from,n.to),!0):!1}var ty=BQ(ve,ga);function Qr(i,e="option"){return t=>{let n=t.state.field(ve,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp-1?n.open.selected+s*(i?1:-1):i?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:Tu.of(l)}),!0}}var iy=i=>{let e=i.state.field(ve,!1);return i.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampi.state.field(ve,!1)?(i.dispatch({effects:br.of(!0)}),!0):!1,ny=i=>{let e=i.state.field(ve,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(i.dispatch({effects:qn.of(null)}),!0)},ha=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},sy=50,ry=1e3,oy=te.fromClass(class{constructor(i){this.view=i,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of i.state.field(ve).active)e.isPending&&this.startQuery(e)}update(i){let e=i.state.field(ve),t=i.state.facet(le);if(!i.selectionSet&&!i.docChanged&&i.startState.field(ve)==e)return;let n=i.transactions.some(r=>{let o=wu(r,t);return o&8||(r.selection||r.docChanged)&&!(o&3)});for(let r=0;rsy&&Date.now()-o.time>ry){for(let l of o.context.abortListeners)try{l()}catch(a){ce(this.view.state,a)}o.context.abortListeners=null,this.running.splice(r--,1)}else o.updates.push(...i.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),i.transactions.some(r=>r.effects.some(o=>o.is(br)))&&(this.pendingStart=!0);let s=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(r=>r.isPending&&!this.running.some(o=>o.active.source==r.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let r of i.transactions)r.isUserEvent("input.type")?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:i}=this.view,e=i.field(ve);for(let t of e.active)t.isPending&&!this.running.some(n=>n.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(le).updateSyncTime))}startQuery(i){let{state:e}=this.view,t=ai(e),n=new yr(e,t,i.explicit,this.view),s=new ha(i,n);this.running.push(s),Promise.resolve(i.source(n)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:qn.of(null)}),ce(this.view.state,r)})}scheduleAccept(){this.running.every(i=>i.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(le).updateSyncTime))}accept(){var i;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(le),n=this.view.state.field(ve);for(let s=0;sl.source==r.active.source);if(o&&o.isPending)if(r.done==null){let l=new Pt(r.active.source,0);for(let a of r.updates)l=l.update(a,t);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:ma.of(e)})}},{eventHandlers:{blur(i){let e=this.view.state.field(ve,!1);if(e&&e.tooltip&&this.view.state.facet(le).closeOnBlur){let t=e.open&&ll(this.view,e.open.tooltip);(!t||!t.dom.contains(i.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:qn.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:br.of(!1)}),20),this.composing=0}}}),ly=typeof navigator=="object"&&/Win/.test(navigator.platform),ay=Me.highest(k.domEventHandlers({keydown(i,e){let t=e.state.field(ve,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||i.key.length>1||i.ctrlKey&&!(ly&&i.altKey)||i.metaKey)return!1;let n=t.open.options[t.open.selected],s=t.active.find(o=>o.source==n.source),r=n.completion.commitCharacters||s.result.commitCharacters;return r&&r.indexOf(i.key)>-1&&ga(e,n),!1}})),zu=k.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",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",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),ca=class{constructor(e,t,n,s){this.field=e,this.line=t,this.from=n,this.to=s}},fa=class i{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,oe.TrackDel),n=e.mapPos(this.to,1,oe.TrackDel);return t==null||n==null?null:new i(this.field,t,n)}},ua=class i{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],s=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(n.length){let O=o,h=/^\t*/.exec(a)[0].length;for(let c=0;cnew fa(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:n,ranges:l}}static parse(e){let t=[],n=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",O=-1,h=a.replace(/\\[{}]/g,c=>c[1]);for(let c=0;c=O&&f.field++}s.push(new ca(O,n.length,r.index,r.index+h.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}o=o.replace(/\\([{}])/g,(l,a,O)=>{for(let h of s)h.line==n.length&&h.from>O&&(h.from--,h.to--);return a}),n.push(o)}return new i(n,s)}},Oy=X.widget({widget:new class extends xe{toDOM(){let i=document.createElement("span");return i.className="cm-snippetFieldPosition",i}ignoreEvent(){return!1}}}),hy=X.mark({class:"cm-snippetField"}),Zi=class i{constructor(e,t){this.ranges=e,this.active=t,this.deco=X.set(e.map(n=>(n.from==n.to?Oy:hy).range(n.from,n.to)))}map(e){let t=[];for(let n of this.ranges){let s=n.map(e);if(!s)return null;t.push(s)}return new i(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(n=>n.field==this.active&&n.from<=t.from&&n.to>=t.to))}},Vn=q.define({map(i,e){return i&&i.map(e)}}),cy=q.define(),Wn=J.define({create(){return null},update(i,e){for(let t of e.effects){if(t.is(Vn))return t.value;if(t.is(cy)&&i)return new Zi(i.ranges,t.value)}return i&&e.docChanged&&(i=i.map(e.changes)),i&&e.selection&&!i.selectionInsideField(e.selection)&&(i=null),i},provide:i=>k.decorations.from(i,e=>e?e.deco:X.none)});function $a(i,e){return Q.create(i.filter(t=>t.field==e).map(t=>Q.range(t.from,t.to)))}function fy(i){let e=ua.parse(i);return(t,n,s,r)=>{let{text:o,ranges:l}=e.instantiate(t.state,s),{main:a}=t.state.selection,O={changes:{from:s,to:r==a.from?a.to:r,insert:Y.of(o)},scrollIntoView:!0,annotations:n?[pa.of(n),ne.userEvent.of("input.complete")]:void 0};if(l.length&&(O.selection=$a(l,0)),l.some(h=>h.field>0)){let h=new Zi(l,0),c=O.effects=[Vn.of(h)];t.state.field(Wn,!1)===void 0&&c.push(q.appendConfig.of([Wn,gy,$y,zu]))}t.dispatch(t.state.update(O))}}function Xu(i){return({state:e,dispatch:t})=>{let n=e.field(Wn,!1);if(!n||i<0&&n.active==0)return!1;let s=n.active+i,r=i>0&&!n.ranges.some(o=>o.field==s+i);return t(e.update({selection:$a(n.ranges,s),effects:Vn.of(r?null:new Zi(n.ranges,s)),scrollIntoView:!0})),!0}}var uy=({state:i,dispatch:e})=>i.field(Wn,!1)?(e(i.update({effects:Vn.of(null)})),!0):!1,dy=Xu(1),py=Xu(-1);var my=[{key:"Tab",run:dy,shift:py},{key:"Escape",run:uy}],bu=T.define({combine(i){return i.length?i[0]:my}}),gy=Me.highest(Wt.compute([bu],i=>i.facet(bu)));function ye(i,e){return Object.assign(Object.assign({},e),{apply:fy(i)})}var $y=k.domEventHandlers({mousedown(i,e){let t=e.state.field(Wn,!1),n;if(!t||(n=e.posAtCoords({x:i.clientX,y:i.clientY}))==null)return!1;let s=t.ranges.find(r=>r.from<=n&&r.to>=n);return!s||s.field==t.active?!1:(e.dispatch({selection:$a(t.ranges,s.field),effects:Vn.of(t.ranges.some(r=>r.field>s.field)?new Zi(t.ranges,s.field):null),scrollIntoView:!0}),!0)}});var Zn={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},li=q.define({map(i,e){let t=e.mapPos(i,-1,oe.TrackAfter);return t??void 0}}),Qa=new class extends He{};Qa.startSide=1;Qa.endSide=-1;var Ru=J.define({create(){return M.empty},update(i,e){if(i=i.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);i=i.update({filter:n=>n>=t.from&&n<=t.to})}for(let t of e.effects)t.is(li)&&(i=i.update({add:[Qa.range(t.value,t.value+1)]}));return i}});function qu(){return[yy,Ru]}var sa="()[]{}<>\xAB\xBB\xBB\xAB\uFF3B\uFF3D\uFF5B\uFF5D";function Wu(i){for(let e=0;e{if((Qy?i.composing:i.compositionStarted)||i.state.readOnly)return!1;let s=i.state.selection.main;if(n.length>2||n.length==2&&Xe(Oe(n,0))==1||e!=s.from||t!=s.to)return!1;let r=by(i.state,n);return r?(i.dispatch(r),!0):!1}),Sy=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let n=Zu(i,i.selection.main.head).brackets||Zn.brackets,s=null,r=i.changeByRange(o=>{if(o.empty){let l=xy(i.doc,o.head);for(let a of n)if(a==l&&Pr(i.doc,o.head)==Wu(Oe(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:Q.cursor(o.head-a.length)}}return{range:s=o}});return s||e(i.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},Vu=[{key:"Backspace",run:Sy}];function by(i,e){let t=Zu(i,i.selection.main.head),n=t.brackets||Zn.brackets;for(let s of n){let r=Wu(Oe(s,0));if(e==s)return r==s?vy(i,s,n.indexOf(s+s+s)>-1,t):Py(i,s,r,t.before||Zn.before);if(e==r&&Cu(i,i.selection.main.from))return ky(i,s,r)}return null}function Cu(i,e){let t=!1;return i.field(Ru).between(0,i.doc.length,n=>{n==e&&(t=!0)}),t}function Pr(i,e){let t=i.sliceString(e,e+2);return t.slice(0,Xe(Oe(t,0)))}function xy(i,e){let t=i.sliceString(e-2,e);return Xe(Oe(t,0))==t.length?t:t.slice(1)}function Py(i,e,t,n){let s=null,r=i.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:li.of(o.to+e.length),range:Q.range(o.anchor+e.length,o.head+e.length)};let l=Pr(i.doc,o.head);return!l||/\s/.test(l)||n.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:li.of(o.head+e.length),range:Q.cursor(o.head+e.length)}:{range:s=o}});return s?null:i.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function ky(i,e,t){let n=null,s=i.changeByRange(r=>r.empty&&Pr(i.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:Q.cursor(r.head+t.length)}:n={range:r});return n?null:i.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function vy(i,e,t,n){let s=n.stringPrefixes||Zn.stringPrefixes,r=null,o=i.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:li.of(l.to+e.length),range:Q.range(l.anchor+e.length,l.head+e.length)};let a=l.head,O=Pr(i.doc,a),h;if(O==e){if(xu(i,a))return{changes:{insert:e+e,from:a},effects:li.of(a+e.length),range:Q.cursor(a+e.length)};if(Cu(i,a)){let f=t&&i.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+f.length,insert:f},range:Q.cursor(a+f.length)}}}else{if(t&&i.sliceDoc(a-2*e.length,a)==e+e&&(h=Pu(i,a-2*e.length,s))>-1&&xu(i,h))return{changes:{insert:e+e+e+e,from:a},effects:li.of(a+e.length),range:Q.cursor(a+e.length)};if(i.charCategorizer(a)(O)!=L.Word&&Pu(i,a,s)>-1&&!wy(i,a,e,s))return{changes:{insert:e+e,from:a},effects:li.of(a+e.length),range:Q.cursor(a+e.length)}}return{range:r=l}});return r?null:i.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function xu(i,e){let t=N(i).resolveInner(e+1);return t.parent&&t.from==e}function wy(i,e,t,n){let s=N(i).resolveInner(e,-1),r=n.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=i.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),a=l.indexOf(t);if(!a||a>-1&&n.indexOf(l.slice(0,a))>-1){let h=s.firstChild;for(;h&&h.from==s.from&&h.to-h.from>t.length+a;){if(i.sliceDoc(h.to-t.length,h.to)==t)return!1;h=h.firstChild}return!0}let O=s.to==e&&s.parent;if(!O)break;s=O}return!1}function Pu(i,e,t){let n=i.charCategorizer(e);if(n(i.sliceDoc(e-1,e))!=L.Word)return e;for(let s of t){let r=e-s.length;if(i.sliceDoc(r,e)==s&&n(i.sliceDoc(r-1,r))!=L.Word)return r}return-1}function Yu(i={}){return[ay,ve,le.of(i),oy,Ty,zu]}var ya=[{key:"Ctrl-Space",run:Su},{mac:"Alt-`",run:Su},{key:"Escape",run:ny},{key:"ArrowDown",run:Qr(!0)},{key:"ArrowUp",run:Qr(!1)},{key:"PageDown",run:Qr(!0,"page")},{key:"PageUp",run:Qr(!1,"page")},{key:"Enter",run:iy}],Ty=Me.highest(Wt.computeN([le],i=>i.facet(le).defaultKeymap?[ya]:[]));var vr=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},Oi=class i{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let s=n.facet(Cn).markerFilter;s&&(e=s(e,n));let r=e.slice().sort((h,c)=>h.from-c.from||h.to-c.to),o=new ze,l=[],a=0;for(let h=0;;){let c=h==r.length?null:r[h];if(!c&&!l.length)break;let f,u;for(l.length?(f=a,u=l.reduce((m,g)=>Math.min(m,g.to),c&&c.from>f?c.from:1e8)):(f=c.from,u=c.to,l.push(c),h++);hm.from||m.to==f))l.push(m),h++,u=Math.min(m.to,u);else{u=Math.min(m.from,u);break}}let d=Ay(l);if(l.some(m=>m.from==m.to||m.from==m.to-1&&n.doc.lineAt(m.from).to==m.from))o.add(f,f,X.widget({widget:new Sa(d),diagnostics:l.slice()}));else{let m=l.reduce((g,$)=>$.markClass?g+" "+$.markClass:g,"");o.add(f,u,X.mark({class:"cm-lintRange cm-lintRange-"+d+m,diagnostics:l.slice(),inclusiveEnd:l.some(g=>g.to>u)}))}a=u;for(let m=0;m{if(!(e&&o.diagnostics.indexOf(e)<0))if(!n)n=new vr(s,r,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new vr(n.from,r,n.diagnostic)}}),n}function zy(i,e){let t=e.pos,n=e.end||t,s=i.state.facet(Cn).hideOn(i,t,n);if(s!=null)return s;let r=i.startState.doc.lineAt(e.pos);return!!(i.effects.some(o=>o.is(Au))||i.changes.touchesRange(r.from,Math.max(r.to,n)))}function Xy(i,e){return i.field(Ce,!1)?e:e.concat(q.appendConfig.of(Uy))}var Au=q.define(),ba=q.define(),Uu=q.define(),Ce=J.define({create(){return new Oi(X.none,null,null)},update(i,e){if(e.docChanged&&i.diagnostics.size){let t=i.diagnostics.map(e.changes),n=null,s=i.panel;if(i.selected){let r=e.changes.mapPos(i.selected.from,1);n=Vi(t,i.selected.diagnostic,r)||Vi(t,null,r)}!t.size&&s&&e.state.facet(Cn).autoPanel&&(s=null),i=new Oi(t,s,n)}for(let t of e.effects)if(t.is(Au)){let n=e.state.facet(Cn).autoPanel?t.value.length?Yn.open:null:i.panel;i=Oi.init(t.value,n,e.state)}else t.is(ba)?i=new Oi(i.diagnostics,t.value?Yn.open:null,i.selected):t.is(Uu)&&(i=new Oi(i.diagnostics,i.panel,t.value));return i},provide:i=>[Jt.from(i,e=>e.panel),k.decorations.from(i,e=>e.diagnostics)]});var Ry=X.mark({class:"cm-lintRange cm-lintRange-active"});function qy(i,e,t){let{diagnostics:n}=i.state.field(Ce),s,r=-1,o=-1;n.between(e-(t<0?1:0),e+(t>0?1:0),(a,O,{spec:h})=>{if(e>=a&&e<=O&&(a==O||(e>a||t>0)&&(eGu(i,t,!1)))}var Zy=i=>{let e=i.state.field(Ce,!1);(!e||!e.panel)&&i.dispatch({effects:Xy(i.state,[ba.of(!0)])});let t=ei(i,Yn.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},_u=i=>{let e=i.state.field(Ce,!1);return!e||!e.panel?!1:(i.dispatch({effects:ba.of(!1)}),!0)},Vy=i=>{let e=i.state.field(Ce,!1);if(!e)return!1;let t=i.state.selection.main,n=e.diagnostics.iter(t.to+1);return!n.value&&(n=e.diagnostics.iter(0),!n.value||n.from==t.from&&n.to==t.to)?!1:(i.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),!0)};var Mu=[{key:"Mod-Shift-m",run:Zy,preventDefault:!0},{key:"F8",run:Vy}];var Cn=T.define({combine(i){return Object.assign({sources:i.map(e=>e.source).filter(e=>e!=null)},de(i.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))}});function ju(i){let e=[];if(i)e:for(let{name:t}of i){for(let n=0;nr.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function Gu(i,e,t){var n;let s=t?ju(e.actions):[];return G("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},G("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(i):e.message),(n=e.actions)===null||n===void 0?void 0:n.map((r,o)=>{let l=!1,a=f=>{if(f.preventDefault(),l)return;l=!0;let u=Vi(i.state.field(Ce).diagnostics,e);u&&r.apply(i,u.from,u.to)},{name:O}=r,h=s[o]?O.indexOf(s[o]):-1,c=h<0?O:[O.slice(0,h),G("u",O.slice(h,h+1)),O.slice(h+1)];return G("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${O}${h<0?"":` (access key "${s[o]})"`}.`},c)}),e.source&&G("div",{class:"cm-diagnosticSource"},e.source))}var Sa=class extends xe{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return G("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}},wr=class{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Gu(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}},Yn=class i{constructor(e){this.view=e,this.items=[];let t=s=>{if(s.keyCode==27)_u(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:r}=this.items[this.selectedIndex],o=ju(r.actions);for(let l=0;l{for(let r=0;r_u(this.view)},"\xD7")),this.update()}get selectedIndex(){let e=this.view.state.field(Ce).selected;if(!e)return-1;for(let t=0;t{for(let h of O.diagnostics){if(o.has(h))continue;o.add(h);let c=-1,f;for(let u=n;un&&(this.items.splice(n,c-n),s=!0)),t&&f.diagnostic==t.diagnostic?f.dom.hasAttribute("aria-selected")||(f.dom.setAttribute("aria-selected","true"),r=f):f.dom.hasAttribute("aria-selected")&&f.dom.removeAttribute("aria-selected"),n++}});n({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let O=a.height/this.list.offsetHeight;l.topa.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/O)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function t(){let n=e;e=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Ce),n=Vi(t.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:Uu.of(n)})}static open(e){return new i(e)}};function Cy(i,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(i)}')`}function kr(i){return Cy(``,'width="6" height="3"')}var Yy=k.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:kr("#d11")},".cm-lintRange-warning":{backgroundImage:kr("orange")},".cm-lintRange-info":{backgroundImage:kr("#999")},".cm-lintRange-hint":{backgroundImage:kr("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function _y(i){return i=="error"?4:i=="warning"?3:i=="info"?2:1}function Ay(i){let e="hint",t=1;for(let n of i){let s=_y(n.severity);s>t&&(t=s,e=n.severity)}return e}var Uy=[Ce,k.decorations.compute([Ce],i=>{let{selected:e,panel:t}=i.field(Ce);return!e||!t||e.from==e.to?X.none:X.set([Ry.range(e.from,e.to)])}),bc(qy,{hideOn:zy}),Yy];var Eu=[kc(),vc(),$c(),Pf(),rf(),dc(),gc(),U.allowMultipleSelections.of(!0),Fc(),lf(af,{fallback:!0}),ff(),qu(),Yu(),yc(),Sc(),Qc(),hu(),Wt.of([...Vu,...tu,...pu,...Tf,...tf,...ya,...Mu])];var ka=class i{constructor(e,t,n,s,r,o,l,a,O,h=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=s,this.pos=r,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=O,this.lookAhead=h,this.parent=c}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let s=e.parser.context;return new i(e,[],t,n,n,0,[],0,s?new Tr(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,s=e&65535,{parser:r}=this.p,o=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[s])===null||t===void 0)&&t.isAnonymous)&&(O==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(s,O)}storeNode(e,t,n,s=4,r=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&o.buffer[l-4]==0&&o.buffer[l-1]>-1){if(t==n)return;if(o.buffer[l-2]>=t){o.buffer[l-2]=n;return}}}if(!r||this.pos==n)this.buffer.push(e,t,n,s);else{let o=this.buffer.length;if(o>0&&this.buffer[o-4]!=0){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>n;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,s>4&&(s-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=s}}shift(e,t,n,s){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let r=e,{parser:o}=this.p;(s>this.pos||t<=o.maxNode)&&(this.pos=s,o.stateFlag(r,1)||(this.reducePos=s)),this.pushState(r,n),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,s,4)}else this.pos=s,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,s,4)}apply(e,t,n,s){e&65536?this.reduce(e):this.shift(e,t,n,s)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let s=this.pos;this.reducePos=this.pos=s+e.length,this.pushState(t,s),this.buffer.push(n,s,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),s=e.bufferBase+t;for(;e&&s==e.bufferBase;)e=e.parent;return new i(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,s,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new va(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if((n&65536)==0)return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let s=[];for(let r=0,o;ra&1&&l==o)||s.push(t[r],o)}t=s}let n=[];for(let s=0;s>19,s=t&65535,r=this.stack.length-n*3;if(r<0||e.getGoto(this.stack[r],s,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(s,r)=>{if(!t.includes(s))return t.push(s),e.allActions(s,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-r;if(l>1){let a=o&65535,O=this.stack.length-l*3;if(O>=0&&e.getGoto(this.stack[O],a,!1)>=0)return l<<19|65536|a}}else{let l=n(o,r+1);if(l!=null)return l}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},Tr=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},va=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let s=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=s}},wa=class i{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new i(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.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,this.index==0&&this.maybeNext()}fork(){return new i(this.stack,this.pos,this.index)}};function _n(i,e=Uint16Array){if(typeof i!="string")return i;let t=null;for(let n=0,s=0;n=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),r+=a,l)break;r*=46}t?t[s++]=r:t=new e(r)}return t}var Ci=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},Lu=new Ci,Ta=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Lu,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,s=this.rangeIndex,r=this.pos+e;for(;rn.to:r>=n.to;){if(s==this.ranges.length-1)return null;let o=this.ranges[++s];r+=o.from-n.to,n=o}return r}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,s;if(t>=0&&t=this.chunk2Pos&&nl.to&&(this.chunk2=this.chunk2.slice(0,l.to-n)),s=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),s}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Lu,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let s of this.ranges){if(s.from>=t)break;s.to>e&&(n+=this.input.read(Math.max(s.from,e),Math.min(s.to,t)))}return n}},jt=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;Fu(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};jt.prototype.contextual=jt.prototype.fallback=jt.prototype.extend=!1;var Gt=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?_n(e):e}token(e,t){let n=e.pos,s=0;for(;;){let r=e.next<0,o=e.resolveOffset(1,1);if(Fu(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(r||s++,o==null)break;e.reset(o,e.token)}s&&(e.reset(n,e.token),e.acceptToken(this.elseToken,s))}};Gt.prototype.contextual=jt.prototype.fallback=jt.prototype.extend=!1;var ie=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function Fu(i,e,t,n,s,r){let o=0,l=1<0){let d=i[u];if(a.allows(d)&&(e.token.value==-1||e.token.value==d||jy(d,e.token.value,s,r))){e.acceptToken(d);break}}let h=e.next,c=0,f=i[o+2];if(e.next<0&&f>c&&i[O+f*3-3]==65535){o=i[O+f*3-1];continue e}for(;c>1,d=O+u+(u<<1),m=i[d],g=i[d+1]||65536;if(h=g)c=u+1;else{o=i[d+2],e.advance();continue e}}break}}function Du(i,e,t){for(let n=e,s;(s=i[n])!=65535;n++)if(s==t)return n-e;return-1}function jy(i,e,t,n){let s=Du(t,n,e);return s<0||Du(t,n,i)e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(i.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:i.length}}var za=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Bu(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Bu(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(r instanceof ee){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+r.length}}},Xa=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new Ci)}getActions(e){let t=0,n=null,{parser:s}=e.p,{tokenizers:r}=s,o=s.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let O=0;Oc.end+25&&(a=Math.max(c.lookAhead,a)),c.value!=0)){let f=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!h.extend&&(n=c,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!n&&e.pos==this.stream.end&&(n=new Ci,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Ci,{pos:n,p:s}=e;return t.start=n,t.end=Math.min(n+1,s.stream.end),t.value=n==s.stream.end?s.parser.eofTerm:0,t}updateCachedToken(e,t,n){let s=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(s,e),n),e.value>-1){let{parser:r}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(s+1)}putAction(e,t,n,s){for(let r=0;re.bufferLength*4?new za(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],s,r;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;ot)n.push(l);else{if(this.advanceStack(l,n,e))continue;{s||(s=[],r=[]),s.push(l);let a=this.tokens.getMainToken(l);r.push(a.value,a.end)}}break}}if(!n.length){let o=s&&Gy(s);if(o)return Ye&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Ye&&s&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&s){let o=this.stoppedAt!=null&&s[0].pos>this.stoppedAt?s[0]:this.runRecovery(s,r,n);if(o)return Ye&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((l,a)=>a.score-l.score);n.length>o;)n.pop();n.some(l=>l.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let o=0;o500&&O.buffer.length>500)if((l.score-O.score||l.buffer.length-O.buffer.length)>0)n.splice(a--,1);else{n.splice(o--,1);continue e}}}n.length>12&&n.splice(12,n.length-12)}this.minStackPos=n[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&s>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let O=e.curContext&&e.curContext.tracker.strict,h=O?e.curContext.hash:0;for(let c=this.fragments.nodeAt(s);c;){let f=this.parser.nodeSet.types[c.type.id]==c.type?r.getGoto(e.state,c.type.id):-1;if(f>-1&&c.length&&(!O||(c.prop(Z.contextHash)||0)==h))return e.useNode(c,f),Ye&&console.log(o+this.stackID(e)+` (via reuse of ${r.getName(c.type.id)})`),!0;if(!(c instanceof ee)||c.children.length==0||c.positions[0]>0)break;let u=c.children[0];if(u instanceof ee&&c.positions[0]==0)c=u;else break}}let l=r.stateSlot(e.state,4);if(l>0)return e.reduce(l),Ye&&console.log(o+this.stackID(e)+` (via always-reduce ${r.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let O=0;Os?t.push(d):n.push(d)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Iu(e,t),!0}}runRecovery(e,t,n){let s=null,r=!1;for(let o=0;o ":"";if(l.deadEnd&&(r||(r=!0,l.restart(),Ye&&console.log(h+this.stackID(l)+" (restarted)"),this.advanceFully(l,n))))continue;let c=l.split(),f=h;for(let u=0;c.forceReduce()&&u<10&&(Ye&&console.log(f+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));u++)Ye&&(f=this.stackID(c)+" -> ");for(let u of l.recoverByInsert(a))Ye&&console.log(h+this.stackID(u)+" (via recover-insert)"),this.advanceFully(u,n);this.stream.end>l.pos?(O==l.pos&&(O++,a=0),l.recoverByDelete(a,O),Ye&&console.log(h+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),Iu(l,n)):(!s||s.scorei,Yi=class{constructor(e){this.start=e.start,this.shift=e.shift||Pa,this.reduce=e.reduce||Pa,this.reuse=e.reuse||Pa,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},Fe=class i extends ki{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;le.topRules[l][1]),s=[];for(let l=0;l=0)r(h,a,l[O++]);else{let c=l[O+-h];for(let f=-h;f>0;f--)r(l[O++],a,c);O++}}}this.nodeSet=new $n(t.map((l,a)=>fe.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:s[a],top:n.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=_n(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new jt(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let s=new Ra(this,e,t,n);for(let r of this.wrappers)s=r(s,e,t,n);return s}getGoto(e,t,n=!1){let s=this.goto;if(t>=s[0])return-1;for(let r=s[t+1];;){let o=s[r++],l=o&1,a=s[r++];if(l&&n)return a;for(let O=r+(o>>1);r0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),s=n?t(n):void 0;for(let r=this.stateSlot(e,1);s==null;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=kt(this.data,r+2);else break;s=t(kt(this.data,r+1))}return s}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=kt(this.data,n+2);else break;if((this.data[n+2]&1)==0){let s=this.data[n+1];t.some((r,o)=>o&1&&r==s)||t.push(this.data[n],s)}}return t}configure(e){let t=Object.assign(Object.create(i.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let s=e.tokenizers.find(r=>r.from==n);return s?s.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,s)=>{let r=e.specializers.find(l=>l.from==n.external);if(!r)return n;let o=Object.assign(Object.assign({},n),{external:r.to});return t.specializers[s]=Nu(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(" ")){let o=t.indexOf(r);o>=0&&(n[o]=!0)}let s=null;for(let r=0;rn)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorei.external(t,n)<<1|e}return i.get}var Ey=107,Hu=1,Ly=108,Dy=109,Ku=2,Ju=110,ed=[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],By=58,Iy=40,td=95,Ny=91,zr=45,Fy=46,Hy=35,Ky=37,Jy=38,eS=92,tS=10,iS=42;function An(i){return i>=65&&i<=90||i>=97&&i<=122||i>=161}function id(i){return i>=48&&i<=57}var nS=new ie((i,e)=>{for(let t=!1,n=0,s=0;;s++){let{next:r}=i;if(An(r)||r==zr||r==td||t&&id(r))!t&&(r!=zr||s>0)&&(t=!0),n===s&&r==zr&&n++,i.advance();else if(r==eS&&i.peek(1)!=tS)i.advance(),i.next>-1&&i.advance(),t=!0;else{t&&i.acceptToken(n==2&&e.canShift(Ku)?Ku:e.canShift(Ju)?Ju:r==Iy?Ly:Dy);break}}}),sS=new ie(i=>{if(ed.includes(i.peek(-1))){let{next:e}=i;(An(e)||e==td||e==Hy||e==Fy||e==iS||e==Ny||e==By&&An(i.peek(1))||e==zr||e==Jy)&&i.acceptToken(Ey)}}),rS=new ie(i=>{if(!ed.includes(i.peek(-1))){let{next:e}=i;if(e==Ky&&(i.advance(),i.acceptToken(Hu)),An(e)){do i.advance();while(An(i.next)||id(i.next));i.acceptToken(Hu)}}}),oS=Le({"AtKeyword import charset namespace keyframes media supports":p.definitionKeyword,"from to selector":p.keyword,NamespaceName:p.namespace,KeyframeName:p.labelName,KeyframeRangeName:p.operatorKeyword,TagName:p.tagName,ClassName:p.className,PseudoClassName:p.constant(p.className),IdName:p.labelName,"FeatureName PropertyName":p.propertyName,AttributeName:p.attributeName,NumberLiteral:p.number,KeywordQuery:p.keyword,UnaryQueryOp:p.operatorKeyword,"CallTag ValueName":p.atom,VariableName:p.variableName,Callee:p.operatorKeyword,Unit:p.unit,"UniversalSelector NestingSelector":p.definitionOperator,"MatchOp CompareOp":p.compareOperator,"ChildOp SiblingOp, LogicOp":p.logicOperator,BinOp:p.arithmeticOperator,Important:p.modifier,Comment:p.blockComment,ColorLiteral:p.color,"ParenthesizedContent StringLiteral":p.string,":":p.punctuation,"PseudoOp #":p.derefOperator,"; ,":p.separator,"( )":p.paren,"[ ]":p.squareBracket,"{ }":p.brace}),lS={__proto__:null,lang:34,"nth-child":34,"nth-last-child":34,"nth-of-type":34,"nth-last-of-type":34,dir:34,"host-context":34,url:62,"url-prefix":62,domain:62,regexp:62},aS={__proto__:null,"@import":120,"@media":154,"@charset":158,"@namespace":162,"@keyframes":168,"@supports":180},OS={__proto__:null,layer:124,not:144,only:144,selector:150},nd=Fe.deserialize({version:14,states:">`QYQ[OOO#kQ[OOP#rOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#wQ[O'#CfO$hQXO'#CaO$rQ[O'#CiO$}Q[O'#DUO%SQ[O'#DXO%XQ[O'#D[O%XQ[O'#D_OOQP'#Ev'#EvO%yQdO'#DhO&hQ[O'#DzO%yQdO'#D|O&yQ[O'#EOO'UQ[O'#ERO'^Q[O'#EXO'lQ[O'#EZOOQS'#Eu'#EuOOQS'#E^'#E^QYQ[OOO'sQXO'#CdO(hQWO'#DdO(mQWO'#E{O(xQ[O'#E{QOQWOOP)SO#tO'#C_POOO)C@e)C@eOOQP'#Ch'#ChOOQP,59Q,59QO#wQ[O,59QO)_Q[O,59TO$}Q[O,59pO%SQ[O,59sO%XQ[O,59vO%XQ[O,59xO%XQ[O,59yO%XQ[O'#EcO)jQWO,58{O)rQ[O'#DcOOQS,58{,58{OOQP'#Cl'#ClOOQO'#DS'#DSOOQP,59T,59TO)yQWO,59TO*OQWO,59TOOQP'#DW'#DWOOQP,59p,59pOOQO'#DY'#DYO*TQ`O,59sO*nQXO,59vO+UQXO,59yOOQS'#Cq'#CqO%yQdO'#CrO+lQvO'#CtO-hQtO,5:SOOQO'#Cy'#CyO*OQWO'#CxO-rQWO'#CzO-wQ[O'#DPOOQS'#Ex'#ExOOQO'#Dn'#DnO.eQdO'#DwO.uQWO'#E|O'^Q[O'#DuO/TQWO'#DxOOQO'#E}'#E}O)mQWO,5:fO/YQpO,5:hOOQ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S$r#u$sR%q%^V$p#u$s%^Q!vlR$P!vQfOSjPyU!pfj#|R#|!rQ$Y#WU%O$Y%X%iQ%X$fR%i%PQ#e!_R$d#eQ%Q$YR%j%QQ$|$VR%h$|QxUR#SxQ$w#yR%d$wQ!siS#}!s$OR$O!tQ%l%UR%u%lQ#n!cR$k#nQ$s#uR%a$sQ%_$rR%r%__eOPfjy!r#|^UOPfjy!r#|Q!UYQ!VZQ#OtQ#PuQ#QvQ#RwQ$V#VQ$l#pR%g${R$Z#WQ!Z]Q!h_Q#Z!XQ#y!q[$X#W$Y$f%P%X%iQ$[#YQ$^#]S$u#y$wQ$z$TR%c$vR$W#VQkPR#UyQ!g^Q!ocQ#_!ZR$a#`W!c^c!Z#`Q!nbQ#i!bQ#o!dQ$i#lR$j#mQ#k!bQ%Z$gR%w%p",nodeNames:"\u26A0 Unit VariableName Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee CallLiteral CallTag ParenthesizedContent ] [ LineNames LineName , PseudoClassName ArgList IdSelector # IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp } { Block Declaration PropertyName Important ; ImportStatement AtKeyword import Layer layer LayerName KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports AtRule Styles",maxTerm:126,nodeProps:[["isolate",-2,3,25,""],["openedBy",18,"(",33,"[",51,"{"],["closedBy",19,")",34,"]",52,"}"]],propSources:[oS],skippedNodes:[0,3,93],repeatNodeCount:13,tokenData:"LU~R!^OX$}X^%u^p$}pq%uqr)Xr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y%^z}%^}!OFm!O!c%^!c!}G[!}#T%^#T#oG[#o;'S%^;'S;=`%o<%lO%^bFrWp`Oy%^z!c%^!c!}G[!}#T%^#T#oG[#o;'S%^;'S;=`%o<%lO%^bGc[!]Qp`Oy%^z}%^}!OG[!O!Q%^!Q![G[![!c%^!c!}G[!}#T%^#T#oG[#o;'S%^;'S;=`%o<%lO%^nH^Sr^Oy%^z;'S%^;'S;=`%o<%lO%^nHoSq^Oy%^z;'S%^;'S;=`%o<%lO%^jIOUOy%^z#b%^#b#cIb#c;'S%^;'S;=`%o<%lO%^jIgUp`Oy%^z#W%^#W#XIy#X;'S%^;'S;=`%o<%lO%^jJQS!fYp`Oy%^z;'S%^;'S;=`%o<%lO%^jJaUOy%^z#f%^#f#gIy#g;'S%^;'S;=`%o<%lO%^fJxS!UUOy%^z;'S%^;'S;=`%o<%lO%^nKZS!T^Oy%^z;'S%^;'S;=`%o<%lO%^fKlU!SQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`LRP;=`<%l$}",tokenizers:[sS,rS,nS,1,2,3,4,new Gt("m~RRYZ[z{a~~g~aO#g~~dP!P!Qg~lO#h~~",28,114)],topRules:{StyleSheet:[0,4],Styles:[1,92]},specialized:[{term:108,get:i=>lS[i]||-1},{term:59,get:i=>aS[i]||-1},{term:110,get:i=>OS[i]||-1}],tokenPrec:1441});var Wa=null;function Za(){if(!Wa&&typeof document=="object"&&document.body){let{style:i}=document.body,e=[],t=new Set;for(let n in i)n!="cssText"&&n!="cssFloat"&&typeof i[n]=="string"&&(/[A-Z]/.test(n)&&(n=n.replace(/[A-Z]/g,s=>"-"+s.toLowerCase())),t.has(n)||(e.push(n),t.add(n)));Wa=e.sort().map(n=>({type:"property",label:n,apply:n+": "}))}return Wa||[]}var sd=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(i=>({type:"class",label:i})),rd=["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(i=>({type:"keyword",label:i})).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(i=>({type:"constant",label:i}))),hS=["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(i=>({type:"type",label:i})),cS=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(i=>({type:"keyword",label:i})),vt=/^(\w[\w-]*|-\w[\w-]*|)$/,fS=/^-(-[\w-]*)?$/;function uS(i,e){var t;if((i.name=="("||i.type.isError)&&(i=i.parent||i),i.name!="ArgList")return!1;let n=(t=i.parent)===null||t===void 0?void 0:t.firstChild;return n?.name!="Callee"?!1:e.sliceString(n.from,n.to)=="var"}var od=new Pi,dS=["Declaration"];function pS(i){for(let e=i;;){if(e.type.isTop)return e;if(!(e=e.parent))return i}}function ld(i,e,t){if(e.to-e.from>4096){let n=od.get(e);if(n)return n;let s=[],r=new Set,o=e.cursor(j.IncludeAnonymous);if(o.firstChild())do for(let l of ld(i,o.node,t))r.has(l.label)||(r.add(l.label),s.push(l));while(o.nextSibling());return od.set(e,s),s}else{let n=[],s=new Set;return e.cursor().iterate(r=>{var o;if(t(r)&&r.matchContext(dS)&&((o=r.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=i.sliceString(r.from,r.to);s.has(l)||(s.add(l),n.push({label:l,type:"variable"}))}}),n}}var mS=i=>e=>{let{state:t,pos:n}=e,s=N(t).resolveInner(n,-1),r=s.type.isError&&s.from==s.to-1&&t.doc.sliceString(s.from,s.to)=="-";if(s.name=="PropertyName"||(r||s.name=="TagName")&&/^(Block|Styles)$/.test(s.resolve(s.to).name))return{from:s.from,options:Za(),validFor:vt};if(s.name=="ValueName")return{from:s.from,options:rd,validFor:vt};if(s.name=="PseudoClassName")return{from:s.from,options:sd,validFor:vt};if(i(s)||(e.explicit||r)&&uS(s,t.doc))return{from:i(s)||r?s.from:n,options:ld(t.doc,pS(s),i),validFor:fS};if(s.name=="TagName"){for(let{parent:a}=s;a;a=a.parent)if(a.name=="Block")return{from:s.from,options:Za(),validFor:vt};return{from:s.from,options:hS,validFor:vt}}if(s.name=="AtKeyword")return{from:s.from,options:cS,validFor:vt};if(!e.explicit)return null;let o=s.resolve(n),l=o.childBefore(n);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:n,options:sd,validFor:vt}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:n,options:rd,validFor:vt}:o.name=="Block"||o.name=="Styles"?{from:n,options:Za(),validFor:vt}:null},gS=mS(i=>i.name=="VariableName"),Un=De.define({name:"css",parser:nd.configure({props:[tt.add({Declaration:Ze()}),it.add({"Block KeyframeList":_t})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Xr(){return new Be(Un,Un.data.of({autocomplete:gS}))}var $S=54,QS=1,yS=55,SS=2,bS=56,xS=3,ad=4,PS=5,Rr=6,md=7,gd=8,$d=9,Qd=10,kS=11,vS=12,wS=13,Va=57,TS=14,Od=58,yd=20,zS=22,Sd=23,XS=24,Ya=26,bd=27,RS=28,qS=31,WS=34,ZS=36,VS=37,CS=0,YS=1,_S={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},AS={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},hd={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function US(i){return i==45||i==46||i==58||i>=65&&i<=90||i==95||i>=97&&i<=122||i>=161}function xd(i){return i==9||i==10||i==13||i==32}var cd=null,fd=null,ud=0;function _a(i,e){let t=i.pos+e;if(ud==t&&fd==i)return cd;let n=i.peek(e);for(;xd(n);)n=i.peek(++e);let s="";for(;US(n);)s+=String.fromCharCode(n),n=i.peek(++e);return fd=i,ud=t,cd=s?s.toLowerCase():n==MS||n==jS?void 0:null}var Pd=60,qr=62,Aa=47,MS=63,jS=33,GS=45;function dd(i,e){this.name=i,this.parent=e}var ES=[Rr,Qd,md,gd,$d],LS=new Yi({start:null,shift(i,e,t,n){return ES.indexOf(e)>-1?new dd(_a(n,1)||"",i):i},reduce(i,e){return e==yd&&i?i.parent:i},reuse(i,e,t,n){let s=e.type.id;return s==Rr||s==ZS?new dd(_a(n,1)||"",i):i},strict:!1}),DS=new ie((i,e)=>{if(i.next!=Pd){i.next<0&&e.context&&i.acceptToken(Va);return}i.advance();let t=i.next==Aa;t&&i.advance();let n=_a(i,0);if(n===void 0)return;if(!n)return i.acceptToken(t?TS:Rr);let s=e.context?e.context.name:null;if(t){if(n==s)return i.acceptToken(kS);if(s&&AS[s])return i.acceptToken(Va,-2);if(e.dialectEnabled(CS))return i.acceptToken(vS);for(let r=e.context;r;r=r.parent)if(r.name==n)return;i.acceptToken(wS)}else{if(n=="script")return i.acceptToken(md);if(n=="style")return i.acceptToken(gd);if(n=="textarea")return i.acceptToken($d);if(_S.hasOwnProperty(n))return i.acceptToken(Qd);s&&hd[s]&&hd[s][n]?i.acceptToken(Va,-1):i.acceptToken(Rr)}},{contextual:!0}),BS=new ie(i=>{for(let e=0,t=0;;t++){if(i.next<0){t&&i.acceptToken(Od);break}if(i.next==GS)e++;else if(i.next==qr&&e>=2){t>=3&&i.acceptToken(Od,-2);break}else e=0;i.advance()}});function IS(i){for(;i;i=i.parent)if(i.name=="svg"||i.name=="math")return!0;return!1}var NS=new ie((i,e)=>{if(i.next==Aa&&i.peek(1)==qr){let t=e.dialectEnabled(YS)||IS(e.context);i.acceptToken(t?PS:ad,2)}else i.next==qr&&i.acceptToken(ad,1)});function Ua(i,e,t){let n=2+i.length;return new ie(s=>{for(let r=0,o=0,l=0;;l++){if(s.next<0){l&&s.acceptToken(e);break}if(r==0&&s.next==Pd||r==1&&s.next==Aa||r>=2&&ro?s.acceptToken(e,-o):s.acceptToken(t,-(o-2));break}else if((s.next==10||s.next==13)&&l){s.acceptToken(e,1);break}else r=o=0;s.advance()}})}var FS=Ua("script",$S,QS),HS=Ua("style",yS,SS),KS=Ua("textarea",bS,xS),JS=Le({"Text RawText":p.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":p.angleBracket,TagName:p.tagName,"MismatchedCloseTag/TagName":[p.tagName,p.invalid],AttributeName:p.attributeName,"AttributeValue UnquotedAttributeValue":p.attributeValue,Is:p.definitionOperator,"EntityReference CharacterReference":p.character,Comment:p.blockComment,ProcessingInst:p.processingInstruction,DoctypeDecl:p.documentMeta}),kd=Fe.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%ZQ&rO,59fO%fQ&rO,59iO%qQ&rO,59lO%|Q&rO,59nOOOa'#D^'#D^O&XOaO'#CxO&dOaO,59[OOOb'#D_'#D_O&lObO'#C{O&wObO,59[OOOd'#D`'#D`O'POdO'#DOO'[OdO,59[OOO`'#Da'#DaO'dO!rO,59[O'kQ#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'pO$fO,59oOOO`,59o,59oO'xQ#|O,59qO'}Q#|O,59rOOO`-E7W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!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"\u26A0 StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:LS,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[JS],skippedNodes:[0],repeatNodeCount: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b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let O=l.type.id;if(O==RS)return Ca(l,a,t);if(O==qS)return Ca(l,a,n);if(O==WS)return Ca(l,a,s);if(O==yd&&r.length){let h=l.node,c=h.firstChild,f=c&&pd(c,a),u;if(f){for(let d of r)if(d.tag==f&&(!d.attrs||d.attrs(u||(u=vd(c,a))))){let m=h.lastChild,g=m.type.id==VS?m.from:h.to;if(g>c.to)return{parser:d.parser,overlay:[{from:c.to,to:g}]}}}}if(o&&O==Sd){let h=l.node,c;if(c=h.firstChild){let f=o[a.read(c.from,c.to)];if(f)for(let u of f){if(u.tagName&&u.tagName!=pd(h.parent,a))continue;let d=h.lastChild;if(d.type.id==Ya){let m=d.from+1,g=d.lastChild,$=d.to-(g&&g.isError?0:1);if($>m)return{parser:u.parser,overlay:[{from:m,to:$}]}}else if(d.type.id==bd)return{parser:u.parser,overlay:[{from:d.from,to:d.to}]}}}}return null})}var e0=315,t0=316,wd=1,i0=2,n0=3,s0=4,r0=317,o0=319,l0=320,a0=5,O0=6,h0=0,Ga=[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],Td=125,c0=59,Ea=47,f0=42,u0=43,d0=45,p0=60,m0=44,g0=63,$0=46,Q0=91,y0=new Yi({start:!1,shift(i,e){return e==a0||e==O0||e==o0?i:e==l0},strict:!1}),S0=new ie((i,e)=>{let{next:t}=i;(t==Td||t==-1||e.context)&&i.acceptToken(r0)},{contextual:!0,fallback:!0}),b0=new ie((i,e)=>{let{next:t}=i,n;Ga.indexOf(t)>-1||t==Ea&&((n=i.peek(1))==Ea||n==f0)||t!=Td&&t!=c0&&t!=-1&&!e.context&&i.acceptToken(e0)},{contextual:!0}),x0=new ie((i,e)=>{i.next==Q0&&!e.context&&i.acceptToken(t0)},{contextual:!0}),P0=new ie((i,e)=>{let{next:t}=i;if(t==u0||t==d0){if(i.advance(),t==i.next){i.advance();let n=!e.context&&e.canShift(wd);i.acceptToken(n?wd:i0)}}else t==g0&&i.peek(1)==$0&&(i.advance(),i.advance(),(i.next<48||i.next>57)&&i.acceptToken(n0))},{contextual:!0});function ja(i,e){return i>=65&&i<=90||i>=97&&i<=122||i==95||i>=192||!e&&i>=48&&i<=57}var k0=new ie((i,e)=>{if(i.next!=p0||!e.dialectEnabled(h0)||(i.advance(),i.next==Ea))return;let t=0;for(;Ga.indexOf(i.next)>-1;)i.advance(),t++;if(ja(i.next,!0)){for(i.advance(),t++;ja(i.next,!1);)i.advance(),t++;for(;Ga.indexOf(i.next)>-1;)i.advance(),t++;if(i.next==m0)return;for(let n=0;;n++){if(n==7){if(!ja(i.next,!0))return;break}if(i.next!="extends".charCodeAt(n))break;i.advance(),t++}}i.acceptToken(s0,-t)}),v0=Le({"get set async static":p.modifier,"for while do if else switch try catch finally return throw break continue default case":p.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":p.operatorKeyword,"let var const using function class extends":p.definitionKeyword,"import export from":p.moduleKeyword,"with debugger new":p.keyword,TemplateString:p.special(p.string),super:p.atom,BooleanLiteral:p.bool,this:p.self,null:p.null,Star:p.modifier,VariableName:p.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":p.function(p.variableName),VariableDefinition:p.definition(p.variableName),Label:p.labelName,PropertyName:p.propertyName,PrivatePropertyName:p.special(p.propertyName),"CallExpression/MemberExpression/PropertyName":p.function(p.propertyName),"FunctionDeclaration/VariableDefinition":p.function(p.definition(p.variableName)),"ClassDeclaration/VariableDefinition":p.definition(p.className),"NewExpression/VariableName":p.className,PropertyDefinition:p.definition(p.propertyName),PrivatePropertyDefinition:p.definition(p.special(p.propertyName)),UpdateOp:p.updateOperator,"LineComment Hashbang":p.lineComment,BlockComment:p.blockComment,Number:p.number,String:p.string,Escape:p.escape,ArithOp:p.arithmeticOperator,LogicOp:p.logicOperator,BitOp:p.bitwiseOperator,CompareOp:p.compareOperator,RegExp:p.regexp,Equals:p.definitionOperator,Arrow:p.function(p.punctuation),": Spread":p.punctuation,"( )":p.paren,"[ ]":p.squareBracket,"{ }":p.brace,"InterpolationStart InterpolationEnd":p.special(p.brace),".":p.derefOperator,", ;":p.separator,"@":p.meta,TypeName:p.typeName,TypeDefinition:p.definition(p.typeName),"type enum interface implements namespace module declare":p.definitionKeyword,"abstract global Privacy readonly override":p.modifier,"is keyof unique infer asserts":p.operatorKeyword,JSXAttributeValue:p.attributeValue,JSXText:p.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":p.angleBracket,"JSXIdentifier JSXNameSpacedName":p.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":p.attributeName,"JSXBuiltin/JSXIdentifier":p.standard(p.tagName)}),w0={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,for:474,of:483,while:486,with:490,do:494,if:498,else:500,switch:504,case:510,try:516,catch:520,finally:524,return:528,throw:532,break:536,continue:540,debugger:544},T0={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},z0={__proto__:null,"<":193},zd=Fe.deserialize({version:14,states:"$EOQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Ik'#IkO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JqO6[Q!0MxO'#JrO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO7eQMhO'#F|O9[Q`O'#F{OOQ!0Lf'#Jr'#JrOOQ!0Lb'#Jq'#JqO9aQ`O'#GwOOQ['#K^'#K^O9lQ`O'#IXO9qQ!0LrO'#IYOOQ['#J_'#J_OOQ['#I^'#I^Q`QlOOQ`QlOOO9yQ!L^O'#DvO:QQlO'#EOO:XQlO'#EQO9gQ`O'#GsO:`QMhO'#CoO:nQ`O'#EnO:yQ`O'#EyO;OQMhO'#FeO;mQ`O'#GsOOQO'#K_'#K_O;rQ`O'#K_O`Q`O'#CeO>pQ`O'#HbO>xQ`O'#HhO>xQ`O'#HjO`QlO'#HlO>xQ`O'#HnO>xQ`O'#HqO>}Q`O'#HwO?SQ!0LsO'#H}O%[QlO'#IPO?_Q!0LsO'#IRO?jQ!0LsO'#ITO9qQ!0LrO'#IVO?uQ!0MxO'#CiO@wQpO'#DlQOQ`OOO%[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^O9aQ`O7+*^OOQ[ANAkANAkO&>lQ!fOANAkO!&oQMhOANAkO#'oQ`OANAkO4UQ!fOANAkO&>sQ`OANAkO%[QlOANAkO&>{Q!0MzO7+'zO&A^Q!0MzO,5?`O&CiQ!0MzO,5?bO&EtQ!0MzO7+'|O&HVQ!fO1G4kO&HaQ?MtO7+&aO&JeQ?MvO,5=XO&LlQ?MvO,5=ZO&L|Q?MvO,5=XO&M^Q?MvO,5=ZO&MnQ?MvO,59uO' tQ?MvO,5}Q`O7+)kO'-dQ`O<QPPP!>YHxPPPPPPPPP!AiP!BvPPHx!DXPHxPHxHxHxHxHxPHx!EkP!HuP!K{P!LP!LZ!L_!L_P!HrP!Lc!LcP# iP# mHxPHx# s#$xCW@zP@zP@z@zP#&V@z@z#(i@z#+a@z#-m@z@z#.]#0q#0q#0v#1P#0q#1[PP#0qP@z#1t@z#5s@z@z6bPPP#9xPPP#:c#:cP#:cP#:y#:cPP#;PP#:vP#:v#;d#:v#S#>Y#>d#>j#>t#>z#?[#?b#@S#@f#@l#@r#AQ#Ag#C[#Cj#Cq#E]#Ek#G]#Gk#Gq#Gw#G}#HX#H_#He#Ho#IR#IXPPPPPPPPPPP#I_PPPPPPP#JS#MZ#Ns#Nz$ SPPP$&nP$&w$)p$0Z$0^$0a$1`$1c$1j$1rP$1x$1{P$2i$2m$3e$4s$4x$5`PP$5e$5k$5o$5r$5v$5z$6v$7_$7v$7z$7}$8Q$8W$8Z$8_$8cR!|RoqOXst!Z#d%l&p&r&s&u,n,s2S2VY!vQ'^-`1g5qQ%svQ%{yQ&S|Q&h!VS'U!e-WQ'd!iS'j!r!yU*h$|*X*lQ+l%|Q+y&UQ,_&bQ-^']Q-h'eQ-p'kQ0U*nQ1q,`R < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:379,context:y0,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,236,242,244,246,248,251,257,263,265,267,269,271,273,274,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[v0],skippedNodes:[0,5,6,277],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Vp(Y!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&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1,94:1,169:1,199:1},specialized:[{term:326,get:i=>w0[i]||-1},{term:342,get:i=>T0[i]||-1},{term:95,get:i=>z0[i]||-1}],tokenPrec:15124});var Wd=[ye("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),ye("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),ye("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),ye("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),ye("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),ye(`try { +`;this.styleTag.textContent=o;let l=t.head||t;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}};var St={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},mi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},yp=typeof navigator<"u"&&/Mac/.test(navigator.platform),Sp=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(re=0;re<10;re++)St[48+re]=St[96+re]=String(re);var re;for(re=1;re<=24;re++)St[re+111]="F"+re;var re;for(re=65;re<=90;re++)St[re]=String.fromCharCode(re+32),mi[re]=String.fromCharCode(re);var re;for(ns in St)mi.hasOwnProperty(ns)||(mi[ns]=St[ns]);var ns;function wO(i){var e=yp&&i.metaKey&&i.shiftKey&&!i.ctrlKey&&!i.altKey||Sp&&i.shiftKey&&i.key&&i.key.length==1||i.key=="Unidentified",t=!e&&i.key||(i.shiftKey?mi:St)[i.keyCode]||i.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function U(){var i=arguments[0];typeof i=="string"&&(i=document.createElement(i));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){var s=t[n];typeof s=="string"?i.setAttribute(n,s):s!=null&&(i[n]=s)}e++}for(;e.995&&t<1.005||!isFinite(t)||Math.abs(e.width-i.offsetWidth)<1)&&(t=1),(n>.995&&n<1.005||!isFinite(n)||Math.abs(e.height-i.offsetHeight)<1)&&(n=1),{scaleX:t,scaleY:n}}function xp(i,e,t,n,s,r,o,l){let a=i.ownerDocument,O=a.defaultView||window;for(let h=i,c=!1;h&&!c;)if(h.nodeType==1){let f,u=h==a.body,d=1,m=1;if(u)f=bp(O);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(c=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let y=h.getBoundingClientRect();({scaleX:d,scaleY:m}=gh(h,y)),f={left:y.left,right:y.left+h.clientWidth*d,top:y.top,bottom:y.top+h.clientHeight*m}}let g=0,$=0;if(s=="nearest")e.top0&&e.bottom>f.bottom+$&&($=e.bottom-f.bottom+o)):e.bottom>f.bottom&&($=e.bottom-f.bottom+o,t<0&&e.top-$0&&e.right>f.right+g&&(g=e.right-f.right+r)):e.right>f.right&&(g=e.right-f.right+r,t<0&&e.leftf.bottom||e.leftf.right)&&(e={left:Math.max(e.left,f.left),right:Math.min(e.right,f.right),top:Math.max(e.top,f.top),bottom:Math.min(e.bottom,f.bottom)}),h=h.assignedSlot||h.parentNode}else if(h.nodeType==11)h=h.host;else break}function Pp(i){let e=i.ownerDocument,t,n;for(let s=i.parentNode;s&&!(s==e.body||t&&n);)if(s.nodeType==1)!n&&s.scrollHeight>s.clientHeight&&(n=s),!t&&s.scrollWidth>s.clientWidth&&(t=s),s=s.assignedSlot||s.parentNode;else if(s.nodeType==11)s=s.host;else break;return{x:t,y:n}}var co=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:n}=e;this.set(t,Math.min(e.anchorOffset,t?ft(t):0),n,Math.min(e.focusOffset,n?ft(n):0))}set(e,t,n,s){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=s}},gi=null;function $h(i){if(i.setActive)return i.setActive();if(gi)return i.focus(gi);let e=[];for(let t=i;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(i.focus(gi==null?{get preventScroll(){return gi={preventScroll:!0},!0}}:void 0),!gi){gi=!1;for(let t=0;tMath.max(1,i.scrollHeight-i.clientHeight-4)}function Sh(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&n>0)return{node:t,offset:n};if(t.nodeType==1&&n>0){if(t.contentEditable=="false")return null;t=t.childNodes[n-1],n=ft(t)}else if(t.parentNode&&!ys(t))n=Ft(t),t=t.parentNode;else return null}}function bh(i,e){for(let t=i,n=e;;){if(t.nodeType==3&&nt)return c.domBoundsAround(e,t,O);if(f>=e&&s==-1&&(s=a,r=O),O>t&&c.dom.parentNode==this.dom){o=a,l=h;break}h=f,O=f+c.breakAfter}return{from:r,to:l<0?n+this.length:l,startDOM:(s?this.children[s-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o=0?this.children[o].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,n=Ko){this.markDirty();for(let s=e;sthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}};function xh(i,e,t,n,s,r,o,l,a){let{children:O}=i,h=O.length?O[e]:null,c=r.length?r[r.length-1]:null,f=c?c.breakAfter:o;if(!(e==n&&h&&!o&&!f&&r.length<2&&h.merge(t,s,r.length?c:null,t==0,l,a))){if(n0&&(!o&&r.length&&h.merge(t,h.length,r[0],!1,l,0)?h.breakAfter=r.shift().breakAfter:(t2),z={mac:ZO||/Mac/.test(be.platform),windows:/Win/.test(be.platform),linux:/Linux|X11/.test(be.platform),ie:Cs,ie_version:kh?fo.documentMode||6:po?+po[1]:uo?+uo[1]:0,gecko:qO,gecko_version:qO?+(/Firefox\/(\d+)/.exec(be.userAgent)||[0,0])[1]:0,chrome:!!no,chrome_version:no?+no[1]:0,ios:ZO,android:/Android\b/.test(be.userAgent),webkit:WO,safari:vh,webkit_version:WO?+(/\bAppleWebKit\/(\d+)/.exec(be.userAgent)||[0,0])[1]:0,tabSize:fo.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"},wp=256,ut=class i extends H{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,n){return this.flags&8||n&&(!(n instanceof i)||this.length-(t-e)+n.length>wp||n.flags&8)?!1:(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new i(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new $e(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return Tp(this.dom,e,t)}},Xt=class i extends H{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let s of t)s.setParent(this)}setAttrs(e){if(Qh(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,s,r,o){return n&&(!(n instanceof i&&n.mark.eq(this.mark))||e&&r<=0||te&&t.push(n=e&&(s=r),n=a,r++}let o=this.length-e;return this.length=e,s>-1&&(this.children.length=s,this.markDirty()),new i(this.mark,t,o)}domAtPos(e){return wh(this,e)}coordsAt(e,t){return zh(this,e,t)}};function Tp(i,e,t){let n=i.nodeValue.length;e>n&&(e=n);let s=e,r=e,o=0;e==0&&t<0||e==n&&t>=0?z.chrome||z.gecko||(e?(s--,o=1):r=0)?0:l.length-1];return z.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,O=>O.width)||a),o?Vs(a,o<0):a||null}var On=class i extends H{static create(e,t,n){return new i(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=i.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(e,t,n,s,r,o){return n&&(!(n instanceof i)||!this.widget.compare(n.widget)||e>0&&r<=0||t0)?$e.before(this.dom):$e.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let s=this.dom.getClientRects(),r=null;if(!s.length)return null;let o=this.side?this.side<0:e>0;for(let l=o?s.length-1:0;r=s[l],!(e>0?l==0:l==s.length-1||r.top0?$e.before(this.dom):$e.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return Y.empty}get isHidden(){return!0}};ut.prototype.children=On.prototype.children=hn.prototype.children=Ko;function wh(i,e){let t=i.dom,{children:n}=i,s=0;for(let r=0;sr&&e0;r--){let o=n[r-1];if(o.dom.parentNode==t)return o.domAtPos(o.length)}for(let r=s;r0&&e instanceof Xt&&s.length&&(n=s[s.length-1])instanceof Xt&&n.mark.eq(e.mark)?Th(n,e.children[0],t-1):(s.push(e),e.setParent(i)),i.length+=e.length}function zh(i,e,t){let n=null,s=-1,r=null,o=-1;function l(O,h){for(let c=0,f=0;c=h&&(u.children.length?l(u,h-f):(!r||r.isHidden&&(t>0||Xp(r,u)))&&(d>h||f==d&&u.getSide()>0)?(r=u,o=h-f):(f-1?1:0)!=s.length-(t&&s.indexOf(t)>-1?1:0))return!1;for(let r of n)if(r!=t&&(s.indexOf(r)==-1||i[r]!==e[r]))return!1;return!0}function go(i,e,t){let n=!1;if(e)for(let s in e)t&&s in t||(n=!0,s=="style"?i.style.cssText="":i.removeAttribute(s));if(t)for(let s in t)e&&e[s]==t[s]||(n=!0,s=="style"?i.style.cssText=t[s]:i.setAttribute(s,t[s]));return n}function Rp(i){let e=Object.create(null);for(let t=0;t0?3e8:-4e8:t>0?1e8:-1e8,new Rt(e,t,t,n,e.widget||null,!1)}static replace(e){let t=!!e.block,n,s;if(e.isBlockGap)n=-5e8,s=4e8;else{let{start:r,end:o}=Xh(e,t);n=(r?t?-3e8:-1:5e8)-1,s=(o?t?2e8:1:-6e8)+1}return new Rt(e,n,s,t,e.widget||null,!0)}static line(e){return new fn(e)}static set(e,t=!1){return j.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};X.none=j.empty;var cn=class i extends X{constructor(e){let{start:t,end:n}=Xh(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof i&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((n=e.attrs)===null||n===void 0?void 0:n.class))&&bs(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}};cn.prototype.point=!1;var fn=class i extends X{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof i&&this.spec.class==e.spec.class&&bs(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}};fn.prototype.mapMode=oe.TrackBefore;fn.prototype.point=!0;var Rt=class i extends X{constructor(e,t,n,s,r,o){super(t,n,r,e),this.block=s,this.isReplace=o,this.mapMode=s?t<=0?oe.TrackBefore:oe.TrackAfter:oe.TrackDel}get type(){return this.startSide!=this.endSide?Qe.WidgetRange:this.startSide<=0?Qe.WidgetBefore:Qe.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof i&&qp(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}};Rt.prototype.point=!0;function Xh(i,e=!1){let{inclusiveStart:t,inclusiveEnd:n}=i;return t==null&&(t=i.inclusive),n==null&&(n=i.inclusive),{start:t??e,end:n??e}}function qp(i,e){return i==e||!!(i&&e&&i.compare(e))}function ds(i,e,t,n=0){let s=t.length-1;s>=0&&t[s]+n>=i?t[s]=Math.max(t[s],e):t.push(i,e)}var he=class i extends H{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(e,t,n,s,r,o){if(n){if(!(n instanceof i))return!1;this.dom||n.transferDOM(this)}return s&&this.setDeco(n?n.attrs:null),Ph(this,e,t,n?n.children.slice():[],r,o),!0}split(e){let t=new i;if(t.breakAfter=this.breakAfter,this.length==0)return t;let{i:n,off:s}=this.childPos(e);s&&(t.append(this.children[n].split(s),0),this.children[n].merge(s,this.children[n].length,null,!1,0,0),n++);for(let r=n;r0&&this.children[n-1].length==0;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){bs(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){Th(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=mo(t,this.attrs||{})),n&&(this.attrs=mo({class:n},this.attrs||{}))}domAtPos(e){return wh(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?this.flags&4&&(Qh(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(go(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let s=this.dom.lastChild;for(;s&&H.get(s)instanceof Xt;)s=s.lastChild;if(!s||!this.length||s.nodeName!="BR"&&((n=H.get(s))===null||n===void 0?void 0:n.isEditable)==!1&&(!z.ios||!this.children.some(r=>r instanceof ut))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let n of this.children){if(!(n instanceof ut)||/[^ -~]/.test(n.text))return null;let s=an(n.dom);if(s.length!=1)return null;e+=s[0].width,t=s[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let n=zh(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:s}=this.parent.view.viewState,r=n.bottom-n.top;if(Math.abs(r-s.lineHeight)<2&&s.textHeight=t){if(r instanceof i)return r;if(o>t)break}s=o+r.breakAfter}return null}},Nt=class i extends H{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,s,r,o){return n&&(!(n instanceof i)||!this.widget.compare(n.widget)||e>0&&r<=0||t0}},un=class extends xe{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}},en=class i{constructor(e,t,n,s){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=s,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Nt&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new he),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(ss(new hn(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Nt)&&this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:r,lineBreak:o,done:l}=this.cursor.next(this.skip);if(this.skip=0,l)throw new Error("Ran out of text content when drawing inline views");if(o){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=r,this.textOff=0}let s=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(ss(new ut(this.text.slice(this.textOff,this.textOff+s)),t),n),this.atCursorPos=!0,this.textOff+=s,e-=s,n=0}}span(e,t,n,s){this.buildText(t-e,n,s),this.pos=t,this.openStart<0&&(this.openStart=s)}point(e,t,n,s,r,o){if(this.disallowBlockEffectsFor[o]&&n instanceof Rt){if(n.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=t-e;if(n instanceof Rt)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Nt(n.widget||qt.block,l,n));else{let a=On.create(n.widget||qt.inline,l,l?0:n.startSide),O=this.atCursorPos&&!a.isEditable&&r<=s.length&&(e0),h=!a.isEditable&&(es.length||n.startSide<=0),c=this.getLine();this.pendingBuffer==2&&!O&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(s),O&&(c.append(ss(new hn(1),s),r),r=s.length+Math.max(0,r-s.length)),c.append(ss(a,s),r),this.atCursorPos=h,this.pendingBuffer=h?es.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=s.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,n,s,r){let o=new i(e,t,n,r);return o.openEnd=j.spans(s,t,n,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}};function ss(i,e){for(let t of e)i=new Xt(t,[i],i.length);return i}var qt=class extends xe{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};qt.inline=new qt("span");qt.block=new qt("div");var D=function(i){return i[i.LTR=0]="LTR",i[i.RTL=1]="RTL",i}(D||(D={})),Kt=D.LTR,Jo=D.RTL;function Rh(i){let e=[];for(let t=0;t=t){if(l.level==n)return o;(r<0||(s!=0?s<0?l.fromt:e[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}};function Wh(i,e){if(i.length!=e.length)return!1;for(let t=0;t=0;m-=3)if(at[m+1]==-u){let g=at[m+2],$=g&2?s:g&4?g&1?r:s:0;$&&(I[c]=I[at[m]]=$),l=m;break}}else{if(at.length==189)break;at[l++]=c,at[l++]=f,at[l++]=a}else if((d=I[c])==2||d==1){let m=d==s;a=m?0:1;for(let g=l-3;g>=0;g-=3){let $=at[g+2];if($&2)break;if(m)at[g+2]|=2;else{if($&4)break;at[g+2]|=4}}}}}function _p(i,e,t,n){for(let s=0,r=n;s<=t.length;s++){let o=s?t[s-1].to:i,l=sa;)d==g&&(d=t[--m].from,g=m?t[m-1].to:i),I[--d]=u;a=h}else r=O,a++}}}function Qo(i,e,t,n,s,r,o){let l=n%2?2:1;if(n%2==s%2)for(let a=e,O=0;aa&&o.push(new ht(a,m.from,u));let g=m.direction==Kt!=!(u%2);yo(i,g?n+1:n,s,m.inner,m.from,m.to,o),a=m.to}d=m.to}else{if(d==t||(h?I[d]!=l:I[d]==l))break;d++}f?Qo(i,a,d,n+1,s,f,o):ae;){let h=!0,c=!1;if(!O||a>r[O-1].to){let m=I[a-1];m!=l&&(h=!1,c=m==16)}let f=!h&&l==1?[]:null,u=h?n:n+1,d=a;e:for(;;)if(O&&d==r[O-1].to){if(c)break e;let m=r[--O];if(!h)for(let g=m.from,$=O;;){if(g==e)break e;if($&&r[$-1].to==g)g=r[--$].from;else{if(I[g-1]==l)break e;break}}if(f)f.push(m);else{m.toI.length;)I[I.length]=256;let n=[],s=e==Kt?0:1;return yo(i,s,s,t,0,i.length,n),n}function Zh(i){return[new ht(0,i,0)]}var Vh="";function Up(i,e,t,n,s){var r;let o=n.head-i.from,l=ht.find(e,o,(r=n.bidiLevel)!==null&&r!==void 0?r:-1,n.assoc),a=e[l],O=a.side(s,t);if(o==O){let f=l+=s?1:-1;if(f<0||f>=e.length)return null;a=e[l=f],o=a.side(!s,t),O=a.side(s,t)}let h=se(i.text,o,a.forward(s,t));(ha.to)&&(h=O),Vh=i.text.slice(Math.min(o,h),Math.max(o,h));let c=l==(s?e.length-1:0)?null:e[l+(s?1:-1)];return c&&h==O&&c.level+(s?0:1)i.some(e=>e)}),Gh=T.define({combine:i=>i.some(e=>e)}),Eh=T.define(),tn=class i{constructor(e,t="nearest",n="nearest",s=5,r=5,o=!1){this.range=e,this.y=t,this.x=n,this.yMargin=s,this.xMargin=r,this.isSnapshot=o}map(e){return e.empty?this:new i(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new i(Q.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}},rs=q.define({map:(i,e)=>i.map(e)}),Lh=q.define();function ce(i,e,t){let n=i.facet(Ah);n.length?n[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}var bt=T.define({combine:i=>i.length?i[0]:!0}),jp=0,$i=T.define({combine(i){return i.filter((e,t)=>{for(let n=0;n{let a=[];return o&&a.push(dn.of(O=>{let h=O.plugin(l);return h?o(h):X.none})),r&&a.push(r(l)),a})}static fromClass(e,t){return i.define((n,s)=>new e(n,s),t)}},nn=class{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(n){if(ce(t.state,n,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){ce(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(n){ce(e.state,n,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}},Dh=T.define(),il=T.define(),dn=T.define(),Bh=T.define(),nl=T.define(),Ih=T.define();function CO(i,e){let t=i.state.facet(Ih);if(!t.length)return t;let n=t.map(r=>r instanceof Function?r(i):r),s=[];return j.spans(n,e.from,e.to,{point(){},span(r,o,l,a){let O=r-e.from,h=o-e.from,c=s;for(let f=l.length-1;f>=0;f--,a--){let u=l[f].spec.bidiIsolate,d;if(u==null&&(u=Mp(e.text,O,h)),a>0&&c.length&&(d=c[c.length-1]).to==O&&d.direction==u)d.to=h,c=d.inner;else{let m={from:O,to:h,direction:u,inner:[]};c.push(m),c=m.inner}}}}),s}var Nh=T.define();function sl(i){let e=0,t=0,n=0,s=0;for(let r of i.state.facet(Nh)){let o=r(i);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(n=Math.max(n,o.top)),o.bottom!=null&&(s=Math.max(s,o.bottom)))}return{left:e,right:t,top:n,bottom:s}}var Ni=T.define(),ct=class i{constructor(e,t,n,s){this.fromA=e,this.toA=t,this.fromB=n,this.toB=s}join(e){return new i(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,n=this;for(;t>0;t--){let s=e[t-1];if(!(s.fromA>n.toA)){if(s.toAh)break;r+=2}if(!a)return n;new i(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),o=a.toA,l=a.toB}}},xs=class i{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=ge.empty(this.startState.doc.length);for(let r of n)this.changes=this.changes.compose(r.changes);let s=[];this.changes.iterChangedRanges((r,o,l,a)=>s.push(new ct(r,o,l,a))),this.changedRanges=s}static create(e,t,n){return new i(e,t,n)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},Ps=class extends H{get length(){return this.view.state.doc.length}constructor(e){super(),this.view=e,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=X.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(e.contentDOM),this.children=[new he],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new ct(0,0,0,e.state.doc.length)],0,null)}update(e){var t;let n=e.changedRanges;this.minWidth>0&&n.length&&(n.every(({fromA:O,toA:h})=>hthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let s=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?s=this.domChanged.newSel.head:!Np(e.changes,this.hasComposition)&&!e.selectionSet&&(s=e.state.selection.main.head));let r=s>-1?Ep(this.view,e.changes,s):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:O,to:h}=this.hasComposition;n=new ct(O,h,e.changes.mapPos(O,-1),e.changes.mapPos(h,1)).addToSet(n.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(z.ie||z.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=Bp(o,l,e.changes);return n=ct.extendWithRanges(n,a),!(this.flags&7)&&n.length==0?!1:(this.updateInner(n,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:s}=this.view;s.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=z.chrome||z.ios?{node:s.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||s.selectionRange.focusNode!=o.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(o=>o.flags&=-9);let r=[];if(this.view.viewport.from||this.view.viewport.to=0?s[o]:null;if(!l)break;let{fromA:a,toA:O,fromB:h,toB:c}=l,f,u,d,m;if(n&&n.range.fromBh){let x=en.build(this.view.state.doc,h,n.range.fromB,this.decorations,this.dynamicDecorationMap),S=en.build(this.view.state.doc,n.range.toB,c,this.decorations,this.dynamicDecorationMap);u=x.breakAtStart,d=x.openStart,m=S.openEnd;let P=this.compositionView(n);S.breakAtStart?P.breakAfter=1:S.content.length&&P.merge(P.length,P.length,S.content[0],!1,S.openStart,0)&&(P.breakAfter=S.content[0].breakAfter,S.content.shift()),x.content.length&&P.merge(0,0,x.content[x.content.length-1],!0,0,x.openEnd)&&x.content.pop(),f=x.content.concat(P).concat(S.content)}else({content:f,breakAtStart:u,openStart:d,openEnd:m}=en.build(this.view.state.doc,h,c,this.decorations,this.dynamicDecorationMap));let{i:g,off:$}=r.findPos(O,1),{i:y,off:b}=r.findPos(a,-1);xh(this,y,b,g,$,f,u,d,m)}n&&this.fixCompositionDOM(n)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let n of t.effects)n.is(Lh)&&(this.editContextFormatting=n.value)}compositionView(e){let t=new ut(e.text.nodeValue);t.flags|=8;for(let{deco:s}of e.marks)t=new Xt(s,[t],t.length);let n=new he;return n.append(t,0),n}fixCompositionDOM(e){let t=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=H.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},n=this.childPos(e.range.fromB,1),s=this.children[n.i];t(e.line,s);for(let r=e.marks.length-1;r>=-1;r--)n=s.childPos(n.off,1),s=s.children[n.i],t(r>=0?e.marks[r].node:e.text,s)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let n=this.view.root.activeElement,s=n==this.dom,r=!s&&!(this.view.state.facet(bt)||this.dom.tabIndex>-1)&&us(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(s||t||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),O=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(z.gecko&&l.empty&&!this.hasComposition&&Gp(a)){let c=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(c,a.node.childNodes[a.offset]||null)),a=O=new $e(c,0),o=!0}let h=this.view.observer.selectionRange;(o||!h.focusNode||(!Ji(a.node,a.offset,h.anchorNode,h.anchorOffset)||!Ji(O.node,O.offset,h.focusNode,h.focusOffset))&&!this.suppressWidgetCursorChange(h,l))&&(this.view.observer.ignore(()=>{z.android&&z.chrome&&this.dom.contains(h.focusNode)&&Ip(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let c=ln(this.view.root);if(c)if(l.empty){if(z.gecko){let f=Lp(a.node,a.offset);if(f&&f!=3){let u=(f==1?Sh:bh)(a.node,a.offset);u&&(a=new $e(u.node,u.offset))}}c.collapse(a.node,a.offset),l.bidiLevel!=null&&c.caretBidiLevel!==void 0&&(c.caretBidiLevel=l.bidiLevel)}else if(c.extend){c.collapse(a.node,a.offset);try{c.extend(O.node,O.offset)}catch{}}else{let f=document.createRange();l.anchor>l.head&&([a,O]=[O,a]),f.setEnd(O.node,O.offset),f.setStart(a.node,a.offset),c.removeAllRanges(),c.addRange(f)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())}),this.view.observer.setSelectionRange(a,O)),this.impreciseAnchor=a.precise?null:new $e(h.anchorNode,h.anchorOffset),this.impreciseHead=O.precise?null:new $e(h.focusNode,h.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&Ji(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=ln(e.root),{anchorNode:s,anchorOffset:r}=e.observer.selectionRange;if(!n||!t.empty||!t.assoc||!n.modify)return;let o=he.find(this,t.head);if(!o)return;let l=o.posAtStart;if(t.head==l||t.head==l+o.length)return;let a=this.coordsAt(t.head,-1),O=this.coordsAt(t.head,1);if(!a||!O||a.bottom>O.top)return;let h=this.domAtPos(t.head+t.assoc);n.collapse(h.node,h.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let c=e.observer.selectionRange;e.docView.posFromDOM(c.anchorNode,c.anchorOffset)!=t.from&&n.collapse(s,r)}moveToLine(e){let t=this.dom,n;if(e.node!=t)return e;for(let s=e.offset;!n&&s=0;s--){let r=H.get(t.childNodes[s]);r instanceof he&&(n=r.domAtPos(r.length))}return n?new $e(n.node,n.offset,!0):e}nearest(e){for(let t=e;t;){let n=H.get(t);if(n&&n.rootView==this)return n;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t=0;o--){let l=this.children[o],a=r-l.breakAfter,O=a-l.length;if(ae||l.covers(1))&&(!n||l instanceof he&&!(n instanceof he&&t>=0)))n=l,s=O;else if(n&&O==e&&a==e&&l instanceof Nt&&Math.abs(t)<2){if(l.deco.startSide<0)break;o&&(n=null)}r=O}return n?n.coordsAt(e-s,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),s=this.children[t];if(!(s instanceof he))return null;for(;s.children.length;){let{i:l,off:a}=s.childPos(n,1);for(;;l++){if(l==s.children.length)return null;if((s=s.children[l]).length)break}n=a}if(!(s instanceof ut))return null;let r=se(s.text,n);if(r==n)return null;let o=Ht(s.dom,n,r).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==D.LTR;for(let O=0,h=0;hs)break;if(O>=n){let u=c.dom.getBoundingClientRect();if(t.push(u.height),o){let d=c.dom.lastChild,m=d?an(d):[];if(m.length){let g=m[m.length-1],$=a?g.right-u.left:u.right-g.left;$>l&&(l=$,this.minWidth=r,this.minWidthFrom=O,this.minWidthTo=f)}}}O=f+c.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?D.RTL:D.LTR}measureTextSize(){for(let r of this.children)if(r instanceof he){let o=r.measureTextSize();if(o)return o}let e=document.createElement("div"),t,n,s;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let r=an(e.firstChild)[0];t=e.getBoundingClientRect().height,n=r?r.width/27:7,s=r?r.height:t,e.remove()}),{lineHeight:t,charWidth:n,textHeight:s}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Ss(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,s=0;;s++){let r=s==t.viewports.length?null:t.viewports[s],o=r?r.from-1:this.length;if(o>n){let l=(t.lineBlockAt(o).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(X.replace({widget:new un(l),block:!0,inclusive:!0,isBlockGap:!0}).range(n,o))}if(!r)break;n=r.to+1}return X.set(e)}updateDeco(){let e=1,t=this.view.state.facet(dn).map(r=>(this.dynamicDecorationMap[e++]=typeof r=="function")?r(this.view):r),n=!1,s=this.view.state.facet(Bh).map((r,o)=>{let l=typeof r=="function";return l&&(n=!0),l?r(this.view):r});for(s.length&&(this.dynamicDecorationMap[e++]=n,t.push(j.join(s))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];et.anchor?-1:1),s;if(!n)return;!t.empty&&(s=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(n={left:Math.min(n.left,s.left),top:Math.min(n.top,s.top),right:Math.max(n.right,s.right),bottom:Math.max(n.bottom,s.bottom)});let r=sl(this.view),o={left:n.left-r.left,top:n.top-r.top,right:n.right+r.right,bottom:n.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;xp(this.view.scrollDOM,o,t.head{ne.from&&(t=!0)}),t}function Fp(i,e,t=1){let n=i.charCategorizer(e),s=i.doc.lineAt(e),r=e-s.from;if(s.length==0)return Q.cursor(e);r==0?t=1:r==s.length&&(t=-1);let o=r,l=r;t<0?o=se(s.text,r,!1):l=se(s.text,r);let a=n(s.text.slice(o,l));for(;o>0;){let O=se(s.text,o,!1);if(n(s.text.slice(O,o))!=a)break;o=O}for(;li?e.left-i:Math.max(0,i-e.right)}function Kp(i,e){return e.top>i?e.top-i:Math.max(0,i-e.bottom)}function so(i,e){return i.tope.top+1}function YO(i,e){return ei.bottom?{top:i.top,left:i.left,right:i.right,bottom:e}:i}function bo(i,e,t){let n,s,r,o,l=!1,a,O,h,c;for(let d=i.firstChild;d;d=d.nextSibling){let m=an(d);for(let g=0;gb||o==b&&r>y){n=d,s=$,r=y,o=b;let x=b?t<$.top?-1:1:y?e<$.left?-1:1:0;l=!x||(x>0?g0)}y==0?t>$.bottom&&(!h||h.bottom<$.bottom)?(a=d,h=$):t<$.top&&(!c||c.top>$.top)&&(O=d,c=$):h&&so(h,$)?h=_O(h,$.bottom):c&&so(c,$)&&(c=YO(c,$.top))}}if(h&&h.bottom>=t?(n=a,s=h):c&&c.top<=t&&(n=O,s=c),!n)return{node:i,offset:0};let f=Math.max(s.left,Math.min(s.right,e));if(n.nodeType==3)return AO(n,f,t);if(l&&n.contentEditable!="false")return bo(n,f,t);let u=Array.prototype.indexOf.call(i.childNodes,n)+(e>=(s.left+s.right)/2?1:0);return{node:i,offset:u}}function AO(i,e,t){let n=i.nodeValue.length,s=-1,r=1e9,o=0;for(let l=0;lt?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&c=(h.left+h.right)/2,u=f;if((z.chrome||z.gecko)&&Ht(i,l).getBoundingClientRect().left==h.right&&(u=!f),c<=0)return{node:i,offset:l+(u?1:0)};s=l+(u?1:0),r=c}}}return{node:i,offset:s>-1?s:o>0?i.nodeValue.length:0}}function Hh(i,e,t,n=-1){var s,r;let o=i.contentDOM.getBoundingClientRect(),l=o.top+i.viewState.paddingTop,a,{docHeight:O}=i.viewState,{x:h,y:c}=e,f=c-l;if(f<0)return 0;if(f>O)return i.state.doc.length;for(let x=i.viewState.heightOracle.textHeight/2,S=!1;a=i.elementAtHeight(f),a.type!=Qe.Text;)for(;f=n>0?a.bottom+x:a.top-x,!(f>=0&&f<=O);){if(S)return t?null:0;S=!0,n=-n}c=l+f;let u=a.from;if(ui.viewport.to)return i.viewport.to==i.state.doc.length?i.state.doc.length:t?null:UO(i,o,a,h,c);let d=i.dom.ownerDocument,m=i.root.elementFromPoint?i.root:d,g=m.elementFromPoint(h,c);g&&!i.contentDOM.contains(g)&&(g=null),g||(h=Math.max(o.left+1,Math.min(o.right-1,h)),g=m.elementFromPoint(h,c),g&&!i.contentDOM.contains(g)&&(g=null));let $,y=-1;if(g&&((s=i.docView.nearest(g))===null||s===void 0?void 0:s.isEditable)!=!1){if(d.caretPositionFromPoint){let x=d.caretPositionFromPoint(h,c);x&&({offsetNode:$,offset:y}=x)}else if(d.caretRangeFromPoint){let x=d.caretRangeFromPoint(h,c);x&&({startContainer:$,startOffset:y}=x,(!i.contentDOM.contains($)||z.safari&&Jp($,y,h)||z.chrome&&em($,y,h))&&($=void 0))}$&&(y=Math.min(ft($),y))}if(!$||!i.docView.dom.contains($)){let x=he.find(i.docView,u);if(!x)return f>a.top+a.height/2?a.to:a.from;({node:$,offset:y}=bo(x.dom,h,c))}let b=i.docView.nearest($);if(!b)return null;if(b.isWidget&&((r=b.dom)===null||r===void 0?void 0:r.nodeType)==1){let x=b.dom.getBoundingClientRect();return e.yi.defaultLineHeight*1.5){let l=i.viewState.heightOracle.textHeight,a=Math.floor((s-t.top-(i.defaultLineHeight-l)*.5)/l);r+=a*i.viewState.heightOracle.lineLength}let o=i.state.sliceDoc(t.from,t.to);return t.from+is(o,r,i.state.tabSize)}function Jp(i,e,t){let n;if(i.nodeType!=3||e!=(n=i.nodeValue.length))return!1;for(let s=i.nextSibling;s;s=s.nextSibling)if(s.nodeType!=1||s.nodeName!="BR")return!1;return Ht(i,n-1,n).getBoundingClientRect().left>t}function em(i,e,t){if(e!=0)return!1;for(let s=i;;){let r=s.parentNode;if(!r||r.nodeType!=1||r.firstChild!=s)return!1;if(r.classList.contains("cm-line"))break;s=r}let n=i.nodeType==1?i.getBoundingClientRect():Ht(i,0,Math.max(i.nodeValue.length,1)).getBoundingClientRect();return t-n.left>5}function xo(i,e,t){let n=i.lineBlockAt(e);if(Array.isArray(n.type)){let s;for(let r of n.type){if(r.from>e)break;if(!(r.toe)return r;(!s||r.type==Qe.Text&&(s.type!=r.type||(t<0?r.frome)))&&(s=r)}}return s||n}return n}function tm(i,e,t,n){let s=xo(i,e.head,e.assoc||-1),r=!n||s.type!=Qe.Text||!(i.lineWrapping||s.widgetLineBreaks)?null:i.coordsAtPos(e.assoc<0&&e.head>s.from?e.head-1:e.head);if(r){let o=i.dom.getBoundingClientRect(),l=i.textDirectionAt(s.from),a=i.posAtCoords({x:t==(l==D.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return Q.cursor(a,t?-1:1)}return Q.cursor(t?s.to:s.from,t?-1:1)}function MO(i,e,t,n){let s=i.state.doc.lineAt(e.head),r=i.bidiSpans(s),o=i.textDirectionAt(s.from);for(let l=e,a=null;;){let O=Up(s,r,o,l,t),h=Vh;if(!O){if(s.number==(t?i.state.doc.lines:1))return l;h=` +`,s=i.state.doc.line(s.number+(t?1:-1)),r=i.bidiSpans(s),O=i.visualLineSide(s,!t)}if(a){if(!a(h))return l}else{if(!n)return O;a=n(h)}l=O}}function im(i,e,t){let n=i.state.charCategorizer(e),s=n(t);return r=>{let o=n(r);return s==L.Space&&(s=o),s==o}}function nm(i,e,t,n){let s=e.head,r=t?1:-1;if(s==(t?i.state.doc.length:0))return Q.cursor(s,e.assoc);let o=e.goalColumn,l,a=i.contentDOM.getBoundingClientRect(),O=i.coordsAtPos(s,e.assoc||-1),h=i.documentTop;if(O)o==null&&(o=O.left-a.left),l=r<0?O.top:O.bottom;else{let u=i.viewState.lineBlockAt(s);o==null&&(o=Math.min(a.right-a.left,i.defaultCharacterWidth*(s-u.from))),l=(r<0?u.top:u.bottom)+h}let c=a.left+o,f=n??i.viewState.heightOracle.textHeight>>1;for(let u=0;;u+=10){let d=l+(f+u)*r,m=Hh(i,{x:c,y:d},!1,r);if(da.bottom||(r<0?ms)){let g=i.docView.coordsForChar(m),$=!g||d{if(e>r&&es(i)),t.from,e.head>t.from?-1:1);return n==t.from?t:Q.cursor(n,nr)&&this.lineBreak(),s=o}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,s=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=t.indexOf(this.lineSeparator,n),o=this.lineSeparator.length):(l=s.exec(t))&&(r=l.index,o=l[0].length),this.append(t.slice(n,r<0?t.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=o-1);n=r+o}}readNode(e){if(e.cmIgnore)return;let t=H.get(e),n=t&&t.overrideDOMText;if(n!=null){this.findPointInside(e,n.length);for(let s=n.iter();!s.next().done;)s.lineBreak?this.lineBreak():this.append(s.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(e.nodeType==3?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(sm(e,n.node,n.offset)?t:0))}};function sm(i,e,t){for(;;){if(!e||t-1;let{impreciseHead:r,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let l=r||o?[]:lm(e),a=new Po(l,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=am(l,this.bounds.from)}else{let l=e.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!ho(e.contentDOM,l.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(l.focusNode,l.focusOffset),O=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!ho(e.contentDOM,l.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(l.anchorNode,l.anchorOffset),h=e.viewport;if((z.ios||z.chrome)&&e.state.selection.main.empty&&a!=O&&(h.from>0||h.toDate.now()-100?i.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:l}=e.bounds,a=s.from,O=null;(r===8||z.android&&e.text.length=s.from&&t.to<=s.to&&(t.from!=s.from||t.to!=s.to)&&s.to-s.from-(t.to-t.from)<=4?t={from:s.from,to:s.to,insert:i.state.doc.slice(s.from,t.from).append(t.insert).append(i.state.doc.slice(t.to,s.to))}:z.chrome&&t&&t.from==t.to&&t.from==s.head&&t.insert.toString()==` + `&&i.lineWrapping&&(n&&(n=Q.single(n.main.anchor-1,n.main.head-1)),t={from:s.from,to:s.to,insert:Y.of([" "])}),t)return rl(i,t,n,r);if(n&&!n.main.eq(s)){let o=!1,l="select";return i.inputState.lastSelectionTime>Date.now()-50&&(i.inputState.lastSelectionOrigin=="select"&&(o=!0),l=i.inputState.lastSelectionOrigin),i.dispatch({selection:n,scrollIntoView:o,userEvent:l}),!0}else return!1}function rl(i,e,t,n=-1){if(z.ios&&i.inputState.flushIOSKey(e))return!0;let s=i.state.selection.main;if(z.android&&(e.to==s.to&&(e.from==s.from||e.from==s.from-1&&i.state.sliceDoc(e.from,s.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&bi(i.contentDOM,"Enter",13)||(e.from==s.from-1&&e.to==s.to&&e.insert.length==0||n==8&&e.insert.lengths.head)&&bi(i.contentDOM,"Backspace",8)||e.from==s.from&&e.to==s.to+1&&e.insert.length==0&&bi(i.contentDOM,"Delete",46)))return!0;let r=e.insert.toString();i.inputState.composing>=0&&i.inputState.composing++;let o,l=()=>o||(o=rm(i,e,t));return i.state.facet(Uh).some(a=>a(i,e.from,e.to,r,l))||i.dispatch(l()),!0}function rm(i,e,t){let n,s=i.state,r=s.selection.main;if(e.from>=r.from&&e.to<=r.to&&e.to-e.from>=(r.to-r.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&i.inputState.composing<0){let l=r.frome.to?s.sliceDoc(e.to,r.to):"";n=s.replaceSelection(i.state.toText(l+e.insert.sliceString(0,void 0,i.state.lineBreak)+a))}else{let l=s.changes(e),a=t&&t.main.to<=l.newLength?t.main:void 0;if(s.selection.ranges.length>1&&i.inputState.composing>=0&&e.to<=r.to&&e.to>=r.to-10){let O=i.state.sliceDoc(e.from,e.to),h,c=t&&Fh(i,t.main.head);if(c){let d=e.insert.length-(e.to-e.from);h={from:c.from,to:c.to-d}}else h=i.state.doc.lineAt(r.head);let f=r.to-e.to,u=r.to-r.from;n=s.changeByRange(d=>{if(d.from==r.from&&d.to==r.to)return{changes:l,range:a||d.map(l)};let m=d.to-f,g=m-O.length;if(d.to-d.from!=u||i.state.sliceDoc(g,m)!=O||d.to>=h.from&&d.from<=h.to)return{range:d};let $=s.changes({from:g,to:m,insert:e.insert}),y=d.to-r.to;return{changes:$,range:a?Q.range(Math.max(0,a.anchor+y),Math.max(0,a.head+y)):d.map($)}})}else n={changes:l,selection:a&&s.selection.replaceRange(a)}}let o="input.type";return(i.composing||i.inputState.compositionPendingChange&&i.inputState.compositionEndedAt>Date.now()-50)&&(i.inputState.compositionPendingChange=!1,o+=".compose",i.inputState.compositionFirstChange&&(o+=".start",i.inputState.compositionFirstChange=!1)),s.update(n,{userEvent:o,scrollIntoView:!0})}function om(i,e,t,n){let s=Math.min(i.length,e.length),r=0;for(;r0&&l>0&&i.charCodeAt(o-1)==e.charCodeAt(l-1);)o--,l--;if(n=="end"){let a=Math.max(0,r-Math.min(o,l));t-=o+a-r}if(o=o?r-t:0;r-=a,l=r+(l-o),o=r}else if(l=l?r-t:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function lm(i){let e=[];if(i.root.activeElement!=i.contentDOM)return e;let{anchorNode:t,anchorOffset:n,focusNode:s,focusOffset:r}=i.observer.selectionRange;return t&&(e.push(new ks(t,n)),(s!=t||r!=n)&&e.push(new ks(s,r))),e}function am(i,e){if(i.length==0)return null;let t=i[0].pos,n=i.length==2?i[1].pos:t;return t>-1&&n>-1?Q.single(t+e,n+e):null}var vo=class{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,z.safari&&e.contentDOM.addEventListener("input",()=>null),z.gecko&&xm(e.contentDOM.ownerDocument)}handleEvent(e){!pm(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let s of n.observers)s(this.view,t);for(let s of n.handlers){if(t.defaultPrevented)break;if(s(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=Om(e),n=this.handlers,s=this.view.contentDOM;for(let r in t)if(r!="scroll"){let o=!t[r].handlers.length,l=n[r];l&&o!=!l.handlers.length&&(s.removeEventListener(r,this.handleEvent),l=null),l||s.addEventListener(r,this.handleEvent,{passive:o})}for(let r in n)r!="scroll"&&!t[r]&&s.removeEventListener(r,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&ec.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),z.android&&z.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return z.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=Jh.find(n=>n.keyCode==e.keyCode))&&!e.ctrlKey||hm.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from0?!0:z.safari&&!z.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function jO(i,e){return(t,n)=>{try{return e.call(i,n,t)}catch(s){ce(t.state,s)}}}function Om(i){let e=Object.create(null);function t(n){return e[n]||(e[n]={observers:[],handlers:[]})}for(let n of i){let s=n.spec,r=s&&s.plugin.domEventHandlers,o=s&&s.plugin.domEventObservers;if(r)for(let l in r){let a=r[l];a&&t(l).handlers.push(jO(n.value,a))}if(o)for(let l in o){let a=o[l];a&&t(l).observers.push(jO(n.value,a))}}for(let n in Ke)t(n).handlers.push(Ke[n]);for(let n in Ee)t(n).observers.push(Ee[n]);return e}var Jh=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],hm="dthko",ec=[16,17,18,20,91,92,224,225],os=6;function ls(i){return Math.max(0,i)*.7+8}function cm(i,e){return Math.max(Math.abs(i.clientX-e.clientX),Math.abs(i.clientY-e.clientY))}var wo=class{constructor(e,t,n,s){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=s,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=Pp(e.contentDOM),this.atoms=e.state.facet(nl).map(o=>o(e));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(M.allowMultipleSelections)&&fm(e,t),this.dragging=dm(e,t)&&nc(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&cm(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,n=0,s=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:s,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=sl(this.view);e.clientX-a.left<=s+os?t=-ls(s-e.clientX):e.clientX+a.right>=o-os&&(t=ls(e.clientX-o)),e.clientY-a.top<=r+os?n=-ls(r-e.clientY):e.clientY+a.bottom>=l-os&&(n=ls(e.clientY-l)),this.setScrollSpeed(t,n)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;nt.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}};function fm(i,e){let t=i.state.facet(Ch);return t.length?t[0](e):z.mac?e.metaKey:e.ctrlKey}function um(i,e){let t=i.state.facet(Yh);return t.length?t[0](e):z.mac?!e.altKey:!e.ctrlKey}function dm(i,e){let{main:t}=i.state.selection;if(t.empty)return!1;let n=ln(i.root);if(!n||n.rangeCount==0)return!0;let s=n.getRangeAt(0).getClientRects();for(let r=0;r=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function pm(i,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,n;t!=i.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(n=H.get(t))&&n.ignoreEvent(e))return!1;return!0}var Ke=Object.create(null),Ee=Object.create(null),tc=z.ie&&z.ie_version<15||z.ios&&z.webkit_version<604;function mm(i){let e=i.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{i.focus(),t.remove(),ic(i,t.value)},50)}function Ys(i,e,t){for(let n of i.facet(e))t=n(t,i);return t}function ic(i,e){e=Ys(i.state,el,e);let{state:t}=i,n,s=1,r=t.toText(e),o=r.lines==t.selection.ranges.length;if(To!=null&&t.selection.ranges.every(a=>a.empty)&&To==r.toString()){let a=-1;n=t.changeByRange(O=>{let h=t.doc.lineAt(O.from);if(h.from==a)return{range:O};a=h.from;let c=t.toText((o?r.line(s++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:c},range:Q.cursor(O.from+c.length)}})}else o?n=t.changeByRange(a=>{let O=r.line(s++);return{changes:{from:a.from,to:a.to,insert:O.text},range:Q.cursor(a.from+O.length)}}):n=t.replaceSelection(r);i.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}Ee.scroll=i=>{i.inputState.lastScrollTop=i.scrollDOM.scrollTop,i.inputState.lastScrollLeft=i.scrollDOM.scrollLeft};Ke.keydown=(i,e)=>(i.inputState.setSelectionOrigin("select"),e.keyCode==27&&i.inputState.tabFocusMode!=0&&(i.inputState.tabFocusMode=Date.now()+2e3),!1);Ee.touchstart=(i,e)=>{i.inputState.lastTouchTime=Date.now(),i.inputState.setSelectionOrigin("select.pointer")};Ee.touchmove=i=>{i.inputState.setSelectionOrigin("select.pointer")};Ke.mousedown=(i,e)=>{if(i.observer.flush(),i.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let n of i.state.facet(_h))if(t=n(i,e),t)break;if(!t&&e.button==0&&(t=Qm(i,e)),t){let n=!i.hasFocus;i.inputState.startMouseSelection(new wo(i,e,t,n)),n&&i.observer.ignore(()=>{$h(i.contentDOM);let r=i.root.activeElement;r&&!r.contains(i.contentDOM)&&r.blur()});let s=i.inputState.mouseSelection;if(s)return s.start(e),s.dragging===!1}return!1};function GO(i,e,t,n){if(n==1)return Q.cursor(e,t);if(n==2)return Fp(i.state,e,t);{let s=he.find(i.docView,e),r=i.state.doc.lineAt(s?s.posAtEnd:e),o=s?s.posAtStart:r.from,l=s?s.posAtEnd:r.to;return le>=t.top&&e<=t.bottom&&i>=t.left&&i<=t.right;function gm(i,e,t,n){let s=he.find(i.docView,e);if(!s)return 1;let r=e-s.posAtStart;if(r==0)return 1;if(r==s.length)return-1;let o=s.coordsAt(r,-1);if(o&&EO(t,n,o))return-1;let l=s.coordsAt(r,1);return l&&EO(t,n,l)?1:o&&o.bottom>=n?-1:1}function LO(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:gm(i,t,e.clientX,e.clientY)}}var $m=z.ie&&z.ie_version<=11,DO=null,BO=0,IO=0;function nc(i){if(!$m)return i.detail;let e=DO,t=IO;return DO=i,IO=Date.now(),BO=!e||t>Date.now()-400&&Math.abs(e.clientX-i.clientX)<2&&Math.abs(e.clientY-i.clientY)<2?(BO+1)%3:1}function Qm(i,e){let t=LO(i,e),n=nc(e),s=i.state.selection;return{update(r){r.docChanged&&(t.pos=r.changes.mapPos(t.pos),s=s.map(r.changes))},get(r,o,l){let a=LO(i,r),O,h=GO(i,a.pos,a.bias,n);if(t.pos!=a.pos&&!o){let c=GO(i,t.pos,t.bias,n),f=Math.min(c.from,h.from),u=Math.max(c.to,h.to);h=f1&&(O=ym(s,a.pos))?O:l?s.addRange(h):Q.create([h])}}}function ym(i,e){for(let t=0;t=e)return Q.create(i.ranges.slice(0,t).concat(i.ranges.slice(t+1)),i.mainIndex==t?0:i.mainIndex-(i.mainIndex>t?1:0))}return null}Ke.dragstart=(i,e)=>{let{selection:{main:t}}=i.state;if(e.target.draggable){let s=i.docView.nearest(e.target);if(s&&s.isWidget){let r=s.posAtStart,o=r+s.length;(r>=t.to||o<=t.from)&&(t=Q.range(r,o))}}let{inputState:n}=i;return n.mouseSelection&&(n.mouseSelection.dragging=!0),n.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",Ys(i.state,tl,i.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Ke.dragend=i=>(i.inputState.draggedContent=null,!1);function NO(i,e,t,n){if(t=Ys(i.state,el,t),!t)return;let s=i.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:r}=i.inputState,o=n&&r&&um(i,e)?{from:r.from,to:r.to}:null,l={from:s,insert:t},a=i.state.changes(o?[o,l]:l);i.focus(),i.dispatch({changes:a,selection:{anchor:a.mapPos(s,-1),head:a.mapPos(s,1)},userEvent:o?"move.drop":"input.drop"}),i.inputState.draggedContent=null}Ke.drop=(i,e)=>{if(!e.dataTransfer)return!1;if(i.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let n=Array(t.length),s=0,r=()=>{++s==t.length&&NO(i,e,n.filter(o=>o!=null).join(i.state.lineBreak),!1)};for(let o=0;o{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(n[o]=l.result),r()},l.readAsText(t[o])}return!0}else{let n=e.dataTransfer.getData("Text");if(n)return NO(i,e,n,!0),!0}return!1};Ke.paste=(i,e)=>{if(i.state.readOnly)return!0;i.observer.flush();let t=tc?null:e.clipboardData;return t?(ic(i,t.getData("text/plain")||t.getData("text/uri-list")),!0):(mm(i),!1)};function Sm(i,e){let t=i.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.value=e,n.focus(),n.selectionEnd=e.length,n.selectionStart=0,setTimeout(()=>{n.remove(),i.focus()},50)}function bm(i){let e=[],t=[],n=!1;for(let s of i.selection.ranges)s.empty||(e.push(i.sliceDoc(s.from,s.to)),t.push(s));if(!e.length){let s=-1;for(let{from:r}of i.selection.ranges){let o=i.doc.lineAt(r);o.number>s&&(e.push(o.text),t.push({from:o.from,to:Math.min(i.doc.length,o.to+1)})),s=o.number}n=!0}return{text:Ys(i,tl,e.join(i.lineBreak)),ranges:t,linewise:n}}var To=null;Ke.copy=Ke.cut=(i,e)=>{let{text:t,ranges:n,linewise:s}=bm(i.state);if(!t&&!s)return!1;To=s?t:null,e.type=="cut"&&!i.state.readOnly&&i.dispatch({changes:n,scrollIntoView:!0,userEvent:"delete.cut"});let r=tc?null:e.clipboardData;return r?(r.clearData(),r.setData("text/plain",t),!0):(Sm(i,t),!1)};var sc=Se.define();function rc(i,e){let t=[];for(let n of i.facet(Mh)){let s=n(i,e);s&&t.push(s)}return t.length?i.update({effects:t,annotations:sc.of(!0)}):null}function oc(i){setTimeout(()=>{let e=i.hasFocus;if(e!=i.inputState.notifiedFocused){let t=rc(i.state,e);t?i.dispatch(t):i.update([])}},10)}Ee.focus=i=>{i.inputState.lastFocusTime=Date.now(),!i.scrollDOM.scrollTop&&(i.inputState.lastScrollTop||i.inputState.lastScrollLeft)&&(i.scrollDOM.scrollTop=i.inputState.lastScrollTop,i.scrollDOM.scrollLeft=i.inputState.lastScrollLeft),oc(i)};Ee.blur=i=>{i.observer.clearSelectionRange(),oc(i)};Ee.compositionstart=Ee.compositionupdate=i=>{i.observer.editContext||(i.inputState.compositionFirstChange==null&&(i.inputState.compositionFirstChange=!0),i.inputState.composing<0&&(i.inputState.composing=0))};Ee.compositionend=i=>{i.observer.editContext||(i.inputState.composing=-1,i.inputState.compositionEndedAt=Date.now(),i.inputState.compositionPendingKey=!0,i.inputState.compositionPendingChange=i.observer.pendingRecords().length>0,i.inputState.compositionFirstChange=null,z.chrome&&z.android?i.observer.flushSoon():i.inputState.compositionPendingChange?Promise.resolve().then(()=>i.observer.flush()):setTimeout(()=>{i.inputState.composing<0&&i.docView.hasComposition&&i.update([])},50))};Ee.contextmenu=i=>{i.inputState.lastContextMenu=Date.now()};Ke.beforeinput=(i,e)=>{var t,n;if(e.inputType=="insertReplacementText"&&i.observer.editContext){let r=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(r&&o.length){let l=o[0],a=i.posAtDOM(l.startContainer,l.startOffset),O=i.posAtDOM(l.endContainer,l.endOffset);return rl(i,{from:a,to:O,insert:i.state.toText(r)},null),!0}}let s;if(z.chrome&&z.android&&(s=Jh.find(r=>r.inputType==e.inputType))&&(i.observer.delayAndroidKey(s.key,s.keyCode),s.key=="Backspace"||s.key=="Delete")){let r=((n=window.visualViewport)===null||n===void 0?void 0:n.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>r+10&&i.hasFocus&&(i.contentDOM.blur(),i.focus())},100)}return z.ios&&e.inputType=="deleteContentForward"&&i.observer.flushSoon(),z.safari&&e.inputType=="insertText"&&i.inputState.composing>=0&&setTimeout(()=>Ee.compositionend(i,e),20),!1};var FO=new Set;function xm(i){FO.has(i)||(FO.add(i),i.addEventListener("copy",()=>{}),i.addEventListener("cut",()=>{}))}var HO=["pre-wrap","normal","pre-line","break-spaces"],xi=!1;function KO(){xi=!1}var zo=class{constructor(e){this.lineWrapping=e,this.doc=Y.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return HO.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=n,this.textHeight=s,this.lineLength=r,a){this.heightSamples={};for(let O=0;O0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>ms&&(xi=!0),this.height=e)}replace(e,t,n){return i.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,s){let r=this,o=n.doc;for(let l=s.length-1;l>=0;l--){let{fromA:a,toA:O,fromB:h,toB:c}=s[l],f=r.lineAt(a,K.ByPosNoHeight,n.setDoc(t),0,0),u=f.to>=O?f:r.lineAt(O,K.ByPosNoHeight,n,0,0);for(c+=u.to-O,O=u.to;l>0&&f.from<=s[l-1].toA;)a=s[l-1].fromA,h=s[l-1].fromB,l--,ar*2){let l=e[t-1];l.break?e.splice(--t,1,l.left,null,l.right):e.splice(--t,1,l.left,l.right),n+=1+l.break,s-=l.size}else if(r>s*2){let l=e[n];l.break?e.splice(n,1,l.left,null,l.right):e.splice(n,1,l.left,l.right),n+=2+l.break,r-=l.size}else break;else if(s=r&&o(this.blockAt(0,n,s,r))}updateHeight(e,t=0,n=!1,s){return s&&s.from<=t&&s.more&&this.setHeight(s.heights[s.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}},Ge=class i extends ws{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,s){return new Ot(s,this.length,n,this.height,this.breaks)}replace(e,t,n){let s=n[0];return n.length==1&&(s instanceof i||s instanceof zt&&s.flags&4)&&Math.abs(this.length-s.length)<10?(s instanceof zt?s=new i(s.length,this.height):s.height=this.height,this.outdated||(s.outdated=!1),s):Re.of(n)}updateHeight(e,t=0,n=!1,s){return s&&s.from<=t&&s.more?this.setHeight(s.heights[s.index++]):(n||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}},zt=class i extends Re{constructor(e){super(e,0)}heightMetrics(e,t){let n=e.doc.lineAt(t).number,s=e.doc.lineAt(t+this.length).number,r=s-n+1,o,l=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:n,lastLine:s,perLine:o,perChar:l}}blockAt(e,t,n,s){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(t,s);if(t.lineWrapping){let O=s+(e0){let r=n[n.length-1];r instanceof i?n[n.length-1]=new i(r.length+s):n.push(null,new i(s-1))}if(e>0){let r=n[0];r instanceof i?n[0]=new i(e+r.length):n.unshift(new i(e-1),null)}return Re.of(n)}decomposeLeft(e,t){t.push(new i(e-1),null)}decomposeRight(e,t){t.push(null,new i(this.length-e-1))}updateHeight(e,t=0,n=!1,s){let r=t+this.length;if(s&&s.from<=t+this.length&&s.more){let o=[],l=Math.max(t,s.from),a=-1;for(s.from>t&&o.push(new i(s.from-t-1).updateHeight(e,t));l<=r&&s.more;){let h=e.doc.lineAt(l).length;o.length&&o.push(null);let c=s.heights[s.index++];a==-1?a=c:Math.abs(c-a)>=ms&&(a=-2);let f=new Ge(h,c);f.outdated=!1,o.push(f),l+=h+1}l<=r&&o.push(null,new i(r-l).updateHeight(e,l));let O=Re.of(o);return(a<0||Math.abs(O.height-this.height)>=ms||Math.abs(a-this.heightMetrics(e,t).perLine)>=ms)&&(xi=!0),vs(this,O)}else(n||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},Ro=class extends Re{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return this.flags&1}blockAt(e,t,n,s){let r=n+this.left.height;return el))return O;let h=t==K.ByPosNoHeight?K.ByPosNoHeight:K.ByPos;return a?O.join(this.right.lineAt(l,h,n,o,l)):this.left.lineAt(l,h,n,s,r).join(O)}forEachLine(e,t,n,s,r,o){let l=s+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,n,l,a,o);else{let O=this.lineAt(a,K.ByPos,n,s,r);e=e&&O.from<=t&&o(O),t>O.to&&this.right.forEachLine(O.to+1,t,n,l,a,o)}}replace(e,t,n){let s=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-s,t-s,n));let r=[];e>0&&this.decomposeLeft(e,r);let o=r.length;for(let l of n)r.push(l);if(e>0&&JO(r,o-1),t=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,s=n+this.break;if(e>=s)return this.right.decomposeRight(e-s,t);e2*t.size||t.size>2*e.size?Re.of(this.break?[e,null,t]:[e,t]):(this.left=vs(this.left,e),this.right=vs(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,n=!1,s){let{left:r,right:o}=this,l=t+r.length+this.break,a=null;return s&&s.from<=t+r.length&&s.more?a=r=r.updateHeight(e,t,n,s):r.updateHeight(e,t,n),s&&s.from<=l+o.length&&s.more?a=o=o.updateHeight(e,l,n,s):o.updateHeight(e,l,n),a?this.balanced(r,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}};function JO(i,e){let t,n;i[e]==null&&(t=i[e-1])instanceof zt&&(n=i[e+1])instanceof zt&&i.splice(e-1,3,new zt(t.length+1+n.length))}var Pm=5,qo=class i{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let n=Math.min(t,this.lineEnd),s=this.nodes[this.nodes.length-1];s instanceof Ge?s.length+=n-this.pos:(n>this.pos||!this.isCovered)&&this.nodes.push(new Ge(n-this.pos,-1)),this.writtenTo=n,t>n&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e=Pm)&&this.addLineDeco(s,r,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new Ge(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new zt(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ge)return e;let t=new Ge(0,-1);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,n){let s=this.ensureLine();s.length+=n,s.collapsed+=n,s.widgetHeight=Math.max(s.widgetHeight,e),s.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Ge)&&!this.isCovered?this.nodes.push(new Ge(0,-1)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&c.overflow!="visible"){let f=h.getBoundingClientRect();r=Math.max(r,f.left),o=Math.min(o,f.right),l=Math.max(l,f.top),a=Math.min(O==i.parentNode?s.innerHeight:a,f.bottom)}O=c.position=="absolute"||c.position=="fixed"?h.offsetParent:h.parentNode}else if(O.nodeType==11)O=O.host;else break;return{left:r-t.left,right:Math.max(r,o)-t.left,top:l-(t.top+e),bottom:Math.max(l,a)-(t.top+e)}}function wm(i){let e=i.getBoundingClientRect(),t=i.ownerDocument.defaultView||window;return e.left0&&e.top0}function Tm(i,e){let t=i.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}var sn=class{constructor(e,t,n,s){this.from=e,this.to=t,this.size=n,this.displaySize=s}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;ntypeof n!="function"&&n.class=="cm-lineWrapping");this.heightOracle=new zo(t),this.stateDeco=e.facet(dn).filter(n=>typeof n!="function"),this.heightMap=Re.empty().applyChanges(this.stateDeco,Y.empty,this.heightOracle.setDoc(e.doc),[new ct(0,0,0,e.doc.length)]);for(let n=0;n<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());n++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=X.set(this.lineGaps.map(n=>n.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let s=n?t.head:t.anchor;if(!e.some(({from:r,to:o})=>s>=r&&s<=o)){let{from:r,to:o}=this.lineBlockAt(s);e.push(new Qi(r,o))}}return this.viewports=e.sort((n,s)=>n.from-s.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?eh:new Vo(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Hi(e,this.scaler))})}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(dn).filter(h=>typeof h!="function");let s=e.changedRanges,r=ct.extendWithRanges(s,km(n,this.stateDeco,e?e.changes:ge.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);KO(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=o||xi)&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let O=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,e.flags|=this.updateForViewport(),(O||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(Gh)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),s=this.heightOracle,r=n.whiteSpace;this.defaultTextDirection=n.direction=="rtl"?D.RTL:D.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let O=0,h=0;if(l.width&&l.height){let{scaleX:x,scaleY:S}=gh(t,l);(x>.005&&Math.abs(this.scaleX-x)>.005||S>.005&&Math.abs(this.scaleY-S)>.005)&&(this.scaleX=x,this.scaleY=S,O|=16,o=a=!0)}let c=(parseInt(n.paddingTop)||0)*this.scaleY,f=(parseInt(n.paddingBottom)||0)*this.scaleY;(this.paddingTop!=c||this.paddingBottom!=f)&&(this.paddingTop=c,this.paddingBottom=f,O|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(s.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,O|=16);let u=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=u&&(this.scrollAnchorHeight=-1,this.scrollTop=u),this.scrolledToBottom=yh(e.scrollDOM);let d=(this.printing?Tm:vm)(t,this.paddingTop),m=d.top-this.pixelViewport.top,g=d.bottom-this.pixelViewport.bottom;this.pixelViewport=d;let $=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if($!=this.inView&&(this.inView=$,$&&(a=!0)),!this.inView&&!this.scrollTarget&&!wm(e.dom))return 0;let y=l.width;if((this.contentDOMWidth!=y||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,O|=16),a){let x=e.docView.measureVisibleLineHeights(this.viewport);if(s.mustRefreshForHeights(x)&&(o=!0),o||s.lineWrapping&&Math.abs(y-this.contentDOMWidth)>s.charWidth){let{lineHeight:S,charWidth:P,textHeight:w}=e.docView.measureTextSize();o=S>0&&s.refresh(r,S,P,w,y/P,x),o&&(e.docView.minWidth=0,O|=16)}m>0&&g>0?h=Math.max(m,g):m<0&&g<0&&(h=Math.min(m,g)),KO();for(let S of this.viewports){let P=S.from==this.viewport.from?x:e.docView.measureVisibleLineHeights(S);this.heightMap=(o?Re.empty().applyChanges(this.stateDeco,Y.empty,this.heightOracle,[new ct(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(s,0,o,new Xo(S.from,P))}xi&&(O|=2)}let b=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return b&&(O&2&&(O|=this.updateScaler()),this.viewport=this.getViewport(h,this.scrollTarget),O|=this.updateForViewport()),(O&2||b)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),O|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),O}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),s=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Qi(s.lineAt(o-n*1e3,K.ByHeight,r,0,0).from,s.lineAt(l+(1-n)*1e3,K.ByHeight,r,0,0).to);if(t){let{head:O}=t.range;if(Oa.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),c=s.lineAt(O,K.ByPos,r,0,0),f;t.y=="center"?f=(c.top+c.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&O=l+Math.max(10,Math.min(n,250)))&&s>o-2*1e3&&r>1,o=s<<1;if(this.defaultTextDirection!=D.LTR&&!n)return[];let l=[],a=(h,c,f,u)=>{if(c-hh&&$$.from>=f.from&&$.to<=f.to&&Math.abs($.from-h)$.fromy));if(!g){if(cb.from<=c&&b.to>=c)){let b=t.moveToLineBoundary(Q.cursor(c),!1,!0).head;b>h&&(c=b)}let $=this.gapSize(f,h,c,u),y=n||$<2e6?$:2e6;g=new sn(h,c,$,y)}l.push(g)},O=h=>{if(h.length2e6)for(let P of e)P.from>=h.from&&P.fromh.from&&a(h.from,u,h,c),dt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let n=[];j.spans(t,this.viewport.from,this.viewport.to,{span(r,o){n.push({from:r,to:o})},point(){}},20);let s=0;if(n.length!=this.visibleRanges.length)s=12;else for(let r=0;r=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Hi(this.heightMap.lineAt(e,K.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Hi(this.heightMap.lineAt(this.scaler.fromDOM(e),K.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Hi(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},Qi=class{constructor(e,t){this.from=e,this.to=t}};function zm(i,e,t){let n=[],s=i,r=0;return j.spans(t,i,e,{span(){},point(o,l){o>s&&(n.push({from:s,to:o}),r+=o-s),s=l}},20),s=1)return e[e.length-1].to;let n=Math.floor(i*t);for(let s=0;;s++){let{from:r,to:o}=e[s],l=o-r;if(n<=l)return r+n;n-=l}}function Os(i,e){let t=0;for(let{from:n,to:s}of i.ranges){if(e<=s){t+=e-n;break}t+=s-n}return t/i.total}function Xm(i,e){for(let t of i)if(e(t))return t}var eh={toDOM(i){return i},fromDOM(i){return i},scale:1,eq(i){return i==this}},Vo=class i{constructor(e,t,n){let s=0,r=0,o=0;this.viewports=n.map(({from:l,to:a})=>{let O=t.lineAt(l,K.ByPos,e,0,0).top,h=t.lineAt(a,K.ByPos,e,0,0).bottom;return s+=h-O,{from:l,to:a,top:O,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-s)/(t.height-s);for(let l of this.viewports)l.domTop=o+(l.top-r)*this.scale,o=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,n=0,s=0;;t++){let r=tt.from==e.viewports[n].from&&t.to==e.viewports[n].to):!1}};function Hi(i,e){if(e.scale==1)return i;let t=e.toDOM(i.top),n=e.toDOM(i.bottom);return new Ot(i.from,i.length,t,n-t,Array.isArray(i._content)?i._content.map(s=>Hi(s,e)):i._content)}var hs=T.define({combine:i=>i.join(" ")}),Co=T.define({combine:i=>i.indexOf(!0)>-1}),Yo=je.newName(),lc=je.newName(),ac=je.newName(),Oc={"&light":"."+lc,"&dark":"."+ac};function _o(i,e,t){return new je(e,{finish(n){return/&/.test(n)?n.replace(/&\w*/,s=>{if(s=="&")return i;if(!t||!t[s])throw new RangeError(`Unsupported selector: ${s}`);return t[s]}):i+" "+n}})}var Rm=_o("."+Yo,{"&":{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,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&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"}},Oc),qm={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},oo=z.ie&&z.ie_version<=11,Ao=class{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new co,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let n of t)this.queue.push(n);(z.ie&&z.ie_version<=11||z.ios&&e.composing)&&t.some(n=>n.type=="childList"&&n.removedNodes.length||n.type=="characterData"&&n.oldValue.length>n.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&e.constructor.EDIT_CONTEXT!==!1&&!(z.chrome&&z.chrome_version<126)&&(this.editContext=new Uo(e),e.state.facet(bt)&&(e.contentDOM.editContext=this.editContext.editContext)),oo&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,n)=>t!=e[n]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:n}=this,s=this.selectionRange;if(n.state.facet(bt)?n.root.activeElement!=this.dom:!us(this.dom,s))return;let r=s.anchorNode&&n.docView.nearest(s.anchorNode);if(r&&r.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(z.ie&&z.ie_version<=11||z.android&&z.chrome)&&!n.state.selection.main.empty&&s.focusNode&&Ji(s.focusNode,s.focusOffset,s.anchorNode,s.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=ln(e.root);if(!t)return!1;let n=z.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&Wm(this.view,t)||t;if(!n||this.selectionRange.eq(n))return!1;let s=us(this.dom,n);return s&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&bi(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(s)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,n=-1,s=!1;for(let r of e){let o=this.readMutation(r);o&&(o.typeOver&&(s=!0),t==-1?{from:t,to:n}=o:(t=Math.min(o.from,t),n=Math.max(o.to,n)))}return{from:t,to:n,typeOver:s}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),s=this.selectionChanged&&us(this.dom,this.selectionRange);if(e<0&&!s)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new ko(this.view,e,t,n);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let n=this.view.state,s=Kh(this.view,t);return this.view.state==n&&(t.domChanged||t.newSel&&!t.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),s}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let n=th(t,e.previousSibling||e.target.previousSibling,-1),s=th(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:s?t.posBefore(s):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(bt)!=e.state.facet(bt)&&(e.view.contentDOM.editContext=e.state.facet(bt)?this.editContext.editContext:null))}destroy(){var e,t,n;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(n=this.resizeScroll)===null||n===void 0||n.disconnect();for(let s of this.scrollTargets)s.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}};function th(i,e,t){for(;e;){let n=H.get(e);if(n&&n.parent==i)return n;let s=e.parentNode;e=s!=i.dom?s:t>0?e.nextSibling:e.previousSibling}return null}function ih(i,e){let t=e.startContainer,n=e.startOffset,s=e.endContainer,r=e.endOffset,o=i.docView.domAtPos(i.state.selection.main.anchor);return Ji(o.node,o.offset,s,r)&&([t,n,s,r]=[s,r,t,n]),{anchorNode:t,anchorOffset:n,focusNode:s,focusOffset:r}}function Wm(i,e){if(e.getComposedRanges){let s=e.getComposedRanges(i.root)[0];if(s)return ih(i,s)}let t=null;function n(s){s.preventDefault(),s.stopImmediatePropagation(),t=s.getTargetRanges()[0]}return i.contentDOM.addEventListener("beforeinput",n,!0),i.dom.ownerDocument.execCommand("indent"),i.contentDOM.removeEventListener("beforeinput",n,!0),t?ih(i,t):null}var Uo=class{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=n=>{let s=e.state.selection.main,{anchor:r,head:o}=s,l=this.toEditorPos(n.updateRangeStart),a=this.toEditorPos(n.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:n.updateRangeStart,editorBase:l,drifted:!1});let O={from:l,to:a,insert:Y.of(n.text.split(` +`))};if(O.from==this.from&&rthis.to&&(O.to=r),O.from==O.to&&!O.insert.length){let h=Q.single(this.toEditorPos(n.selectionStart),this.toEditorPos(n.selectionEnd));h.main.eq(s)||e.dispatch({selection:h,userEvent:"select"});return}if((z.mac||z.android)&&O.from==o-1&&/^\. ?$/.test(n.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(O={from:l,to:a,insert:Y.of([n.text.replace("."," ")])}),this.pendingContextChange=O,!e.state.readOnly){let h=this.to-this.from+(O.to-O.from+O.insert.length);rl(e,O,Q.single(this.toEditorPos(n.selectionStart,h),this.toEditorPos(n.selectionEnd,h)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state))},this.handlers.characterboundsupdate=n=>{let s=[],r=null;for(let o=this.toEditorPos(n.rangeStart),l=this.toEditorPos(n.rangeEnd);o{let s=[];for(let r of n.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(o!="None"&&l!="None"){let a=this.toEditorPos(r.rangeStart),O=this.toEditorPos(r.rangeEnd);if(a{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:n}=this.composing;this.composing=null,n&&this.reset(e.state)}};for(let n in this.handlers)t.addEventListener(n,this.handlers[n]);this.measureReq={read:n=>{this.editContext.updateControlBounds(n.contentDOM.getBoundingClientRect());let s=ln(n.root);s&&s.rangeCount&&this.editContext.updateSelectionBounds(s.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,n=!1,s=this.pendingContextChange;return e.changes.iterChanges((r,o,l,a,O)=>{if(n)return;let h=O.length-(o-r);if(s&&o>=s.to)if(s.from==r&&s.to==o&&s.insert.eq(O)){s=this.pendingContextChange=null,t+=h,this.to+=h;return}else s=null,this.revertPending(e.state);if(r+=t,o+=t,o<=this.from)this.from+=h,this.to+=h;else if(rthis.to||this.to-this.from+O.length>3e4){n=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),O.toString()),this.to+=h}t+=h}),s&&!n&&this.revertPending(e.state),!n}update(e){let t=this.pendingContextChange,n=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(n.from,n.to)&&e.transactions.some(s=>!s.isUserEvent("input.type")&&s.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,n=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),s=this.toContextPos(t.head);(this.editContext.selectionStart!=n||this.editContext.selectionEnd!=s)&&this.editContext.updateSelection(n,s)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let n=this.composing;return n&&n.drifted?n.editorBase+(e-n.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}},k=class i{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!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,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.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:n}=e;this.dispatchTransactions=e.dispatchTransactions||n&&(s=>s.forEach(r=>n(r,this)))||(s=>this.update(s)),this.dispatch=this.dispatch.bind(this),this._root=e.root||kp(e.parent)||document,this.viewState=new Ts(e.state||M.create(e)),e.scrollTo&&e.scrollTo.is(rs)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet($i).map(s=>new nn(s));for(let s of this.plugins)s.update(this);this.observer=new Ao(this),this.inputState=new vo(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Ps(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...e){let t=e.length==1&&e[0]instanceof ne?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,n=!1,s,r=this.state;for(let f of e){if(f.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=f.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;e.some(f=>f.annotation(sc))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=rc(r,o),a||(l=1));let O=this.observer.delayedAndroidKey,h=null;if(O?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(h=null)):this.observer.clear(),r.facet(M.phrases)!=this.state.facet(M.phrases))return this.setState(r);s=xs.create(this,r,e),s.flags|=l;let c=this.viewState.scrollTarget;try{this.updateState=2;for(let f of e){if(c&&(c=c.map(f.changes)),f.scrollIntoView){let{main:u}=f.state.selection;c=new tn(u.empty?u:Q.cursor(u.head,u.head>u.anchor?-1:1))}for(let u of f.effects)u.is(rs)&&(c=u.value.clip(this.state))}this.viewState.update(s,c),this.bidiCache=zs.update(this.bidiCache,s.changes),s.empty||(this.updatePlugins(s),this.inputState.update(s)),t=this.docView.update(s),this.state.facet(Ni)!=this.styleModules&&this.mountStyles(),n=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(f=>f.isUserEvent("select.pointer")))}finally{this.updateState=0}if(s.startState.facet(hs)!=s.state.facet(hs)&&(this.viewState.mustMeasureContent=!0),(t||n||c||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!s.empty)for(let f of this.state.facet(So))try{f(s)}catch(u){ce(this.state,u,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!Kh(this,h)&&O.force&&bi(this.contentDOM,O.key,O.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let n of this.plugins)n.destroy(this);this.viewState=new Ts(e),this.plugins=e.facet($i).map(n=>new nn(n)),this.pluginMap.clear();for(let n of this.plugins)n.update(this);this.docView.destroy(),this.docView=new Ps(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet($i),n=e.state.facet($i);if(t!=n){let s=[];for(let r of n){let o=t.indexOf(r);if(o<0)s.push(new nn(r));else{let l=this.plugins[o];l.mustUpdate=e,s.push(l)}}for(let r of this.plugins)r.mustUpdate!=e&&r.destroy(this);this.plugins=s,this.pluginMap.clear()}else for(let s of this.plugins)s.mustUpdate=e;for(let s=0;s-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,s=n.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(s-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(yh(n))r=-1,o=this.viewState.heightMap.height;else{let u=this.viewState.scrollAnchorAt(s);r=u.from,o=u.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(l>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let O=[];a&4||([this.measureRequests,O]=[O,this.measureRequests]);let h=O.map(u=>{try{return u.read(this)}catch(d){return ce(this.state,d),nh}}),c=xs.create(this,this.state,[]),f=!1;c.flags|=a,t?t.flags|=a:t=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),f=this.docView.update(c),f&&this.docViewUpdate());for(let u=0;u1||d<-1){s=s+d,n.scrollTop=s/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(So))l(t)}get themeClasses(){return Yo+" "+(this.state.facet(Co)?ac:lc)+" "+this.state.facet(hs)}updateAttrs(){let e=sh(this,Dh,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(bt)?"true":"false",class:"cm-content",style:`${z.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),sh(this,il,t);let n=this.observer.ignore(()=>{let s=go(this.contentDOM,this.contentAttrs,t),r=go(this.dom,this.editorAttrs,e);return s||r});return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let s of n.effects)if(s.is(i.announce)){t&&(this.announceDOM.textContent=""),t=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=s.value}}mountStyles(){this.styleModules=this.state.facet(Ni);let e=this.state.facet(i.cspNonce);je.mount(this.root,this.styleModules.concat(Rm).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;tn.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,n){return ro(this,e,MO(this,e,t,n))}moveByGroup(e,t){return ro(this,e,MO(this,e,t,n=>im(this,e.head,n)))}visualLineSide(e,t){let n=this.bidiSpans(e),s=this.textDirectionAt(e.from),r=n[t?n.length-1:0];return Q.cursor(r.side(t,s)+e.from,r.forward(!t,s)?1:-1)}moveToLineBoundary(e,t,n=!0){return tm(this,e,t,n)}moveVertically(e,t,n){return ro(this,e,nm(this,e,t,n))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),Hh(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let n=this.docView.coordsAt(e,t);if(!n||n.left==n.right)return n;let s=this.state.doc.lineAt(e),r=this.bidiSpans(s),o=r[ht.find(r,e-s.from,-1,t)];return Vs(n,o.dir==D.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(jh)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>Zm)return Zh(e.length);let t=this.textDirectionAt(e.from),n;for(let r of this.bidiCache)if(r.from==e.from&&r.dir==t&&(r.fresh||Wh(r.isolates,n=CO(this,e))))return r.order;n||(n=CO(this,e));let s=Ap(e.text,t,n);return this.bidiCache.push(new zs(e.from,e.to,t,n,!0,s)),s}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||z.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{$h(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return rs.of(new tn(typeof e=="number"?Q.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return rs.of(new tn(Q.cursor(n.from),"start","start",n.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return te.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return te.define(()=>({}),{eventObservers:e})}static theme(e,t){let n=je.newName(),s=[hs.of(n),Ni.of(_o(`.${n}`,e))];return t&&t.dark&&s.push(Co.of(!0)),s}static baseTheme(e){return Me.lowest(Ni.of(_o("."+Yo,e,Oc)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),s=n&&H.get(n)||H.get(e);return((t=s?.rootView)===null||t===void 0?void 0:t.view)||null}};k.styleModule=Ni;k.inputHandler=Uh;k.clipboardInputFilter=el;k.clipboardOutputFilter=tl;k.scrollHandler=Eh;k.focusChangeEffect=Mh;k.perLineTextDirection=jh;k.exceptionSink=Ah;k.updateListener=So;k.editable=bt;k.mouseSelectionStyle=_h;k.dragMovesSelection=Yh;k.clickAddsSelectionRange=Ch;k.decorations=dn;k.outerDecorations=Bh;k.atomicRanges=nl;k.bidiIsolatedRanges=Ih;k.scrollMargins=Nh;k.darkTheme=Co;k.cspNonce=T.define({combine:i=>i.length?i[0]:""});k.contentAttributes=il;k.editorAttributes=Dh;k.lineWrapping=k.contentAttributes.of({class:"cm-lineWrapping"});k.announce=q.define();var Zm=4096,nh={},zs=class i{constructor(e,t,n,s,r,o){this.from=e,this.to=t,this.dir=n,this.isolates=s,this.fresh=r,this.order=o}static update(e,t){if(t.empty&&!e.some(r=>r.fresh))return e;let n=[],s=e.length?e[e.length-1].dir:D.LTR;for(let r=Math.max(0,e.length-10);r=0;s--){let r=n[s],o=typeof r=="function"?r(i):r;o&&mo(o,t)}return t}var Vm=z.mac?"mac":z.windows?"win":z.linux?"linux":"key";function Cm(i,e){let t=i.split(/-(?!$)/),n=t[t.length-1];n=="Space"&&(n=" ");let s,r,o,l;for(let a=0;an.concat(s),[]))),t}function cc(i,e,t){return fc(hc(i.state),e,i,t)}var Tt=null,_m=4e3;function Am(i,e=Vm){let t=Object.create(null),n=Object.create(null),s=(o,l)=>{let a=n[o];if(a==null)n[o]=l;else if(a!=l)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},r=(o,l,a,O,h)=>{var c,f;let u=t[o]||(t[o]=Object.create(null)),d=l.split(/ (?!$)/).map($=>Cm($,e));for(let $=1;${let x=Tt={view:b,prefix:y,scope:o};return setTimeout(()=>{Tt==x&&(Tt=null)},_m),!0}]})}let m=d.join(" ");s(m,!1);let g=u[m]||(u[m]={preventDefault:!1,stopPropagation:!1,run:((f=(c=u._any)===null||c===void 0?void 0:c.run)===null||f===void 0?void 0:f.slice())||[]});a&&g.run.push(a),O&&(g.preventDefault=!0),h&&(g.stopPropagation=!0)};for(let o of i){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let O of l){let h=t[O]||(t[O]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:c}=o;for(let f in h)h[f].run.push(u=>c(u,Mo))}let a=o[e]||o.key;if(a)for(let O of l)r(O,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(O,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return t}var Mo=null;function fc(i,e,t,n){Mo=e;let s=wO(e),r=Oe(s,0),o=Xe(r)==s.length&&s!=" ",l="",a=!1,O=!1,h=!1;Tt&&Tt.view==t&&Tt.scope==n&&(l=Tt.prefix+" ",ec.indexOf(e.keyCode)<0&&(O=!0,Tt=null));let c=new Set,f=g=>{if(g){for(let $ of g.run)if(!c.has($)&&(c.add($),$(t)))return g.stopPropagation&&(h=!0),!0;g.preventDefault&&(g.stopPropagation&&(h=!0),O=!0)}return!1},u=i[n],d,m;return u&&(f(u[l+cs(s,e,!o)])?a=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(z.windows&&e.ctrlKey&&e.altKey)&&(d=St[e.keyCode])&&d!=s?(f(u[l+cs(d,e,!0)])||e.shiftKey&&(m=mi[e.keyCode])!=s&&m!=d&&f(u[l+cs(m,e,!1)]))&&(a=!0):o&&e.shiftKey&&f(u[l+cs(s,e,!0)])&&(a=!0),!a&&f(u._any)&&(a=!0)),O&&(a=!0),a&&h&&e.stopPropagation(),Mo=null,a}var pn=class i{constructor(e,t,n,s,r){this.className=e,this.left=t,this.top=n,this.width=s,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,n){if(n.empty){let s=e.coordsAtPos(n.head,n.assoc||1);if(!s)return[];let r=uc(e);return[new i(t,s.left-r.left,s.top-r.top,null,s.bottom-s.top)]}else return Um(e,t,n)}};function uc(i){let e=i.scrollDOM.getBoundingClientRect();return{left:(i.textDirection==D.LTR?e.left:e.right-i.scrollDOM.clientWidth*i.scaleX)-i.scrollDOM.scrollLeft*i.scaleX,top:e.top-i.scrollDOM.scrollTop*i.scaleY}}function oh(i,e,t,n){let s=i.coordsAtPos(e,t*2);if(!s)return n;let r=i.dom.getBoundingClientRect(),o=(s.top+s.bottom)/2,l=i.posAtCoords({x:r.left+1,y:o}),a=i.posAtCoords({x:r.right-1,y:o});return l==null||a==null?n:{from:Math.max(n.from,Math.min(l,a)),to:Math.min(n.to,Math.max(l,a))}}function Um(i,e,t){if(t.to<=i.viewport.from||t.from>=i.viewport.to)return[];let n=Math.max(t.from,i.viewport.from),s=Math.min(t.to,i.viewport.to),r=i.textDirection==D.LTR,o=i.contentDOM,l=o.getBoundingClientRect(),a=uc(i),O=o.querySelector(".cm-line"),h=O&&window.getComputedStyle(O),c=l.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),f=l.right-(h?parseInt(h.paddingRight):0),u=xo(i,n,1),d=xo(i,s,-1),m=u.type==Qe.Text?u:null,g=d.type==Qe.Text?d:null;if(m&&(i.lineWrapping||u.widgetLineBreaks)&&(m=oh(i,n,1,m)),g&&(i.lineWrapping||d.widgetLineBreaks)&&(g=oh(i,s,-1,g)),m&&g&&m.from==g.from&&m.to==g.to)return y(b(t.from,t.to,m));{let S=m?b(t.from,null,m):x(u,!1),P=g?b(null,t.to,g):x(d,!0),w=[];return(m||u).to<(g||d).from-(m&&g?1:0)||u.widgetLineBreaks>1&&S.bottom+i.defaultLineHeight/2W&&A.from=me)break;Ae>F&&C(Math.max(ae,F),S==null&&ae<=W,Math.min(Ae,me),P==null&&Ae>=E,ot.dir)}if(F=we.to+1,F>=me)break}return B.length==0&&C(W,S==null,E,P==null,i.textDirection),{top:V,bottom:_,horizontal:B}}function x(S,P){let w=l.top+(P?S.top:S.bottom);return{top:w,bottom:w,horizontal:[]}}}function Mm(i,e){return i.constructor==e.constructor&&i.eq(e)}var jo=class{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(gs)!=e.state.facet(gs)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}docViewUpdate(e){this.layer.updateOnDocViewUpdate!==!1&&e.requestMeasure(this.measureReq)}setOrder(e){let t=0,n=e.facet(gs);for(;t!Mm(t,this.drawn[n]))){let t=this.dom.firstChild,n=0;for(let s of e)s.update&&t&&s.constructor&&this.drawn[n].constructor&&s.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(s.draw(),t);for(;t;){let s=t.nextSibling;t.remove(),t=s}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}},gs=T.define();function dc(i){return[te.define(e=>new jo(e,i)),gs.of(i)]}var mn=T.define({combine(i){return de(i,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function pc(i={}){return[mn.of(i),jm,Gm,Em,Gh.of(!0)]}function mc(i){return i.startState.facet(mn)!=i.state.facet(mn)}var jm=dc({above:!0,markers(i){let{state:e}=i,t=e.facet(mn),n=[];for(let s of e.selection.ranges){let r=s==e.selection.main;if(s.empty||t.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=s.empty?s:Q.cursor(s.head,s.head>s.anchor?-1:1);for(let a of pn.forRange(i,o,l))n.push(a)}}return n},update(i,e){i.transactions.some(n=>n.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=mc(i);return t&&lh(i.state,e),i.docChanged||i.selectionSet||t},mount(i,e){lh(e.state,i)},class:"cm-cursorLayer"});function lh(i,e){e.style.animationDuration=i.facet(mn).cursorBlinkRate+"ms"}var Gm=dc({above:!1,markers(i){return i.state.selection.ranges.map(e=>e.empty?[]:pn.forRange(i,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(i,e){return i.docChanged||i.selectionSet||i.viewportChanged||mc(i)},class:"cm-selectionLayer"}),Em=Me.highest(k.theme({".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"},caretColor:"transparent !important"},".cm-content":{caretColor:"transparent !important","& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}})),gc=q.define({map(i,e){return i==null?null:e.mapPos(i)}}),Ki=J.define({create(){return null},update(i,e){return i!=null&&(i=e.changes.mapPos(i)),e.effects.reduce((t,n)=>n.is(gc)?n.value:t,i)}}),Lm=te.fromClass(class{constructor(i){this.view=i,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(i){var e;let t=i.state.field(Ki);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(i.startState.field(Ki)!=t||i.docChanged||i.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:i}=this,e=i.state.field(Ki),t=e!=null&&i.coordsAtPos(e);if(!t)return null;let n=i.scrollDOM.getBoundingClientRect();return{left:t.left-n.left+i.scrollDOM.scrollLeft*i.scaleX,top:t.top-n.top+i.scrollDOM.scrollTop*i.scaleY,height:t.bottom-t.top}}drawCursor(i){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;i?(this.cursor.style.left=i.left/e+"px",this.cursor.style.top=i.top/t+"px",this.cursor.style.height=i.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(i){this.view.state.field(Ki)!=i&&this.view.dispatch({effects:gc.of(i)})}},{eventObservers:{dragover(i){this.setDropPos(this.view.posAtCoords({x:i.clientX,y:i.clientY}))},dragleave(i){(i.target==this.view.contentDOM||!this.view.contentDOM.contains(i.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function $c(){return[Ki,Lm]}function ah(i,e,t,n,s){e.lastIndex=0;for(let r=i.iterRange(t,n),o=t,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=e.exec(r.value);)s(o+l.index,l)}function Dm(i,e){let t=i.visibleRanges;if(t.length==1&&t[0].from==i.viewport.from&&t[0].to==i.viewport.to)return t;let n=[];for(let{from:s,to:r}of t)s=Math.max(i.state.doc.lineAt(s).from,s-e),r=Math.min(i.state.doc.lineAt(r).to,r+e),n.length&&n[n.length-1].to>=s?n[n.length-1].to=r:n.push({from:s,to:r});return n}var Go=class{constructor(e){let{regexp:t,decoration:n,decorate:s,boundary:r,maxLength:o=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,s)this.addMatch=(l,a,O,h)=>s(h,O,O+l[0].length,l,a);else if(typeof n=="function")this.addMatch=(l,a,O,h)=>{let c=n(l,a,O);c&&h(O,O+l[0].length,c)};else if(n)this.addMatch=(l,a,O,h)=>h(O,O+l[0].length,n);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(e){let t=new ze,n=t.add.bind(t);for(let{from:s,to:r}of Dm(e,this.maxLength))ah(e.state.doc,this.regexp,s,r,(o,l)=>this.addMatch(l,e,o,n));return t.finish()}updateDeco(e,t){let n=1e9,s=-1;return e.docChanged&&e.changes.iterChanges((r,o,l,a)=>{a>=e.view.viewport.from&&l<=e.view.viewport.to&&(n=Math.min(l,n),s=Math.max(a,s))}),e.viewportMoved||s-n>1e3?this.createDeco(e.view):s>-1?this.updateRange(e.view,t.map(e.changes),n,s):t}updateRange(e,t,n,s){for(let r of e.visibleRanges){let o=Math.max(r.from,n),l=Math.min(r.to,s);if(l>=o){let a=e.state.doc.lineAt(o),O=a.toa.from;o--)if(this.boundary.test(a.text[o-1-a.from])){h=o;break}for(;lf.push($.range(m,g));if(a==O)for(this.regexp.lastIndex=h-a.from;(u=this.regexp.exec(a.text))&&u.indexthis.addMatch(g,e,m,d));t=t.update({filterFrom:h,filterTo:c,filter:(m,g)=>mc,add:f})}}return t}},Eo=/x/.unicode!=null?"gu":"g",Bm=new RegExp(`[\0-\b +-\x7F-\x9F\xAD\u061C\u200B\u200E\u200F\u2028\u2029\u202D\u202E\u2066\u2067\u2069\uFEFF\uFFF9-\uFFFC]`,Eo),Im={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"},lo=null;function Nm(){var i;if(lo==null&&typeof document<"u"&&document.body){let e=document.body.style;lo=((i=e.tabSize)!==null&&i!==void 0?i:e.MozTabSize)!=null}return lo||!1}var $s=T.define({combine(i){let e=de(i,{render:null,specialChars:Bm,addSpecialChars:null});return(e.replaceTabs=!Nm())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,Eo)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,Eo)),e}});function Qc(i={}){return[$s.of(i),Fm()]}var Oh=null;function Fm(){return Oh||(Oh=te.fromClass(class{constructor(i){this.view=i,this.decorations=X.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(i.state.facet($s)),this.decorations=this.decorator.createDeco(i)}makeDecorator(i){return new Go({regexp:i.specialChars,decoration:(e,t,n)=>{let{doc:s}=t.state,r=Oe(e[0],0);if(r==9){let o=s.lineAt(n),l=t.state.tabSize,a=yt(o.text,l,n-o.from);return X.replace({widget:new Do((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=X.replace({widget:new Lo(i,r)}))},boundary:i.replaceTabs?void 0:/[^]/})}update(i){let e=i.state.facet($s);i.startState.facet($s)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(i.view)):this.decorations=this.decorator.updateDeco(i,this.decorations)}},{decorations:i=>i.decorations}))}var Hm="\u2022";function Km(i){return i>=32?Hm:i==10?"\u2424":String.fromCharCode(9216+i)}var Lo=class extends xe{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=Km(this.code),n=e.state.phrase("Control character")+" "+(Im[this.code]||"0x"+this.code.toString(16)),s=this.options.render&&this.options.render(this.code,n,t);if(s)return s;let r=document.createElement("span");return r.textContent=t,r.title=n,r.setAttribute("aria-label",n),r.className="cm-specialChar",r}ignoreEvent(){return!1}},Do=class extends xe{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}};function yc(){return eg}var Jm=X.line({class:"cm-activeLine"}),eg=te.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.docChanged||i.selectionSet)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=-1,t=[];for(let n of i.state.selection.ranges){let s=i.lineBlockAt(n.head);s.from>e&&(t.push(Jm.range(s.from)),e=s.from)}return X.set(t)}},{decorations:i=>i.decorations});var Bo=2e3;function tg(i,e,t){let n=Math.min(e.line,t.line),s=Math.max(e.line,t.line),r=[];if(e.off>Bo||t.off>Bo||e.col<0||t.col<0){let o=Math.min(e.off,t.off),l=Math.max(e.off,t.off);for(let a=n;a<=s;a++){let O=i.doc.line(a);O.length<=l&&r.push(Q.range(O.from+o,O.to+l))}}else{let o=Math.min(e.col,t.col),l=Math.max(e.col,t.col);for(let a=n;a<=s;a++){let O=i.doc.line(a),h=is(O.text,o,i.tabSize,!0);if(h<0)r.push(Q.cursor(O.to));else{let c=is(O.text,l,i.tabSize);r.push(Q.range(O.from+h,O.from+c))}}}return r}function ig(i,e){let t=i.coordsAtPos(i.viewport.from);return t?Math.round(Math.abs((t.left-e)/i.defaultCharacterWidth)):-1}function hh(i,e){let t=i.posAtCoords({x:e.clientX,y:e.clientY},!1),n=i.state.doc.lineAt(t),s=t-n.from,r=s>Bo?-1:s==n.length?ig(i,e.clientX):yt(n.text,i.state.tabSize,t-n.from);return{line:n.number,col:r,off:s}}function ng(i,e){let t=hh(i,e),n=i.state.selection;return t?{update(s){if(s.docChanged){let r=s.changes.mapPos(s.startState.doc.line(t.line).from),o=s.state.doc.lineAt(r);t={line:o.number,col:t.col,off:Math.min(t.off,o.length)},n=n.map(s.changes)}},get(s,r,o){let l=hh(i,s);if(!l)return n;let a=tg(i.state,t,l);return a.length?o?Q.create(a.concat(n.ranges)):Q.create(a):n}}:null}function Sc(i){let e=i?.eventFilter||(t=>t.altKey&&t.button==0);return k.mouseSelectionStyle.of((t,n)=>e(n)?ng(t,n):null)}var sg={Alt:[18,i=>!!i.altKey],Control:[17,i=>!!i.ctrlKey],Shift:[16,i=>!!i.shiftKey],Meta:[91,i=>!!i.metaKey]},rg={style:"cursor: crosshair"};function bc(i={}){let[e,t]=sg[i.key||"Alt"],n=te.fromClass(class{constructor(s){this.view=s,this.isDown=!1}set(s){this.isDown!=s&&(this.isDown=s,this.view.update([]))}},{eventObservers:{keydown(s){this.set(s.keyCode==e||t(s))},keyup(s){(s.keyCode==e||!t(s))&&this.set(!1)},mousemove(s){this.set(t(s))}}});return[n,k.contentAttributes.of(s=>{var r;return!((r=s.plugin(n))===null||r===void 0)&&r.isDown?rg:null})]}var Ii="-10000px",Xs=class{constructor(e,t,n,s){this.facet=t,this.createTooltipView=n,this.removeTooltipView=s,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let r=null;this.tooltipViews=this.tooltips.map(o=>r=n(o,r))}update(e,t){var n;let s=e.state.facet(this.facet),r=s.filter(a=>a);if(s===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let o=[],l=t?[]:null;for(let a=0;at[O]=a),t.length=l.length),this.input=s,this.tooltips=r,this.tooltipViews=o,!0}};function og(i){let e=i.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}var ao=T.define({combine:i=>{var e,t,n;return{position:z.ios?"absolute":((e=i.find(s=>s.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=i.find(s=>s.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((n=i.find(s=>s.tooltipSpace))===null||n===void 0?void 0:n.tooltipSpace)||og}}}),ch=new WeakMap,ol=te.fromClass(class{constructor(i){this.view=i,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=i.state.facet(ao);this.position=e.position,this.parent=e.parent,this.classes=i.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new Xs(i,gn,(t,n)=>this.createTooltip(t,n),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),i.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let i of this.manager.tooltipViews)this.intersectionObserver.observe(i.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(i){i.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(i,this.above);e&&this.observeIntersection();let t=e||i.geometryChanged,n=i.state.facet(ao);if(n.position!=this.position&&!this.madeAbsolute){this.position=n.position;for(let s of this.manager.tooltipViews)s.dom.style.position=this.position;t=!0}if(n.parent!=this.parent){this.parent&&this.container.remove(),this.parent=n.parent,this.createContainer();for(let s of this.manager.tooltipViews)this.container.appendChild(s.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(i,e){let t=i.create(this.view),n=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),i.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let s=document.createElement("div");s.className="cm-tooltip-arrow",t.dom.appendChild(s)}return t.dom.style.position=this.position,t.dom.style.top=Ii,t.dom.style.left="0px",this.container.insertBefore(t.dom,n),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var i,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),(i=n.destroy)===null||i===void 0||i.call(n);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let i=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(z.gecko)t=r.offsetParent!=this.container.ownerDocument.body;else if(r.style.top==Ii&&r.style.left=="0px"){let o=r.getBoundingClientRect();t=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}}if(t||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(i=r.width/this.parent.offsetWidth,e=r.height/this.parent.offsetHeight)}else({scaleX:i,scaleY:e}=this.view.viewState);let n=this.view.scrollDOM.getBoundingClientRect(),s=sl(this.view);return{visible:{left:n.left+s.left,top:n.top+s.top,right:n.right-s.right,bottom:n.bottom-s.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((r,o)=>{let l=this.manager.tooltipViews[o];return l.getCoords?l.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(ao).tooltipSpace(this.view),scaleX:i,scaleY:e,makeAbsolute:t}}writeMeasure(i){var e;if(i.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{visible:t,space:n,scaleX:s,scaleY:r}=i,o=[];for(let l=0;l=Math.min(t.bottom,n.bottom)||c.rightMath.min(t.right,n.right)+.1)){h.style.top=Ii;continue}let u=a.arrow?O.dom.querySelector(".cm-tooltip-arrow"):null,d=u?7:0,m=f.right-f.left,g=(e=ch.get(O))!==null&&e!==void 0?e:f.bottom-f.top,$=O.offset||ag,y=this.view.textDirection==D.LTR,b=f.width>n.right-n.left?y?n.left:n.right-f.width:y?Math.max(n.left,Math.min(c.left-(u?14:0)+$.x,n.right-m)):Math.min(Math.max(n.left,c.left-m+(u?14:0)-$.x),n.right-m),x=this.above[l];!a.strictSide&&(x?c.top-g-d-$.yn.bottom)&&x==n.bottom-c.bottom>c.top-n.top&&(x=this.above[l]=!x);let S=(x?c.top-n.top:n.bottom-c.bottom)-d;if(Sb&&V.topP&&(P=x?V.top-g-2-d:V.bottom+d+2);if(this.position=="absolute"?(h.style.top=(P-i.parent.top)/r+"px",fh(h,(b-i.parent.left)/s)):(h.style.top=P/r+"px",fh(h,b/s)),u){let V=c.left+(y?$.x:-$.x)-(b+14-7);u.style.left=V/s+"px"}O.overlap!==!0&&o.push({left:b,top:P,right:w,bottom:P+g}),h.classList.toggle("cm-tooltip-above",x),h.classList.toggle("cm-tooltip-below",!x),O.positioned&&O.positioned(i.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let i of this.manager.tooltipViews)i.dom.style.top=Ii}},{eventObservers:{scroll(){this.maybeMeasure()}}});function fh(i,e){let t=parseInt(i.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(i.style.left=e+"px")}var lg=k.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:`${7*2}px`,position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),ag={x:0,y:0},gn=T.define({enables:[ol,lg]}),Rs=T.define({combine:i=>i.reduce((e,t)=>e.concat(t),[])}),qs=class i{static create(e){return new i(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new Xs(e,Rs,(t,n)=>this.createHostedView(t,n),t=>t.dom.remove())}createHostedView(e,t){let n=e.create(this.view);return n.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(n.dom,t?t.dom.nextSibling:this.dom.firstChild),this.mounted&&n.mount&&n.mount(this.view),n}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let s=n[e];if(s!==void 0){if(t===void 0)t=s;else if(t!==s)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}},Og=gn.compute([Rs],i=>{let e=i.facet(Rs);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.map(t=>{var n;return(n=t.end)!==null&&n!==void 0?n:t.pos})),create:qs.create,above:e[0].above,arrow:e.some(t=>t.arrow)}}),Io=class{constructor(e,t,n,s,r){this.view=e,this.source=t,this.field=n,this.setHover=s,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active.length)return;let e=Date.now()-this.lastMove.time;el.bottom||t.xl.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(s)).find(h=>h.from<=s&&h.to>=s),O=a&&a.dir==D.RTL?-1:1;r=t.x{this.pending==l&&(this.pending=null,a&&!(Array.isArray(a)&&!a.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])}))},a=>ce(e.state,a,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&e.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let e=this.view.plugin(ol),t=e?e.manager.tooltips.findIndex(n=>n.create==qs.create):-1;return t>-1?e.manager.tooltipViews[t]:null}mousemove(e){var t,n;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:s,tooltip:r}=this;if(s.length&&r&&!hg(r.dom,e)||this.pending){let{pos:o}=s[0]||this.pending,l=(n=(t=s[0])===null||t===void 0?void 0:t.end)!==null&&n!==void 0?n:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!cg(this.view,o,l,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t.length){let{tooltip:n}=this;n&&n.dom.contains(e.relatedTarget)?this.watchTooltipLeave(n.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active.length&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}},fs=4;function hg(i,e){let{left:t,right:n,top:s,bottom:r}=i.getBoundingClientRect(),o;if(o=i.querySelector(".cm-tooltip-arrow")){let l=o.getBoundingClientRect();s=Math.min(l.top,s),r=Math.max(l.bottom,r)}return e.clientX>=t-fs&&e.clientX<=n+fs&&e.clientY>=s-fs&&e.clientY<=r+fs}function cg(i,e,t,n,s,r){let o=i.scrollDOM.getBoundingClientRect(),l=i.documentTop+i.documentPadding.top+i.contentHeight;if(o.left>n||o.rights||Math.min(o.bottom,l)=e&&a<=t}function xc(i,e={}){let t=q.define(),n=J.define({create(){return[]},update(s,r){if(s.length&&(e.hideOnChange&&(r.docChanged||r.selection)?s=[]:e.hideOn&&(s=s.filter(o=>!e.hideOn(r,o))),r.docChanged)){let o=[];for(let l of s){let a=r.changes.mapPos(l.pos,-1,oe.TrackDel);if(a!=null){let O=Object.assign(Object.create(null),l);O.pos=a,O.end!=null&&(O.end=r.changes.mapPos(O.end)),o.push(O)}}s=o}for(let o of r.effects)o.is(t)&&(s=o.value),o.is(fg)&&(s=[]);return s},provide:s=>Rs.from(s)});return{active:n,extension:[n,te.define(s=>new Io(s,i,n,t,e.hoverTime||300)),Og]}}function ll(i,e){let t=i.plugin(ol);if(!t)return null;let n=t.manager.tooltips.indexOf(e);return n<0?null:t.manager.tooltipViews[n]}var fg=q.define();var uh=T.define({combine(i){let e,t;for(let n of i)e=e||n.topContainer,t=t||n.bottomContainer;return{topContainer:e,bottomContainer:t}}});function ei(i,e){let t=i.plugin(Pc),n=t?t.specs.indexOf(e):-1;return n>-1?t.panels[n]:null}var Pc=te.fromClass(class{constructor(i){this.input=i.state.facet(Jt),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(i));let e=i.state.facet(uh);this.top=new yi(i,!0,e.topContainer),this.bottom=new yi(i,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(i){let e=i.state.facet(uh);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new yi(i.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new yi(i.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=i.state.facet(Jt);if(t!=this.input){let n=t.filter(a=>a),s=[],r=[],o=[],l=[];for(let a of n){let O=this.specs.indexOf(a),h;O<0?(h=a(i.view),l.push(h)):(h=this.panels[O],h.update&&h.update(i)),s.push(h),(h.top?r:o).push(h)}this.specs=n,this.panels=s,this.top.sync(r),this.bottom.sync(o);for(let a of l)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let n of this.panels)n.update&&n.update(i)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:i=>k.scrollMargins.of(e=>{let t=e.plugin(i);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})}),yi=class{constructor(e,t,n){this.view=e,this.top=t,this.container=n,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=dh(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=dh(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}};function dh(i){let e=i.nextSibling;return i.remove(),e}var Jt=T.define({enables:Pc});var qe=class extends He{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}};qe.prototype.elementClass="";qe.prototype.toDOM=void 0;qe.prototype.mapMode=oe.TrackBefore;qe.prototype.startSide=qe.prototype.endSide=-1;qe.prototype.point=!0;var Qs=T.define(),ug=T.define(),dg={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>j.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},rn=T.define();function al(i){return[kc(),rn.of({...dg,...i})]}var No=T.define({combine:i=>i.some(e=>e)});function kc(i){let e=[pg];return i&&i.fixed===!1&&e.push(No.of(!0)),e}var pg=te.fromClass(class{constructor(i){this.view=i,this.prevViewport=i.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=i.state.facet(rn).map(e=>new Ws(i,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!i.state.facet(No),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),i.scrollDOM.insertBefore(this.dom,i.contentDOM)}update(i){if(this.updateGutters(i)){let e=this.prevViewport,t=i.view.viewport,n=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(n<(t.to-t.from)*.8)}i.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px"),this.view.state.facet(No)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=i.view.viewport}syncGutters(i){let e=this.dom.nextSibling;i&&this.dom.remove();let t=j.iter(this.view.state.facet(Qs),this.view.viewport.from),n=[],s=this.gutters.map(r=>new Ho(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(n.length&&(n=[]),Array.isArray(r.type)){let o=!0;for(let l of r.type)if(l.type==Qe.Text&&o){Fo(t,n,l.from);for(let a of s)a.line(this.view,l,n);o=!1}else if(l.widget)for(let a of s)a.widget(this.view,l)}else if(r.type==Qe.Text){Fo(t,n,r.from);for(let o of s)o.line(this.view,r,n)}else if(r.widget)for(let o of s)o.widget(this.view,r);for(let r of s)r.finish();i&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(i){let e=i.startState.facet(rn),t=i.state.facet(rn),n=i.docChanged||i.heightChanged||i.viewportChanged||!j.eq(i.startState.facet(Qs),i.state.facet(Qs),i.view.viewport.from,i.view.viewport.to);if(e==t)for(let s of this.gutters)s.update(i)&&(n=!0);else{n=!0;let s=[];for(let r of t){let o=e.indexOf(r);o<0?s.push(new Ws(this.view,r)):(this.gutters[o].update(i),s.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),s.indexOf(r)<0&&r.destroy();for(let r of s)this.dom.appendChild(r.dom);this.gutters=s}return n}destroy(){for(let i of this.gutters)i.destroy();this.dom.remove()}},{provide:i=>k.scrollMargins.of(e=>{let t=e.plugin(i);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==D.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function ph(i){return Array.isArray(i)?i:[i]}function Fo(i,e,t){for(;i.value&&i.from<=t;)i.from==t&&e.push(i.value),i.next()}var Ho=class{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=j.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:s}=this,r=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==s.elements.length){let l=new Zs(e,o,r,n);s.elements.push(l),s.dom.appendChild(l.dom)}else s.elements[this.i].update(e,o,r,n);this.height=t.bottom,this.i++}line(e,t,n){let s=[];Fo(this.cursor,s,t.from),n.length&&(s=s.concat(n));let r=this.gutter.config.lineMarker(e,t,s);r&&s.unshift(r);let o=this.gutter;s.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,s)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t),s=n?[n]:null;for(let r of e.state.facet(ug)){let o=r(e,t.widget,t);o&&(s||(s=[])).push(o)}s&&this.addElement(e,t,s)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}},Ws=class{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let n in t.domEventHandlers)this.dom.addEventListener(n,s=>{let r=s.target,o;if(r!=this.dom&&this.dom.contains(r)){for(;r.parentNode!=this.dom;)r=r.parentNode;let a=r.getBoundingClientRect();o=(a.top+a.bottom)/2}else o=s.clientY;let l=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[n](e,l,s)&&s.preventDefault()});this.markers=ph(t.markers(e)),t.initialSpacer&&(this.spacer=new Zs(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=ph(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let s=this.config.updateSpacer(this.spacer.markers[0],e);s!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[s])}let n=e.view.viewport;return!j.eq(this.markers,t,n.from,n.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}},Zs=class{constructor(e,t,n,s){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,s)}update(e,t,n,s){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),mg(this.markers,s)||this.setMarkers(e,s)}setMarkers(e,t){let n="cm-gutterElement",s=this.dom.firstChild;for(let r=0,o=0;;){let l=o,a=rr(l,a,O)||o(l,a,O):o}return n}})}}),on=class extends qe{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}};function Oo(i,e){return i.state.facet(Si).formatNumber(e,i.state)}var Qg=rn.compute([Si],i=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(gg)},lineMarker(e,t,n){return n.some(s=>s.toDOM)?null:new on(Oo(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,n)=>{for(let s of e.state.facet($g)){let r=s(e,t,n);if(r)return r}return null},lineMarkerChange:e=>e.startState.facet(Si)!=e.state.facet(Si),initialSpacer(e){return new on(Oo(e,mh(e.state.doc.lines)))},updateSpacer(e,t){let n=Oo(t.view,mh(t.view.state.doc.lines));return n==e.number?e:new on(n)},domEventHandlers:i.facet(Si).domEventHandlers}));function vc(i={}){return[Si.of(i),kc(),Qg]}function mh(i){let e=9;for(;e{let e=[],t=-1;for(let n of i.selection.ranges){let s=i.doc.lineAt(n.head).from;s>t&&(t=s,e.push(yg.range(s)))}return j.of(e)});function wc(){return Sg}var bg=0,Pe=class{constructor(e,t){this.from=e,this.to=t}},Z=class{constructor(e={}){this.id=bg++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=fe.match(e)),t=>{let n=e(t);return n===void 0?null:[this,n]}}};Z.closedBy=new Z({deserialize:i=>i.split(" ")});Z.openedBy=new Z({deserialize:i=>i.split(" ")});Z.group=new Z({deserialize:i=>i.split(" ")});Z.isolate=new Z({deserialize:i=>{if(i&&i!="rtl"&&i!="ltr"&&i!="auto")throw new RangeError("Invalid value for isolate: "+i);return i||"auto"}});Z.contextHash=new Z({perNode:!0});Z.lookAhead=new Z({perNode:!0});Z.mounted=new Z({perNode:!0});var ti=class{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[Z.mounted.id]}},xg=Object.create(null),fe=class i{constructor(e,t,n,s=0){this.name=e,this.props=t,this.id=n,this.flags=s}static define(e){let t=e.props&&e.props.length?Object.create(null):xg,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),s=new i(e.name||"",t,e.id,n);if(e.props){for(let r of e.props)if(Array.isArray(r)||(r=r(s)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}}return s}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(Z.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let s of n.split(" "))t[s]=e[n];return n=>{for(let s=n.prop(Z.group),r=-1;r<(s?s.length:0);r++){let o=t[r<0?n.name:s[r]];if(o)return o}}}};fe.none=new fe("",Object.create(null),0,8);var $n=class i{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(o|G.IncludeAnonymous);;){let O=!1;if(a.from<=r&&a.to>=s&&(!l&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;O=!0}for(;O&&n&&(l||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;O=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:Ql(fe.none,this.children,this.positions,0,this.children.length,0,this.length,(t,n,s)=>new i(this.type,t,n,s,this.propValues),e.makeTree||((t,n,s)=>new i(fe.none,t,n,s)))}static build(e){return kg(e)}};ee.empty=new ee(fe.none,[],[],0);var Ol=class i{constructor(e,t){this.buffer=e,this.index=t}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 i(this.buffer,this.index)}},Zt=class i{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return fe.none}toString(){let e=[];for(let t=0;t0));a=o[a+3]);return l}slice(e,t,n){let s=this.buffer,r=new Uint16Array(t-e),o=0;for(let l=e,a=0;l=e&&te;case 1:return t<=e&&n>e;case 2:return n>e;case 4:return!0}}function Qn(i,e,t,n){for(var s;i.from==i.to||(t<1?i.from>=e:i.from>e)||(t>-1?i.to<=e:i.to0?l.length:-1;e!=O;e+=t){let h=l[e],c=a[e]+o.from;if(Vc(s,n,c,c+h.length)){if(h instanceof Zt){if(r&G.ExcludeBuffers)continue;let f=h.findChild(0,h.buffer.length,t,n-c,s);if(f>-1)return new ii(new cl(o,h,e,c),null,f)}else if(r&G.IncludeAnonymous||!h.type.isAnonymous||$l(h)){let f;if(!(r&G.IgnoreMounts)&&(f=ti.get(h))&&!f.overlay)return new i(f.tree,c,e,o);let u=new i(h,c,e,o);return r&G.IncludeAnonymous||!u.type.isAnonymous?u:u.nextChild(t<0?h.children.length-1:0,t,n,s)}}}if(r&G.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}enter(e,t,n=0){let s;if(!(n&G.IgnoreOverlays)&&(s=ti.get(this._tree))&&s.overlay){let r=e-this.from;for(let{from:o,to:l}of s.overlay)if((t>0?o<=r:o=r:l>r))return new i(s.tree,s.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}};function zc(i,e,t,n){let s=i.cursor(),r=[];if(!s.firstChild())return r;if(t!=null){for(let o=!1;!o;)if(o=s.type.is(t),!s.nextSibling())return r}for(;;){if(n!=null&&s.type.is(n))return r;if(s.type.is(e)&&r.push(s.node),!s.nextSibling())return n==null?r:[]}}function hl(i,e,t=e.length-1){for(let n=i;t>=0;n=n.parent){if(!n)return!1;if(!n.type.isAnonymous){if(e[t]&&e[t]!=n.name)return!1;t--}}return!0}var cl=class{constructor(e,t,n,s){this.parent=e,this.buffer=t,this.index=n,this.start=s}},ii=class i extends Us{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new i(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}enter(e,t,n=0){if(n&G.ExcludeBuffers)return null;let{buffer:s}=this.context,r=s.findChild(this.index+4,s.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new i(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new i(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new i(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,s=this.index+4,r=n.buffer[this.index+3];if(r>s){let o=n.buffer[this.index+1];e.push(n.slice(s,r,o)),t.push(0)}return new ee(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function Cc(i){if(!i.length)return null;let e=0,t=i[0];for(let r=1;rt.from||o.to=e){let l=new ke(o.tree,o.overlay[0].from+r.from,-1,r);(s||(s=[n])).push(Qn(l,e,t,!1))}}return s?Cc(s):n}var Pi=class{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof ke)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let n=e._parent;n;n=n._parent)this.stack.unshift(n.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:n,buffer:s}=this.buffer;return this.type=t||s.set.types[s.buffer[e]],this.from=n+s.buffer[e+1],this.to=n+s.buffer[e+2],!0}yield(e){return e?e instanceof ke?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,n){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,n,this.mode));let{buffer:s}=this.buffer,r=s.findChild(this.index+4,s.buffer[this.index+3],e,t-this.buffer.start,n);return r<0?!1:(this.stack.push(this.index),this.yieldBuf(r))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,n=this.mode){return this.buffer?n&G.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,n))}parent(){if(!this.buffer)return this.yieldNode(this.mode&G.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&G.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,n=this.stack.length-1;if(e<0){let s=n<0?0:this.stack[n]+4;if(this.index!=s)return this.yieldBuf(t.findChild(s,this.index,-1,0,4))}else{let s=t.buffer[this.index+3];if(s<(n<0?t.buffer.length:t.buffer[this.stack[n]+3]))return this.yieldBuf(s)}return n<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,n,{buffer:s}=this;if(s){if(e>0){if(this.index-1)for(let r=t+e,o=e<0?-1:n._tree.children.length;r!=o;r+=e){let l=n._tree.children[r];if(this.mode&G.IncludeAnonymous||l instanceof Zt||!l.type.isAnonymous||$l(l))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to=0;){for(let o=e;o;o=o._parent)if(o.index==s){if(s==this.index)return o;t=o,n=r+1;break e}s=this.stack[--r]}for(let s=n;s=0;r--){if(r<0)return hl(this._tree,e,s);let o=n[t.buffer[this.stack[r]]];if(!o.isAnonymous){if(e[s]&&e[s]!=o.name)return!1;s--}}return!0}};function $l(i){return i.children.some(e=>e instanceof Zt||!e.type.isAnonymous||$l(e))}function kg(i){var e;let{buffer:t,nodeSet:n,maxBufferLength:s=1024,reused:r=[],minRepeatType:o=n.types.length}=i,l=Array.isArray(t)?new Ol(t,t.length):t,a=n.types,O=0,h=0;function c(S,P,w,V,_,B){let{id:C,start:W,end:E,size:A}=l,F=h,me=O;for(;A<0;)if(l.next(),A==-1){let $t=r[C];w.push($t),V.push(W-S);return}else if(A==-3){O=C;return}else if(A==-4){h=C;return}else throw new RangeError(`Unrecognized record size: ${A}`);let we=a[C],ot,ae,Ae=W-S;if(E-W<=s&&(ae=g(l.pos-P,_))){let $t=new Uint16Array(ae.size-ae.skip),Ue=l.pos-ae.size,lt=$t.length;for(;l.pos>Ue;)lt=$(ae.start,$t,lt);ot=new Zt($t,E-ae.start,n),Ae=ae.start-S}else{let $t=l.pos-A;l.next();let Ue=[],lt=[],Et=C>=o?C:-1,hi=0,En=E;for(;l.pos>$t;)Et>=0&&l.id==Et&&l.size>=0?(l.end<=En-s&&(d(Ue,lt,W,hi,l.end,En,Et,F,me),hi=Ue.length,En=l.end),l.next()):B>2500?f(W,$t,Ue,lt):c(W,$t,Ue,lt,Et,B+1);if(Et>=0&&hi>0&&hi-1&&hi>0){let eO=u(we,me);ot=Ql(we,Ue,lt,0,Ue.length,0,E-W,eO,eO)}else ot=m(we,Ue,lt,E-W,F-E,me)}w.push(ot),V.push(Ae)}function f(S,P,w,V){let _=[],B=0,C=-1;for(;l.pos>P;){let{id:W,start:E,end:A,size:F}=l;if(F>4)l.next();else{if(C>-1&&E=0;A-=3)W[F++]=_[A],W[F++]=_[A+1]-E,W[F++]=_[A+2]-E,W[F++]=F;w.push(new Zt(W,_[2]-E,n)),V.push(E-S)}}function u(S,P){return(w,V,_)=>{let B=0,C=w.length-1,W,E;if(C>=0&&(W=w[C])instanceof ee){if(!C&&W.type==S&&W.length==_)return W;(E=W.prop(Z.lookAhead))&&(B=V[C]+W.length+E)}return m(S,w,V,_,B,P)}}function d(S,P,w,V,_,B,C,W,E){let A=[],F=[];for(;S.length>V;)A.push(S.pop()),F.push(P.pop()+w-_);S.push(m(n.types[C],A,F,B-_,W-B,E)),P.push(_-w)}function m(S,P,w,V,_,B,C){if(B){let W=[Z.contextHash,B];C=C?[W].concat(C):[W]}if(_>25){let W=[Z.lookAhead,_];C=C?[W].concat(C):[W]}return new ee(S,P,w,V,C)}function g(S,P){let w=l.fork(),V=0,_=0,B=0,C=w.end-s,W={size:0,start:0,skip:0};e:for(let E=w.pos-S;w.pos>E;){let A=w.size;if(w.id==P&&A>=0){W.size=V,W.start=_,W.skip=B,B+=4,V+=4,w.next();continue}let F=w.pos-A;if(A<0||F=o?4:0,we=w.start;for(w.next();w.pos>F;){if(w.size<0)if(w.size==-3)me+=4;else break e;else w.id>=o&&(me+=4);w.next()}_=we,V+=A,B+=me}return(P<0||V==S)&&(W.size=V,W.start=_,W.skip=B),W.size>4?W:void 0}function $(S,P,w){let{id:V,start:_,end:B,size:C}=l;if(l.next(),C>=0&&V4){let E=l.pos-(C-4);for(;l.pos>E;)w=$(S,P,w)}P[--w]=W,P[--w]=B-S,P[--w]=_-S,P[--w]=V}else C==-3?O=V:C==-4&&(h=V);return w}let y=[],b=[];for(;l.pos>0;)c(i.start||0,i.bufferStart||0,y,b,-1,0);let x=(e=i.length)!==null&&e!==void 0?e:y.length?b[0]+y[0].length:0;return new ee(a[i.topID],y.reverse(),b.reverse(),x)}var Xc=new WeakMap;function As(i,e){if(!i.isAnonymous||e instanceof Zt||e.type!=i)return 1;let t=Xc.get(e);if(t==null){t=1;for(let n of e.children){if(n.type!=i||!(n instanceof ee)){t=1;break}t+=As(i,n)}Xc.set(e,t)}return t}function Ql(i,e,t,n,s,r,o,l,a){let O=0;for(let d=n;d=h)break;P+=w}if(b==x+1){if(P>h){let w=d[x];u(w.children,w.positions,0,w.children.length,m[x]+y);continue}c.push(d[x])}else{let w=m[b-1]+d[b-1].length-S;c.push(Ql(i,d,m,x,b,S,w,null,a))}f.push(S+y-r)}}return u(e,t,n,s,0),(l||a)(c,f,o)}var ki=class{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let s=this.map.get(e);s||this.map.set(e,s=new Map),s.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof ii?this.setBuffer(e.context.buffer,e.index,t):e instanceof ke&&this.map.set(e.tree,t)}get(e){return e instanceof ii?this.getBuffer(e.context.buffer,e.index):e instanceof ke?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}},xt=class i{constructor(e,t,n,s,r=!1,o=!1){this.from=e,this.to=t,this.tree=n,this.offset=s,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],n=!1){let s=[new i(0,e.length,e,0,!1,n)];for(let r of t)r.to>e.length&&s.push(r);return s}static applyChanges(e,t,n=128){if(!t.length)return e;let s=[],r=1,o=e.length?e[0]:null;for(let l=0,a=0,O=0;;l++){let h=l=n)for(;o&&o.from=f.from||c<=f.to||O){let u=Math.max(f.from,a)-O,d=Math.min(f.to,c)-O;f=u>=d?null:new i(u,d,f.tree,f.offset+O,l>0,!!h)}if(f&&s.push(f),o.to>c)break;o=rnew Pe(s.from,s.to)):[new Pe(0,0)]:[new Pe(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let s=this.startParse(e,t,n);for(;;){let r=s.advance();if(r)return r}}},ul=class{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}};function Gs(i){return(e,t,n,s)=>new ml(e,i,t,n,s)}var Ms=class{constructor(e,t,n,s,r){this.parser=e,this.parse=t,this.overlay=n,this.target=s,this.from=r}};function Rc(i){if(!i.length||i.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(i))}var dl=class{constructor(e,t,n,s,r,o,l){this.parser=e,this.predicate=t,this.mounts=n,this.index=s,this.start=r,this.target=o,this.prev=l,this.depth=0,this.ranges=[]}},pl=new Z({perNode:!0}),ml=class{constructor(e,t,n,s,r){this.nest=t,this.input=n,this.fragments=s,this.ranges=r,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let n=this.baseParse.advance();if(!n)return null;if(this.baseParse=null,this.baseTree=n,this.startInner(),this.stoppedAt!=null)for(let s of this.inner)s.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let n=this.baseTree;return this.stoppedAt!=null&&(n=new ee(n.type,n.children,n.positions,n.length,n.propValues.concat([[pl,this.stoppedAt]]))),n}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let n=Object.assign(Object.create(null),e.target.props);n[Z.mounted.id]=new ti(t,e.overlay,e.parser),e.target.props=n}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)l=!1;else if(e.hasNode(s)){if(t){let O=t.mounts.find(h=>h.frag.from<=s.from&&h.frag.to>=s.to&&h.mount.overlay);if(O)for(let h of O.mount.overlay){let c=h.from+O.pos,f=h.to+O.pos;c>=s.from&&f<=s.to&&!t.ranges.some(u=>u.fromc)&&t.ranges.push({from:c,to:f})}}l=!1}else if(n&&(o=vg(n.ranges,s.from,s.to)))l=o!=2;else if(!s.type.isAnonymous&&(r=this.nest(s,this.input))&&(s.fromnew Pe(c.from-s.from,c.to-s.from)):null,s.tree,h.length?h[0].from:s.from)),r.overlay?h.length&&(n={ranges:h,depth:0,prev:n}):l=!1}}else if(t&&(a=t.predicate(s))&&(a===!0&&(a=new Pe(s.from,s.to)),a.from=0&&t.ranges[O].to==a.from?t.ranges[O]={from:t.ranges[O].from,to:a.to}:t.ranges.push(a)}if(l&&s.firstChild())t&&t.depth++,n&&n.depth++;else for(;!s.nextSibling();){if(!s.parent())break e;if(t&&!--t.depth){let O=Wc(this.ranges,t.ranges);O.length&&(Rc(O),this.inner.splice(t.index,0,new Ms(t.parser,t.parser.startParse(this.input,Zc(t.mounts,O),O),t.ranges.map(h=>new Pe(h.from-t.start,h.to-t.start)),t.target,O[0].from))),t=t.prev}n&&!--n.depth&&(n=n.prev)}}}};function vg(i,e,t){for(let n of i){if(n.from>=t)break;if(n.to>e)return n.from<=e&&n.to>=t?2:1}return 0}function qc(i,e,t,n,s,r){if(e=e&&t.enter(n,1,G.IgnoreOverlays|G.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof ee)t=t.children[0];else break}return!1}},gl=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let n=this.curFrag=e[0];this.curTo=(t=n.tree.prop(pl))!==null&&t!==void 0?t:n.to,this.inner=new js(n.tree,-n.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(pl))!==null&&e!==void 0?e:t.to,this.inner=new js(t.tree,-t.offset)}}findMounts(e,t){var n;let s=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let r=this.inner.cursor.node;r;r=r.parent){let o=(n=r.tree)===null||n===void 0?void 0:n.prop(Z.mounted);if(o&&o.parser==t)for(let l=this.fragI;l=r.to)break;a.tree==this.curFrag.tree&&s.push({frag:a,pos:r.from-a.offset,mount:o})}}}return s}};function Wc(i,e){let t=null,n=e;for(let s=1,r=0;s=l)break;a.to<=o||(t||(n=t=e.slice()),a.froml&&t.splice(r+1,0,new Pe(l,a.to))):a.to>l?t[r--]=new Pe(l,a.to):t.splice(r--,1))}}return n}function Tg(i,e,t,n){let s=0,r=0,o=!1,l=!1,a=-1e9,O=[];for(;;){let h=s==i.length?1e9:o?i[s].to:i[s].from,c=r==e.length?1e9:l?e[r].to:e[r].from;if(o!=l){let f=Math.max(a,t),u=Math.min(h,c,n);fnew Pe(f.from+n,f.to+n)),c=Tg(e,h,a,O);for(let f=0,u=a;;f++){let d=f==c.length,m=d?O:c[f].from;if(m>u&&t.push(new xt(u,m,s.tree,-o,r.from>=u||r.openStart,r.to<=m||r.openEnd)),d)break;u=c[f].to}}else t.push(new xt(a,O,s.tree,-o,r.from>=o||r.openStart,r.to<=l||r.openEnd))}return t}var zg=0,Je=class i{constructor(e,t,n,s){this.name=e,this.set=t,this.base=n,this.modified=s,this.id=zg++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let n=typeof e=="string"?e:"?";if(e instanceof i&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let s=new i(n,[],null,[]);if(s.set.push(s),t)for(let r of t.set)s.set.push(r);return s}static defineModifier(e){let t=new Bs(e);return n=>n.modified.indexOf(t)>-1?n:Bs.get(n.base||n,n.modified.concat(t).sort((s,r)=>s.id-r.id))}},Xg=0,Bs=class i{constructor(e){this.name=e,this.instances=[],this.id=Xg++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find(l=>l.base==e&&Rg(t,l.modified));if(n)return n;let s=[],r=new Je(e.name,s,e,t);for(let l of t)l.instances.push(r);let o=qg(t);for(let l of e.set)if(!l.modified.length)for(let a of o)s.push(i.get(l,a));return r}};function Rg(i,e){return i.length==e.length&&i.every((t,n)=>t==e[n])}function qg(i){let e=[[]];for(let t=0;tn.length-t.length)}function Le(i){let e=Object.create(null);for(let t in i){let n=i[t];Array.isArray(n)||(n=[n]);for(let s of t.split(" "))if(s){let r=[],o=2,l=s;for(let c=0;;){if(l=="..."&&c>0&&c+3==s.length){o=1;break}let f=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!f)throw new RangeError("Invalid path: "+s);if(r.push(f[0]=="*"?"":f[0][0]=='"'?JSON.parse(f[0]):f[0]),c+=f[0].length,c==s.length)break;let u=s[c++];if(c==s.length&&u=="!"){o=0;break}if(u!="/")throw new RangeError("Invalid path: "+s);l=s.slice(c)}let a=r.length-1,O=r[a];if(!O)throw new RangeError("Invalid path: "+s);let h=new wi(n,o,a>0?r.slice(0,a):null);e[O]=h.sort(e[O])}}return Ac.add(e)}var Ac=new Z,wi=class{constructor(e,t,n,s){this.tags=e,this.mode=t,this.context=n,this.next=s}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let o=s;for(let l of r)for(let a of l.set){let O=t[a.id];if(O){o=o?o+" "+O:O;break}}return o},scope:n}}function Wg(i,e){let t=null;for(let n of i){let s=n.style(e);s&&(t=t?t+" "+s:s)}return t}function Uc(i,e,t,n=0,s=i.length){let r=new Sl(n,Array.isArray(e)?e:[e],t);r.highlightRange(i.cursor(),n,s,"",r.highlighters),r.flush(s)}var Sl=class{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,n,s,r){let{type:o,from:l,to:a}=e;if(l>=n||a<=t)return;o.isTop&&(r=this.highlighters.filter(u=>!u.scope||u.scope(o)));let O=s,h=Zg(e)||wi.empty,c=Wg(r,h.tags);if(c&&(O&&(O+=" "),O+=c,h.mode==1&&(s+=(s?" ":"")+c)),this.startSpan(Math.max(t,l),O),h.opaque)return;let f=e.tree&&e.tree.prop(Z.mounted);if(f&&f.overlay){let u=e.node.enter(f.overlay[0].from+l,1),d=this.highlighters.filter(g=>!g.scope||g.scope(f.tree.type)),m=e.firstChild();for(let g=0,$=l;;g++){let y=g=b||!e.nextSibling())););if(!y||b>n)break;$=y.to+l,$>t&&(this.highlightRange(u.cursor(),Math.max(t,y.from+l),Math.min(n,$),"",d),this.startSpan(Math.min(n,$),O))}m&&e.parent()}else if(e.firstChild()){f&&(s="");do if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,s,r),this.startSpan(Math.min(n,e.to),O)}while(e.nextSibling());e.parent()}}};function Zg(i){let e=i.type.prop(Ac);for(;e&&e.context&&!i.matchContext(e.context);)e=e.next;return e||null}var v=Je.define,Es=v(),Vt=v(),Yc=v(Vt),_c=v(Vt),Ct=v(),Ls=v(Ct),yl=v(Ct),mt=v(),ni=v(mt),dt=v(),pt=v(),bl=v(),yn=v(bl),Ds=v(),p={comment:Es,lineComment:v(Es),blockComment:v(Es),docComment:v(Es),name:Vt,variableName:v(Vt),typeName:Yc,tagName:v(Yc),propertyName:_c,attributeName:v(_c),className:v(Vt),labelName:v(Vt),namespace:v(Vt),macroName:v(Vt),literal:Ct,string:Ls,docString:v(Ls),character:v(Ls),attributeValue:v(Ls),number:yl,integer:v(yl),float:v(yl),bool:v(Ct),regexp:v(Ct),escape:v(Ct),color:v(Ct),url:v(Ct),keyword:dt,self:v(dt),null:v(dt),atom:v(dt),unit:v(dt),modifier:v(dt),operatorKeyword:v(dt),controlKeyword:v(dt),definitionKeyword:v(dt),moduleKeyword:v(dt),operator:pt,derefOperator:v(pt),arithmeticOperator:v(pt),logicOperator:v(pt),bitwiseOperator:v(pt),compareOperator:v(pt),updateOperator:v(pt),definitionOperator:v(pt),typeOperator:v(pt),controlOperator:v(pt),punctuation:bl,separator:v(bl),bracket:yn,angleBracket:v(yn),squareBracket:v(yn),paren:v(yn),brace:v(yn),content:mt,heading:ni,heading1:v(ni),heading2:v(ni),heading3:v(ni),heading4:v(ni),heading5:v(ni),heading6:v(ni),contentSeparator:v(mt),list:v(mt),quote:v(mt),emphasis:v(mt),strong:v(mt),link:v(mt),monospace:v(mt),strikethrough:v(mt),inserted:v(),deleted:v(),changed:v(),invalid:v(),meta:Ds,documentMeta:v(Ds),annotation:v(Ds),processingInstruction:v(Ds),definition:Je.defineModifier("definition"),constant:Je.defineModifier("constant"),function:Je.defineModifier("function"),standard:Je.defineModifier("standard"),local:Je.defineModifier("local"),special:Je.defineModifier("special")};for(let i in p){let e=p[i];e instanceof Je&&(e.name=i)}var A1=xl([{tag:p.link,class:"tok-link"},{tag:p.heading,class:"tok-heading"},{tag:p.emphasis,class:"tok-emphasis"},{tag:p.strong,class:"tok-strong"},{tag:p.keyword,class:"tok-keyword"},{tag:p.atom,class:"tok-atom"},{tag:p.bool,class:"tok-bool"},{tag:p.url,class:"tok-url"},{tag:p.labelName,class:"tok-labelName"},{tag:p.inserted,class:"tok-inserted"},{tag:p.deleted,class:"tok-deleted"},{tag:p.literal,class:"tok-literal"},{tag:p.string,class:"tok-string"},{tag:p.number,class:"tok-number"},{tag:[p.regexp,p.escape,p.special(p.string)],class:"tok-string2"},{tag:p.variableName,class:"tok-variableName"},{tag:p.local(p.variableName),class:"tok-variableName tok-local"},{tag:p.definition(p.variableName),class:"tok-variableName tok-definition"},{tag:p.special(p.variableName),class:"tok-variableName2"},{tag:p.definition(p.propertyName),class:"tok-propertyName tok-definition"},{tag:p.typeName,class:"tok-typeName"},{tag:p.namespace,class:"tok-namespace"},{tag:p.className,class:"tok-className"},{tag:p.macroName,class:"tok-macroName"},{tag:p.propertyName,class:"tok-propertyName"},{tag:p.operator,class:"tok-operator"},{tag:p.comment,class:"tok-comment"},{tag:p.meta,class:"tok-meta"},{tag:p.invalid,class:"tok-invalid"},{tag:p.punctuation,class:"tok-punctuation"}]);var Pl,Ti=new Z;function Cl(i){return T.define({combine:i?e=>e.concat(i):void 0})}var Hs=new Z,We=class{constructor(e,t,n=[],s=""){this.data=e,this.name=s,M.prototype.hasOwnProperty("tree")||Object.defineProperty(M.prototype,"tree",{get(){return N(this)}}),this.parser=t,this.extension=[Yt.of(this),M.languageData.of((r,o,l)=>{let a=Mc(r,o,l),O=a.type.prop(Ti);if(!O)return[];let h=r.facet(O),c=a.type.prop(Hs);if(c){let f=a.resolve(o-a.from,l);for(let u of c)if(u.test(f,r)){let d=r.facet(u.facet);return u.type=="replace"?d:d.concat(h)}}return h})].concat(n)}isActiveAt(e,t,n=-1){return Mc(e,t,n).type.prop(Ti)==this.data}findRegions(e){let t=e.facet(Yt);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],s=(r,o)=>{if(r.prop(Ti)==this.data){n.push({from:o,to:o+r.length});return}let l=r.prop(Z.mounted);if(l){if(l.tree.prop(Ti)==this.data){if(l.overlay)for(let a of l.overlay)n.push({from:a.from+o,to:a.to+o});else n.push({from:o,to:o+r.length});return}else if(l.overlay){let a=n.length;if(s(l.tree,l.overlay[0].from+o),n.length>a)return}}for(let a=0;an.isTop?t:void 0)]}),e.name)}configure(e,t){return new i(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}};function N(i){let e=i.field(We.state,!1);return e?e.tree:ee.empty}var Tl=class{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}},Sn=null,zl=class i{constructor(e,t,n=[],s,r,o,l,a){this.parser=e,this.state=t,this.fragments=n,this.tree=s,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new i(e,t,[],ee.empty,0,n,[],null)}startParse(){return this.parser.startParse(new Tl(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=ee.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var n;if(typeof e=="number"){let s=Date.now()+e;e=()=>Date.now()>s}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(xt.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Sn;Sn=this;try{return e()}finally{Sn=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=jc(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:s,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((O,h,c,f)=>a.push({fromA:O,toA:h,fromB:c,toB:f})),n=xt.applyChanges(n,a),s=ee.empty,r=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){l=[];for(let O of this.skipped){let h=e.mapPos(O.from,1),c=e.mapPos(O.to,-1);he.from&&(this.fragments=jc(this.fragments,s,r),this.skipped.splice(n--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends vi{createParse(t,n,s){let r=s[0].from,o=s[s.length-1].to;return{parsedPos:r,advance(){let a=Sn;if(a){for(let O of s)a.tempSkipped.push(O);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=o,new ee(fe.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return Sn}};function jc(i,e,t){return xt.applyChanges(i,[{fromA:e,toA:t,fromB:e,toB:t}])}var xn=class i{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new i(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=zl.create(e.facet(Yt).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new i(n)}};We.state=J.define({create:xn.init,update(i,e){for(let t of e.effects)if(t.is(We.setState))return t.value;return e.startState.facet(Yt)!=e.state.facet(Yt)?xn.init(e.state):i.apply(e)}});var Bc=i=>{let e=setTimeout(()=>i(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(Bc=i=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(i,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});var kl=typeof navigator<"u"&&(!((Pl=navigator.scheduling)===null||Pl===void 0)&&Pl.isInputPending)?()=>navigator.scheduling.isInputPending():null,Vg=te.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(We.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(We.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=Bc(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnds+1e3,a=r.context.work(()=>kl&&kl()||Date.now()>o,s+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:We.setState.of(new xn(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>ce(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),Yt=T.define({combine(i){return i.length?i[0]:null},enables:i=>[We.state,Vg,k.contentAttributes.compute([i],e=>{let t=e.facet(i);return t&&t.name?{"data-language":t.name}:{}})]}),Be=class{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}};var Cg=T.define(),zi=T.define({combine:i=>{if(!i.length)return" ";let e=i[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(i[0]));return e}});function Pn(i){let e=i.facet(zi);return e.charCodeAt(0)==9?i.tabSize*e.length:e.length}function Xi(i,e){let t="",n=i.tabSize,s=i.facet(zi)[0];if(s==" "){for(;e>=n;)t+=" ",e-=n;s=" "}for(let r=0;r=e?Yg(i,t,e):null}var si=class{constructor(e,t={}){this.state=e,this.options=t,this.unit=Pn(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:s,simulateDoubleBreak:r}=this.options;return s!=null&&s>=n.from&&s<=n.to?r&&s==e?{text:"",from:e}:(t<0?s-1&&(r+=o-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return yt(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:s}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let o=r(s);if(o>-1)return o}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}},tt=new Z;function Yg(i,e,t){let n=e.resolveStack(t),s=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(s!=n.node){let r=[];for(let o=s;o&&!(o.from==n.node.from&&o.type==n.node.type);o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)n={node:r[o],next:n}}return Ic(n,i,t)}function Ic(i,e,t){for(let n=i;n;n=n.next){let s=Ag(n.node);if(s)return s(Xl.create(e,t,n))}return 0}function _g(i){return i.pos==i.options.simulateBreak&&i.options.simulateDoubleBreak}function Ag(i){let e=i.type.prop(tt);if(e)return e;let t=i.firstChild,n;if(t&&(n=t.type.prop(Z.closedBy))){let s=i.lastChild,r=s&&n.indexOf(s.name)>-1;return o=>Nc(o,!0,1,void 0,r&&!_g(o)?s.from:void 0)}return i.parent==null?Ug:null}function Ug(){return 0}var Xl=class i extends si{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new i(e,t,n)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(Mg(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return Ic(this.context.next,this.base,this.pos)}};function Mg(i,e){for(let t=e;t;t=t.parent)if(i==t)return!0;return!1}function jg(i){let e=i.node,t=e.childAfter(e.from),n=e.lastChild;if(!t)return null;let s=i.options.simulateBreak,r=i.state.doc.lineAt(t.from),o=s==null||s<=r.from?r.to:Math.min(r.to,s);for(let l=t.to;;){let a=e.childAfter(l);if(!a||a==n)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let O=/^ */.exec(r.text.slice(t.to-r.from))[0].length;return{from:t.from,to:t.to+O}}l=a.to}}function Js({closing:i,align:e=!0,units:t=1}){return n=>Nc(n,e,t,i)}function Nc(i,e,t,n,s){let r=i.textAfter,o=r.match(/^\s*/)[0].length,l=n&&r.slice(o,o+n.length)==n||s==i.pos+o,a=e?jg(i):null;return a?l?i.column(a.from):i.column(a.to):i.baseIndent+(l?0:i.unit*t)}var Fc=i=>i.baseIndent;function Ze({except:i,units:e=1}={}){return t=>{let n=i&&i.test(t.textAfter);return t.baseIndent+(n?0:e*t.unit)}}var Gg=200;function Hc(){return M.transactionFilter.of(i=>{if(!i.docChanged||!i.isUserEvent("input.type")&&!i.isUserEvent("input.complete"))return i;let e=i.startState.languageDataAt("indentOnInput",i.startState.selection.main.head);if(!e.length)return i;let t=i.newDoc,{head:n}=i.newSelection.main,s=t.lineAt(n);if(n>s.from+Gg)return i;let r=t.sliceString(s.from,n);if(!e.some(O=>O.test(r)))return i;let{state:o}=i,l=-1,a=[];for(let{head:O}of o.selection.ranges){let h=o.doc.lineAt(O);if(h.from==l)continue;l=h.from;let c=Ks(o,h.from);if(c==null)continue;let f=/^\s*/.exec(h.text)[0],u=Xi(o,c);f!=u&&a.push({from:h.from,to:h.from+f.length,insert:u})}return a.length?[i,{changes:a,sequential:!0}]:i})}var Eg=T.define(),it=new Z;function _t(i){let e=i.firstChild,t=i.lastChild;return e&&e.tot)continue;if(r&&l.from=e&&O.to>t&&(r=O)}}return r}function Dg(i){let e=i.lastChild;return e&&e.to==i.to&&e.type.isError}function Is(i,e,t){for(let n of i.facet(Eg)){let s=n(i,e,t);if(s)return s}return Lg(i,e,t)}function Kc(i,e){let t=e.mapPos(i.from,1),n=e.mapPos(i.to,-1);return t>=n?void 0:{from:t,to:n}}var er=q.define({map:Kc}),kn=q.define({map:Kc});function Jc(i){let e=[];for(let{head:t}of i.state.selection.ranges)e.some(n=>n.from<=t&&n.to>=t)||e.push(i.lineBlockAt(t));return e}var ri=J.define({create(){return X.none},update(i,e){i=i.map(e.changes);for(let t of e.effects)if(t.is(er)&&!Bg(i,t.value.from,t.value.to)){let{preparePlaceholder:n}=e.state.facet(Yl),s=n?X.replace({widget:new Rl(n(e.state,t.value))}):Gc;i=i.update({add:[s.range(t.value.from,t.value.to)]})}else t.is(kn)&&(i=i.update({filter:(n,s)=>t.value.from!=n||t.value.to!=s,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:n}=e.selection.main;i.between(n,n,(s,r)=>{sn&&(t=!0)}),t&&(i=i.update({filterFrom:n,filterTo:n,filter:(s,r)=>r<=n||s>=n}))}return i},provide:i=>k.decorations.from(i),toJSON(i,e){let t=[];return i.between(0,e.doc.length,(n,s)=>{t.push(n,s)}),t},fromJSON(i){if(!Array.isArray(i)||i.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!s||s.from>r)&&(s={from:r,to:o})}),s}function Bg(i,e,t){let n=!1;return i.between(e,e,(s,r)=>{s==e&&r==t&&(n=!0)}),n}function ef(i,e){return i.field(ri,!1)?e:e.concat(q.appendConfig.of(sf()))}var Ig=i=>{for(let e of Jc(i)){let t=Is(i.state,e.from,e.to);if(t)return i.dispatch({effects:ef(i.state,[er.of(t),tf(i,t)])}),!0}return!1},Ng=i=>{if(!i.state.field(ri,!1))return!1;let e=[];for(let t of Jc(i)){let n=Ns(i.state,t.from,t.to);n&&e.push(kn.of(n),tf(i,n,!1))}return e.length&&i.dispatch({effects:e}),e.length>0};function tf(i,e,t=!0){let n=i.state.doc.lineAt(e.from).number,s=i.state.doc.lineAt(e.to).number;return k.announce.of(`${i.state.phrase(t?"Folded lines":"Unfolded lines")} ${n} ${i.state.phrase("to")} ${s}.`)}var Fg=i=>{let{state:e}=i,t=[];for(let n=0;n{let e=i.state.field(ri,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,i.state.doc.length,(n,s)=>{t.push(kn.of({from:n,to:s}))}),i.dispatch({effects:t}),!0};var nf=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:Ig},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:Ng},{key:"Ctrl-Alt-[",run:Fg},{key:"Ctrl-Alt-]",run:Hg}],Kg={placeholderDOM:null,preparePlaceholder:null,placeholderText:"\u2026"},Yl=T.define({combine(i){return de(i,Kg)}});function sf(i){let e=[ri,e$];return i&&e.push(Yl.of(i)),e}function rf(i,e){let{state:t}=i,n=t.facet(Yl),s=o=>{let l=i.lineBlockAt(i.posAtDOM(o.target)),a=Ns(i.state,l.from,l.to);a&&i.dispatch({effects:kn.of(a)}),o.preventDefault()};if(n.placeholderDOM)return n.placeholderDOM(i,s,e);let r=document.createElement("span");return r.textContent=n.placeholderText,r.setAttribute("aria-label",t.phrase("folded code")),r.title=t.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=s,r}var Gc=X.replace({widget:new class extends xe{toDOM(i){return rf(i,null)}}}),Rl=class extends xe{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return rf(e,this.value)}},Jg={openText:"\u2304",closedText:"\u203A",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1},bn=class extends qe{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}};function of(i={}){let e=Object.assign(Object.assign({},Jg),i),t=new bn(e,!0),n=new bn(e,!1),s=te.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(Yt)!=o.state.facet(Yt)||o.startState.field(ri,!1)!=o.state.field(ri,!1)||N(o.startState)!=N(o.state)||e.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new ze;for(let a of o.viewportLineBlocks){let O=Ns(o.state,a.from,a.to)?n:Is(o.state,a.from,a.to)?t:null;O&&l.add(a.from,a.from,O)}return l.finish()}}),{domEventHandlers:r}=e;return[s,al({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(s))===null||l===void 0?void 0:l.markers)||j.empty},initialSpacer(){return new bn(e,!1)},domEventHandlers:Object.assign(Object.assign({},r),{click:(o,l,a)=>{if(r.click&&r.click(o,l,a))return!0;let O=Ns(o.state,l.from,l.to);if(O)return o.dispatch({effects:kn.of(O)}),!0;let h=Is(o.state,l.from,l.to);return h?(o.dispatch({effects:er.of(h)}),!0):!1}})}),sf()]}var e$=k.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}}),Fs=class i{constructor(e,t){this.specs=e;let n;function s(l){let a=je.newName();return(n||(n=Object.create(null)))["."+a]=l,a}let r=typeof t.all=="string"?t.all:t.all?s(t.all):void 0,o=t.scope;this.scope=o instanceof We?l=>l.prop(Ti)==o.data:o?l=>l==o:void 0,this.style=xl(e.map(l=>({tag:l.tag,class:l.class||s(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=n?new je(n):null,this.themeType=t.themeType}static define(e,t){return new i(e,t||{})}},ql=T.define(),lf=T.define({combine(i){return i.length?[i[0]]:null}});function vl(i){let e=i.facet(ql);return e.length?e:i.facet(lf)}function af(i,e){let t=[t$],n;return i instanceof Fs&&(i.module&&t.push(k.styleModule.of(i.module)),n=i.themeType),e?.fallback?t.push(lf.of(i)):n?t.push(ql.computeN([k.darkTheme],s=>s.facet(k.darkTheme)==(n=="dark")?[i]:[])):t.push(ql.of(i)),t}var Wl=class{constructor(e){this.markCache=Object.create(null),this.tree=N(e.state),this.decorations=this.buildDeco(e,vl(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=N(e.state),n=vl(e.state),s=n!=vl(e.startState),{viewport:r}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length=r.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||s)&&(this.tree=t,this.decorations=this.buildDeco(e.view,n),this.decoratedTo=r.to)}buildDeco(e,t){if(!t||!this.tree.length)return X.none;let n=new ze;for(let{from:s,to:r}of e.visibleRanges)Uc(this.tree,t,(o,l,a)=>{n.add(o,l,this.markCache[a]||(this.markCache[a]=X.mark({class:a})))},s,r);return n.finish()}},t$=Me.high(te.fromClass(Wl,{decorations:i=>i.decorations})),Of=Fs.define([{tag:p.meta,color:"#404740"},{tag:p.link,textDecoration:"underline"},{tag:p.heading,textDecoration:"underline",fontWeight:"bold"},{tag:p.emphasis,fontStyle:"italic"},{tag:p.strong,fontWeight:"bold"},{tag:p.strikethrough,textDecoration:"line-through"},{tag:p.keyword,color:"#708"},{tag:[p.atom,p.bool,p.url,p.contentSeparator,p.labelName],color:"#219"},{tag:[p.literal,p.inserted],color:"#164"},{tag:[p.string,p.deleted],color:"#a11"},{tag:[p.regexp,p.escape,p.special(p.string)],color:"#e40"},{tag:p.definition(p.variableName),color:"#00f"},{tag:p.local(p.variableName),color:"#30a"},{tag:[p.typeName,p.namespace],color:"#085"},{tag:p.className,color:"#167"},{tag:[p.special(p.variableName),p.macroName],color:"#256"},{tag:p.definition(p.propertyName),color:"#00c"},{tag:p.comment,color:"#940"},{tag:p.invalid,color:"#f00"}]),i$=k.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),hf=1e4,cf="()[]{}",ff=T.define({combine(i){return de(i,{afterCursor:!0,brackets:cf,maxScanDistance:hf,renderMatch:r$})}}),n$=X.mark({class:"cm-matchingBracket"}),s$=X.mark({class:"cm-nonmatchingBracket"});function r$(i){let e=[],t=i.matched?n$:s$;return e.push(t.range(i.start.from,i.start.to)),i.end&&e.push(t.range(i.end.from,i.end.to)),e}var o$=J.define({create(){return X.none},update(i,e){if(!e.docChanged&&!e.selection)return i;let t=[],n=e.state.facet(ff);for(let s of e.state.selection.ranges){if(!s.empty)continue;let r=et(e.state,s.head,-1,n)||s.head>0&&et(e.state,s.head-1,1,n)||n.afterCursor&&(et(e.state,s.head,1,n)||s.headk.decorations.from(i)}),l$=[o$,i$];function uf(i={}){return[ff.of(i),l$]}var _l=new Z;function Zl(i,e,t){let n=i.prop(e<0?Z.openedBy:Z.closedBy);if(n)return n;if(i.name.length==1){let s=t.indexOf(i.name);if(s>-1&&s%2==(e<0?1:0))return[t[s+e]]}return null}function Vl(i){let e=i.type.prop(_l);return e?e(i.node):i}function et(i,e,t,n={}){let s=n.maxScanDistance||hf,r=n.brackets||cf,o=N(i),l=o.resolveInner(e,t);for(let a=l;a;a=a.parent){let O=Zl(a.type,t,r);if(O&&a.from0?e>=h.from&&eh.from&&e<=h.to))return a$(i,e,t,a,h,O,r)}}return O$(i,e,t,o,l.type,s,r)}function a$(i,e,t,n,s,r,o){let l=n.parent,a={from:s.from,to:s.to},O=0,h=l?.cursor();if(h&&(t<0?h.childBefore(n.from):h.childAfter(n.to)))do if(t<0?h.to<=n.from:h.from>=n.to){if(O==0&&r.indexOf(h.type.name)>-1&&h.from0)return null;let O={from:t<0?e-1:e,to:t>0?e+1:e},h=i.doc.iterRange(e,t>0?i.doc.length:0),c=0;for(let f=0;!h.next().done&&f<=r;){let u=h.value;t<0&&(f+=u.length);let d=e+f*t;for(let m=t>0?0:u.length-1,g=t>0?u.length:-1;m!=g;m+=t){let $=o.indexOf(u[m]);if(!($<0||n.resolveInner(d+m,1).type!=s))if($%2==0==t>0)c++;else{if(c==1)return{start:O,end:{from:d+m,to:d+m+1},matched:$>>1==a>>1};c--}}t>0&&(f+=u.length)}return h.done?{start:O,matched:!1}:null}var h$=Object.create(null),Ec=[fe.none];var Lc=[],Dc=Object.create(null),c$=Object.create(null);for(let[i,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])c$[i]=f$(h$,e);function wl(i,e){Lc.indexOf(i)>-1||(Lc.push(i),console.warn(e))}function f$(i,e){let t=[];for(let l of e.split(" ")){let a=[];for(let O of l.split(".")){let h=i[O]||p[O];h?typeof h=="function"?a.length?a=a.map(h):wl(O,`Modifier ${O} used at start of tag`):a.length?wl(O,`Tag ${O} used as modifier`):a=Array.isArray(h)?h:[h]:wl(O,`Unknown highlighting tag ${O}`)}for(let O of a)t.push(O)}if(!t.length)return 0;let n=e.replace(/ /g,"_"),s=n+" "+t.map(l=>l.id),r=Dc[s];if(r)return r.id;let o=Dc[s]=fe.define({id:Ec.length,name:n,props:[Le({[n]:t})]});return Ec.push(o),o.id}var B1={rtl:X.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"rtl"},bidiIsolate:D.RTL}),ltr:X.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"ltr"},bidiIsolate:D.LTR}),auto:X.mark({class:"cm-iso",inclusive:!0,attributes:{dir:"auto"},bidiIsolate:null})};var u$=i=>{let{state:e}=i,t=e.doc.lineAt(e.selection.main.from),n=Ll(i.state,t.from);return n.line?d$(i):n.block?m$(i):!1};function El(i,e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let s=i(e,t);return s?(n(t.update(s)),!0):!1}}var d$=El(Q$,0);var p$=El(bf,0);var m$=El((i,e)=>bf(i,e,$$(e)),0);function Ll(i,e){let t=i.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}var vn=50;function g$(i,{open:e,close:t},n,s){let r=i.sliceDoc(n-vn,n),o=i.sliceDoc(s,s+vn),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,O=r.length-l;if(r.slice(O-e.length,O)==e&&o.slice(a,a+t.length)==t)return{open:{pos:n-l,margin:l&&1},close:{pos:s+a,margin:a&&1}};let h,c;s-n<=2*vn?h=c=i.sliceDoc(n,s):(h=i.sliceDoc(n,n+vn),c=i.sliceDoc(s-vn,s));let f=/^\s*/.exec(h)[0].length,u=/\s*$/.exec(c)[0].length,d=c.length-u-t.length;return h.slice(f,f+e.length)==e&&c.slice(d,d+t.length)==t?{open:{pos:n+f+e.length,margin:/\s/.test(h.charAt(f+e.length))?1:0},close:{pos:s-u-t.length,margin:/\s/.test(c.charAt(d-1))?1:0}}:null}function $$(i){let e=[];for(let t of i.selection.ranges){let n=i.doc.lineAt(t.from),s=t.to<=n.to?n:i.doc.lineAt(t.to);s.from>n.from&&s.from==t.to&&(s=t.to==n.to+1?n:i.doc.lineAt(t.to-1));let r=e.length-1;r>=0&&e[r].to>n.from?e[r].to=s.to:e.push({from:n.from+/^\s*/.exec(n.text)[0].length,to:s.to})}return e}function bf(i,e,t=e.selection.ranges){let n=t.map(r=>Ll(e,r.from).block);if(!n.every(r=>r))return null;let s=t.map((r,o)=>g$(e,n[o],r.from,r.to));if(i!=2&&!s.every(r=>r))return{changes:e.changes(t.map((r,o)=>s[o]?[]:[{from:r.from,insert:n[o].open+" "},{from:r.to,insert:" "+n[o].close}]))};if(i!=1&&s.some(r=>r)){let r=[];for(let o=0,l;os&&(r==o||o>c.from)){s=c.from;let f=/^\s*/.exec(c.text)[0].length,u=f==c.length,d=c.text.slice(f,f+O.length)==O?f:-1;fr.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:O,empty:h,single:c}of n)(c||!h)&&r.push({from:l.from+O,insert:a+" "});let o=e.changes(r);return{changes:o,selection:e.selection.map(o,1)}}else if(i!=1&&n.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of n)if(l>=0){let O=o.from+l,h=O+a.length;o.text[h-o.from]==" "&&h++,r.push({from:O,to:h})}return{changes:r}}return null}var Ul=Se.define(),y$=Se.define(),S$=T.define(),xf=T.define({combine(i){return de(i,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,s)=>e(n,s)||t(n,s)})}}),Pf=J.define({create(){return oi.empty},update(i,e){let t=e.state.facet(xf),n=e.annotation(Ul);if(n){let a=nt.fromTransaction(e,n.selection),O=n.side,h=O==0?i.undone:i.done;return a?h=ir(h,h.length,t.minDepth,a):h=Tf(h,e.startState.selection),new oi(O==0?n.rest:h,O==0?h:n.rest)}let s=e.annotation(y$);if((s=="full"||s=="before")&&(i=i.isolate()),e.annotation(ne.addToHistory)===!1)return e.changes.empty?i:i.addMapping(e.changes.desc);let r=nt.fromTransaction(e),o=e.annotation(ne.time),l=e.annotation(ne.userEvent);return r?i=i.addChanges(r,o,l,t,e):e.selection&&(i=i.addSelection(e.startState.selection,o,l,t.newGroupDelay)),(s=="full"||s=="after")&&(i=i.isolate()),i},toJSON(i){return{done:i.done.map(e=>e.toJSON()),undone:i.undone.map(e=>e.toJSON())}},fromJSON(i){return new oi(i.done.map(nt.fromJSON),i.undone.map(nt.fromJSON))}});function kf(i={}){return[Pf,xf.of(i),k.domEventHandlers({beforeinput(e,t){let n=e.inputType=="historyUndo"?vf:e.inputType=="historyRedo"?Ml:null;return n?(e.preventDefault(),n(t)):!1}})]}function nr(i,e){return function({state:t,dispatch:n}){if(!e&&t.readOnly)return!1;let s=t.field(Pf,!1);if(!s)return!1;let r=s.pop(i,t,e);return r?(n(r),!0):!1}}var vf=nr(0,!1),Ml=nr(1,!1),b$=nr(0,!0),x$=nr(1,!0);var nt=class i{constructor(e,t,n,s,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=s,this.selectionsAfter=r}setSelAfter(e){return new i(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(n=this.startSelection)===null||n===void 0?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map(s=>s.toJSON())}}static fromJSON(e){return new i(e.changes&&ge.fromJSON(e.changes),[],e.mapped&&Qt.fromJSON(e.mapped),e.startSelection&&Q.fromJSON(e.startSelection),e.selectionsAfter.map(Q.fromJSON))}static fromTransaction(e,t){let n=Ie;for(let s of e.startState.facet(S$)){let r=s(e);r.length&&(n=n.concat(r))}return!n.length&&e.changes.empty?null:new i(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,Ie)}static selection(e){return new i(void 0,Ie,void 0,void 0,e)}};function ir(i,e,t,n){let s=e+1>t+20?e-t-1:0,r=i.slice(s,e);return r.push(n),r}function P$(i,e){let t=[],n=!1;return i.iterChangedRanges((s,r)=>t.push(s,r)),e.iterChangedRanges((s,r,o,l)=>{for(let a=0;a=O&&o<=h&&(n=!0)}}),n}function k$(i,e){return i.ranges.length==e.ranges.length&&i.ranges.filter((t,n)=>t.empty!=e.ranges[n].empty).length===0}function wf(i,e){return i.length?e.length?i.concat(e):i:e}var Ie=[],v$=200;function Tf(i,e){if(i.length){let t=i[i.length-1],n=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-v$));return n.length&&n[n.length-1].eq(e)?i:(n.push(e),ir(i,i.length-1,1e9,t.setSelAfter(n)))}else return[nt.selection([e])]}function w$(i){let e=i[i.length-1],t=i.slice();return t[i.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function Al(i,e){if(!i.length)return i;let t=i.length,n=Ie;for(;t;){let s=T$(i[t-1],e,n);if(s.changes&&!s.changes.empty||s.effects.length){let r=i.slice(0,t);return r[t-1]=s,r}else e=s.mapped,t--,n=s.selectionsAfter}return n.length?[nt.selection(n)]:Ie}function T$(i,e,t){let n=wf(i.selectionsAfter.length?i.selectionsAfter.map(l=>l.map(e)):Ie,t);if(!i.changes)return nt.selection(n);let s=i.changes.map(e),r=e.mapDesc(i.changes,!0),o=i.mapped?i.mapped.composeDesc(r):r;return new nt(s,q.mapEffects(i.effects,e),o,i.startSelection.map(r),n)}var z$=/^(input\.type|delete)($|\.)/,oi=class i{constructor(e,t,n=0,s=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=s}isolate(){return this.prevTime?new i(this.done,this.undone):this}addChanges(e,t,n,s,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&e.changes&&(!n||z$.test(n))&&(!l.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?i.moveByChar(t,e):sr(t,e))}function pe(i){return i.textDirectionAt(i.state.selection.main.head)==D.LTR}var Rf=i=>Xf(i,!pe(i)),qf=i=>Xf(i,pe(i));function Wf(i,e){return st(i,t=>t.empty?i.moveByGroup(t,e):sr(t,e))}var X$=i=>Wf(i,!pe(i)),R$=i=>Wf(i,pe(i));var ix=typeof Intl<"u"&&Intl.Segmenter?new Intl.Segmenter(void 0,{granularity:"word"}):null;function q$(i,e,t){if(e.type.prop(t))return!0;let n=e.to-e.from;return n&&(n>2||/[^\s,.;:]/.test(i.sliceDoc(e.from,e.to)))||e.firstChild}function rr(i,e,t){let n=N(i).resolveInner(e.head),s=t?Z.closedBy:Z.openedBy;for(let a=e.head;;){let O=t?n.childAfter(a):n.childBefore(a);if(!O)break;q$(i,O,s)?n=O:a=t?O.to:O.from}let r=n.type.prop(s),o,l;return r&&(o=t?et(i,n.from,1):et(i,n.to,-1))&&o.matched?l=t?o.end.to:o.end.from:l=t?n.to:n.from,Q.cursor(l,t?-1:1)}var W$=i=>st(i,e=>rr(i.state,e,!pe(i))),Z$=i=>st(i,e=>rr(i.state,e,pe(i)));function Zf(i,e){return st(i,t=>{if(!t.empty)return sr(t,e);let n=i.moveVertically(t,e);return n.head!=t.head?n:i.moveToLineBoundary(t,e)})}var Vf=i=>Zf(i,!1),Cf=i=>Zf(i,!0);function Yf(i){let e=i.scrollDOM.clientHeighto.empty?i.moveVertically(o,e,t.height):sr(o,e));if(s.eq(n.selection))return!1;let r;if(t.selfScroll){let o=i.coordsAtPos(n.selection.main.head),l=i.scrollDOM.getBoundingClientRect(),a=l.top+t.marginTop,O=l.bottom-t.marginBottom;o&&o.top>a&&o.bottom_f(i,!1),jl=i=>_f(i,!0);function At(i,e,t){let n=i.lineBlockAt(e.head),s=i.moveToLineBoundary(e,t);if(s.head==e.head&&s.head!=(t?n.to:n.from)&&(s=i.moveToLineBoundary(e,t,!1)),!t&&s.head==n.from&&n.length){let r=/^\s*/.exec(i.state.sliceDoc(n.from,Math.min(n.from+100,n.to)))[0].length;r&&e.head!=n.from+r&&(s=Q.cursor(n.from+r))}return s}var V$=i=>st(i,e=>At(i,e,!0)),C$=i=>st(i,e=>At(i,e,!1)),Y$=i=>st(i,e=>At(i,e,!pe(i))),_$=i=>st(i,e=>At(i,e,pe(i))),A$=i=>st(i,e=>Q.cursor(i.lineBlockAt(e.head).from,1)),U$=i=>st(i,e=>Q.cursor(i.lineBlockAt(e.head).to,-1));function M$(i,e,t){let n=!1,s=Ri(i.selection,r=>{let o=et(i,r.head,-1)||et(i,r.head,1)||r.head>0&&et(i,r.head-1,1)||r.headM$(i,e,!1);function Ne(i,e){let t=Ri(i.state.selection,n=>{let s=e(n);return Q.range(n.anchor,s.head,s.goalColumn,s.bidiLevel||void 0)});return t.eq(i.state.selection)?!1:(i.dispatch(gt(i.state,t)),!0)}function Af(i,e){return Ne(i,t=>i.moveByChar(t,e))}var Uf=i=>Af(i,!pe(i)),Mf=i=>Af(i,pe(i));function jf(i,e){return Ne(i,t=>i.moveByGroup(t,e))}var G$=i=>jf(i,!pe(i)),E$=i=>jf(i,pe(i));var L$=i=>Ne(i,e=>rr(i.state,e,!pe(i))),D$=i=>Ne(i,e=>rr(i.state,e,pe(i)));function Gf(i,e){return Ne(i,t=>i.moveVertically(t,e))}var Ef=i=>Gf(i,!1),Lf=i=>Gf(i,!0);function Df(i,e){return Ne(i,t=>i.moveVertically(t,e,Yf(i).height))}var pf=i=>Df(i,!1),mf=i=>Df(i,!0),B$=i=>Ne(i,e=>At(i,e,!0)),I$=i=>Ne(i,e=>At(i,e,!1)),N$=i=>Ne(i,e=>At(i,e,!pe(i))),F$=i=>Ne(i,e=>At(i,e,pe(i))),H$=i=>Ne(i,e=>Q.cursor(i.lineBlockAt(e.head).from)),K$=i=>Ne(i,e=>Q.cursor(i.lineBlockAt(e.head).to)),gf=({state:i,dispatch:e})=>(e(gt(i,{anchor:0})),!0),$f=({state:i,dispatch:e})=>(e(gt(i,{anchor:i.doc.length})),!0),Qf=({state:i,dispatch:e})=>(e(gt(i,{anchor:i.selection.main.anchor,head:0})),!0),yf=({state:i,dispatch:e})=>(e(gt(i,{anchor:i.selection.main.anchor,head:i.doc.length})),!0),J$=({state:i,dispatch:e})=>(e(i.update({selection:{anchor:0,head:i.doc.length},userEvent:"select"})),!0),eQ=({state:i,dispatch:e})=>{let t=or(i).map(({from:n,to:s})=>Q.range(n,Math.min(s+1,i.doc.length)));return e(i.update({selection:Q.create(t),userEvent:"select"})),!0},tQ=({state:i,dispatch:e})=>{let t=Ri(i.selection,n=>{let s=N(i),r=s.resolveStack(n.from,1);if(n.empty){let o=s.resolveStack(n.from,-1);o.node.from>=r.node.from&&o.node.to<=r.node.to&&(r=o)}for(let o=r;o;o=o.next){let{node:l}=o;if((l.from=n.to||l.to>n.to&&l.from<=n.from)&&o.next)return Q.range(l.to,l.from)}return n});return t.eq(i.selection)?!1:(e(gt(i,t)),!0)},iQ=({state:i,dispatch:e})=>{let t=i.selection,n=null;return t.ranges.length>1?n=Q.create([t.main]):t.main.empty||(n=Q.create([Q.cursor(t.main.head)])),n?(e(gt(i,n)),!0):!1};function wn(i,e){if(i.state.readOnly)return!1;let t="delete.selection",{state:n}=i,s=n.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=e(r);ao&&(t="delete.forward",a=tr(i,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=tr(i,o,!1),l=tr(i,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:Q.cursor(o,os(i)))n.between(e,e,(s,r)=>{se&&(e=t?r:s)});return e}var Bf=(i,e,t)=>wn(i,n=>{let s=n.from,{state:r}=i,o=r.doc.lineAt(s),l,a;if(t&&!e&&s>o.from&&sBf(i,!1,!0);var If=i=>Bf(i,!0,!1),Nf=(i,e)=>wn(i,t=>{let n=t.head,{state:s}=i,r=s.doc.lineAt(n),o=s.charCategorizer(n);for(let l=null;;){if(n==(e?r.to:r.from)){n==t.head&&r.number!=(e?s.doc.lines:1)&&(n+=e?1:-1);break}let a=se(r.text,n-r.from,e)+r.from,O=r.text.slice(Math.min(n,a)-r.from,Math.max(n,a)-r.from),h=o(O);if(l!=null&&h!=l)break;(O!=" "||n!=t.head)&&(l=h),n=a}return n}),Ff=i=>Nf(i,!1),nQ=i=>Nf(i,!0),sQ=i=>wn(i,e=>{let t=i.lineBlockAt(e.head).to;return e.headwn(i,e=>{let t=i.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),oQ=i=>wn(i,e=>{let t=i.moveToLineBoundary(e,!0).head;return e.head{if(i.readOnly)return!1;let t=i.changeByRange(n=>({changes:{from:n.from,to:n.to,insert:Y.of(["",""])},range:Q.cursor(n.from)}));return e(i.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},aQ=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=i.changeByRange(n=>{if(!n.empty||n.from==0||n.from==i.doc.length)return{range:n};let s=n.from,r=i.doc.lineAt(s),o=s==r.from?s-1:se(r.text,s-r.from,!1)+r.from,l=s==r.to?s+1:se(r.text,s-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:i.doc.slice(s,l).append(i.doc.slice(o,s))},range:Q.cursor(l)}});return t.changes.empty?!1:(e(i.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function or(i){let e=[],t=-1;for(let n of i.selection.ranges){let s=i.doc.lineAt(n.from),r=i.doc.lineAt(n.to);if(!n.empty&&n.to==r.from&&(r=i.doc.lineAt(n.to-1)),t>=s.number){let o=e[e.length-1];o.to=r.to,o.ranges.push(n)}else e.push({from:s.from,to:r.to,ranges:[n]});t=r.number+1}return e}function Hf(i,e,t){if(i.readOnly)return!1;let n=[],s=[];for(let r of or(i)){if(t?r.to==i.doc.length:r.from==0)continue;let o=i.doc.lineAt(t?r.to+1:r.from-1),l=o.length+1;if(t){n.push({from:r.to,to:o.to},{from:r.from,insert:o.text+i.lineBreak});for(let a of r.ranges)s.push(Q.range(Math.min(i.doc.length,a.anchor+l),Math.min(i.doc.length,a.head+l)))}else{n.push({from:o.from,to:r.from},{from:r.to,insert:i.lineBreak+o.text});for(let a of r.ranges)s.push(Q.range(a.anchor-l,a.head-l))}}return n.length?(e(i.update({changes:n,scrollIntoView:!0,selection:Q.create(s,i.selection.mainIndex),userEvent:"move.line"})),!0):!1}var OQ=({state:i,dispatch:e})=>Hf(i,e,!1),hQ=({state:i,dispatch:e})=>Hf(i,e,!0);function Kf(i,e,t){if(i.readOnly)return!1;let n=[];for(let s of or(i))t?n.push({from:s.from,insert:i.doc.slice(s.from,s.to)+i.lineBreak}):n.push({from:s.to,insert:i.lineBreak+i.doc.slice(s.from,s.to)});return e(i.update({changes:n,scrollIntoView:!0,userEvent:"input.copyline"})),!0}var cQ=({state:i,dispatch:e})=>Kf(i,e,!1),fQ=({state:i,dispatch:e})=>Kf(i,e,!0),uQ=i=>{if(i.state.readOnly)return!1;let{state:e}=i,t=e.changes(or(e).map(({from:s,to:r})=>(s>0?s--:r{let r;if(i.lineWrapping){let o=i.lineBlockAt(s.head),l=i.coordsAtPos(s.head,s.assoc||1);l&&(r=o.bottom+i.documentTop-l.bottom+i.defaultLineHeight/2)}return i.moveVertically(s,!0,r)}).map(t);return i.dispatch({changes:t,selection:n,scrollIntoView:!0,userEvent:"delete.line"}),!0};function dQ(i,e){if(/\(\)|\[\]|\{\}/.test(i.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=N(i).resolveInner(e),n=t.childBefore(e),s=t.childAfter(e),r;return n&&s&&n.to<=e&&s.from>=e&&(r=n.type.prop(Z.closedBy))&&r.indexOf(s.name)>-1&&i.doc.lineAt(n.to).from==i.doc.lineAt(s.from).from&&!/\S/.test(i.sliceDoc(n.to,s.from))?{from:n.to,to:s.from}:null}var Sf=Jf(!1),pQ=Jf(!0);function Jf(i){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange(s=>{let{from:r,to:o}=s,l=e.doc.lineAt(r),a=!i&&r==o&&dQ(e,r);i&&(r=o=(o<=l.to?l:e.doc.lineAt(o)).to);let O=new si(e,{simulateBreak:r,simulateDoubleBreak:!!a}),h=Ks(O,r);for(h==null&&(h=yt(/^\s*/.exec(e.doc.lineAt(r).text)[0],e.tabSize));ol.from&&r{let s=[];for(let o=n.from;o<=n.to;){let l=i.doc.lineAt(o);l.number>t&&(n.empty||n.to>l.from)&&(e(l,s,n),t=l.number),o=l.to+1}let r=i.changes(s);return{changes:s,range:Q.range(r.mapPos(n.anchor,1),r.mapPos(n.head,1))}})}var mQ=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let t=Object.create(null),n=new si(i,{overrideIndentation:r=>{let o=t[r];return o??-1}}),s=Dl(i,(r,o,l)=>{let a=Ks(n,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let O=/^\s*/.exec(r.text)[0],h=Xi(i,a);(O!=h||l.fromi.readOnly?!1:(e(i.update(Dl(i,(t,n)=>{n.push({from:t.from,insert:i.facet(zi)})}),{userEvent:"input.indent"})),!0),tu=({state:i,dispatch:e})=>i.readOnly?!1:(e(i.update(Dl(i,(t,n)=>{let s=/^\s*/.exec(t.text)[0];if(!s)return;let r=yt(s,i.tabSize),o=0,l=Xi(i,Math.max(0,r-Pn(i)));for(;o(i.setTabFocusMode(),!0);var $Q=[{key:"Ctrl-b",run:Rf,shift:Uf,preventDefault:!0},{key:"Ctrl-f",run:qf,shift:Mf},{key:"Ctrl-p",run:Vf,shift:Ef},{key:"Ctrl-n",run:Cf,shift:Lf},{key:"Ctrl-a",run:A$,shift:H$},{key:"Ctrl-e",run:U$,shift:K$},{key:"Ctrl-d",run:If},{key:"Ctrl-h",run:Gl},{key:"Ctrl-k",run:sQ},{key:"Ctrl-Alt-h",run:Ff},{key:"Ctrl-o",run:lQ},{key:"Ctrl-t",run:aQ},{key:"Ctrl-v",run:jl}],QQ=[{key:"ArrowLeft",run:Rf,shift:Uf,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:X$,shift:G$,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:Y$,shift:N$,preventDefault:!0},{key:"ArrowRight",run:qf,shift:Mf,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:R$,shift:E$,preventDefault:!0},{mac:"Cmd-ArrowRight",run:_$,shift:F$,preventDefault:!0},{key:"ArrowUp",run:Vf,shift:Ef,preventDefault:!0},{mac:"Cmd-ArrowUp",run:gf,shift:Qf},{mac:"Ctrl-ArrowUp",run:df,shift:pf},{key:"ArrowDown",run:Cf,shift:Lf,preventDefault:!0},{mac:"Cmd-ArrowDown",run:$f,shift:yf},{mac:"Ctrl-ArrowDown",run:jl,shift:mf},{key:"PageUp",run:df,shift:pf},{key:"PageDown",run:jl,shift:mf},{key:"Home",run:C$,shift:I$,preventDefault:!0},{key:"Mod-Home",run:gf,shift:Qf},{key:"End",run:V$,shift:B$,preventDefault:!0},{key:"Mod-End",run:$f,shift:yf},{key:"Enter",run:Sf,shift:Sf},{key:"Mod-a",run:J$},{key:"Backspace",run:Gl,shift:Gl},{key:"Delete",run:If},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Ff},{key:"Mod-Delete",mac:"Alt-Delete",run:nQ},{mac:"Mod-Backspace",run:rQ},{mac:"Mod-Delete",run:oQ}].concat($Q.map(i=>({mac:i.key,run:i.run,shift:i.shift}))),iu=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:W$,shift:L$},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:Z$,shift:D$},{key:"Alt-ArrowUp",run:OQ},{key:"Shift-Alt-ArrowUp",run:cQ},{key:"Alt-ArrowDown",run:hQ},{key:"Shift-Alt-ArrowDown",run:fQ},{key:"Escape",run:iQ},{key:"Mod-Enter",run:pQ},{key:"Alt-l",mac:"Ctrl-l",run:eQ},{key:"Mod-i",run:tQ,preventDefault:!0},{key:"Mod-[",run:tu},{key:"Mod-]",run:eu},{key:"Mod-Alt-\\",run:mQ},{key:"Shift-Mod-k",run:uQ},{key:"Shift-Mod-\\",run:j$},{key:"Mod-/",run:u$},{key:"Alt-A",run:p$},{key:"Ctrl-m",mac:"Shift-Alt-m",run:gQ}].concat(QQ),nu={key:"Tab",run:eu,shift:tu};var su=typeof String.prototype.normalize=="function"?i=>i.normalize("NFKD"):i=>i,Mt=class{constructor(e,t,n=0,s=e.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,s),this.bufferStart=n,this.normalize=r?l=>r(su(l)):su,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Oe(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=Bi(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Xe(e);let s=this.normalize(t);if(s.length)for(let r=0,o=n;;r++){let l=s.charCodeAt(r),a=this.match(l,o,this.bufferPos+this.bufferStart);if(r==s.length-1){if(a)return this.value=a,this;break}o==n&&rthis.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let n=this.curLineStart+t.index,s=n+t[0].length;if(this.matchPos=fr(this.text,s+(n==s?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,s,t)))return this.value={from:n,to:s,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=n||s.to<=t){let l=new i(t,e.sliceString(t,n));return Bl.set(e,l),l}if(s.from==t&&s.to==n)return s;let{text:r,from:o}=s;return o>t&&(r=e.sliceString(t,o)+r,o=t),s.to=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let n=this.flat.from+t.index,s=n+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(n,s,t)))return this.value={from:n,to:s,match:t},this.matchPos=fr(this.text,s+(n==s?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=hr.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}};typeof Symbol<"u"&&(Or.prototype[Symbol.iterator]=cr.prototype[Symbol.iterator]=function(){return this});function yQ(i){try{return new RegExp(i,Jl),!0}catch{return!1}}function fr(i,e){if(e>=i.length)return e;let t=i.lineAt(e),n;for(;e=56320&&n<57344;)e++;return e}function Il(i){let e=String(i.state.doc.lineAt(i.state.selection.main.head).number),t=U("input",{class:"cm-textfield",name:"line",value:e}),n=U("form",{class:"cm-gotoLine",onkeydown:r=>{r.keyCode==27?(r.preventDefault(),i.dispatch({effects:Tn.of(!1)}),i.focus()):r.keyCode==13&&(r.preventDefault(),s())},onsubmit:r=>{r.preventDefault(),s()}},U("label",i.state.phrase("Go to line"),": ",t)," ",U("button",{class:"cm-button",type:"submit"},i.state.phrase("go")),U("button",{name:"close",onclick:()=>{i.dispatch({effects:Tn.of(!1)}),i.focus()},"aria-label":i.state.phrase("close"),type:"button"},["\xD7"]));function s(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!r)return;let{state:o}=i,l=o.doc.lineAt(o.selection.main.head),[,a,O,h,c]=r,f=h?+h.slice(1):0,u=O?+O:l.number;if(O&&c){let g=u/100;a&&(g=g*(a=="-"?-1:1)+l.number/o.doc.lines),u=Math.round(o.doc.lines*g)}else O&&a&&(u=u*(a=="-"?-1:1)+l.number);let d=o.doc.line(Math.max(1,Math.min(o.doc.lines,u))),m=Q.cursor(d.from+Math.max(0,Math.min(f,d.length)));i.dispatch({effects:[Tn.of(!1),k.scrollIntoView(m.from,{y:"center"})],selection:m}),i.focus()}return{dom:n}}var Tn=q.define(),ru=J.define({create(){return!0},update(i,e){for(let t of e.effects)t.is(Tn)&&(i=t.value);return i},provide:i=>Jt.from(i,e=>e?Il:null)}),SQ=i=>{let e=ei(i,Il);if(!e){let t=[Tn.of(!0)];i.state.field(ru,!1)==null&&t.push(q.appendConfig.of([ru,bQ])),i.dispatch({effects:t}),e=ei(i,Il)}return e&&e.dom.querySelector("input").select(),!0},bQ=k.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px",position:"relative","& label":{fontSize:"80%"},"& [name=close]":{position:"absolute",top:"0",bottom:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:"0"}}}),xQ={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},Ou=T.define({combine(i){return de(i,xQ,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function hu(i){let e=[TQ,wQ];return i&&e.push(Ou.of(i)),e}var PQ=X.mark({class:"cm-selectionMatch"}),kQ=X.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function ou(i,e,t,n){return(t==0||i(e.sliceDoc(t-1,t))!=L.Word)&&(n==e.doc.length||i(e.sliceDoc(n,n+1))!=L.Word)}function vQ(i,e,t,n){return i(e.sliceDoc(t,t+1))==L.Word&&i(e.sliceDoc(n-1,n))==L.Word}var wQ=te.fromClass(class{constructor(i){this.decorations=this.getDeco(i)}update(i){(i.selectionSet||i.docChanged||i.viewportChanged)&&(this.decorations=this.getDeco(i.view))}getDeco(i){let e=i.state.facet(Ou),{state:t}=i,n=t.selection;if(n.ranges.length>1)return X.none;let s=n.main,r,o=null;if(s.empty){if(!e.highlightWordAroundCursor)return X.none;let a=t.wordAt(s.head);if(!a)return X.none;o=t.charCategorizer(s.head),r=t.sliceDoc(a.from,a.to)}else{let a=s.to-s.from;if(a200)return X.none;if(e.wholeWords){if(r=t.sliceDoc(s.from,s.to),o=t.charCategorizer(s.head),!(ou(o,t,s.from,s.to)&&vQ(o,t,s.from,s.to)))return X.none}else if(r=t.sliceDoc(s.from,s.to),!r)return X.none}let l=[];for(let a of i.visibleRanges){let O=new Mt(t.doc,r,a.from,a.to);for(;!O.next().done;){let{from:h,to:c}=O.value;if((!o||ou(o,t,h,c))&&(s.empty&&h<=s.from&&c>=s.to?l.push(kQ.range(h,c)):(h>=s.to||c<=s.from)&&l.push(PQ.range(h,c)),l.length>e.maxMatches))return X.none}}return X.set(l)}},{decorations:i=>i.decorations}),TQ=k.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),zQ=({state:i,dispatch:e})=>{let{selection:t}=i,n=Q.create(t.ranges.map(s=>i.wordAt(s.head)||Q.cursor(s.head)),t.mainIndex);return n.eq(t)?!1:(e(i.update({selection:n})),!0)};function XQ(i,e){let{main:t,ranges:n}=i.selection,s=i.wordAt(t.head),r=s&&s.from==t.from&&s.to==t.to;for(let o=!1,l=new Mt(i.doc,e,n[n.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new Mt(i.doc,e,0,Math.max(0,n[n.length-1].from-1)),o=!0}else{if(o&&n.some(a=>a.from==l.value.from))continue;if(r){let a=i.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}var RQ=({state:i,dispatch:e})=>{let{ranges:t}=i.selection;if(t.some(r=>r.from===r.to))return zQ({state:i,dispatch:e});let n=i.sliceDoc(t[0].from,t[0].to);if(i.selection.ranges.some(r=>i.sliceDoc(r.from,r.to)!=n))return!1;let s=XQ(i,n);return s?(e(i.update({selection:i.selection.addRange(Q.range(s.from,s.to),!1),effects:k.scrollIntoView(s.to)})),!0):!1},Zi=T.define({combine(i){return de(i,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new Kl(e),scrollToMatch:e=>k.scrollIntoView(e)})}});var ur=class{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||yQ(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,n)=>n=="n"?` +`:n=="r"?"\r":n=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new Fl(this):new Nl(this)}getCursor(e,t=0,n){let s=e.doc?e:M.create({doc:e});return n==null&&(n=s.doc.length),this.regexp?Wi(this,s,t,n):qi(this,s,t,n)}},dr=class{constructor(e){this.spec=e}};function qi(i,e,t,n){return new Mt(e.doc,i.unquoted,t,n,i.caseSensitive?void 0:s=>s.toLowerCase(),i.wholeWord?qQ(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function qQ(i,e){return(t,n,s,r)=>((r>t||r+s.length=t)return null;s.push(n.value)}return s}highlight(e,t,n,s){let r=qi(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}};function Wi(i,e,t,n){return new Or(e.doc,i.search,{ignoreCase:!i.caseSensitive,test:i.wholeWord?WQ(e.charCategorizer(e.selection.main.head)):void 0},t,n)}function pr(i,e){return i.slice(se(i,e,!1),e)}function mr(i,e){return i.slice(e,se(i,e))}function WQ(i){return(e,t,n)=>!n[0].length||(i(pr(n.input,n.index))!=L.Word||i(mr(n.input,n.index))!=L.Word)&&(i(mr(n.input,n.index+n[0].length))!=L.Word||i(pr(n.input,n.index+n[0].length))!=L.Word)}var Fl=class extends dr{nextMatch(e,t,n){let s=Wi(this.spec,e,n,e.doc.length).next();return s.done&&(s=Wi(this.spec,e,0,t).next()),s.done?null:s.value}prevMatchInRange(e,t,n){for(let s=1;;s++){let r=Math.max(t,n-s*1e4),o=Wi(this.spec,e,r,n),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,n)=>{if(n=="&")return e.match[0];if(n=="$")return"$";for(let s=n.length;s>0;s--){let r=+n.slice(0,s);if(r>0&&r=t)return null;s.push(n.value)}return s}highlight(e,t,n,s){let r=Wi(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)s(r.value.from,r.value.to)}},Xn=q.define(),ea=q.define(),Ut=J.define({create(i){return new zn(Hl(i).create(),null)},update(i,e){for(let t of e.effects)t.is(Xn)?i=new zn(t.value.create(),i.panel):t.is(ea)&&(i=new zn(i.query,t.value?ta:null));return i},provide:i=>Jt.from(i,e=>e.panel)});var zn=class{constructor(e,t){this.query=e,this.panel=t}},ZQ=X.mark({class:"cm-searchMatch"}),VQ=X.mark({class:"cm-searchMatch cm-searchMatch-selected"}),CQ=te.fromClass(class{constructor(i){this.view=i,this.decorations=this.highlight(i.state.field(Ut))}update(i){let e=i.state.field(Ut);(e!=i.startState.field(Ut)||i.docChanged||i.selectionSet||i.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:i,panel:e}){if(!e||!i.spec.valid)return X.none;let{view:t}=this,n=new ze;for(let s=0,r=t.visibleRanges,o=r.length;sr[s+1].from-2*250;)a=r[++s].to;i.highlight(t.state,l,a,(O,h)=>{let c=t.state.selection.ranges.some(f=>f.from==O&&f.to==h);n.add(O,h,c?VQ:ZQ)})}return n.finish()}},{decorations:i=>i.decorations});function Rn(i){return e=>{let t=e.state.field(Ut,!1);return t&&t.query.spec.valid?i(e,t):uu(e)}}var gr=Rn((i,{query:e})=>{let{to:t}=i.state.selection.main,n=e.nextMatch(i.state,t,t);if(!n)return!1;let s=Q.single(n.from,n.to),r=i.state.facet(Zi);return i.dispatch({selection:s,effects:[ia(i,n),r.scrollToMatch(s.main,i)],userEvent:"select.search"}),fu(i),!0}),$r=Rn((i,{query:e})=>{let{state:t}=i,{from:n}=t.selection.main,s=e.prevMatch(t,n,n);if(!s)return!1;let r=Q.single(s.from,s.to),o=i.state.facet(Zi);return i.dispatch({selection:r,effects:[ia(i,s),o.scrollToMatch(r.main,i)],userEvent:"select.search"}),fu(i),!0}),YQ=Rn((i,{query:e})=>{let t=e.matchAll(i.state,1e3);return!t||!t.length?!1:(i.dispatch({selection:Q.create(t.map(n=>Q.range(n.from,n.to))),userEvent:"select.search.matches"}),!0)}),_Q=({state:i,dispatch:e})=>{let t=i.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:n,to:s}=t.main,r=[],o=0;for(let l=new Mt(i.doc,i.sliceDoc(n,s));!l.next().done;){if(r.length>1e3)return!1;l.value.from==n&&(o=r.length),r.push(Q.range(l.value.from,l.value.to))}return e(i.update({selection:Q.create(r,o),userEvent:"select.search.matches"})),!0},lu=Rn((i,{query:e})=>{let{state:t}=i,{from:n,to:s}=t.selection.main;if(t.readOnly)return!1;let r=e.nextMatch(t,n,n);if(!r)return!1;let o=r,l=[],a,O,h=[];o.from==n&&o.to==s&&(O=t.toText(e.getReplacement(o)),l.push({from:o.from,to:o.to,insert:O}),o=e.nextMatch(t,o.from,o.to),h.push(k.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(n).number)+".")));let c=i.state.changes(l);return o&&(a=Q.single(o.from,o.to).map(c),h.push(ia(i,o)),h.push(t.facet(Zi).scrollToMatch(a.main,i))),i.dispatch({changes:c,selection:a,effects:h,userEvent:"input.replace"}),!0}),AQ=Rn((i,{query:e})=>{if(i.state.readOnly)return!1;let t=e.matchAll(i.state,1e9).map(s=>{let{from:r,to:o}=s;return{from:r,to:o,insert:e.getReplacement(s)}});if(!t.length)return!1;let n=i.state.phrase("replaced $ matches",t.length)+".";return i.dispatch({changes:t,effects:k.announce.of(n),userEvent:"input.replace.all"}),!0});function ta(i){return i.state.facet(Zi).createPanel(i)}function Hl(i,e){var t,n,s,r,o;let l=i.selection.main,a=l.empty||l.to>l.from+100?"":i.sliceDoc(l.from,l.to);if(e&&!a)return e;let O=i.facet(Zi);return new ur({search:((t=e?.literal)!==null&&t!==void 0?t:O.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(n=e?.caseSensitive)!==null&&n!==void 0?n:O.caseSensitive,literal:(s=e?.literal)!==null&&s!==void 0?s:O.literal,regexp:(r=e?.regexp)!==null&&r!==void 0?r:O.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:O.wholeWord})}function cu(i){let e=ei(i,ta);return e&&e.dom.querySelector("[main-field]")}function fu(i){let e=cu(i);e&&e==i.root.activeElement&&e.select()}var uu=i=>{let e=i.state.field(Ut,!1);if(e&&e.panel){let t=cu(i);if(t&&t!=i.root.activeElement){let n=Hl(i.state,e.query.spec);n.valid&&i.dispatch({effects:Xn.of(n)}),t.focus(),t.select()}}else i.dispatch({effects:[ea.of(!0),e?Xn.of(Hl(i.state,e.query.spec)):q.appendConfig.of(MQ)]});return!0},du=i=>{let e=i.state.field(Ut,!1);if(!e||!e.panel)return!1;let t=ei(i,ta);return t&&t.dom.contains(i.root.activeElement)&&i.focus(),i.dispatch({effects:ea.of(!1)}),!0},pu=[{key:"Mod-f",run:uu,scope:"editor search-panel"},{key:"F3",run:gr,shift:$r,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:gr,shift:$r,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:du,scope:"editor search-panel"},{key:"Mod-Shift-l",run:_Q},{key:"Mod-Alt-g",run:SQ},{key:"Mod-d",run:RQ,preventDefault:!0}],Kl=class{constructor(e){this.view=e;let t=this.query=e.state.field(Ut).query.spec;this.commit=this.commit.bind(this),this.searchField=U("input",{value:t.search,placeholder:Ve(e,"Find"),"aria-label":Ve(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=U("input",{value:t.replace,placeholder:Ve(e,"Replace"),"aria-label":Ve(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=U("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=U("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=U("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function n(s,r,o){return U("button",{class:"cm-button",name:s,onclick:r,type:"button"},o)}this.dom=U("div",{onkeydown:s=>this.keydown(s),class:"cm-search"},[this.searchField,n("next",()=>gr(e),[Ve(e,"next")]),n("prev",()=>$r(e),[Ve(e,"previous")]),n("select",()=>YQ(e),[Ve(e,"all")]),U("label",null,[this.caseField,Ve(e,"match case")]),U("label",null,[this.reField,Ve(e,"regexp")]),U("label",null,[this.wordField,Ve(e,"by word")]),...e.state.readOnly?[]:[U("br"),this.replaceField,n("replace",()=>lu(e),[Ve(e,"replace")]),n("replaceAll",()=>AQ(e),[Ve(e,"replace all")])],U("button",{name:"close",onclick:()=>du(e),"aria-label":Ve(e,"close"),type:"button"},["\xD7"])])}commit(){let e=new ur({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Xn.of(e)}))}keydown(e){cc(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?$r:gr)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),lu(this.view))}update(e){for(let t of e.transactions)for(let n of t.effects)n.is(Xn)&&!n.value.eq(this.query)&&this.setQuery(n.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(Zi).top}};function Ve(i,e){return i.state.phrase(e)}var lr=30,ar=/[\s\.,:;?!]/;function ia(i,{from:e,to:t}){let n=i.state.doc.lineAt(e),s=i.state.doc.lineAt(t).to,r=Math.max(n.from,e-lr),o=Math.min(s,t+lr),l=i.state.sliceDoc(r,o);if(r!=n.from){for(let a=0;al.length-lr;a--)if(!ar.test(l[a-1])&&ar.test(l[a])){l=l.slice(0,a);break}}return k.announce.of(`${i.state.phrase("current match")}. ${l} ${i.state.phrase("on line")} ${n.number}.`)}var UQ=k.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),MQ=[Ut,Me.low(CQ),UQ];var yr=class{constructor(e,t,n,s){this.state=e,this.pos=t,this.explicit=n,this.view=s,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=N(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),n=Math.max(t.from,this.pos-250),s=t.text.slice(n-t.from,this.pos-t.from),r=s.search(vu(e,!1));return r<0?null:{from:n+r,to:this.pos,text:s.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,n){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),n&&n.onDocChange&&(this.abortOnDocChange=!0))}};function mu(i){let e=Object.keys(i).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function jQ(i){let e=Object.create(null),t=Object.create(null);for(let{label:s}of i){e[s[0]]=!0;for(let r=1;rtypeof s=="string"?{label:s}:s),[t,n]=e.every(s=>/^\w+$/.test(s.label))?[/\w*$/,/\w+$/]:jQ(e);return s=>{let r=s.matchBefore(n);return r||s.explicit?{from:r?r.from:s.pos,options:e,validFor:t}:null}}function ku(i,e){return t=>{for(let n=N(t.state).resolveInner(t.pos,-1);n;n=n.parent){if(i.indexOf(n.name)>-1)return null;if(n.type.isTop)break}return e(t)}}var Sr=class{constructor(e,t,n,s){this.completion=e,this.source=t,this.match=n,this.score=s}};function ai(i){return i.selection.main.from}function vu(i,e){var t;let{source:n}=i,s=e&&n[0]!="^",r=n[n.length-1]!="$";return!s&&!r?i:new RegExp(`${s?"^":""}(?:${n})${r?"$":""}`,(t=i.flags)!==null&&t!==void 0?t:i.ignoreCase?"i":"")}var pa=Se.define();function GQ(i,e,t,n){let{main:s}=i.selection,r=t-s.from,o=n-s.from;return Object.assign(Object.assign({},i.changeByRange(l=>{if(l!=s&&t!=n&&i.sliceDoc(l.from+r,l.from+o)!=i.sliceDoc(t,n))return{range:l};let a=i.toText(e);return{changes:{from:l.from+r,to:n==s.from?l.to:l.from+o,insert:a},range:Q.cursor(l.from+r+a.length)}})),{scrollIntoView:!0,userEvent:"input.complete"})}var gu=new WeakMap;function EQ(i){if(!Array.isArray(i))return i;let e=gu.get(i);return e||gu.set(i,e=da(i)),e}var br=q.define(),qn=q.define(),ra=class{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t=48&&S<=57||S>=97&&S<=122?2:S>=65&&S<=90?1:0:(P=Bi(S))!=P.toLowerCase()?1:P!=P.toUpperCase()?2:0;(!y||w==1&&g||x==0&&w!=0)&&(t[c]==S||n[c]==S&&(f=!0)?o[c++]=y:o.length&&($=!1)),x=w,y+=Xe(S)}return c==a&&o[0]==0&&$?this.result(-100+(f?-200:0),o,e):u==a&&d==0?this.ret(-200-e.length+(m==e.length?0:-100),[0,m]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):u==a?this.ret(-900-e.length,[d,m]):c==a?this.result(-100+(f?-200:0)+-700+($?0:-1100),o,e):t.length==2?null:this.result((s[0]?-700:0)+-200+-1100,s,e)}result(e,t,n){let s=[],r=0;for(let o of t){let l=o+(this.astral?Xe(Oe(n,o)):1);r&&s[r-1]==o?s[r-1]=l:(s[r++]=o,s[r++]=l)}return this.ret(e-n.length,s)}},oa=class{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:LQ,filterStrict:!1,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>n=>$u(e(n),t(n)),optionClass:(e,t)=>n=>$u(e(n),t(n)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function $u(i,e){return i?e?i+" "+e:i:e}function LQ(i,e,t,n,s,r){let o=i.textDirection==D.RTL,l=o,a=!1,O="top",h,c,f=e.left-s.left,u=s.right-e.right,d=n.right-n.left,m=n.bottom-n.top;if(l&&f=m||y>e.top?h=t.bottom-e.top:(O="bottom",h=e.bottom-t.top)}let g=(e.bottom-e.top)/r.offsetHeight,$=(e.right-e.left)/r.offsetWidth;return{style:`${O}: ${h/g}px; max-width: ${c/$}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}function DQ(i){let e=i.addToOptions.slice();return i.icons&&e.push({render(t){let n=document.createElement("div");return n.classList.add("cm-completionIcon"),t.type&&n.classList.add(...t.type.split(/\s+/g).map(s=>"cm-completionIcon-"+s)),n.setAttribute("aria-hidden","true"),n},position:20}),e.push({render(t,n,s,r){let o=document.createElement("span");o.className="cm-completionLabel";let l=t.displayLabel||t.label,a=0;for(let O=0;Oa&&o.appendChild(document.createTextNode(l.slice(a,h)));let f=o.appendChild(document.createElement("span"));f.appendChild(document.createTextNode(l.slice(h,c))),f.className="cm-completionMatchedText",a=c}return at.position-n.position).map(t=>t.render)}function na(i,e,t){if(i<=t)return{from:0,to:i};if(e<0&&(e=0),e<=i>>1){let s=Math.floor(e/t);return{from:s*t,to:(s+1)*t}}let n=Math.floor((i-e)/t);return{from:i-(n+1)*t,to:i-n*t}}var la=class{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let s=e.state.field(t),{options:r,selected:o}=s.open,l=e.state.facet(le);this.optionContent=DQ(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=na(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:O}=e.state.field(t).open;for(let h=a.target,c;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(c=/-(\d+)$/.exec(h.id))&&+c[1]{let O=e.state.field(this.stateField,!1);O&&O.tooltip&&e.state.facet(le).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:qn.of(null)})}),this.showOptions(r,s.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let n=e.state.field(this.stateField),s=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=s){let{options:r,selected:o,disabled:l}=n.open;(!s.open||s.open.options!=r)&&(this.range=na(r.length,o,e.state.facet(le).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),l!=((t=s.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let n of this.currentClass.split(" "))n&&this.dom.classList.remove(n);for(let n of t.split(" "))n&&this.dom.classList.add(n);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=na(t.options.length,t.selected,this.view.state.facet(le).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:s}=n;if(!s)return;let r=typeof s=="string"?document.createTextNode(s):s(n);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(o,n)}).catch(o=>ce(this.view.state,o,"completion info")):this.addInfoPane(r,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",e.nodeType!=null)n.appendChild(e),this.infoDestroy=null;else{let{dom:s,destroy:r}=e;n.appendChild(s),this.infoDestroy=r||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,s=this.range.from;n;n=n.nextSibling,s++)n.nodeName!="LI"||!n.id?s--:s==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected");return t&&IQ(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),s=e.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.documentElement;r={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return s.top>Math.min(r.bottom,t.bottom)-10||s.bottom{o.target==s&&o.preventDefault()});let r=null;for(let o=n.from;on.from||n.from==0))if(r=f,typeof O!="string"&&O.header)s.appendChild(O.header(O));else{let u=s.appendChild(document.createElement("completion-section"));u.textContent=f}}let h=s.appendChild(document.createElement("li"));h.id=t+"-"+o,h.setAttribute("role","option");let c=this.optionClass(l);c&&(h.className=c);for(let f of this.optionContent){let u=f(l,this.view.state,this.view,a);u&&h.appendChild(u)}}return n.from&&s.classList.add("cm-completionListIncompleteTop"),n.tonew la(t,i,e)}function IQ(i,e){let t=i.getBoundingClientRect(),n=e.getBoundingClientRect(),s=t.height/i.offsetHeight;n.topt.bottom&&(i.scrollTop+=(n.bottom-t.bottom)/s)}function Qu(i){return(i.boost||0)*100+(i.apply?10:0)+(i.info?5:0)+(i.type?1:0)}function NQ(i,e){let t=[],n=null,s=O=>{t.push(O);let{section:h}=O.completion;if(h){n||(n=[]);let c=typeof h=="string"?h:h.name;n.some(f=>f.name==c)||n.push(typeof h=="string"?{name:c}:h)}},r=e.facet(le);for(let O of i)if(O.hasResult()){let h=O.result.getMatch;if(O.result.filter===!1)for(let c of O.result.options)s(new Sr(c,O.source,h?h(c):[],1e9-t.length));else{let c=e.sliceDoc(O.from,O.to),f,u=r.filterStrict?new oa(c):new ra(c);for(let d of O.result.options)if(f=u.match(d.label)){let m=d.displayLabel?h?h(d,f.matched):[]:f.matched;s(new Sr(d,O.source,m,f.score+(d.boost||0)))}}}if(n){let O=Object.create(null),h=0,c=(f,u)=>{var d,m;return((d=f.rank)!==null&&d!==void 0?d:1e9)-((m=u.rank)!==null&&m!==void 0?m:1e9)||(f.namec.score-h.score||a(h.completion,c.completion))){let h=O.completion;!l||l.label!=h.label||l.detail!=h.detail||l.type!=null&&h.type!=null&&l.type!=h.type||l.apply!=h.apply||l.boost!=h.boost?o.push(O):Qu(O.completion)>Qu(l)&&(o[o.length-1]=O),l=O.completion}return o}var aa=class i{constructor(e,t,n,s,r,o){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=s,this.selected=r,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new i(this.options,yu(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,s,r,o){if(s&&!o&&e.some(O=>O.isPending))return s.setDisabled();let l=NQ(e,t);if(!l.length)return s&&e.some(O=>O.isPending)?s.setDisabled():null;let a=t.facet(le).selectOnOpen?0:-1;if(s&&s.selected!=a&&s.selected!=-1){let O=s.options[s.selected].completion;for(let h=0;hh.hasResult()?Math.min(O,h.from):O,1e8),create:ty,above:r.aboveCursor},s?s.timestamp:Date.now(),a,!1)}map(e){return new i(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}setDisabled(){return new i(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}},Oa=class i{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new i(JQ,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,n=t.facet(le),r=(n.override||t.languageDataAt("autocomplete",ai(t)).map(EQ)).map(a=>(this.active.find(h=>h.source==a)||new Pt(a,this.active.some(h=>h.state!=0)?1:0)).update(e,n));r.length==this.active.length&&r.every((a,O)=>a==this.active[O])&&(r=this.active);let o=this.open,l=e.effects.some(a=>a.is(ma));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||r.some(a=>a.hasResult()&&e.changes.touchesRange(a.from,a.to))||!FQ(r,this.active)||l?o=aa.build(r,t,this.id,o,n,l):o&&o.disabled&&!r.some(a=>a.isPending)&&(o=null),!o&&r.every(a=>!a.isPending)&&r.some(a=>a.hasResult())&&(r=r.map(a=>a.hasResult()?new Pt(a.source,0):a));for(let a of e.effects)a.is(Tu)&&(o=o&&o.setSelected(a.value,this.id));return r==this.active&&o==this.open?this:new i(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?HQ:KQ}};function FQ(i,e){if(i==e)return!0;for(let t=0,n=0;;){for(;t-1&&(t["aria-activedescendant"]=i+"-"+e),t}var JQ=[];function wu(i,e){if(i.isUserEvent("input.complete")){let n=i.annotation(pa);if(n&&e.activateOnCompletion(n))return 12}let t=i.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:i.isUserEvent("delete.backward")?2:i.selection?8:i.docChanged?16:0}var Pt=class i{constructor(e,t,n=!1){this.source=e,this.state=t,this.explicit=n}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let n=wu(e,t),s=this;(n&8||n&16&&this.touches(e))&&(s=new i(s.source,0)),n&4&&s.state==0&&(s=new i(this.source,1)),s=s.updateFor(e,n);for(let r of e.effects)if(r.is(br))s=new i(s.source,1,r.value);else if(r.is(qn))s=new i(s.source,0);else if(r.is(ma))for(let o of r.value)o.source==s.source&&(s=o);return s}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(ai(e.state))}},xr=class i extends Pt{constructor(e,t,n,s,r,o){super(e,3,t),this.limit=n,this.result=s,this.from=r,this.to=o}hasResult(){return!0}updateFor(e,t){var n;if(!(t&3))return this.map(e.changes);let s=this.result;s.map&&!e.changes.empty&&(s=s.map(s,e.changes));let r=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),l=ai(e.state);if(l>o||!s||t&2&&(ai(e.startState)==this.from||lt.map(e))}}),Tu=q.define(),ve=J.define({create(){return Oa.start()},update(i,e){return i.update(e)},provide:i=>[gn.from(i,e=>e.tooltip),k.contentAttributes.from(i,e=>e.attrs)]});function ga(i,e){let t=e.completion.apply||e.completion.label,n=i.state.field(ve).active.find(s=>s.source==e.source);return n instanceof xr?(typeof t=="string"?i.dispatch(Object.assign(Object.assign({},GQ(i.state,t,n.from,n.to)),{annotations:pa.of(e.completion)})):t(i,e.completion,n.from,n.to),!0):!1}var ty=BQ(ve,ga);function Qr(i,e="option"){return t=>{let n=t.state.field(ve,!1);if(!n||!n.open||n.open.disabled||Date.now()-n.open.timestamp-1?n.open.selected+s*(i?1:-1):i?0:o-1;return l<0?l=e=="page"?0:o-1:l>=o&&(l=e=="page"?o-1:0),t.dispatch({effects:Tu.of(l)}),!0}}var iy=i=>{let e=i.state.field(ve,!1);return i.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampi.state.field(ve,!1)?(i.dispatch({effects:br.of(!0)}),!0):!1,ny=i=>{let e=i.state.field(ve,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(i.dispatch({effects:qn.of(null)}),!0)},ha=class{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}},sy=50,ry=1e3,oy=te.fromClass(class{constructor(i){this.view=i,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of i.state.field(ve).active)e.isPending&&this.startQuery(e)}update(i){let e=i.state.field(ve),t=i.state.facet(le);if(!i.selectionSet&&!i.docChanged&&i.startState.field(ve)==e)return;let n=i.transactions.some(r=>{let o=wu(r,t);return o&8||(r.selection||r.docChanged)&&!(o&3)});for(let r=0;rsy&&Date.now()-o.time>ry){for(let l of o.context.abortListeners)try{l()}catch(a){ce(this.view.state,a)}o.context.abortListeners=null,this.running.splice(r--,1)}else o.updates.push(...i.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),i.transactions.some(r=>r.effects.some(o=>o.is(br)))&&(this.pendingStart=!0);let s=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(r=>r.isPending&&!this.running.some(o=>o.active.source==r.source))?setTimeout(()=>this.startUpdate(),s):-1,this.composing!=0)for(let r of i.transactions)r.isUserEvent("input.type")?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:i}=this.view,e=i.field(ve);for(let t of e.active)t.isPending&&!this.running.some(n=>n.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(le).updateSyncTime))}startQuery(i){let{state:e}=this.view,t=ai(e),n=new yr(e,t,i.explicit,this.view),s=new ha(i,n);this.running.push(s),Promise.resolve(i.source(n)).then(r=>{s.context.aborted||(s.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:qn.of(null)}),ce(this.view.state,r)})}scheduleAccept(){this.running.every(i=>i.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(le).updateSyncTime))}accept(){var i;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(le),n=this.view.state.field(ve);for(let s=0;sl.source==r.active.source);if(o&&o.isPending)if(r.done==null){let l=new Pt(r.active.source,0);for(let a of r.updates)l=l.update(a,t);l.isPending||e.push(l)}else this.startQuery(o)}(e.length||n.open&&n.open.disabled)&&this.view.dispatch({effects:ma.of(e)})}},{eventHandlers:{blur(i){let e=this.view.state.field(ve,!1);if(e&&e.tooltip&&this.view.state.facet(le).closeOnBlur){let t=e.open&&ll(this.view,e.open.tooltip);(!t||!t.dom.contains(i.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:qn.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:br.of(!1)}),20),this.composing=0}}}),ly=typeof navigator=="object"&&/Win/.test(navigator.platform),ay=Me.highest(k.domEventHandlers({keydown(i,e){let t=e.state.field(ve,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||i.key.length>1||i.ctrlKey&&!(ly&&i.altKey)||i.metaKey)return!1;let n=t.open.options[t.open.selected],s=t.active.find(o=>o.source==n.source),r=n.completion.commitCharacters||s.result.commitCharacters;return r&&r.indexOf(i.key)>-1&&ga(e,n),!1}})),zu=k.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"\xB7\xB7\xB7"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",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",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'\u0192'"}},".cm-completionIcon-class":{"&:after":{content:"'\u25CB'"}},".cm-completionIcon-interface":{"&:after":{content:"'\u25CC'"}},".cm-completionIcon-variable":{"&:after":{content:"'\u{1D465}'"}},".cm-completionIcon-constant":{"&:after":{content:"'\u{1D436}'"}},".cm-completionIcon-type":{"&:after":{content:"'\u{1D461}'"}},".cm-completionIcon-enum":{"&:after":{content:"'\u222A'"}},".cm-completionIcon-property":{"&:after":{content:"'\u25A1'"}},".cm-completionIcon-keyword":{"&:after":{content:"'\u{1F511}\uFE0E'"}},".cm-completionIcon-namespace":{"&:after":{content:"'\u25A2'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),ca=class{constructor(e,t,n,s){this.field=e,this.line=t,this.from=n,this.to=s}},fa=class i{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,oe.TrackDel),n=e.mapPos(this.to,1,oe.TrackDel);return t==null||n==null?null:new i(this.field,t,n)}},ua=class i{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],s=[t],r=e.doc.lineAt(t),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(n.length){let O=o,h=/^\t*/.exec(a)[0].length;for(let c=0;cnew fa(a.field,s[a.line]+a.from,s[a.line]+a.to));return{text:n,ranges:l}}static parse(e){let t=[],n=[],s=[],r;for(let o of e.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|((?:\\[{}]|[^}])*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",O=-1,h=a.replace(/\\[{}]/g,c=>c[1]);for(let c=0;c=O&&f.field++}s.push(new ca(O,n.length,r.index,r.index+h.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}o=o.replace(/\\([{}])/g,(l,a,O)=>{for(let h of s)h.line==n.length&&h.from>O&&(h.from--,h.to--);return a}),n.push(o)}return new i(n,s)}},Oy=X.widget({widget:new class extends xe{toDOM(){let i=document.createElement("span");return i.className="cm-snippetFieldPosition",i}ignoreEvent(){return!1}}}),hy=X.mark({class:"cm-snippetField"}),Vi=class i{constructor(e,t){this.ranges=e,this.active=t,this.deco=X.set(e.map(n=>(n.from==n.to?Oy:hy).range(n.from,n.to)))}map(e){let t=[];for(let n of this.ranges){let s=n.map(e);if(!s)return null;t.push(s)}return new i(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(n=>n.field==this.active&&n.from<=t.from&&n.to>=t.to))}},Vn=q.define({map(i,e){return i&&i.map(e)}}),cy=q.define(),Wn=J.define({create(){return null},update(i,e){for(let t of e.effects){if(t.is(Vn))return t.value;if(t.is(cy)&&i)return new Vi(i.ranges,t.value)}return i&&e.docChanged&&(i=i.map(e.changes)),i&&e.selection&&!i.selectionInsideField(e.selection)&&(i=null),i},provide:i=>k.decorations.from(i,e=>e?e.deco:X.none)});function $a(i,e){return Q.create(i.filter(t=>t.field==e).map(t=>Q.range(t.from,t.to)))}function fy(i){let e=ua.parse(i);return(t,n,s,r)=>{let{text:o,ranges:l}=e.instantiate(t.state,s),{main:a}=t.state.selection,O={changes:{from:s,to:r==a.from?a.to:r,insert:Y.of(o)},scrollIntoView:!0,annotations:n?[pa.of(n),ne.userEvent.of("input.complete")]:void 0};if(l.length&&(O.selection=$a(l,0)),l.some(h=>h.field>0)){let h=new Vi(l,0),c=O.effects=[Vn.of(h)];t.state.field(Wn,!1)===void 0&&c.push(q.appendConfig.of([Wn,gy,$y,zu]))}t.dispatch(t.state.update(O))}}function Xu(i){return({state:e,dispatch:t})=>{let n=e.field(Wn,!1);if(!n||i<0&&n.active==0)return!1;let s=n.active+i,r=i>0&&!n.ranges.some(o=>o.field==s+i);return t(e.update({selection:$a(n.ranges,s),effects:Vn.of(r?null:new Vi(n.ranges,s)),scrollIntoView:!0})),!0}}var uy=({state:i,dispatch:e})=>i.field(Wn,!1)?(e(i.update({effects:Vn.of(null)})),!0):!1,dy=Xu(1),py=Xu(-1);var my=[{key:"Tab",run:dy,shift:py},{key:"Escape",run:uy}],bu=T.define({combine(i){return i.length?i[0]:my}}),gy=Me.highest(Wt.compute([bu],i=>i.facet(bu)));function ye(i,e){return Object.assign(Object.assign({},e),{apply:fy(i)})}var $y=k.domEventHandlers({mousedown(i,e){let t=e.state.field(Wn,!1),n;if(!t||(n=e.posAtCoords({x:i.clientX,y:i.clientY}))==null)return!1;let s=t.ranges.find(r=>r.from<=n&&r.to>=n);return!s||s.field==t.active?!1:(e.dispatch({selection:$a(t.ranges,s.field),effects:Vn.of(t.ranges.some(r=>r.field>s.field)?new Vi(t.ranges,s.field):null),scrollIntoView:!0}),!0)}});var Zn={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},li=q.define({map(i,e){let t=e.mapPos(i,-1,oe.TrackAfter);return t??void 0}}),Qa=new class extends He{};Qa.startSide=1;Qa.endSide=-1;var Ru=J.define({create(){return j.empty},update(i,e){if(i=i.map(e.changes),e.selection){let t=e.state.doc.lineAt(e.selection.main.head);i=i.update({filter:n=>n>=t.from&&n<=t.to})}for(let t of e.effects)t.is(li)&&(i=i.update({add:[Qa.range(t.value,t.value+1)]}));return i}});function qu(){return[yy,Ru]}var sa="()[]{}<>\xAB\xBB\xBB\xAB\uFF3B\uFF3D\uFF5B\uFF5D";function Wu(i){for(let e=0;e{if((Qy?i.composing:i.compositionStarted)||i.state.readOnly)return!1;let s=i.state.selection.main;if(n.length>2||n.length==2&&Xe(Oe(n,0))==1||e!=s.from||t!=s.to)return!1;let r=by(i.state,n);return r?(i.dispatch(r),!0):!1}),Sy=({state:i,dispatch:e})=>{if(i.readOnly)return!1;let n=Zu(i,i.selection.main.head).brackets||Zn.brackets,s=null,r=i.changeByRange(o=>{if(o.empty){let l=xy(i.doc,o.head);for(let a of n)if(a==l&&Pr(i.doc,o.head)==Wu(Oe(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:Q.cursor(o.head-a.length)}}return{range:s=o}});return s||e(i.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!s},Vu=[{key:"Backspace",run:Sy}];function by(i,e){let t=Zu(i,i.selection.main.head),n=t.brackets||Zn.brackets;for(let s of n){let r=Wu(Oe(s,0));if(e==s)return r==s?vy(i,s,n.indexOf(s+s+s)>-1,t):Py(i,s,r,t.before||Zn.before);if(e==r&&Cu(i,i.selection.main.from))return ky(i,s,r)}return null}function Cu(i,e){let t=!1;return i.field(Ru).between(0,i.doc.length,n=>{n==e&&(t=!0)}),t}function Pr(i,e){let t=i.sliceString(e,e+2);return t.slice(0,Xe(Oe(t,0)))}function xy(i,e){let t=i.sliceString(e-2,e);return Xe(Oe(t,0))==t.length?t:t.slice(1)}function Py(i,e,t,n){let s=null,r=i.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:t,from:o.to}],effects:li.of(o.to+e.length),range:Q.range(o.anchor+e.length,o.head+e.length)};let l=Pr(i.doc,o.head);return!l||/\s/.test(l)||n.indexOf(l)>-1?{changes:{insert:e+t,from:o.head},effects:li.of(o.head+e.length),range:Q.cursor(o.head+e.length)}:{range:s=o}});return s?null:i.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function ky(i,e,t){let n=null,s=i.changeByRange(r=>r.empty&&Pr(i.doc,r.head)==t?{changes:{from:r.head,to:r.head+t.length,insert:t},range:Q.cursor(r.head+t.length)}:n={range:r});return n?null:i.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function vy(i,e,t,n){let s=n.stringPrefixes||Zn.stringPrefixes,r=null,o=i.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:e,from:l.to}],effects:li.of(l.to+e.length),range:Q.range(l.anchor+e.length,l.head+e.length)};let a=l.head,O=Pr(i.doc,a),h;if(O==e){if(xu(i,a))return{changes:{insert:e+e,from:a},effects:li.of(a+e.length),range:Q.cursor(a+e.length)};if(Cu(i,a)){let f=t&&i.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+f.length,insert:f},range:Q.cursor(a+f.length)}}}else{if(t&&i.sliceDoc(a-2*e.length,a)==e+e&&(h=Pu(i,a-2*e.length,s))>-1&&xu(i,h))return{changes:{insert:e+e+e+e,from:a},effects:li.of(a+e.length),range:Q.cursor(a+e.length)};if(i.charCategorizer(a)(O)!=L.Word&&Pu(i,a,s)>-1&&!wy(i,a,e,s))return{changes:{insert:e+e,from:a},effects:li.of(a+e.length),range:Q.cursor(a+e.length)}}return{range:r=l}});return r?null:i.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function xu(i,e){let t=N(i).resolveInner(e+1);return t.parent&&t.from==e}function wy(i,e,t,n){let s=N(i).resolveInner(e,-1),r=n.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=i.sliceDoc(s.from,Math.min(s.to,s.from+t.length+r)),a=l.indexOf(t);if(!a||a>-1&&n.indexOf(l.slice(0,a))>-1){let h=s.firstChild;for(;h&&h.from==s.from&&h.to-h.from>t.length+a;){if(i.sliceDoc(h.to-t.length,h.to)==t)return!1;h=h.firstChild}return!0}let O=s.to==e&&s.parent;if(!O)break;s=O}return!1}function Pu(i,e,t){let n=i.charCategorizer(e);if(n(i.sliceDoc(e-1,e))!=L.Word)return e;for(let s of t){let r=e-s.length;if(i.sliceDoc(r,e)==s&&n(i.sliceDoc(r-1,r))!=L.Word)return r}return-1}function Yu(i={}){return[ay,ve,le.of(i),oy,Ty,zu]}var ya=[{key:"Ctrl-Space",run:Su},{mac:"Alt-`",run:Su},{key:"Escape",run:ny},{key:"ArrowDown",run:Qr(!0)},{key:"ArrowUp",run:Qr(!1)},{key:"PageDown",run:Qr(!0,"page")},{key:"PageUp",run:Qr(!1,"page")},{key:"Enter",run:iy}],Ty=Me.highest(Wt.computeN([le],i=>i.facet(le).defaultKeymap?[ya]:[]));var vr=class{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}},Oi=class i{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let s=n.facet(Cn).markerFilter;s&&(e=s(e,n));let r=e.slice().sort((h,c)=>h.from-c.from||h.to-c.to),o=new ze,l=[],a=0;for(let h=0;;){let c=h==r.length?null:r[h];if(!c&&!l.length)break;let f,u;for(l.length?(f=a,u=l.reduce((m,g)=>Math.min(m,g.to),c&&c.from>f?c.from:1e8)):(f=c.from,u=c.to,l.push(c),h++);hm.from||m.to==f))l.push(m),h++,u=Math.min(m.to,u);else{u=Math.min(m.from,u);break}}let d=Ay(l);if(l.some(m=>m.from==m.to||m.from==m.to-1&&n.doc.lineAt(m.from).to==m.from))o.add(f,f,X.widget({widget:new Sa(d),diagnostics:l.slice()}));else{let m=l.reduce((g,$)=>$.markClass?g+" "+$.markClass:g,"");o.add(f,u,X.mark({class:"cm-lintRange cm-lintRange-"+d+m,diagnostics:l.slice(),inclusiveEnd:l.some(g=>g.to>u)}))}a=u;for(let m=0;m{if(!(e&&o.diagnostics.indexOf(e)<0))if(!n)n=new vr(s,r,e||o.diagnostics[0]);else{if(o.diagnostics.indexOf(n.diagnostic)<0)return!1;n=new vr(n.from,r,n.diagnostic)}}),n}function zy(i,e){let t=e.pos,n=e.end||t,s=i.state.facet(Cn).hideOn(i,t,n);if(s!=null)return s;let r=i.startState.doc.lineAt(e.pos);return!!(i.effects.some(o=>o.is(Au))||i.changes.touchesRange(r.from,Math.max(r.to,n)))}function Xy(i,e){return i.field(Ce,!1)?e:e.concat(q.appendConfig.of(Uy))}var Au=q.define(),ba=q.define(),Uu=q.define(),Ce=J.define({create(){return new Oi(X.none,null,null)},update(i,e){if(e.docChanged&&i.diagnostics.size){let t=i.diagnostics.map(e.changes),n=null,s=i.panel;if(i.selected){let r=e.changes.mapPos(i.selected.from,1);n=Ci(t,i.selected.diagnostic,r)||Ci(t,null,r)}!t.size&&s&&e.state.facet(Cn).autoPanel&&(s=null),i=new Oi(t,s,n)}for(let t of e.effects)if(t.is(Au)){let n=e.state.facet(Cn).autoPanel?t.value.length?Yn.open:null:i.panel;i=Oi.init(t.value,n,e.state)}else t.is(ba)?i=new Oi(i.diagnostics,t.value?Yn.open:null,i.selected):t.is(Uu)&&(i=new Oi(i.diagnostics,i.panel,t.value));return i},provide:i=>[Jt.from(i,e=>e.panel),k.decorations.from(i,e=>e.diagnostics)]});var Ry=X.mark({class:"cm-lintRange cm-lintRange-active"});function qy(i,e,t){let{diagnostics:n}=i.state.field(Ce),s,r=-1,o=-1;n.between(e-(t<0?1:0),e+(t>0?1:0),(a,O,{spec:h})=>{if(e>=a&&e<=O&&(a==O||(e>a||t>0)&&(eGu(i,t,!1)))}var Zy=i=>{let e=i.state.field(Ce,!1);(!e||!e.panel)&&i.dispatch({effects:Xy(i.state,[ba.of(!0)])});let t=ei(i,Yn.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},_u=i=>{let e=i.state.field(Ce,!1);return!e||!e.panel?!1:(i.dispatch({effects:ba.of(!1)}),!0)},Vy=i=>{let e=i.state.field(Ce,!1);if(!e)return!1;let t=i.state.selection.main,n=e.diagnostics.iter(t.to+1);return!n.value&&(n=e.diagnostics.iter(0),!n.value||n.from==t.from&&n.to==t.to)?!1:(i.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0}),!0)};var Mu=[{key:"Mod-Shift-m",run:Zy,preventDefault:!0},{key:"F8",run:Vy}];var Cn=T.define({combine(i){return Object.assign({sources:i.map(e=>e.source).filter(e=>e!=null)},de(i.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null,hideOn:()=>null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))}});function ju(i){let e=[];if(i)e:for(let{name:t}of i){for(let n=0;nr.toLowerCase()==s.toLowerCase())){e.push(s);continue e}}e.push("")}return e}function Gu(i,e,t){var n;let s=t?ju(e.actions):[];return U("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},U("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage(i):e.message),(n=e.actions)===null||n===void 0?void 0:n.map((r,o)=>{let l=!1,a=f=>{if(f.preventDefault(),l)return;l=!0;let u=Ci(i.state.field(Ce).diagnostics,e);u&&r.apply(i,u.from,u.to)},{name:O}=r,h=s[o]?O.indexOf(s[o]):-1,c=h<0?O:[O.slice(0,h),U("u",O.slice(h,h+1)),O.slice(h+1)];return U("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${O}${h<0?"":` (access key "${s[o]})"`}.`},c)}),e.source&&U("div",{class:"cm-diagnosticSource"},e.source))}var Sa=class extends xe{constructor(e){super(),this.sev=e}eq(e){return e.sev==this.sev}toDOM(){return U("span",{class:"cm-lintPoint cm-lintPoint-"+this.sev})}},wr=class{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Gu(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}},Yn=class i{constructor(e){this.view=e,this.items=[];let t=s=>{if(s.keyCode==27)_u(this.view),this.view.focus();else if(s.keyCode==38||s.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(s.keyCode==40||s.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(s.keyCode==36)this.moveSelection(0);else if(s.keyCode==35)this.moveSelection(this.items.length-1);else if(s.keyCode==13)this.view.focus();else if(s.keyCode>=65&&s.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:r}=this.items[this.selectedIndex],o=ju(r.actions);for(let l=0;l{for(let r=0;r_u(this.view)},"\xD7")),this.update()}get selectedIndex(){let e=this.view.state.field(Ce).selected;if(!e)return-1;for(let t=0;t{for(let h of O.diagnostics){if(o.has(h))continue;o.add(h);let c=-1,f;for(let u=n;un&&(this.items.splice(n,c-n),s=!0)),t&&f.diagnostic==t.diagnostic?f.dom.hasAttribute("aria-selected")||(f.dom.setAttribute("aria-selected","true"),r=f):f.dom.hasAttribute("aria-selected")&&f.dom.removeAttribute("aria-selected"),n++}});n({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:a})=>{let O=a.height/this.list.offsetHeight;l.topa.bottom&&(this.list.scrollTop+=(l.bottom-a.bottom)/O)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),s&&this.sync()}sync(){let e=this.list.firstChild;function t(){let n=e;e=n.nextSibling,n.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(Ce),n=Ci(t.diagnostics,this.items[e].diagnostic);n&&this.view.dispatch({selection:{anchor:n.from,head:n.to},scrollIntoView:!0,effects:Uu.of(n)})}static open(e){return new i(e)}};function Cy(i,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(i)}')`}function kr(i){return Cy(``,'width="6" height="3"')}var Yy=k.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:kr("#d11")},".cm-lintRange-warning":{backgroundImage:kr("orange")},".cm-lintRange-info":{backgroundImage:kr("#999")},".cm-lintRange-hint":{backgroundImage:kr("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}});function _y(i){return i=="error"?4:i=="warning"?3:i=="info"?2:1}function Ay(i){let e="hint",t=1;for(let n of i){let s=_y(n.severity);s>t&&(t=s,e=n.severity)}return e}var Uy=[Ce,k.decorations.compute([Ce],i=>{let{selected:e,panel:t}=i.field(Ce);return!e||!t||e.from==e.to?X.none:X.set([Ry.range(e.from,e.to)])}),xc(qy,{hideOn:zy}),Yy];var Eu=[vc(),wc(),Qc(),kf(),of(),pc(),$c(),M.allowMultipleSelections.of(!0),Hc(),af(Of,{fallback:!0}),uf(),qu(),Yu(),Sc(),bc(),yc(),hu(),Wt.of([...Vu,...iu,...pu,...zf,...nf,...ya,...Mu])];var ka=class i{constructor(e,t,n,s,r,o,l,a,O,h=0,c){this.p=e,this.stack=t,this.state=n,this.reducePos=s,this.pos=r,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=O,this.lookAhead=h,this.parent=c}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let s=e.parser.context;return new i(e,[],t,n,n,0,[],0,s?new Tr(s,s.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let n=e>>19,s=e&65535,{parser:r}=this.p,o=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[s])===null||t===void 0)&&t.isAnonymous)&&(O==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(s,O)}storeNode(e,t,n,s=4,r=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&o.buffer[l-4]==0&&o.buffer[l-1]>-1){if(t==n)return;if(o.buffer[l-2]>=t){o.buffer[l-2]=n;return}}}if(!r||this.pos==n)this.buffer.push(e,t,n,s);else{let o=this.buffer.length;if(o>0&&this.buffer[o-4]!=0){let l=!1;for(let a=o;a>0&&this.buffer[a-2]>n;a-=4)if(this.buffer[a-1]>=0){l=!0;break}if(l)for(;o>0&&this.buffer[o-2]>n;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,s>4&&(s-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=n,this.buffer[o+3]=s}}shift(e,t,n,s){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let r=e,{parser:o}=this.p;(s>this.pos||t<=o.maxNode)&&(this.pos=s,o.stateFlag(r,1)||(this.reducePos=s)),this.pushState(r,n),this.shiftContext(t,n),t<=o.maxNode&&this.buffer.push(t,n,s,4)}else this.pos=s,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,s,4)}apply(e,t,n,s){e&65536?this.reduce(e):this.shift(e,t,n,s)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let s=this.pos;this.reducePos=this.pos=s+e.length,this.pushState(t,s),this.buffer.push(n,s,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let n=e.buffer.slice(t),s=e.bufferBase+t;for(;e&&s==e.bufferBase;)e=e.parent;return new i(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,s,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new va(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(n==0)return!1;if((n&65536)==0)return!0;t.reduce(n)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let s=[];for(let r=0,o;ra&1&&l==o)||s.push(t[r],o)}t=s}let n=[];for(let s=0;s>19,s=t&65535,r=this.stack.length-n*3;if(r<0||e.getGoto(this.stack[r],s,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],n=(s,r)=>{if(!t.includes(s))return t.push(s),e.allActions(s,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-r;if(l>1){let a=o&65535,O=this.stack.length-l*3;if(O>=0&&e.getGoto(this.stack[O],a,!1)>=0)return l<<19|65536|a}}else{let l=n(o,r+1);if(l!=null)return l}})};return n(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}},Tr=class{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}},va=class{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,n=e>>19;n==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(n-1)*3;let s=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=s}},wa=class i{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new i(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.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,this.index==0&&this.maybeNext()}fork(){return new i(this.stack,this.pos,this.index)}};function _n(i,e=Uint16Array){if(typeof i!="string")return i;let t=null;for(let n=0,s=0;n=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),r+=a,l)break;r*=46}t?t[s++]=r:t=new e(r)}return t}var Yi=class{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}},Lu=new Yi,Ta=class{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Lu,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let n=this.range,s=this.rangeIndex,r=this.pos+e;for(;rn.to:r>=n.to;){if(s==this.ranges.length-1)return null;let o=this.ranges[++s];r+=o.from-n.to,n=o}return r}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,n,s;if(t>=0&&t=this.chunk2Pos&&nl.to&&(this.chunk2=this.chunk2.slice(0,l.to-n)),s=this.chunk2.charCodeAt(0)}}return n>=this.token.lookAhead&&(this.token.lookAhead=n+1),s}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(n==null||n=this.chunk2Pos&&this.posthis.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=Lu,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let n="";for(let s of this.ranges){if(s.from>=t)break;s.to>e&&(n+=this.input.read(Math.max(s.from,e),Math.min(s.to,t)))}return n}},jt=class{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;Fu(this.data,e,t,this.id,n.data,n.tokenPrecTable)}};jt.prototype.contextual=jt.prototype.fallback=jt.prototype.extend=!1;var Gt=class{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data=typeof e=="string"?_n(e):e}token(e,t){let n=e.pos,s=0;for(;;){let r=e.next<0,o=e.resolveOffset(1,1);if(Fu(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(r||s++,o==null)break;e.reset(o,e.token)}s&&(e.reset(n,e.token),e.acceptToken(this.elseToken,s))}};Gt.prototype.contextual=jt.prototype.fallback=jt.prototype.extend=!1;var ie=class{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}};function Fu(i,e,t,n,s,r){let o=0,l=1<0){let d=i[u];if(a.allows(d)&&(e.token.value==-1||e.token.value==d||jy(d,e.token.value,s,r))){e.acceptToken(d);break}}let h=e.next,c=0,f=i[o+2];if(e.next<0&&f>c&&i[O+f*3-3]==65535){o=i[O+f*3-1];continue e}for(;c>1,d=O+u+(u<<1),m=i[d],g=i[d+1]||65536;if(h=g)c=u+1;else{o=i[d+2],e.advance();continue e}}break}}function Du(i,e,t){for(let n=e,s;(s=i[n])!=65535;n++)if(s==t)return n-e;return-1}function jy(i,e,t,n){let s=Du(t,n,e);return s<0||Du(t,n,i)e)&&!n.type.isError)return t<0?Math.max(0,Math.min(n.to-1,e-25)):Math.min(i.length,Math.max(n.from+1,e+25));if(t<0?n.prevSibling():n.nextSibling())break;if(!n.parent())return t<0?0:i.length}}var za=class{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?Bu(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Bu(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(ee)return this.nextStart=o,null;if(r instanceof ee){if(o==e){if(o=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+r.length}}},Xa=class{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(n=>new Yi)}getActions(e){let t=0,n=null,{parser:s}=e.p,{tokenizers:r}=s,o=s.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let O=0;Oc.end+25&&(a=Math.max(c.lookAhead,a)),c.value!=0)){let f=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!h.extend&&(n=c,t>f))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!n&&e.pos==this.stream.end&&(n=new Yi,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Yi,{pos:n,p:s}=e;return t.start=n,t.end=Math.min(n+1,s.stream.end),t.value=n==s.stream.end?s.parser.eofTerm:0,t}updateCachedToken(e,t,n){let s=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(s,e),n),e.value>-1){let{parser:r}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(l>>1)){(l&1)==0?e.value=l>>1:e.extended=l>>1;break}}}else e.value=0,e.end=this.stream.clipPos(s+1)}putAction(e,t,n,s){for(let r=0;re.bufferLength*4?new za(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,n=this.stacks=[],s,r;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;ot)n.push(l);else{if(this.advanceStack(l,n,e))continue;{s||(s=[],r=[]),s.push(l);let a=this.tokens.getMainToken(l);r.push(a.value,a.end)}}break}}if(!n.length){let o=s&&Gy(s);if(o)return Ye&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Ye&&s&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&s){let o=this.stoppedAt!=null&&s[0].pos>this.stoppedAt?s[0]:this.runRecovery(s,r,n);if(o)return Ye&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(n.length>o)for(n.sort((l,a)=>a.score-l.score);n.length>o;)n.pop();n.some(l=>l.reducePos>t)&&this.recovering--}else if(n.length>1){e:for(let o=0;o500&&O.buffer.length>500)if((l.score-O.score||l.buffer.length-O.buffer.length)>0)n.splice(a--,1);else{n.splice(o--,1);continue e}}}n.length>12&&n.splice(12,n.length-12)}this.minStackPos=n[0].pos;for(let o=1;o ":"";if(this.stoppedAt!=null&&s>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let O=e.curContext&&e.curContext.tracker.strict,h=O?e.curContext.hash:0;for(let c=this.fragments.nodeAt(s);c;){let f=this.parser.nodeSet.types[c.type.id]==c.type?r.getGoto(e.state,c.type.id):-1;if(f>-1&&c.length&&(!O||(c.prop(Z.contextHash)||0)==h))return e.useNode(c,f),Ye&&console.log(o+this.stackID(e)+` (via reuse of ${r.getName(c.type.id)})`),!0;if(!(c instanceof ee)||c.children.length==0||c.positions[0]>0)break;let u=c.children[0];if(u instanceof ee&&c.positions[0]==0)c=u;else break}}let l=r.stateSlot(e.state,4);if(l>0)return e.reduce(l),Ye&&console.log(o+this.stackID(e)+` (via always-reduce ${r.getName(l&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let O=0;Os?t.push(d):n.push(d)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Iu(e,t),!0}}runRecovery(e,t,n){let s=null,r=!1;for(let o=0;o ":"";if(l.deadEnd&&(r||(r=!0,l.restart(),Ye&&console.log(h+this.stackID(l)+" (restarted)"),this.advanceFully(l,n))))continue;let c=l.split(),f=h;for(let u=0;c.forceReduce()&&u<10&&(Ye&&console.log(f+this.stackID(c)+" (via force-reduce)"),!this.advanceFully(c,n));u++)Ye&&(f=this.stackID(c)+" -> ");for(let u of l.recoverByInsert(a))Ye&&console.log(h+this.stackID(u)+" (via recover-insert)"),this.advanceFully(u,n);this.stream.end>l.pos?(O==l.pos&&(O++,a=0),l.recoverByDelete(a,O),Ye&&console.log(h+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),Iu(l,n)):(!s||s.scorei,_i=class{constructor(e){this.start=e.start,this.shift=e.shift||Pa,this.reduce=e.reduce||Pa,this.reuse=e.reuse||Pa,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}},Fe=class i extends vi{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;le.topRules[l][1]),s=[];for(let l=0;l=0)r(h,a,l[O++]);else{let c=l[O+-h];for(let f=-h;f>0;f--)r(l[O++],a,c);O++}}}this.nodeSet=new $n(t.map((l,a)=>fe.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:s[a],top:n.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=1024;let o=_n(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;ltypeof l=="number"?new jt(o,l):l),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,n){let s=new Ra(this,e,t,n);for(let r of this.wrappers)s=r(s,e,t,n);return s}getGoto(e,t,n=!1){let s=this.goto;if(t>=s[0])return-1;for(let r=s[t+1];;){let o=s[r++],l=o&1,a=s[r++];if(l&&n)return a;for(let O=r+(o>>1);r0}validAction(e,t){return!!this.allActions(e,n=>n==t?!0:null)}allActions(e,t){let n=this.stateSlot(e,4),s=n?t(n):void 0;for(let r=this.stateSlot(e,1);s==null;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=kt(this.data,r+2);else break;s=t(kt(this.data,r+1))}return s}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(this.data[n]==65535)if(this.data[n+1]==1)n=kt(this.data,n+2);else break;if((this.data[n+2]&1)==0){let s=this.data[n+1];t.some((r,o)=>o&1&&r==s)||t.push(this.data[n],s)}}return t}configure(e){let t=Object.assign(Object.create(i.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(n=>{let s=e.tokenizers.find(r=>r.from==n);return s?s.to:n})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((n,s)=>{let r=e.specializers.find(l=>l.from==n.external);if(!r)return n;let o=Object.assign(Object.assign({},n),{external:r.to});return t.specializers[s]=Nu(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map(()=>!1);if(e)for(let r of e.split(" ")){let o=t.indexOf(r);o>=0&&(n[o]=!0)}let s=null;for(let r=0;rn)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scorei.external(t,n)<<1|e}return i.get}var Ey=107,Hu=1,Ly=108,Dy=109,Ku=2,Ju=110,ed=[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],By=58,Iy=40,td=95,Ny=91,zr=45,Fy=46,Hy=35,Ky=37,Jy=38,eS=92,tS=10,iS=42;function An(i){return i>=65&&i<=90||i>=97&&i<=122||i>=161}function id(i){return i>=48&&i<=57}var nS=new ie((i,e)=>{for(let t=!1,n=0,s=0;;s++){let{next:r}=i;if(An(r)||r==zr||r==td||t&&id(r))!t&&(r!=zr||s>0)&&(t=!0),n===s&&r==zr&&n++,i.advance();else if(r==eS&&i.peek(1)!=tS)i.advance(),i.next>-1&&i.advance(),t=!0;else{t&&i.acceptToken(n==2&&e.canShift(Ku)?Ku:e.canShift(Ju)?Ju:r==Iy?Ly:Dy);break}}}),sS=new ie(i=>{if(ed.includes(i.peek(-1))){let{next:e}=i;(An(e)||e==td||e==Hy||e==Fy||e==iS||e==Ny||e==By&&An(i.peek(1))||e==zr||e==Jy)&&i.acceptToken(Ey)}}),rS=new ie(i=>{if(!ed.includes(i.peek(-1))){let{next:e}=i;if(e==Ky&&(i.advance(),i.acceptToken(Hu)),An(e)){do i.advance();while(An(i.next)||id(i.next));i.acceptToken(Hu)}}}),oS=Le({"AtKeyword import charset namespace keyframes media supports":p.definitionKeyword,"from to selector":p.keyword,NamespaceName:p.namespace,KeyframeName:p.labelName,KeyframeRangeName:p.operatorKeyword,TagName:p.tagName,ClassName:p.className,PseudoClassName:p.constant(p.className),IdName:p.labelName,"FeatureName PropertyName":p.propertyName,AttributeName:p.attributeName,NumberLiteral:p.number,KeywordQuery:p.keyword,UnaryQueryOp:p.operatorKeyword,"CallTag ValueName":p.atom,VariableName:p.variableName,Callee:p.operatorKeyword,Unit:p.unit,"UniversalSelector NestingSelector":p.definitionOperator,"MatchOp CompareOp":p.compareOperator,"ChildOp SiblingOp, LogicOp":p.logicOperator,BinOp:p.arithmeticOperator,Important:p.modifier,Comment:p.blockComment,ColorLiteral:p.color,"ParenthesizedContent StringLiteral":p.string,":":p.punctuation,"PseudoOp #":p.derefOperator,"; ,":p.separator,"( )":p.paren,"[ ]":p.squareBracket,"{ }":p.brace}),lS={__proto__:null,lang:34,"nth-child":34,"nth-last-child":34,"nth-of-type":34,"nth-last-of-type":34,dir:34,"host-context":34,url:62,"url-prefix":62,domain:62,regexp:62},aS={__proto__:null,"@import":120,"@media":154,"@charset":158,"@namespace":162,"@keyframes":168,"@supports":180},OS={__proto__:null,layer:124,not:144,only:144,selector:150},nd=Fe.deserialize({version:14,states:">`QYQ[OOO#kQ[OOP#rOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#wQ[O'#CfO$hQXO'#CaO$rQ[O'#CiO$}Q[O'#DUO%SQ[O'#DXO%XQ[O'#D[O%XQ[O'#D_OOQP'#Ev'#EvO%yQdO'#DhO&hQ[O'#DzO%yQdO'#D|O&yQ[O'#EOO'UQ[O'#ERO'^Q[O'#EXO'lQ[O'#EZOOQS'#Eu'#EuOOQS'#E^'#E^QYQ[OOO'sQXO'#CdO(hQWO'#DdO(mQWO'#E{O(xQ[O'#E{QOQWOOP)SO#tO'#C_POOO)C@e)C@eOOQP'#Ch'#ChOOQP,59Q,59QO#wQ[O,59QO)_Q[O,59TO$}Q[O,59pO%SQ[O,59sO%XQ[O,59vO%XQ[O,59xO%XQ[O,59yO%XQ[O'#EcO)jQWO,58{O)rQ[O'#DcOOQS,58{,58{OOQP'#Cl'#ClOOQO'#DS'#DSOOQ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g%pw!]]_!X!b!q#W#Y#]#y$T$Y$f$g$v$w%P%X%i%pp!`]_!X!q#W#Y#]#y$T$Y$f$v$w%P%X%iQ!j`U#j!b$g%pR#t!kT#d!_#eQ!OVR!zqQ!y!OR$R!zQ!RWR!|rQ!TXR!}sQzUQ#TxQ#q!gQ#w!nQ#x!oQ%`$rR%s%_SiPyQ!tjQ#{!rR$y#|ZhPjy!r#|R#`!ZQ%U$_R%t%kc!f^bc!Z!b!d#`#l#mQ#h!bQ%Z$gR%w%pR!k`R!maR#v!mS$r#u$sR%q%^V$p#u$s%^Q!vlR$P!vQfOSjPyU!pfj#|R#|!rQ$Y#WU%O$Y%X%iQ%X$fR%i%PQ#e!_R$d#eQ%Q$YR%j%QQ$|$VR%h$|QxUR#SxQ$w#yR%d$wQ!siS#}!s$OR$O!tQ%l%UR%u%lQ#n!cR$k#nQ$s#uR%a$sQ%_$rR%r%__eOPfjy!r#|^UOPfjy!r#|Q!UYQ!VZQ#OtQ#PuQ#QvQ#RwQ$V#VQ$l#pR%g${R$Z#WQ!Z]Q!h_Q#Z!XQ#y!q[$X#W$Y$f%P%X%iQ$[#YQ$^#]S$u#y$wQ$z$TR%c$vR$W#VQkPR#UyQ!g^Q!ocQ#_!ZR$a#`W!c^c!Z#`Q!nbQ#i!bQ#o!dQ$i#lR$j#mQ#k!bQ%Z$gR%w%p",nodeNames:"\u26A0 Unit VariableName Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee CallLiteral CallTag ParenthesizedContent ] [ LineNames LineName , PseudoClassName ArgList IdSelector # IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp } { Block Declaration PropertyName Important ; ImportStatement AtKeyword import Layer layer LayerName KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports AtRule Styles",maxTerm:126,nodeProps:[["isolate",-2,3,25,""],["openedBy",18,"(",33,"[",51,"{"],["closedBy",19,")",34,"]",52,"}"]],propSources:[oS],skippedNodes:[0,3,93],repeatNodeCount:13,tokenData:"LU~R!^OX$}X^%u^p$}pq%uqr)Xrs.Rst/utu6duv$}vw7^wx7oxy9^yz9oz{9t{|:_|}?Q}!O?c!O!P@Q!P!Q@i!Q![Ab![!]B]!]!^CX!^!_Cj!_!`Df!`!aDy!a!b$}!b!cEz!c!}$}!}#OHX#O#P$}#P#QHj#Q#R6d#R#T$}#T#UH{#U#c$}#c#dJ^#d#o$}#o#pJs#p#q6d#q#rKU#r#sKg#s#y$}#y#z%u#z$f$}$f$g%u$g#BY$}#BY#BZ%u#BZ$IS$}$IS$I_%u$I_$I|$}$I|$JO%u$JO$JT$}$JT$JU%u$JU$KV$}$KV$KW%u$KW&FU$}&FU&FV%u&FV;'S$};'S;=`LO<%lO$}`%QSOy%^z;'S%^;'S;=`%o<%lO%^`%cSp`Oy%^z;'S%^;'S;=`%o<%lO%^`%rP;=`<%l%^~%zh#d~OX%^X^'f^p%^pq'fqy%^z#y%^#y#z'f#z$f%^$f$g'f$g#BY%^#BY#BZ'f#BZ$IS%^$IS$I_'f$I_$I|%^$I|$JO'f$JO$JT%^$JT$JU'f$JU$KV%^$KV$KW'f$KW&FU%^&FU&FV'f&FV;'S%^;'S;=`%o<%lO%^~'mh#d~p`OX%^X^'f^p%^pq'fqy%^z#y%^#y#z'f#z$f%^$f$g'f$g#BY%^#BY#BZ'f#BZ$IS%^$IS$I_'f$I_$I|%^$I|$JO'f$JO$JT%^$JT$JU'f$JU$KV%^$KV$KW'f$KW&FU%^&FU&FV'f&FV;'S%^;'S;=`%o<%lO%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o<%lO%^bB{S_Qp`Oy%^z;'S%^;'S;=`%o<%lO%^nC^S!Z^Oy%^z;'S%^;'S;=`%o<%lO%^hCoU!hWOy%^z!_%^!_!`DR!`;'S%^;'S;=`%o<%lO%^hDYS!hWp`Oy%^z;'S%^;'S;=`%o<%lO%^lDmS!hW}SOy%^z;'S%^;'S;=`%o<%lO%^jEQV!PQ!hWOy%^z!_%^!_!`DR!`!aEg!a;'S%^;'S;=`%o<%lO%^bEnS!PQp`Oy%^z;'S%^;'S;=`%o<%lO%^bE}YOy%^z}%^}!OFm!O!c%^!c!}G[!}#T%^#T#oG[#o;'S%^;'S;=`%o<%lO%^bFrWp`Oy%^z!c%^!c!}G[!}#T%^#T#oG[#o;'S%^;'S;=`%o<%lO%^bGc[!]Qp`Oy%^z}%^}!OG[!O!Q%^!Q![G[![!c%^!c!}G[!}#T%^#T#oG[#o;'S%^;'S;=`%o<%lO%^nH^Sr^Oy%^z;'S%^;'S;=`%o<%lO%^nHoSq^Oy%^z;'S%^;'S;=`%o<%lO%^jIOUOy%^z#b%^#b#cIb#c;'S%^;'S;=`%o<%lO%^jIgUp`Oy%^z#W%^#W#XIy#X;'S%^;'S;=`%o<%lO%^jJQS!fYp`Oy%^z;'S%^;'S;=`%o<%lO%^jJaUOy%^z#f%^#f#gIy#g;'S%^;'S;=`%o<%lO%^fJxS!UUOy%^z;'S%^;'S;=`%o<%lO%^nKZS!T^Oy%^z;'S%^;'S;=`%o<%lO%^fKlU!SQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`LRP;=`<%l$}",tokenizers:[sS,rS,nS,1,2,3,4,new Gt("m~RRYZ[z{a~~g~aO#g~~dP!P!Qg~lO#h~~",28,114)],topRules:{StyleSheet:[0,4],Styles:[1,92]},specialized:[{term:108,get:i=>lS[i]||-1},{term:59,get:i=>aS[i]||-1},{term:110,get:i=>OS[i]||-1}],tokenPrec:1441});var Wa=null;function Za(){if(!Wa&&typeof document=="object"&&document.body){let{style:i}=document.body,e=[],t=new Set;for(let n in i)n!="cssText"&&n!="cssFloat"&&typeof i[n]=="string"&&(/[A-Z]/.test(n)&&(n=n.replace(/[A-Z]/g,s=>"-"+s.toLowerCase())),t.has(n)||(e.push(n),t.add(n)));Wa=e.sort().map(n=>({type:"property",label:n,apply:n+": "}))}return Wa||[]}var sd=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(i=>({type:"class",label:i})),rd=["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(i=>({type:"keyword",label:i})).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(i=>({type:"constant",label:i}))),hS=["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(i=>({type:"type",label:i})),cS=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(i=>({type:"keyword",label:i})),vt=/^(\w[\w-]*|-\w[\w-]*|)$/,fS=/^-(-[\w-]*)?$/;function uS(i,e){var t;if((i.name=="("||i.type.isError)&&(i=i.parent||i),i.name!="ArgList")return!1;let n=(t=i.parent)===null||t===void 0?void 0:t.firstChild;return n?.name!="Callee"?!1:e.sliceString(n.from,n.to)=="var"}var od=new ki,dS=["Declaration"];function pS(i){for(let e=i;;){if(e.type.isTop)return e;if(!(e=e.parent))return i}}function ld(i,e,t){if(e.to-e.from>4096){let n=od.get(e);if(n)return n;let s=[],r=new Set,o=e.cursor(G.IncludeAnonymous);if(o.firstChild())do for(let l of ld(i,o.node,t))r.has(l.label)||(r.add(l.label),s.push(l));while(o.nextSibling());return od.set(e,s),s}else{let n=[],s=new Set;return e.cursor().iterate(r=>{var o;if(t(r)&&r.matchContext(dS)&&((o=r.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let l=i.sliceString(r.from,r.to);s.has(l)||(s.add(l),n.push({label:l,type:"variable"}))}}),n}}var mS=i=>e=>{let{state:t,pos:n}=e,s=N(t).resolveInner(n,-1),r=s.type.isError&&s.from==s.to-1&&t.doc.sliceString(s.from,s.to)=="-";if(s.name=="PropertyName"||(r||s.name=="TagName")&&/^(Block|Styles)$/.test(s.resolve(s.to).name))return{from:s.from,options:Za(),validFor:vt};if(s.name=="ValueName")return{from:s.from,options:rd,validFor:vt};if(s.name=="PseudoClassName")return{from:s.from,options:sd,validFor:vt};if(i(s)||(e.explicit||r)&&uS(s,t.doc))return{from:i(s)||r?s.from:n,options:ld(t.doc,pS(s),i),validFor:fS};if(s.name=="TagName"){for(let{parent:a}=s;a;a=a.parent)if(a.name=="Block")return{from:s.from,options:Za(),validFor:vt};return{from:s.from,options:hS,validFor:vt}}if(s.name=="AtKeyword")return{from:s.from,options:cS,validFor:vt};if(!e.explicit)return null;let o=s.resolve(n),l=o.childBefore(n);return l&&l.name==":"&&o.name=="PseudoClassSelector"?{from:n,options:sd,validFor:vt}:l&&l.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:n,options:rd,validFor:vt}:o.name=="Block"||o.name=="Styles"?{from:n,options:Za(),validFor:vt}:null},gS=mS(i=>i.name=="VariableName"),Un=De.define({name:"css",parser:nd.configure({props:[tt.add({Declaration:Ze()}),it.add({"Block KeyframeList":_t})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function Xr(){return new Be(Un,Un.data.of({autocomplete:gS}))}var $S=54,QS=1,yS=55,SS=2,bS=56,xS=3,ad=4,PS=5,Rr=6,md=7,gd=8,$d=9,Qd=10,kS=11,vS=12,wS=13,Va=57,TS=14,Od=58,yd=20,zS=22,Sd=23,XS=24,Ya=26,bd=27,RS=28,qS=31,WS=34,ZS=36,VS=37,CS=0,YS=1,_S={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},AS={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},hd={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function US(i){return i==45||i==46||i==58||i>=65&&i<=90||i==95||i>=97&&i<=122||i>=161}function xd(i){return i==9||i==10||i==13||i==32}var cd=null,fd=null,ud=0;function _a(i,e){let t=i.pos+e;if(ud==t&&fd==i)return cd;let n=i.peek(e);for(;xd(n);)n=i.peek(++e);let s="";for(;US(n);)s+=String.fromCharCode(n),n=i.peek(++e);return fd=i,ud=t,cd=s?s.toLowerCase():n==MS||n==jS?void 0:null}var Pd=60,qr=62,Aa=47,MS=63,jS=33,GS=45;function dd(i,e){this.name=i,this.parent=e}var ES=[Rr,Qd,md,gd,$d],LS=new _i({start:null,shift(i,e,t,n){return ES.indexOf(e)>-1?new dd(_a(n,1)||"",i):i},reduce(i,e){return e==yd&&i?i.parent:i},reuse(i,e,t,n){let s=e.type.id;return s==Rr||s==ZS?new dd(_a(n,1)||"",i):i},strict:!1}),DS=new ie((i,e)=>{if(i.next!=Pd){i.next<0&&e.context&&i.acceptToken(Va);return}i.advance();let t=i.next==Aa;t&&i.advance();let n=_a(i,0);if(n===void 0)return;if(!n)return i.acceptToken(t?TS:Rr);let s=e.context?e.context.name:null;if(t){if(n==s)return i.acceptToken(kS);if(s&&AS[s])return i.acceptToken(Va,-2);if(e.dialectEnabled(CS))return i.acceptToken(vS);for(let r=e.context;r;r=r.parent)if(r.name==n)return;i.acceptToken(wS)}else{if(n=="script")return i.acceptToken(md);if(n=="style")return i.acceptToken(gd);if(n=="textarea")return i.acceptToken($d);if(_S.hasOwnProperty(n))return i.acceptToken(Qd);s&&hd[s]&&hd[s][n]?i.acceptToken(Va,-1):i.acceptToken(Rr)}},{contextual:!0}),BS=new ie(i=>{for(let e=0,t=0;;t++){if(i.next<0){t&&i.acceptToken(Od);break}if(i.next==GS)e++;else if(i.next==qr&&e>=2){t>=3&&i.acceptToken(Od,-2);break}else e=0;i.advance()}});function IS(i){for(;i;i=i.parent)if(i.name=="svg"||i.name=="math")return!0;return!1}var NS=new ie((i,e)=>{if(i.next==Aa&&i.peek(1)==qr){let t=e.dialectEnabled(YS)||IS(e.context);i.acceptToken(t?PS:ad,2)}else i.next==qr&&i.acceptToken(ad,1)});function Ua(i,e,t){let n=2+i.length;return new ie(s=>{for(let r=0,o=0,l=0;;l++){if(s.next<0){l&&s.acceptToken(e);break}if(r==0&&s.next==Pd||r==1&&s.next==Aa||r>=2&&ro?s.acceptToken(e,-o):s.acceptToken(t,-(o-2));break}else if((s.next==10||s.next==13)&&l){s.acceptToken(e,1);break}else r=o=0;s.advance()}})}var FS=Ua("script",$S,QS),HS=Ua("style",yS,SS),KS=Ua("textarea",bS,xS),JS=Le({"Text RawText":p.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":p.angleBracket,TagName:p.tagName,"MismatchedCloseTag/TagName":[p.tagName,p.invalid],AttributeName:p.attributeName,"AttributeValue UnquotedAttributeValue":p.attributeValue,Is:p.definitionOperator,"EntityReference CharacterReference":p.character,Comment:p.blockComment,ProcessingInst:p.processingInstruction,DoctypeDecl:p.documentMeta}),kd=Fe.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk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^^O`^Oa^Ob^Oc^Ox^O!dZO~O!ZrO~P#dO![sO!euO~OfvO~OfwO~OS|OT}OhyO~OS!POT}OhyO~OS!ROT}OhyO~OS!TOT}OhyO~OS}OT}OhyO~O!WfOPlX!ZlX~OP!WO!Z!XO~O!XiOQoX!ZoX~OQ!ZO!Z!XO~O!YlORrX!ZrX~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXTgXhgX~OS!fOT!gOhyO~OS!hOT!gOhyO~OS!iOT!gOhyO~OS!jOT!gOhyO~OS!gOT!gOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"\u26A0 StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:67,context:LS,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"],["isolate",-11,21,29,30,32,33,35,36,37,38,41,42,"ltr",-3,26,27,39,""]],propSources:[JS],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx7Sx!]5u!]!^7w!^!a7S!a#S5u#S#T7S#T;'S5u;'S;=`8n<%lO5u!R7VVOp7Sqs7St!]7S!]!^7l!^;'S7S;'S;=`7q<%lO7S!R7qOa!R!R7tP;=`<%l7S!Z8OYkWa!ROX+PZ[+P^p+Pqr+Psw+Px!^+P!a#S+P#T;'S+P;'S;=`+t<%lO+P!Z8qP;=`<%l5u!_8{ihSkWOX5uXZ7SZ[5u[^7S^p5uqr8trs7Sst/^tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^:j!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!_:sbhSkWa!ROX+PZ[+P^p+Pqr/^sw/^x!P/^!P!Q+P!Q!^/^!a#S/^#S#T0m#T#s/^#s$f+P$f;'S/^;'S;=`1e<%l?Ah/^?Ah?BY+P?BY?Mn/^?MnO+P!VP<%l?Ah;{?Ah?BY7S?BY?Mn;{?MnO7S!V=dXhSa!Rqr0msw0mx!P0m!Q!^0m!a#s0m$f;'S0m;'S;=`1_<%l?Ah0m?BY?Mn0m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(g>c.to)return{parser:d.parser,overlay:[{from:c.to,to:g}]}}}}if(o&&O==Sd){let h=l.node,c;if(c=h.firstChild){let f=o[a.read(c.from,c.to)];if(f)for(let u of f){if(u.tagName&&u.tagName!=pd(h.parent,a))continue;let d=h.lastChild;if(d.type.id==Ya){let m=d.from+1,g=d.lastChild,$=d.to-(g&&g.isError?0:1);if($>m)return{parser:u.parser,overlay:[{from:m,to:$}]}}else if(d.type.id==bd)return{parser:u.parser,overlay:[{from:d.from,to:d.to}]}}}}return null})}var e0=315,t0=316,wd=1,i0=2,n0=3,s0=4,r0=317,o0=319,l0=320,a0=5,O0=6,h0=0,Ga=[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],Td=125,c0=59,Ea=47,f0=42,u0=43,d0=45,p0=60,m0=44,g0=63,$0=46,Q0=91,y0=new _i({start:!1,shift(i,e){return e==a0||e==O0||e==o0?i:e==l0},strict:!1}),S0=new ie((i,e)=>{let{next:t}=i;(t==Td||t==-1||e.context)&&i.acceptToken(r0)},{contextual:!0,fallback:!0}),b0=new ie((i,e)=>{let{next:t}=i,n;Ga.indexOf(t)>-1||t==Ea&&((n=i.peek(1))==Ea||n==f0)||t!=Td&&t!=c0&&t!=-1&&!e.context&&i.acceptToken(e0)},{contextual:!0}),x0=new ie((i,e)=>{i.next==Q0&&!e.context&&i.acceptToken(t0)},{contextual:!0}),P0=new ie((i,e)=>{let{next:t}=i;if(t==u0||t==d0){if(i.advance(),t==i.next){i.advance();let n=!e.context&&e.canShift(wd);i.acceptToken(n?wd:i0)}}else t==g0&&i.peek(1)==$0&&(i.advance(),i.advance(),(i.next<48||i.next>57)&&i.acceptToken(n0))},{contextual:!0});function ja(i,e){return i>=65&&i<=90||i>=97&&i<=122||i==95||i>=192||!e&&i>=48&&i<=57}var k0=new ie((i,e)=>{if(i.next!=p0||!e.dialectEnabled(h0)||(i.advance(),i.next==Ea))return;let t=0;for(;Ga.indexOf(i.next)>-1;)i.advance(),t++;if(ja(i.next,!0)){for(i.advance(),t++;ja(i.next,!1);)i.advance(),t++;for(;Ga.indexOf(i.next)>-1;)i.advance(),t++;if(i.next==m0)return;for(let n=0;;n++){if(n==7){if(!ja(i.next,!0))return;break}if(i.next!="extends".charCodeAt(n))break;i.advance(),t++}}i.acceptToken(s0,-t)}),v0=Le({"get set async static":p.modifier,"for while do if else switch try catch finally return throw break continue default case":p.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":p.operatorKeyword,"let var const using function class extends":p.definitionKeyword,"import export from":p.moduleKeyword,"with debugger new":p.keyword,TemplateString:p.special(p.string),super:p.atom,BooleanLiteral:p.bool,this:p.self,null:p.null,Star:p.modifier,VariableName:p.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":p.function(p.variableName),VariableDefinition:p.definition(p.variableName),Label:p.labelName,PropertyName:p.propertyName,PrivatePropertyName:p.special(p.propertyName),"CallExpression/MemberExpression/PropertyName":p.function(p.propertyName),"FunctionDeclaration/VariableDefinition":p.function(p.definition(p.variableName)),"ClassDeclaration/VariableDefinition":p.definition(p.className),"NewExpression/VariableName":p.className,PropertyDefinition:p.definition(p.propertyName),PrivatePropertyDefinition:p.definition(p.special(p.propertyName)),UpdateOp:p.updateOperator,"LineComment Hashbang":p.lineComment,BlockComment:p.blockComment,Number:p.number,String:p.string,Escape:p.escape,ArithOp:p.arithmeticOperator,LogicOp:p.logicOperator,BitOp:p.bitwiseOperator,CompareOp:p.compareOperator,RegExp:p.regexp,Equals:p.definitionOperator,Arrow:p.function(p.punctuation),": Spread":p.punctuation,"( )":p.paren,"[ ]":p.squareBracket,"{ }":p.brace,"InterpolationStart InterpolationEnd":p.special(p.brace),".":p.derefOperator,", ;":p.separator,"@":p.meta,TypeName:p.typeName,TypeDefinition:p.definition(p.typeName),"type enum interface implements namespace module declare":p.definitionKeyword,"abstract global Privacy readonly override":p.modifier,"is keyof unique infer asserts":p.operatorKeyword,JSXAttributeValue:p.attributeValue,JSXText:p.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":p.angleBracket,"JSXIdentifier JSXNameSpacedName":p.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":p.attributeName,"JSXBuiltin/JSXIdentifier":p.standard(p.tagName)}),w0={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,for:474,of:483,while:486,with:490,do:494,if:498,else:500,switch:504,case:510,try:516,catch:520,finally:524,return:528,throw:532,break:536,continue:540,debugger:544},T0={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},z0={__proto__:null,"<":193},zd=Fe.deserialize({version:14,states:"$EOQ%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Ik'#IkO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JqO6[Q!0MxO'#JrO6uQ`O'#F]O6zQ,UO'#FtOOQ!0Lf'#Ff'#FfO7VO7dO'#FfO7eQMhO'#F|O9[Q`O'#F{OOQ!0Lf'#Jr'#JrOOQ!0Lb'#Jq'#JqO9aQ`O'#GwOOQ['#K^'#K^O9lQ`O'#IXO9qQ!0LrO'#IYOOQ['#J_'#J_OOQ['#I^'#I^Q`QlOOQ`QlOOO9yQ!L^O'#DvO:QQlO'#EOO:XQlO'#EQO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8cR!|RoqOXst!Z#d%l&p&r&s&u,n,s2S2VY!vQ'^-`1g5qQ%svQ%{yQ&S|Q&h!VS'U!e-WQ'd!iS'j!r!yU*h$|*X*lQ+l%|Q+y&UQ,_&bQ-^']Q-h'eQ-p'kQ0U*nQ1q,`R < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:379,context:y0,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,236,242,244,246,248,251,257,263,265,267,269,271,273,274,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[v0],skippedNodes:[0,5,6,277],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ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z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(b~~",141,339),new Gt("j~RQYZXz{^~^O(P~~aP!P!Qd~iO(Q~~",25,322)],topRules:{Script:[0,7],SingleExpression:[1,275],SingleClassItem:[2,276]},dialects:{jsx:0,ts:15098},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:326,get:i=>w0[i]||-1},{term:342,get:i=>T0[i]||-1},{term:95,get:i=>z0[i]||-1}],tokenPrec:15124});var Wd=[ye("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),ye("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),ye("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),ye("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),ye("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),ye(`try { \${} } catch (\${error}) { \${} @@ -21,4 +21,4 @@ var Yr=[],sO=[];(()=>{let i="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2, constructor(\${params}) { \${} } -}`,{label:"class",detail:"definition",type:"keyword"}),ye('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),ye('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],X0=Wd.concat([ye("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),ye("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),ye("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Xd=new Pi,Zd=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Mn(i){return(e,t)=>{let n=e.node.getChild("VariableDefinition");return n&&t(n,i),!0}}var R0=["FunctionDeclaration"],q0={FunctionDeclaration:Mn("function"),ClassDeclaration:Mn("class"),ClassExpression:()=>!0,EnumDeclaration:Mn("constant"),TypeAliasDeclaration:Mn("type"),NamespaceDeclaration:Mn("namespace"),VariableDefinition(i,e){i.matchContext(R0)||e(i,"variable")},TypeDefinition(i,e){e(i,"type")},__proto__:null};function Vd(i,e){let t=Xd.get(e);if(t)return t;let n=[],s=!0;function r(o,l){let a=i.sliceString(o.from,o.to);n.push({label:a,type:l})}return e.cursor(j.IncludeAnonymous).iterate(o=>{if(s)s=!1;else if(o.name){let l=q0[o.name];if(l&&l(o,r)||Zd.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of Vd(i,o.node))n.push(l);return!1}}),Xd.set(e,n),n}var Rd=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Cd=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function W0(i){let e=N(i.state).resolveInner(i.pos,-1);if(Cd.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&Rd.test(i.state.sliceDoc(e.from,e.to));if(!t&&!i.explicit)return null;let n=[];for(let s=e;s;s=s.parent)Zd.has(s.name)&&(n=n.concat(Vd(i.state.doc,s)));return{options:n,from:t?e.from:i.pos,validFor:Rd}}var rt=De.define({name:"javascript",parser:zd.configure({props:[tt.add({IfStatement:Ze({except:/^\s*({|else\b)/}),TryStatement:Ze({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Nc,SwitchBody:i=>{let e=i.textAfter,t=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return i.baseIndent+(t?0:n?1:2)*i.unit},Block:Js({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"TemplateString BlockComment":()=>null,"Statement Property":Ze({except:/^\s*{/}),JSXElement(i){let e=/^\s*<\//.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},JSXEscape(i){let e=/\s*\}/.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},"JSXOpenTag JSXSelfClosingTag"(i){return i.column(i.node.from)+i.unit}}),it.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":_t,BlockComment(i){return{from:i.from+2,to:i.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Yd={test:i=>/^JSX/.test(i.name),facet:Cl({commentTokens:{block:{open:"{/*",close:"*/}"}}})},La=rt.configure({dialect:"ts"},"typescript"),Da=rt.configure({dialect:"jsx",props:[Hs.add(i=>i.isTop?[Yd]:void 0)]}),Ba=rt.configure({dialect:"jsx ts",props:[Hs.add(i=>i.isTop?[Yd]:void 0)]},"typescript"),_d=i=>({label:i,type:"keyword"}),Ad="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(_d),Z0=Ad.concat(["declare","implements","private","protected","public"].map(_d));function Wr(i={}){let e=i.jsx?i.typescript?Ba:Da:i.typescript?La:rt,t=i.typescript?X0.concat(Z0):Wd.concat(Ad);return new Be(e,[rt.data.of({autocomplete:ku(Cd,da(t))}),rt.data.of({autocomplete:W0}),i.jsx?Y0:[]])}function V0(i){for(;;){if(i.name=="JSXOpenTag"||i.name=="JSXSelfClosingTag"||i.name=="JSXFragmentTag")return i;if(i.name=="JSXEscape"||!i.parent)return null;i=i.parent}}function qd(i,e,t=i.length){for(let n=e?.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return i.sliceString(n.from,Math.min(n.to,t));return""}var C0=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Y0=k.inputHandler.of((i,e,t,n,s)=>{if((C0?i.composing:i.compositionStarted)||i.state.readOnly||e!=t||n!=">"&&n!="/"||!rt.isActiveAt(i.state,e,-1))return!1;let r=s(),{state:o}=r,l=o.changeByRange(a=>{var O;let{head:h}=a,c=N(o).resolveInner(h-1,-1),f;if(c.name=="JSXStartTag"&&(c=c.parent),!(o.doc.sliceString(h-1,h)!=n||c.name=="JSXAttributeValue"&&c.to>h)){if(n==">"&&c.name=="JSXFragmentTag")return{range:a,changes:{from:h,insert:""}};if(n=="/"&&c.name=="JSXStartCloseTag"){let u=c.parent,d=u.parent;if(d&&u.from==h-2&&((f=qd(o.doc,d.firstChild,h))||((O=d.firstChild)===null||O===void 0?void 0:O.name)=="JSXFragmentTag")){let m=`${f}>`;return{range:Q.cursor(h+m.length,-1),changes:{from:h,insert:m}}}}else if(n==">"){let u=V0(c);if(u&&u.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(h,h+2))&&(f=qd(o.doc,u,h)))return{range:a,changes:{from:h,insert:``}}}}return{range:a}});return l.changes.empty?!1:(i.dispatch([r,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var jn=["_blank","_self","_top","_parent"],Ia=["ascii","utf-8","utf-16","latin1","latin1"],Na=["get","post","put","delete"],Fa=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],_e=["true","false"],R={},_0={a:{attrs:{href:null,ping:null,type:null,media:null,target:jn,hreflang:null}},abbr:R,address:R,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:R,aside:R,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:R,base:{attrs:{href:null,target:jn}},bdi:R,bdo:R,blockquote:{attrs:{cite:null}},body:R,br:R,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Fa,formmethod:Na,formnovalidate:["novalidate"],formtarget:jn,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:R,center:R,cite:R,code:R,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:R,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:R,div:R,dl:R,dt:R,em:R,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:R,figure:R,footer:R,form:{attrs:{action:null,name:null,"accept-charset":Ia,autocomplete:["on","off"],enctype:Fa,method:Na,novalidate:["novalidate"],target:jn}},h1:R,h2:R,h3:R,h4:R,h5:R,h6:R,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:R,hgroup:R,hr:R,html:{attrs:{manifest:null}},i:R,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Fa,formmethod:Na,formnovalidate:["novalidate"],formtarget:jn,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:R,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:R,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:R,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Ia,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:R,noscript:R,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:R,param:{attrs:{name:null,value:null}},pre:R,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:R,rt:R,ruby:R,samp:R,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Ia}},section:R,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:R,source:{attrs:{src:null,type:null,media:null}},span:R,strong:R,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:R,summary:R,sup:R,table:R,tbody:R,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:R,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:R,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:R,time:{attrs:{datetime:null}},title:R,tr:R,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:R,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:R},Gd={accesskey:null,class:null,contenteditable:_e,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:_e,autocorrect:_e,autocapitalize:_e,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":_e,"aria-autocomplete":["inline","list","both","none"],"aria-busy":_e,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":_e,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":_e,"aria-hidden":_e,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":_e,"aria-multiselectable":_e,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":_e,"aria-relevant":null,"aria-required":_e,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Ed="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(i=>"on"+i);for(let i of Ed)Gd[i]=null;var _i=class{constructor(e,t){this.tags=Object.assign(Object.assign({},_0),e),this.globalAttrs=Object.assign(Object.assign({},Gd),t),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};_i.default=new _i;function Ai(i,e,t=i.length){if(!e)return"";let n=e.firstChild,s=n&&n.getChild("TagName");return s?i.sliceString(s.from,Math.min(s.to,t)):""}function Ui(i,e=!1){for(;i;i=i.parent)if(i.name=="Element")if(e)e=!1;else return i;return null}function Ld(i,e,t){let n=t.tags[Ai(i,Ui(e))];return n?.children||t.allTags}function Ha(i,e){let t=[];for(let n=Ui(e);n&&!n.type.isTop;n=Ui(n.parent)){let s=Ai(i,n);if(s&&n.lastChild.name=="CloseTag")break;s&&t.indexOf(s)<0&&(e.name=="EndTag"||e.from>=n.firstChild.to)&&t.push(s)}return t}var Dd=/^[:\-\.\w\u00b7-\uffff]*$/;function Ud(i,e,t,n,s){let r=/\s*>/.test(i.sliceDoc(s,s+5))?"":">",o=Ui(t,!0);return{from:n,to:s,options:Ld(i.doc,o,e).map(l=>({label:l,type:"type"})).concat(Ha(i.doc,t).map((l,a)=>({label:"/"+l,apply:"/"+l+r,type:"type",boost:99-a}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Md(i,e,t,n){let s=/\s*>/.test(i.sliceDoc(n,n+5))?"":">";return{from:t,to:n,options:Ha(i.doc,e).map((r,o)=>({label:r,apply:r+s,type:"type",boost:99-o})),validFor:Dd}}function A0(i,e,t,n){let s=[],r=0;for(let o of Ld(i.doc,t,e))s.push({label:"<"+o,type:"type"});for(let o of Ha(i.doc,t))s.push({label:"",type:"type",boost:99-r++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function U0(i,e,t,n,s){let r=Ui(t),o=r?e.tags[Ai(i.doc,r)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],a=o&&o.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:n,to:s,options:a.map(O=>({label:O,type:"property"})),validFor:Dd}}function M0(i,e,t,n,s){var r;let o=(r=t.parent)===null||r===void 0?void 0:r.getChild("AttributeName"),l=[],a;if(o){let O=i.sliceDoc(o.from,o.to),h=e.globalAttrs[O];if(!h){let c=Ui(t),f=c?e.tags[Ai(i.doc,c)]:null;h=f?.attrs&&f.attrs[O]}if(h){let c=i.sliceDoc(n,s).toLowerCase(),f='"',u='"';/^['"]/.test(c)?(a=c[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",u=i.sliceDoc(s,s+1)==c[0]?"":c[0],c=c.slice(1),n++):a=/^[^\s<>='"]*$/;for(let d of h)l.push({label:d,apply:f+d+u,type:"constant"})}}return{from:n,to:s,options:l,validFor:a}}function j0(i,e){let{state:t,pos:n}=e,s=N(t).resolveInner(n,-1),r=s.resolve(n);for(let o=n,l;r==s&&(l=s.childBefore(o));){let a=l.lastChild;if(!a||!a.type.isError||a.fromj0(n,s)}var E0=rt.parser.configure({top:"SingleExpression"}),Bd=[{tag:"script",attrs:i=>i.type=="text/typescript"||i.lang=="ts",parser:La.parser},{tag:"script",attrs:i=>i.type=="text/babel"||i.type=="text/jsx",parser:Da.parser},{tag:"script",attrs:i=>i.type=="text/typescript-jsx",parser:Ba.parser},{tag:"script",attrs(i){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(i.type)},parser:E0},{tag:"script",attrs(i){return!i.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(i.type)},parser:rt.parser},{tag:"style",attrs(i){return(!i.lang||i.lang=="css")&&(!i.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(i.type))},parser:Un.parser}],Id=[{name:"style",parser:Un.parser.configure({top:"Styles"})}].concat(Ed.map(i=>({name:i,parser:rt.parser}))),Nd=De.define({name:"html",parser:kd.configure({props:[tt.add({Element(i){let e=/^(\s*)(<\/)?/.exec(i.textAfter);return i.node.to<=i.pos+e[0].length?i.continue():i.lineIndent(i.node.from)+(e[2]?0:i.unit)},"OpenTag CloseTag SelfClosingTag"(i){return i.column(i.node.from)+i.unit},Document(i){if(i.pos+/\s*/.exec(i.textAfter)[0].lengthi.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),Zr=Nd.configure({wrap:Ma(Bd,Id)});function Vr(i={}){let e="",t;i.matchClosingTags===!1&&(e="noMatch"),i.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(i.nestedLanguages&&i.nestedLanguages.length||i.nestedAttributes&&i.nestedAttributes.length)&&(t=Ma((i.nestedLanguages||[]).concat(Bd),(i.nestedAttributes||[]).concat(Id)));let n=t?Nd.configure({wrap:t,dialect:e}):e?Zr.configure({dialect:e}):Zr;return new Be(n,[Zr.data.of({autocomplete:G0(i)}),i.autoCloseTags!==!1?L0:[],Wr().support,Xr().support])}var jd=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),L0=k.inputHandler.of((i,e,t,n,s)=>{if(i.composing||i.state.readOnly||e!=t||n!=">"&&n!="/"||!Zr.isActiveAt(i.state,e,-1))return!1;let r=s(),{state:o}=r,l=o.changeByRange(a=>{var O,h,c;let f=o.doc.sliceString(a.from-1,a.to)==n,{head:u}=a,d=N(o).resolveInner(u,-1),m;if(f&&n==">"&&d.name=="EndTag"){let g=d.parent;if(((h=(O=g.parent)===null||O===void 0?void 0:O.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(m=Ai(o.doc,g.parent,u))&&!jd.has(m)){let $=u+(o.doc.sliceString(u,u+1)===">"?1:0),y=``;return{range:a,changes:{from:u,to:$,insert:y}}}}else if(f&&n=="/"&&d.name=="IncompleteCloseTag"){let g=d.parent;if(d.from==u-2&&((c=g.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(m=Ai(o.doc,g,u))&&!jd.has(m)){let $=u+(o.doc.sliceString(u,u+1)===">"?1:0),y=`${m}>`;return{range:Q.cursor(u+y.length,-1),changes:{from:u,to:$,insert:y}}}}return{range:a}});return l.changes.empty?!1:(i.dispatch([r,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var D0=Le({String:p.string,Number:p.number,"True False":p.bool,PropertyName:p.propertyName,Null:p.null,", :":p.separator,"[ ]":p.squareBracket,"{ }":p.brace}),Fd=Fe.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"\u26A0 JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[D0],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});var B0=De.define({name:"json",parser:Fd.configure({props:[tt.add({Object:Ze({except:/^\s*\}/}),Array:Ze({except:/^\s*\]/})}),it.add({"Object Array":_t})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Hd(){return new Be(B0)}var I0=1,N0=2,F0=263,H0=3,K0=264,Kd=265,J0=266,e1=4,t1=5,i1=6,n1=7,Jd=8,s1=9,r1=10,o1=11,l1=12,a1=13,O1=14,h1=15,c1=16,f1=17,u1=18,d1=19,p1=20,m1=21,g1=22,$1=23,Q1=24,y1=25,S1=26,b1=27,x1=28,P1=29,k1=30,v1=31,w1=32,T1=33,z1=34,X1=35,R1=36,q1=37,W1=38,Z1=39,V1=40,C1=41,Y1=42,_1=43,A1=44,U1=45,M1=46,j1=47,G1=48,E1=49,L1=50,D1=51,B1=52,I1=53,N1=54,F1=55,H1=56,K1=57,J1=58,eb=59,tb=60,ib=61,Ka=62,nb=63,sb=64,rb=65,ob={abstract:e1,and:t1,array:i1,as:n1,true:Jd,false:Jd,break:s1,case:r1,catch:o1,clone:l1,const:a1,continue:O1,declare:c1,default:h1,do:f1,echo:u1,else:d1,elseif:p1,enddeclare:m1,endfor:g1,endforeach:$1,endif:Q1,endswitch:y1,endwhile:S1,enum:b1,extends:x1,final:P1,finally:k1,fn:v1,for:w1,foreach:T1,from:z1,function:X1,global:R1,goto:q1,if:W1,implements:Z1,include:V1,include_once:C1,instanceof:Y1,insteadof:_1,interface:A1,list:U1,match:M1,namespace:j1,new:G1,null:E1,or:L1,print:D1,require:B1,require_once:I1,return:N1,switch:F1,throw:H1,trait:K1,try:J1,unset:eb,use:tb,var:ib,public:Ka,private:Ka,protected:Ka,while:nb,xor:sb,yield:rb,__proto__:null};function ep(i){let e=ob[i.toLowerCase()];return e??-1}function tp(i){return i==9||i==10||i==13||i==32}function ip(i){return i>=97&&i<=122||i>=65&&i<=90}function Gn(i){return i==95||i>=128||ip(i)}function Ja(i){return i>=48&&i<=55||i>=97&&i<=102||i>=65&&i<=70}var lb={int:!0,integer:!0,bool:!0,boolean:!0,float:!0,double:!0,real:!0,string:!0,array:!0,object:!0,unset:!0,__proto__:null},ab=new ie(i=>{if(i.next==40){i.advance();let e=0;for(;tp(i.peek(e));)e++;let t="",n;for(;ip(n=i.peek(e));)t+=String.fromCharCode(n),e++;for(;tp(i.peek(e));)e++;i.peek(e)==41&&lb[t.toLowerCase()]&&i.acceptToken(I0)}else if(i.next==60&&i.peek(1)==60&&i.peek(2)==60){for(let n=0;n<3;n++)i.advance();for(;i.next==32||i.next==9;)i.advance();let e=i.next==39;if(e&&i.advance(),!Gn(i.next))return;let t=String.fromCharCode(i.next);for(;i.advance(),!(!Gn(i.next)&&!(i.next>=48&&i.next<=55));)t+=String.fromCharCode(i.next);if(e){if(i.next!=39)return;i.advance()}if(i.next!=10&&i.next!=13)return;for(;;){let n=i.next==10||i.next==13;if(i.advance(),i.next<0)return;if(n){for(;i.next==32||i.next==9;)i.advance();let s=!0;for(let r=0;r{i.next<0&&i.acceptToken(J0)}),hb=new ie((i,e)=>{i.next==63&&e.canShift(Kd)&&i.peek(1)==62&&i.acceptToken(Kd)});function cb(i){let e=i.peek(1);if(e==110||e==114||e==116||e==118||e==101||e==102||e==92||e==36||e==34||e==123)return 2;if(e>=48&&e<=55){let t=2,n;for(;t<5&&(n=i.peek(t))>=48&&n<=55;)t++;return t}if(e==120&&Ja(i.peek(2)))return Ja(i.peek(3))?4:3;if(e==117&&i.peek(2)==123)for(let t=3;;t++){let n=i.peek(t);if(n==125)return t==2?0:t+1;if(!Ja(n))break}return 0}var fb=new ie((i,e)=>{let t=!1;for(;!(i.next==34||i.next<0||i.next==36&&(Gn(i.peek(1))||i.peek(1)==123)||i.next==123&&i.peek(1)==36);t=!0){if(i.next==92){let n=cb(i);if(n){if(t)break;return i.acceptToken(H0,n)}}else if(!t&&(i.next==91||i.next==45&&i.peek(1)==62&&Gn(i.peek(2))||i.next==63&&i.peek(1)==45&&i.peek(2)==62&&Gn(i.peek(3)))&&e.canShift(K0))break;i.advance()}t&&i.acceptToken(F0)}),ub=Le({"Visibility abstract final static":p.modifier,"for foreach while do if else elseif switch try catch finally return throw break continue default case":p.controlKeyword,"endif endfor endforeach endswitch endwhile declare enddeclare goto match":p.controlKeyword,"and or xor yield unset clone instanceof insteadof":p.operatorKeyword,"function fn class trait implements extends const enum global interface use var":p.definitionKeyword,"include include_once require require_once namespace":p.moduleKeyword,"new from echo print array list as":p.keyword,null:p.null,Boolean:p.bool,VariableName:p.variableName,"NamespaceName/...":p.namespace,"NamedType/...":p.typeName,Name:p.name,"CallExpression/Name":p.function(p.variableName),"LabelStatement/Name":p.labelName,"MemberExpression/Name":p.propertyName,"MemberExpression/VariableName":p.special(p.propertyName),"ScopedExpression/ClassMemberName/Name":p.propertyName,"ScopedExpression/ClassMemberName/VariableName":p.special(p.propertyName),"CallExpression/MemberExpression/Name":p.function(p.propertyName),"CallExpression/ScopedExpression/ClassMemberName/Name":p.function(p.propertyName),"MethodDeclaration/Name":p.function(p.definition(p.variableName)),"FunctionDefinition/Name":p.function(p.definition(p.variableName)),"ClassDeclaration/Name":p.definition(p.className),UpdateOp:p.updateOperator,ArithOp:p.arithmeticOperator,LogicOp:p.logicOperator,BitOp:p.bitwiseOperator,CompareOp:p.compareOperator,ControlOp:p.controlOperator,AssignOp:p.definitionOperator,"$ ConcatOp":p.operator,LineComment:p.lineComment,BlockComment:p.blockComment,Integer:p.integer,Float:p.float,String:p.string,ShellExpression:p.special(p.string),"=> ->":p.punctuation,"( )":p.paren,"#[ [ ]":p.squareBracket,"${ { }":p.brace,"-> ?->":p.derefOperator,", ; :: : \\":p.separator,"PhpOpen PhpClose":p.processingInstruction}),db={__proto__:null,static:311,STATIC:311,class:333,CLASS:333},np=Fe.deserialize({version:14,states:"$GSQ`OWOOQhQaOOP%oO`OOOOO#t'#H_'#H_O%tO#|O'#DtOOO#u'#Dw'#DwQ&SOWO'#DwO&XO$VOOOOQ#u'#Dx'#DxO&lQaO'#D|O(mQdO'#E}O(tQdO'#EQO*kQaO'#EWO,zQ`O'#ETO-PQ`O'#E^O/nQaO'#E^O/uQ`O'#EfO/zQ`O'#EoO*kQaO'#EoO0VQ`O'#HhO0[Q`O'#E{O0[Q`O'#E{OOQS'#Ic'#IcO0aQ`O'#EvOOQS'#IZ'#IZO2oQdO'#IWO6tQeO'#FUO*kQaO'#FeO*kQaO'#FfO*kQaO'#FgO*kQaO'#FhO*kQaO'#FhO*kQaO'#FkOOQO'#Id'#IdO7RQ`O'#FqOOQO'#Hi'#HiO7ZQ`O'#HOO7uQ`O'#FlO8QQ`O'#H]O8]Q`O'#FvO8eQaO'#FwO*kQaO'#GVO*kQaO'#GYO8}OrO'#G]OOQS'#Iq'#IqOOQS'#Ip'#IpOOQS'#IW'#IWO,zQ`O'#GdO,zQ`O'#GfO,zQ`O'#GkOhQaO'#GmO9UQ`O'#GnO9ZQ`O'#GqO9`Q`O'#GtO9eQeO'#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o6p6q6r6s6t6u6v6z6{6|7X7l7o7r7w7|8T8U8X8Z8[8f8g8h8i#|>]!y!z!}%c&W)t)v*T*o,T-d-k.t/c/i/m0d0v4W6T7i7s7u7z8j8k8l8m8n8o8p8q8r8s8t8u8v8w8x8y8z8{8|8}9O9P9Q9R9S9T9Z9[9]9h9y9}:O:R:Y:Z:_:a:b;c;d=Z=m=n!v>^+z-Q9V9X:d:e:f:g:h:j:k:m:o:p:r:t:v:x:z:|;O;Q;S;U;W;Y;[;^;`;e;g;i;t_0V1]9W:i:l:n:q:s:u:w:y:{:};P;R;T;V;X;Z;];_;a;f;h;u AssignmentExpression ArrayExpression ValueList & VariadicUnpacking ... Pair [ ] ListExpression ValueList Pair Pair SubscriptExpression MemberExpression -> ?-> VariableName DynamicVariable $ ${ CallExpression ArgList NamedArgument SpreadArgument CastExpression UnionType LogicOp OptionalType NamedType QualifiedName \\ NamespaceName ScopedExpression :: ClassMemberName AssignOp UpdateExpression UpdateOp YieldExpression BinaryExpression LogicOp LogicOp LogicOp BitOp BitOp BitOp CompareOp CompareOp BitOp ArithOp ConcatOp ArithOp ArithOp IncludeExpression RequireExpression CloneExpression UnaryExpression ControlOp LogicOp PrintIntrinsic FunctionExpression static ParamList Parameter #[ Attributes Attribute VariadicParameter PropertyParameter UseList ArrowFunction NewExpression class BaseClause ClassInterfaceClause DeclarationList ConstDeclaration VariableDeclarator PropertyDeclaration VariableDeclarator MethodDeclaration UseDeclaration UseList UseInsteadOfClause UseAsClause UpdateExpression ArithOp ShellExpression ThrowExpression Integer Float String MemberExpression SubscriptExpression UnaryExpression ArithOp Interpolation String IfStatement ColonBlock SwitchStatement Block CaseStatement DefaultStatement ColonBlock WhileStatement EmptyStatement DoStatement ForStatement ForSpec SequenceExpression ForeachStatement ForSpec Pair GotoStatement ContinueStatement BreakStatement ReturnStatement TryStatement CatchDeclarator DeclareStatement EchoStatement UnsetStatement ConstDeclaration FunctionDefinition ClassDeclaration InterfaceDeclaration TraitDeclaration EnumDeclaration EnumBody EnumCase NamespaceDefinition NamespaceUseDeclaration UseGroup UseClause UseClause GlobalDeclaration FunctionStaticDeclaration Program",maxTerm:304,nodeProps:[["group",-36,2,8,49,81,83,85,88,93,94,102,106,107,110,111,114,118,123,126,130,132,133,147,148,149,150,153,154,164,165,179,181,182,183,184,185,191,"Expression",-28,74,78,80,82,192,194,199,201,202,205,208,209,210,211,212,214,215,216,217,218,219,220,221,222,225,226,230,231,"Statement",-3,119,121,122,"Type"],["isolate",-4,66,67,70,191,""],["openedBy",69,"phpOpen",76,"{",86,"(",101,"#["],["closedBy",71,"phpClose",77,"}",87,")",158,"]"]],propSources:[ub],skippedNodes:[0],repeatNodeCount:29,tokenData:"!F|_R!]OX$zXY&^YZ'sZ]$z]^&^^p$zpq&^qr)Rrs+Pst+otu2buv5evw6rwx8Vxy>]yz>yz{?g{|@}|}Bb}!OCO!O!PDh!P!QKT!Q!R!!o!R![!$q![!]!,P!]!^!-a!^!_!-}!_!`!1S!`!a!2d!a!b!3t!b!c!7^!c!d!7z!d!e!9W!e!}!7z!}#O!;^#O#P!;z#P#Q!V<%lO8VR9WV&wP%VQOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X<%lO9mQ9rV%VQOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X<%lO9mQ:^O%VQQ:aRO;'S9m;'S;=`:j;=`O9mQ:oW%VQOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X;=`<%l9m<%lO9mQ;[P;=`<%l9mR;fV&wP%VQOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zRV<%l~8V~O8V~~%fR=OW&wPOY8VYZ9PZ!^8V!^!_;{!_;'S8V;'S;=`=h;=`<%l9m<%lO8VR=mW%VQOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X;=`<%l8V<%lO9mR>YP;=`<%l8VR>dV!yQ&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z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!@j#T;'S!?X;'S;=`!@o;=`<%l!?X<%lO!?XQ!@oO${QQ!@rP;=`<%l!?XR!@x]OY!=uYZ!>mZ!a!=u!a!b!?X!b#O!=u#O#P!Aq#P#S!=u#S#T!B{#T;'S!=u;'S;=`!Ci<%l~!=u~O!=u~~%fR!AvW&wPOY!=uYZ!>mZ!^!=u!^!_!@u!_;'S!=u;'S;=`!B`;=`<%l!?X<%lO!=uR!BcWO#O!?X#O#P!?q#P#S!?X#S#T!@j#T;'S!?X;'S;=`!@o;=`<%l!=u<%lO!?XR!CSV${Q&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!ClP;=`<%l!=uV!CvV!oU&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zV!DfY#}Q#lS&wPOY$zYZ%fZ!^$z!^!_%k!_!`6U!`#p$z#p#q!EU#q;'S$z;'S;=`&W<%lO$zR!E]V#{Q&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!EyV!nQ&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!FgV$^Q&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z",tokenizers:[ab,fb,hb,0,1,2,3,Ob],topRules:{Template:[0,72],Program:[1,232]},dynamicPrecedences:{284:1},specialized:[{term:81,get:(i,e)=>ep(i)<<1,external:ep},{term:81,get:i=>db[i]||-1}],tokenPrec:29354});var pb=De.define({name:"php",parser:np.configure({props:[tt.add({IfStatement:Ze({except:/^\s*({|else\b|elseif\b|endif\b)/}),TryStatement:Ze({except:/^\s*({|catch\b|finally\b)/}),SwitchBody:i=>{let e=i.textAfter,t=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return i.baseIndent+(t?0:n?1:2)*i.unit},ColonBlock:i=>i.baseIndent+i.unit,"Block EnumBody DeclarationList":Js({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"String BlockComment":()=>null,Statement:Ze({except:/^({|end(for|foreach|switch|while)\b)/})}),it.add({"Block EnumBody DeclarationList SwitchBody ArrayExpression ValueList":_t,ColonBlock(i){return{from:i.from+1,to:i.to}},BlockComment(i){return{from:i.from+2,to:i.to-2}}})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*(?:case |default:|end(?:if|for(?:each)?|switch|while)|else(?:if)?|\{|\})$/,wordChars:"$",closeBrackets:{stringPrefixes:["b","B"]}}});function sp(i={}){let e=[],t;if(i.baseLanguage!==null)if(i.baseLanguage)t=i.baseLanguage;else{let n=Vr({matchClosingTags:!1});e.push(n.support),t=n.language}return new Be(pb.configure({wrap:t&&Gs(n=>n.type.isTop?{parser:t.parser,overlay:s=>s.name=="Text"}:null),top:i.plain?"Program":"Template"}),e)}function mb({isDisabled:i,state:e}){return{editor:null,state:e,init:function(){this.editor=new k({parent:this.$refs.editor,state:U.create({doc:this.state,extensions:[Eu,Wt.of([iu]),U.readOnly.of(i),k.editable.of(!i),k.updateListener.of(t=>{t.docChanged&&(this.state=t.state.doc.toString())}),Xr(),Vr(),Wr(),Hd(),sp()]})}),this.$watch("state",()=>{this.editor.state.doc.toString()!==this.state&&this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,insert:this.state}})})}}}export{mb as default}; +}`,{label:"class",detail:"definition",type:"keyword"}),ye('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),ye('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],X0=Wd.concat([ye("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),ye("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),ye("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Xd=new ki,Zd=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Mn(i){return(e,t)=>{let n=e.node.getChild("VariableDefinition");return n&&t(n,i),!0}}var R0=["FunctionDeclaration"],q0={FunctionDeclaration:Mn("function"),ClassDeclaration:Mn("class"),ClassExpression:()=>!0,EnumDeclaration:Mn("constant"),TypeAliasDeclaration:Mn("type"),NamespaceDeclaration:Mn("namespace"),VariableDefinition(i,e){i.matchContext(R0)||e(i,"variable")},TypeDefinition(i,e){e(i,"type")},__proto__:null};function Vd(i,e){let t=Xd.get(e);if(t)return t;let n=[],s=!0;function r(o,l){let a=i.sliceString(o.from,o.to);n.push({label:a,type:l})}return e.cursor(G.IncludeAnonymous).iterate(o=>{if(s)s=!1;else if(o.name){let l=q0[o.name];if(l&&l(o,r)||Zd.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of Vd(i,o.node))n.push(l);return!1}}),Xd.set(e,n),n}var Rd=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Cd=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function W0(i){let e=N(i.state).resolveInner(i.pos,-1);if(Cd.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&Rd.test(i.state.sliceDoc(e.from,e.to));if(!t&&!i.explicit)return null;let n=[];for(let s=e;s;s=s.parent)Zd.has(s.name)&&(n=n.concat(Vd(i.state.doc,s)));return{options:n,from:t?e.from:i.pos,validFor:Rd}}var rt=De.define({name:"javascript",parser:zd.configure({props:[tt.add({IfStatement:Ze({except:/^\s*({|else\b)/}),TryStatement:Ze({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Fc,SwitchBody:i=>{let e=i.textAfter,t=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return i.baseIndent+(t?0:n?1:2)*i.unit},Block:Js({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"TemplateString BlockComment":()=>null,"Statement Property":Ze({except:/^\s*{/}),JSXElement(i){let e=/^\s*<\//.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},JSXEscape(i){let e=/\s*\}/.test(i.textAfter);return i.lineIndent(i.node.from)+(e?0:i.unit)},"JSXOpenTag JSXSelfClosingTag"(i){return i.column(i.node.from)+i.unit}}),it.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":_t,BlockComment(i){return{from:i.from+2,to:i.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Yd={test:i=>/^JSX/.test(i.name),facet:Cl({commentTokens:{block:{open:"{/*",close:"*/}"}}})},La=rt.configure({dialect:"ts"},"typescript"),Da=rt.configure({dialect:"jsx",props:[Hs.add(i=>i.isTop?[Yd]:void 0)]}),Ba=rt.configure({dialect:"jsx ts",props:[Hs.add(i=>i.isTop?[Yd]:void 0)]},"typescript"),_d=i=>({label:i,type:"keyword"}),Ad="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(_d),Z0=Ad.concat(["declare","implements","private","protected","public"].map(_d));function Wr(i={}){let e=i.jsx?i.typescript?Ba:Da:i.typescript?La:rt,t=i.typescript?X0.concat(Z0):Wd.concat(Ad);return new Be(e,[rt.data.of({autocomplete:ku(Cd,da(t))}),rt.data.of({autocomplete:W0}),i.jsx?Y0:[]])}function V0(i){for(;;){if(i.name=="JSXOpenTag"||i.name=="JSXSelfClosingTag"||i.name=="JSXFragmentTag")return i;if(i.name=="JSXEscape"||!i.parent)return null;i=i.parent}}function qd(i,e,t=i.length){for(let n=e?.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return i.sliceString(n.from,Math.min(n.to,t));return""}var C0=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),Y0=k.inputHandler.of((i,e,t,n,s)=>{if((C0?i.composing:i.compositionStarted)||i.state.readOnly||e!=t||n!=">"&&n!="/"||!rt.isActiveAt(i.state,e,-1))return!1;let r=s(),{state:o}=r,l=o.changeByRange(a=>{var O;let{head:h}=a,c=N(o).resolveInner(h-1,-1),f;if(c.name=="JSXStartTag"&&(c=c.parent),!(o.doc.sliceString(h-1,h)!=n||c.name=="JSXAttributeValue"&&c.to>h)){if(n==">"&&c.name=="JSXFragmentTag")return{range:a,changes:{from:h,insert:""}};if(n=="/"&&c.name=="JSXStartCloseTag"){let u=c.parent,d=u.parent;if(d&&u.from==h-2&&((f=qd(o.doc,d.firstChild,h))||((O=d.firstChild)===null||O===void 0?void 0:O.name)=="JSXFragmentTag")){let m=`${f}>`;return{range:Q.cursor(h+m.length,-1),changes:{from:h,insert:m}}}}else if(n==">"){let u=V0(c);if(u&&u.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(h,h+2))&&(f=qd(o.doc,u,h)))return{range:a,changes:{from:h,insert:``}}}}return{range:a}});return l.changes.empty?!1:(i.dispatch([r,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var jn=["_blank","_self","_top","_parent"],Ia=["ascii","utf-8","utf-16","latin1","latin1"],Na=["get","post","put","delete"],Fa=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],_e=["true","false"],R={},_0={a:{attrs:{href:null,ping:null,type:null,media:null,target:jn,hreflang:null}},abbr:R,address:R,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:R,aside:R,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:R,base:{attrs:{href:null,target:jn}},bdi:R,bdo:R,blockquote:{attrs:{cite:null}},body:R,br:R,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:Fa,formmethod:Na,formnovalidate:["novalidate"],formtarget:jn,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:R,center:R,cite:R,code:R,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:R,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:R,div:R,dl:R,dt:R,em:R,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:R,figure:R,footer:R,form:{attrs:{action:null,name:null,"accept-charset":Ia,autocomplete:["on","off"],enctype:Fa,method:Na,novalidate:["novalidate"],target:jn}},h1:R,h2:R,h3:R,h4:R,h5:R,h6:R,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:R,hgroup:R,hr:R,html:{attrs:{manifest:null}},i:R,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:Fa,formmethod:Na,formnovalidate:["novalidate"],formtarget:jn,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:R,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:R,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:R,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Ia,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:R,noscript:R,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:R,param:{attrs:{name:null,value:null}},pre:R,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:R,rt:R,ruby:R,samp:R,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Ia}},section:R,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:R,source:{attrs:{src:null,type:null,media:null}},span:R,strong:R,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:R,summary:R,sup:R,table:R,tbody:R,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:R,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:R,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:R,time:{attrs:{datetime:null}},title:R,tr:R,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:R,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:R},Gd={accesskey:null,class:null,contenteditable:_e,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:_e,autocorrect:_e,autocapitalize:_e,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":_e,"aria-autocomplete":["inline","list","both","none"],"aria-busy":_e,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":_e,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":_e,"aria-hidden":_e,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":_e,"aria-multiselectable":_e,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":_e,"aria-relevant":null,"aria-required":_e,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},Ed="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(i=>"on"+i);for(let i of Ed)Gd[i]=null;var Ai=class{constructor(e,t){this.tags=Object.assign(Object.assign({},_0),e),this.globalAttrs=Object.assign(Object.assign({},Gd),t),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}};Ai.default=new Ai;function Ui(i,e,t=i.length){if(!e)return"";let n=e.firstChild,s=n&&n.getChild("TagName");return s?i.sliceString(s.from,Math.min(s.to,t)):""}function Mi(i,e=!1){for(;i;i=i.parent)if(i.name=="Element")if(e)e=!1;else return i;return null}function Ld(i,e,t){let n=t.tags[Ui(i,Mi(e))];return n?.children||t.allTags}function Ha(i,e){let t=[];for(let n=Mi(e);n&&!n.type.isTop;n=Mi(n.parent)){let s=Ui(i,n);if(s&&n.lastChild.name=="CloseTag")break;s&&t.indexOf(s)<0&&(e.name=="EndTag"||e.from>=n.firstChild.to)&&t.push(s)}return t}var Dd=/^[:\-\.\w\u00b7-\uffff]*$/;function Ud(i,e,t,n,s){let r=/\s*>/.test(i.sliceDoc(s,s+5))?"":">",o=Mi(t,!0);return{from:n,to:s,options:Ld(i.doc,o,e).map(l=>({label:l,type:"type"})).concat(Ha(i.doc,t).map((l,a)=>({label:"/"+l,apply:"/"+l+r,type:"type",boost:99-a}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Md(i,e,t,n){let s=/\s*>/.test(i.sliceDoc(n,n+5))?"":">";return{from:t,to:n,options:Ha(i.doc,e).map((r,o)=>({label:r,apply:r+s,type:"type",boost:99-o})),validFor:Dd}}function A0(i,e,t,n){let s=[],r=0;for(let o of Ld(i.doc,t,e))s.push({label:"<"+o,type:"type"});for(let o of Ha(i.doc,t))s.push({label:"",type:"type",boost:99-r++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function U0(i,e,t,n,s){let r=Mi(t),o=r?e.tags[Ui(i.doc,r)]:null,l=o&&o.attrs?Object.keys(o.attrs):[],a=o&&o.globalAttrs===!1?l:l.length?l.concat(e.globalAttrNames):e.globalAttrNames;return{from:n,to:s,options:a.map(O=>({label:O,type:"property"})),validFor:Dd}}function M0(i,e,t,n,s){var r;let o=(r=t.parent)===null||r===void 0?void 0:r.getChild("AttributeName"),l=[],a;if(o){let O=i.sliceDoc(o.from,o.to),h=e.globalAttrs[O];if(!h){let c=Mi(t),f=c?e.tags[Ui(i.doc,c)]:null;h=f?.attrs&&f.attrs[O]}if(h){let c=i.sliceDoc(n,s).toLowerCase(),f='"',u='"';/^['"]/.test(c)?(a=c[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",u=i.sliceDoc(s,s+1)==c[0]?"":c[0],c=c.slice(1),n++):a=/^[^\s<>='"]*$/;for(let d of h)l.push({label:d,apply:f+d+u,type:"constant"})}}return{from:n,to:s,options:l,validFor:a}}function j0(i,e){let{state:t,pos:n}=e,s=N(t).resolveInner(n,-1),r=s.resolve(n);for(let o=n,l;r==s&&(l=s.childBefore(o));){let a=l.lastChild;if(!a||!a.type.isError||a.fromj0(n,s)}var E0=rt.parser.configure({top:"SingleExpression"}),Bd=[{tag:"script",attrs:i=>i.type=="text/typescript"||i.lang=="ts",parser:La.parser},{tag:"script",attrs:i=>i.type=="text/babel"||i.type=="text/jsx",parser:Da.parser},{tag:"script",attrs:i=>i.type=="text/typescript-jsx",parser:Ba.parser},{tag:"script",attrs(i){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(i.type)},parser:E0},{tag:"script",attrs(i){return!i.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(i.type)},parser:rt.parser},{tag:"style",attrs(i){return(!i.lang||i.lang=="css")&&(!i.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(i.type))},parser:Un.parser}],Id=[{name:"style",parser:Un.parser.configure({top:"Styles"})}].concat(Ed.map(i=>({name:i,parser:rt.parser}))),Nd=De.define({name:"html",parser:kd.configure({props:[tt.add({Element(i){let e=/^(\s*)(<\/)?/.exec(i.textAfter);return i.node.to<=i.pos+e[0].length?i.continue():i.lineIndent(i.node.from)+(e[2]?0:i.unit)},"OpenTag CloseTag SelfClosingTag"(i){return i.column(i.node.from)+i.unit},Document(i){if(i.pos+/\s*/.exec(i.textAfter)[0].lengthi.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),Zr=Nd.configure({wrap:Ma(Bd,Id)});function Vr(i={}){let e="",t;i.matchClosingTags===!1&&(e="noMatch"),i.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(i.nestedLanguages&&i.nestedLanguages.length||i.nestedAttributes&&i.nestedAttributes.length)&&(t=Ma((i.nestedLanguages||[]).concat(Bd),(i.nestedAttributes||[]).concat(Id)));let n=t?Nd.configure({wrap:t,dialect:e}):e?Zr.configure({dialect:e}):Zr;return new Be(n,[Zr.data.of({autocomplete:G0(i)}),i.autoCloseTags!==!1?L0:[],Wr().support,Xr().support])}var jd=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),L0=k.inputHandler.of((i,e,t,n,s)=>{if(i.composing||i.state.readOnly||e!=t||n!=">"&&n!="/"||!Zr.isActiveAt(i.state,e,-1))return!1;let r=s(),{state:o}=r,l=o.changeByRange(a=>{var O,h,c;let f=o.doc.sliceString(a.from-1,a.to)==n,{head:u}=a,d=N(o).resolveInner(u,-1),m;if(f&&n==">"&&d.name=="EndTag"){let g=d.parent;if(((h=(O=g.parent)===null||O===void 0?void 0:O.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(m=Ui(o.doc,g.parent,u))&&!jd.has(m)){let $=u+(o.doc.sliceString(u,u+1)===">"?1:0),y=``;return{range:a,changes:{from:u,to:$,insert:y}}}}else if(f&&n=="/"&&d.name=="IncompleteCloseTag"){let g=d.parent;if(d.from==u-2&&((c=g.lastChild)===null||c===void 0?void 0:c.name)!="CloseTag"&&(m=Ui(o.doc,g,u))&&!jd.has(m)){let $=u+(o.doc.sliceString(u,u+1)===">"?1:0),y=`${m}>`;return{range:Q.cursor(u+y.length,-1),changes:{from:u,to:$,insert:y}}}}return{range:a}});return l.changes.empty?!1:(i.dispatch([r,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var D0=Le({String:p.string,Number:p.number,"True False":p.bool,PropertyName:p.propertyName,Null:p.null,", :":p.separator,"[ ]":p.squareBracket,"{ }":p.brace}),Fd=Fe.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#ClOOQO'#Cr'#CrQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CtOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59W,59WO!iQPO,59WOVQPO,59QOqQPO'#CmO!nQPO,59`OOQO1G.k1G.kOVQPO'#CnO!vQPO,59aOOQO1G.r1G.rOOQO1G.l1G.lOOQO,59X,59XOOQO-E6k-E6kOOQO,59Y,59YOOQO-E6l-E6l",stateData:"#O~OeOS~OQSORSOSSOTSOWQO_ROgPO~OVXOgUO~O^[O~PVO[^O~O]_OVhX~OVaO~O]bO^iX~O^dO~O]_OVha~O]bO^ia~O",goto:"!kjPPPPPPkPPkqwPPPPk{!RPPP!XP!e!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"\u26A0 JsonText True False Null Number String } { Object Property PropertyName : , ] [ Array",maxTerm:25,nodeProps:[["isolate",-2,6,11,""],["openedBy",7,"{",14,"["],["closedBy",8,"}",15,"]"]],propSources:[D0],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oe~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Og~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zO]~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yO[~~'OO_~~'TO^~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0});var B0=De.define({name:"json",parser:Fd.configure({props:[tt.add({Object:Ze({except:/^\s*\}/}),Array:Ze({except:/^\s*\]/})}),it.add({"Object Array":_t})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function Hd(){return new Be(B0)}var I0=1,N0=2,F0=263,H0=3,K0=264,Kd=265,J0=266,eb=4,tb=5,ib=6,nb=7,Jd=8,sb=9,rb=10,ob=11,lb=12,ab=13,Ob=14,hb=15,cb=16,fb=17,ub=18,db=19,pb=20,mb=21,gb=22,$b=23,Qb=24,yb=25,Sb=26,bb=27,xb=28,Pb=29,kb=30,vb=31,wb=32,Tb=33,zb=34,Xb=35,Rb=36,qb=37,Wb=38,Zb=39,Vb=40,Cb=41,Yb=42,_b=43,Ab=44,Ub=45,Mb=46,jb=47,Gb=48,Eb=49,Lb=50,Db=51,Bb=52,Ib=53,Nb=54,Fb=55,Hb=56,Kb=57,Jb=58,e1=59,t1=60,i1=61,Ka=62,n1=63,s1=64,r1=65,o1={abstract:eb,and:tb,array:ib,as:nb,true:Jd,false:Jd,break:sb,case:rb,catch:ob,clone:lb,const:ab,continue:Ob,declare:cb,default:hb,do:fb,echo:ub,else:db,elseif:pb,enddeclare:mb,endfor:gb,endforeach:$b,endif:Qb,endswitch:yb,endwhile:Sb,enum:bb,extends:xb,final:Pb,finally:kb,fn:vb,for:wb,foreach:Tb,from:zb,function:Xb,global:Rb,goto:qb,if:Wb,implements:Zb,include:Vb,include_once:Cb,instanceof:Yb,insteadof:_b,interface:Ab,list:Ub,match:Mb,namespace:jb,new:Gb,null:Eb,or:Lb,print:Db,require:Bb,require_once:Ib,return:Nb,switch:Fb,throw:Hb,trait:Kb,try:Jb,unset:e1,use:t1,var:i1,public:Ka,private:Ka,protected:Ka,while:n1,xor:s1,yield:r1,__proto__:null};function ep(i){let e=o1[i.toLowerCase()];return e??-1}function tp(i){return i==9||i==10||i==13||i==32}function ip(i){return i>=97&&i<=122||i>=65&&i<=90}function Gn(i){return i==95||i>=128||ip(i)}function Ja(i){return i>=48&&i<=55||i>=97&&i<=102||i>=65&&i<=70}var l1={int:!0,integer:!0,bool:!0,boolean:!0,float:!0,double:!0,real:!0,string:!0,array:!0,object:!0,unset:!0,__proto__:null},a1=new ie(i=>{if(i.next==40){i.advance();let e=0;for(;tp(i.peek(e));)e++;let t="",n;for(;ip(n=i.peek(e));)t+=String.fromCharCode(n),e++;for(;tp(i.peek(e));)e++;i.peek(e)==41&&l1[t.toLowerCase()]&&i.acceptToken(I0)}else if(i.next==60&&i.peek(1)==60&&i.peek(2)==60){for(let n=0;n<3;n++)i.advance();for(;i.next==32||i.next==9;)i.advance();let e=i.next==39;if(e&&i.advance(),!Gn(i.next))return;let t=String.fromCharCode(i.next);for(;i.advance(),!(!Gn(i.next)&&!(i.next>=48&&i.next<=55));)t+=String.fromCharCode(i.next);if(e){if(i.next!=39)return;i.advance()}if(i.next!=10&&i.next!=13)return;for(;;){let n=i.next==10||i.next==13;if(i.advance(),i.next<0)return;if(n){for(;i.next==32||i.next==9;)i.advance();let s=!0;for(let r=0;r{i.next<0&&i.acceptToken(J0)}),h1=new ie((i,e)=>{i.next==63&&e.canShift(Kd)&&i.peek(1)==62&&i.acceptToken(Kd)});function c1(i){let e=i.peek(1);if(e==110||e==114||e==116||e==118||e==101||e==102||e==92||e==36||e==34||e==123)return 2;if(e>=48&&e<=55){let t=2,n;for(;t<5&&(n=i.peek(t))>=48&&n<=55;)t++;return t}if(e==120&&Ja(i.peek(2)))return Ja(i.peek(3))?4:3;if(e==117&&i.peek(2)==123)for(let t=3;;t++){let n=i.peek(t);if(n==125)return t==2?0:t+1;if(!Ja(n))break}return 0}var f1=new ie((i,e)=>{let t=!1;for(;!(i.next==34||i.next<0||i.next==36&&(Gn(i.peek(1))||i.peek(1)==123)||i.next==123&&i.peek(1)==36);t=!0){if(i.next==92){let n=c1(i);if(n){if(t)break;return i.acceptToken(H0,n)}}else if(!t&&(i.next==91||i.next==45&&i.peek(1)==62&&Gn(i.peek(2))||i.next==63&&i.peek(1)==45&&i.peek(2)==62&&Gn(i.peek(3)))&&e.canShift(K0))break;i.advance()}t&&i.acceptToken(F0)}),u1=Le({"Visibility abstract final static":p.modifier,"for foreach while do if else elseif switch try catch finally return throw break continue default case":p.controlKeyword,"endif endfor endforeach endswitch endwhile declare enddeclare goto match":p.controlKeyword,"and or xor yield unset clone instanceof insteadof":p.operatorKeyword,"function fn class trait implements extends const enum global interface use var":p.definitionKeyword,"include include_once require require_once namespace":p.moduleKeyword,"new from echo print array list as":p.keyword,null:p.null,Boolean:p.bool,VariableName:p.variableName,"NamespaceName/...":p.namespace,"NamedType/...":p.typeName,Name:p.name,"CallExpression/Name":p.function(p.variableName),"LabelStatement/Name":p.labelName,"MemberExpression/Name":p.propertyName,"MemberExpression/VariableName":p.special(p.propertyName),"ScopedExpression/ClassMemberName/Name":p.propertyName,"ScopedExpression/ClassMemberName/VariableName":p.special(p.propertyName),"CallExpression/MemberExpression/Name":p.function(p.propertyName),"CallExpression/ScopedExpression/ClassMemberName/Name":p.function(p.propertyName),"MethodDeclaration/Name":p.function(p.definition(p.variableName)),"FunctionDefinition/Name":p.function(p.definition(p.variableName)),"ClassDeclaration/Name":p.definition(p.className),UpdateOp:p.updateOperator,ArithOp:p.arithmeticOperator,LogicOp:p.logicOperator,BitOp:p.bitwiseOperator,CompareOp:p.compareOperator,ControlOp:p.controlOperator,AssignOp:p.definitionOperator,"$ ConcatOp":p.operator,LineComment:p.lineComment,BlockComment:p.blockComment,Integer:p.integer,Float:p.float,String:p.string,ShellExpression:p.special(p.string),"=> ->":p.punctuation,"( )":p.paren,"#[ [ ]":p.squareBracket,"${ { }":p.brace,"-> ?->":p.derefOperator,", ; :: : \\":p.separator,"PhpOpen PhpClose":p.processingInstruction}),d1={__proto__:null,static:311,STATIC:311,class:333,CLASS:333},np=Fe.deserialize({version:14,states:"$GSQ`OWOOQhQaOOP%oO`OOOOO#t'#H_'#H_O%tO#|O'#DtOOO#u'#Dw'#DwQ&SOWO'#DwO&XO$VOOOOQ#u'#Dx'#DxO&lQaO'#D|O(mQdO'#E}O(tQdO'#EQO*kQaO'#EWO,zQ`O'#ETO-PQ`O'#E^O/nQaO'#E^O/uQ`O'#EfO/zQ`O'#EoO*kQaO'#EoO0VQ`O'#HhO0[Q`O'#E{O0[Q`O'#E{OOQS'#Ic'#IcO0aQ`O'#EvOOQS'#IZ'#IZO2oQdO'#IWO6tQeO'#FUO*kQaO'#FeO*kQaO'#FfO*kQaO'#FgO*kQaO'#FhO*kQaO'#FhO*kQaO'#FkOOQO'#Id'#IdO7RQ`O'#FqOOQO'#Hi'#HiO7ZQ`O'#HOO7uQ`O'#FlO8QQ`O'#H]O8]Q`O'#FvO8eQaO'#FwO*kQaO'#GVO*kQaO'#GYO8}OrO'#G]OOQS'#Iq'#IqOOQS'#Ip'#IpOOQS'#IW'#IWO,zQ`O'#GdO,zQ`O'#GfO,zQ`O'#GkOhQaO'#GmO9UQ`O'#GnO9ZQ`O'#GqO9`Q`O'#GtO9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l6m6n6o6p6q6r6s6t6u6v6z6{6|7X7l7o7r7w7|8T8U8X8Z8[8f8g8h8i#|>]!y!z!}%c&W)t)v*T*o,T-d-k.t/c/i/m0d0v4W6T7i7s7u7z8j8k8l8m8n8o8p8q8r8s8t8u8v8w8x8y8z8{8|8}9O9P9Q9R9S9T9Z9[9]9h9y9}:O:R:Y:Z:_:a:b;c;d=Z=m=n!v>^+z-Q9V9X:d:e:f:g:h:j:k:m:o:p:r:t:v:x:z:|;O;Q;S;U;W;Y;[;^;`;e;g;i;t_0V1]9W:i:l:n:q:s:u:w:y:{:};P;R;T;V;X;Z;];_;a;f;h;u AssignmentExpression ArrayExpression ValueList & VariadicUnpacking ... Pair [ ] ListExpression ValueList Pair Pair SubscriptExpression MemberExpression -> ?-> VariableName DynamicVariable $ ${ CallExpression ArgList NamedArgument SpreadArgument CastExpression UnionType LogicOp OptionalType NamedType QualifiedName \\ NamespaceName ScopedExpression :: ClassMemberName AssignOp UpdateExpression UpdateOp YieldExpression BinaryExpression LogicOp LogicOp LogicOp BitOp BitOp BitOp CompareOp CompareOp BitOp ArithOp ConcatOp ArithOp ArithOp IncludeExpression RequireExpression CloneExpression UnaryExpression ControlOp LogicOp PrintIntrinsic FunctionExpression static ParamList Parameter #[ Attributes Attribute VariadicParameter PropertyParameter UseList ArrowFunction NewExpression class BaseClause ClassInterfaceClause DeclarationList ConstDeclaration VariableDeclarator PropertyDeclaration VariableDeclarator MethodDeclaration UseDeclaration UseList UseInsteadOfClause UseAsClause UpdateExpression ArithOp ShellExpression ThrowExpression Integer Float String MemberExpression SubscriptExpression UnaryExpression ArithOp Interpolation String IfStatement ColonBlock SwitchStatement Block CaseStatement DefaultStatement ColonBlock WhileStatement EmptyStatement DoStatement ForStatement ForSpec SequenceExpression ForeachStatement ForSpec Pair GotoStatement ContinueStatement BreakStatement ReturnStatement TryStatement CatchDeclarator DeclareStatement EchoStatement UnsetStatement ConstDeclaration FunctionDefinition ClassDeclaration InterfaceDeclaration TraitDeclaration EnumDeclaration EnumBody EnumCase NamespaceDefinition NamespaceUseDeclaration UseGroup UseClause UseClause GlobalDeclaration FunctionStaticDeclaration Program",maxTerm:304,nodeProps:[["group",-36,2,8,49,81,83,85,88,93,94,102,106,107,110,111,114,118,123,126,130,132,133,147,148,149,150,153,154,164,165,179,181,182,183,184,185,191,"Expression",-28,74,78,80,82,192,194,199,201,202,205,208,209,210,211,212,214,215,216,217,218,219,220,221,222,225,226,230,231,"Statement",-3,119,121,122,"Type"],["isolate",-4,66,67,70,191,""],["openedBy",69,"phpOpen",76,"{",86,"(",101,"#["],["closedBy",71,"phpClose",77,"}",87,")",158,"]"]],propSources:[u1],skippedNodes:[0],repeatNodeCount:29,tokenData:"!F|_R!]OX$zXY&^YZ'sZ]$z]^&^^p$zpq&^qr)Rrs+Pst+otu2buv5evw6rwx8Vxy>]yz>yz{?g{|@}|}Bb}!OCO!O!PDh!P!QKT!Q!R!!o!R![!$q![!]!,P!]!^!-a!^!_!-}!_!`!1S!`!a!2d!a!b!3t!b!c!7^!c!d!7z!d!e!9W!e!}!7z!}#O!;^#O#P!;z#P#Q!V<%lO8VR9WV&wP%VQOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X<%lO9mQ9rV%VQOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X<%lO9mQ:^O%VQQ:aRO;'S9m;'S;=`:j;=`O9mQ:oW%VQOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X;=`<%l9m<%lO9mQ;[P;=`<%l9mR;fV&wP%VQOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zRV<%l~8V~O8V~~%fR=OW&wPOY8VYZ9PZ!^8V!^!_;{!_;'S8V;'S;=`=h;=`<%l9m<%lO8VR=mW%VQOw9mwx:Xx#O9m#O#P:^#P;'S9m;'S;=`;X;=`<%l8V<%lO9mR>YP;=`<%l8VR>dV!yQ&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W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?X#S#T!@j#T;'S!?X;'S;=`!@o;=`<%l!?X<%lO!?XQ!@oO${QQ!@rP;=`<%l!?XR!@x]OY!=uYZ!>mZ!a!=u!a!b!?X!b#O!=u#O#P!Aq#P#S!=u#S#T!B{#T;'S!=u;'S;=`!Ci<%l~!=u~O!=u~~%fR!AvW&wPOY!=uYZ!>mZ!^!=u!^!_!@u!_;'S!=u;'S;=`!B`;=`<%l!?X<%lO!=uR!BcWO#O!?X#O#P!?q#P#S!?X#S#T!@j#T;'S!?X;'S;=`!@o;=`<%l!=u<%lO!?XR!CSV${Q&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!ClP;=`<%l!=uV!CvV!oU&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zV!DfY#}Q#lS&wPOY$zYZ%fZ!^$z!^!_%k!_!`6U!`#p$z#p#q!EU#q;'S$z;'S;=`&W<%lO$zR!E]V#{Q&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!EyV!nQ&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$zR!FgV$^Q&wPOY$zYZ%fZ!^$z!^!_%k!_;'S$z;'S;=`&W<%lO$z",tokenizers:[a1,f1,h1,0,1,2,3,O1],topRules:{Template:[0,72],Program:[1,232]},dynamicPrecedences:{284:1},specialized:[{term:81,get:(i,e)=>ep(i)<<1,external:ep},{term:81,get:i=>d1[i]||-1}],tokenPrec:29354});var p1=De.define({name:"php",parser:np.configure({props:[tt.add({IfStatement:Ze({except:/^\s*({|else\b|elseif\b|endif\b)/}),TryStatement:Ze({except:/^\s*({|catch\b|finally\b)/}),SwitchBody:i=>{let e=i.textAfter,t=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return i.baseIndent+(t?0:n?1:2)*i.unit},ColonBlock:i=>i.baseIndent+i.unit,"Block EnumBody DeclarationList":Js({closing:"}"}),ArrowFunction:i=>i.baseIndent+i.unit,"String BlockComment":()=>null,Statement:Ze({except:/^({|end(for|foreach|switch|while)\b)/})}),it.add({"Block EnumBody DeclarationList SwitchBody ArrayExpression ValueList":_t,ColonBlock(i){return{from:i.from+1,to:i.to}},BlockComment(i){return{from:i.from+2,to:i.to-2}}})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"},line:"//"},indentOnInput:/^\s*(?:case |default:|end(?:if|for(?:each)?|switch|while)|else(?:if)?|\{|\})$/,wordChars:"$",closeBrackets:{stringPrefixes:["b","B"]}}});function sp(i={}){let e=[],t;if(i.baseLanguage!==null)if(i.baseLanguage)t=i.baseLanguage;else{let n=Vr({matchClosingTags:!1});e.push(n.support),t=n.language}return new Be(p1.configure({wrap:t&&Gs(n=>n.type.isTop?{parser:t.parser,overlay:s=>s.name=="Text"}:null),top:i.plain?"Program":"Template"}),e)}function m1({isDisabled:i,state:e}){return{editor:null,state:e,init:function(){this.editor=new k({parent:this.$refs.editor,state:M.create({doc:this.state,extensions:[Eu,Wt.of([nu]),M.readOnly.of(i),k.editable.of(!i),k.updateListener.of(t=>{t.docChanged&&(this.state=t.state.doc.toString())}),Xr(),Vr(),Wr(),Hd(),sp()]})}),this.$watch("state",()=>{this.editor.state.doc.toString()!==this.state&&this.editor.dispatch({changes:{from:0,to:this.editor.state.doc.length,insert:this.state}})})}}}export{m1 as default}; diff --git a/packages/forms/dist/components/rich-editor.js b/packages/forms/dist/components/rich-editor.js index 0d6c66f159..0249c54433 100644 --- a/packages/forms/dist/components/rich-editor.js +++ b/packages/forms/dist/components/rich-editor.js @@ -1,16 +1,16 @@ -function se(n){this.content=n}se.prototype={constructor:se,find:function(n){for(var e=0;e>1}};se.from=function(n){if(n instanceof se)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new se(e)};var Fi=se;function hl(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=hl(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}}function pl(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let s=n.child(--i),l=e.child(--o),a=s.nodeSize;if(s==l){t-=a,r-=a;continue}if(!s.sameMarkup(l))return{a:t,b:r};if(s.isText&&s.text!=l.text){let c=0,u=Math.min(s.text.length,l.text.length);for(;ce&&r(a,i+l,o||null,s)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,i+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);oe)for(let o=0,s=0;se&&((st)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,t-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,t-s-1))),r.push(l),i+=l.nodeSize),s=a}return new n(r,i)}cutByIndex(e,t){return e==t?n.empty:e==0&&t==this.content.length?this:new n(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new n(i,o)}addToStart(e){return new n([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new n(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||t>0?Qn(r+1,s):Qn(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return n.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new n(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return n.empty;let t,r=0;for(let i=0;ithis.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;tr.type.rank-i.type.rank),t}};B.none=[];var kt=class extends Error{},w=class n{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=gl(this.content,e+this.openStart,t);return r&&new n(r,this.openStart,this.openEnd)}removeBetween(e,t){return new n(ml(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return n.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new n(x.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new n(e,r,i)}};w.empty=new w(x.empty,0,0);function ml(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:l}=n.findIndex(t);if(i==e||o.isText){if(l!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(ml(o.content,e-i-1,t-i-1)))}function gl(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=gl(s.content,e-o-1,t);return l&&n.replaceChild(i,s.copy(l))}function $f(n,e,t){if(t.openStart>n.depth)throw new kt("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new kt("Inconsistent open depths");return yl(n,e,t,0)}function yl(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function dn(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(bt(n.nodeAfter,r),o++));for(let l=o;li&&$i(n,e,i+1),s=r.depth>i&&$i(t,r,i+1),l=[];return dn(null,n,i,l),o&&s&&e.index(i)==t.index(i)?(bl(o,s),bt(xt(o,xl(n,e,t,r,i+1)),l)):(o&&bt(xt(o,tr(n,e,i+1)),l),dn(e,t,i,l),s&&bt(xt(s,tr(t,r,i+1)),l)),dn(r,null,i,l),new x(l)}function tr(n,e,t){let r=[];if(dn(null,n,t,r),n.depth>t){let i=$i(n,e,t+1);bt(xt(i,tr(n,e,t+1)),r)}return dn(e,null,t,r),new x(r)}function Vf(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(x.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}var nr=class n{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new St(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let s=e;;){let{index:l,offset:a}=s.content.findIndex(o),c=o-a;if(r.push(s,l,i+a),!c||(s=s.child(l),s.isText))break;o=c-1,i+=a+1}return new n(t,r,o)}static resolveCached(e,t){let r=il.get(e);if(r)for(let o=0;oe&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),kl(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=x.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=i;at.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=x.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};G.prototype.text=void 0;var Wi=class n extends G{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):kl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new n(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new n(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function kl(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}var wt=class n{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new ji(e,t);if(r.next==null)return n.empty;let i=Sl(r);r.next&&r.err("Unexpected trailing text");let o=Yf(Gf(i));return Xf(o,r),o}matchType(e){for(let t=0;tc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` -`)}};wt.empty=new wt(!0);var ji=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function Sl(n){let e=[];do e.push(Kf(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Kf(n){let e=[];do e.push(_f(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function _f(n){let e=qf(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=Uf(n,e);else break;return e}function ol(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function Uf(n,e){let t=ol(n),r=t;return n.eat(",")&&(n.next!="}"?r=ol(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Jf(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let s=t[o];s.isInGroup(e)&&i.push(s)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function qf(n){if(n.eat("(")){let e=Sl(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=Jf(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Gf(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(s,l,a){let c={term:a,to:l};return e[s].push(c),c}function i(s,l){s.forEach(a=>a.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((a,c)=>a.concat(o(c,l)),[]);if(s.type=="seq")for(let a=0;;a++){let c=o(s.exprs[a],l);if(a==s.exprs.length-1)return c;i(c,l=t())}else if(s.type=="star"){let a=t();return r(l,a),i(o(s.expr,a),a),[r(a)]}else if(s.type=="plus"){let a=t();return i(o(s.expr,l),a),i(o(s.expr,a),a),[r(a)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let a=l;for(let c=0;c{n[s].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u{c||i.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=e[r.join(",")]=new wt(r.indexOf(n.length-1)>-1);for(let s=0;s-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:Cl(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new G(this,this.computeAttrs(e),x.from(t),B.setFrom(r))}createChecked(e=null,t,r){return t=x.from(t),this.checkContent(t),new G(this,this.computeAttrs(e),t,B.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=x.from(t),t.size){let s=this.contentMatch.fillBefore(t);if(!s)return null;t=s.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(x.empty,!0);return o?new G(this,e,t.append(o),B.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;tr[o]=new n(o,t,s));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function Qf(n,e,t){let r=t.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${o}`)}}var Ki=class{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?Qf(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}},pn=class n{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=Tl(e,i.attrs),this.excluded=null;let o=Ml(this.attrs);this.instance=o?new B(this,o):null}create(e=null){return!e&&this.instance?this.instance:new B(this,Cl(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new n(o,i++,t,s)),r}removeFromSet(e){for(var t=0;t-1}},_t=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Fi.from(e.nodes),t.marks=Fi.from(e.marks||{}),this.nodes=rr.compile(this.spec.nodes,this),this.marks=pn.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=wt.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=l=="_"?null:l?ll(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:ll(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof rr){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new Wi(r,r.defaultAttrs,e,B.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return G.fromJSON(this,e)}markFromJSON(e){return B.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}};function ll(n,e){let t=[];for(let r=0;r-1)&&t.push(s=a)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function Zf(n){return n.tag!=null}function ed(n){return n.style!=null}var Ie=class n{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(Zf(i))this.tags.push(i);else if(ed(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,t={}){let r=new ir(this,t,!1);return r.addAll(e,B.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new ir(this,t,!0);return r.addAll(e,B.none,t.from,t.to),w.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(s.getAttrs){let a=s.getAttrs(t);if(a===!1)continue;s.attrs=a||void 0}return s}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=cl(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=cl(s)),s.node||s.ignore||s.mark||(s.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new n(e,n.schemaRules(e)))}},El={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},td={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Al={ol:!0,ul:!0},mn=1,_i=2,hn=4;function al(n,e,t){return e!=null?(e?mn:0)|(e==="full"?_i:0):n&&n.whitespace=="pre"?mn|_i:t&~hn}var Kt=class{constructor(e,t,r,i,o,s){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=B.none,this.match=o||(s&hn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(x.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&mn)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=x.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(x.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!El.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},ir=class{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=t.topNode,o,s=al(null,t.preserveWhitespace,0)|(r?hn:0);i?o=new Kt(i.type,i.attrs,B.none,!0,t.topMatch||i.type.contentMatch,s):r?o=new Kt(null,null,B.none,!0,null,s):o=new Kt(e.schema.topNodeType,null,B.none,!0,null,s),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,i=this.top,o=i.options&_i?"full":this.localPreserveWS||(i.options&mn)>0;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,` -`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],l=e.previousSibling;(!s||l&&l.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),l;Al.hasOwnProperty(s)&&this.parser.normalizeLists&&nd(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:td.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(El.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let f=a&&a.skip?t:this.readStyles(e,t);f&&this.addAll(e,f),c&&this.sync(o),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` -`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let i=0;i!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,i){let o,s;if(t.node)if(s=this.parser.schema.nodes[t.node],s.isLeaf)this.insertNode(s.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(s,t.attrs||null,r,t.preserveWhitespace);a&&(o=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}o&&this.sync(l)&&this.open--}addAll(e,t,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];s!=l;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,t);this.findAtPoint(e,o)}findPlace(e,t,r){let i,o;for(let s=this.open,l=0;s>=0;s--){let a=this.nodes[s],c=a.findWrapping(e);if(c&&(!i||i.length>c.length+l)&&(i=c,o=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!i)return null;this.sync(o);for(let s=0;s(s.type?s.type.allowsMarkType(c.type):ul(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Kt(e,t,a,i,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=mn)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=o;a--)if(s(l-1,a))return!0;return!1}else{let u=a>0||a==0&&i?this.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}};function nd(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Al.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function rd(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function cl(n){let e={};for(let t in n)e[t]=n[t];return e}function ul(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],s=l=>{o.push(l);for(let a=0;a{if(o.length||s.marks.length){let l=0,a=0;for(;l=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&Zn(Hi(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return Zn(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new n(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=fl(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return fl(e.marks)}};function fl(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Hi(n){return n.document||window.document}var dl=new WeakMap;function id(n){let e=dl.get(n);return e===void 0&&dl.set(n,e=od(n)),e}function od(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(t=i.slice(0,s),i=i.slice(s+1));let l,a=t?n.createElementNS(t,i):n.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let f in c)if(c[f]!=null){let d=f.indexOf(" ");d>0?a.setAttributeNS(f.slice(0,d),f.slice(d+1),c[f]):a.setAttribute(f,c[f])}}for(let f=u;fu)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:p}=Zn(n,d,t,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}var Dl=65535,Rl=Math.pow(2,16);function sd(n,e){return n+e*Rl}function Ol(n){return n&Dl}function ld(n){return(n-(n&Dl))/Rl}var Pl=1,Il=2,or=4,Ll=8,bn=class{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Ll)>0}get deletedBefore(){return(this.delInfo&(Pl|or))>0}get deletedAfter(){return(this.delInfo&(Il|or))>0}get deletedAcross(){return(this.delInfo&or)>0}},Je=class n{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&n.empty)return n.empty}recover(e){let t=0,r=Ol(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[l+o],u=this.ranges[l+s],f=a+c;if(e<=f){let d=c?e==a?-1:e==f?1:t:t,h=a+i+(d<0?0:u);if(r)return h;let p=e==(t<0?a:f)?null:sd(l/3,e-a),m=e==a?Il:e==f?Pl:or;return(t<0?e!=a:e!=f)&&(m|=Ll),new bn(h,m,p)}i+=u-c}return r?e+i:new bn(e+i,0,null)}touches(e,t){let r=0,i=Ol(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;le)break;let c=this.ranges[l+o],u=a+c;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+s]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new n;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;ro&&a!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),t.openStart,t.openEnd);return Z.fromReplace(e,this.from,this.to,o)}invert(){return new qe(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new n(t.pos,r.pos,this.mark)}merge(e){return e instanceof n&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new n(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new n(t.from,t.to,e.markFromJSON(t.mark))}};Y.jsonID("addMark",kn);var qe=class n extends Y{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new w(Xi(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Z.fromReplace(e,this.from,this.to,r)}invert(){return new kn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new n(t.pos,r.pos,this.mark)}merge(e){return e instanceof n&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new n(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new n(t.from,t.to,e.markFromJSON(t.mark))}};Y.jsonID("removeMark",qe);var Sn=class n extends Y{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Z.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Z.fromReplace(e,this.pos,this.pos+1,new w(x.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;ir.pos?null:new n(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new n(t.from,t.to,t.gapFrom,t.gapTo,w.fromJSON(e,t.slice),t.insert,!!t.structure)}};Y.jsonID("replaceAround",J);function Gi(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function ad(n,e,t,r){let i=[],o=[],s,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let f=a.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let d=Math.max(c,e),h=Math.min(c+a.nodeSize,t),p=r.addToSet(f);for(let m=0;mn.step(a)),o.forEach(a=>n.step(a))}function cd(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(s,l)=>{if(!s.isInline)return;o++;let a=null;if(r instanceof pn){let c=s.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(a=[r]):a=s.marks;if(a&&a.length){let c=Math.min(l+s.nodeSize,t);for(let u=0;un.step(new qe(s.from,s.to,s.style)))}function Qi(n,e,t,r=t.contentMatch,i=!0){let o=n.doc.nodeAt(e),s=[],l=e+1;for(let a=0;a=0;a--)n.step(s[a])}function ud(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Ge(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),o=n.$from.index(r),s=n.$to.indexAfter(r);if(rt;p--)m||r.index(p)>0?(m=!0,u=x.from(r.node(p).copy(u)),f++):a--;let d=x.empty,h=0;for(let p=o,m=!1;p>t;p--)m||i.after(p+1)=0;s--){if(r.size){let l=t[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=x.from(t[s].type.create(t[s].attrs,r))}let i=e.start,o=e.end;n.step(new J(i,o,i,o,new w(r,0,0),t.length,!0))}function md(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(s,l)=>{let a=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,a)&&gd(n.doc,n.mapping.slice(o).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&Fl(n,s,l,o),Qi(n,n.mapping.slice(o).map(l,1),r,void 0,c===null);let u=n.mapping.slice(o),f=u.map(l,1),d=u.map(l+s.nodeSize,1);return n.step(new J(f,d,f+1,d-1,new w(x.from(r.create(a,null,s.marks)),0,0),1,!0)),c===!0&&Bl(n,s,l,o),!1}})}function Bl(n,e,t,r){e.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let a=n.mapping.slice(r).map(t+1+o+s.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function Fl(n,e,t,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=n.mapping.slice(r).map(t+1+o);n.replaceWith(s,s+1,e.type.schema.text(` -`))}})}function gd(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function yd(n,e,t,r,i){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let s=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,s);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new J(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new w(x.from(s),0,0),1,!0))}function xe(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=t-2;c>o;c--,u--){let f=i.node(c),d=i.index(c);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(d,f.childCount),p=r&&r[u+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[u]||f;if(!f.canReplace(d+1,f.childCount)||!m.type.validContent(h))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function bd(n,e,t=1,r){let i=n.doc.resolve(e),o=x.empty,s=x.empty;for(let l=i.depth,a=i.depth-t,c=t-1;l>a;l--,c--){o=x.from(i.node(l).copy(o));let u=r&&r[c];s=x.from(u?u.type.create(u.attrs,s):i.node(l).copy(s))}n.step(new le(e,e,new w(o.append(s),t,t),!0))}function Se(n,e){let t=n.resolve(e),r=t.index();return zl(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function xd(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.type.schema;for(let i=0;i0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&zl(o,s)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function kd(n,e,t){let r=null,{linebreakReplacement:i}=n.doc.type.schema,o=n.doc.resolve(e-t),s=o.node().type;if(i&&s.inlineContent){let u=s.whitespace=="pre",f=!!s.contentMatch.matchType(i);u&&!f?r=!1:!u&&f&&(r=!0)}let l=n.steps.length;if(r===!1){let u=n.doc.resolve(e+t);Fl(n,u.node(),u.before(),l)}s.inlineContent&&Qi(n,e+t-1,s,o.node().contentMatchAt(o.index()),r==null);let a=n.mapping.slice(l),c=a.map(e-t);if(n.step(new le(c,a.map(e+t,-1),w.empty,!0)),r===!0){let u=n.doc.resolve(c);Bl(n,u.node(),u.before(),n.steps.length)}return n}function Sd(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,t))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,t))return r.after(i+1);if(o=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),c=r.node(s),u=!1;if(o==1)u=c.canReplace(a,a,i);else{let f=c.contentMatchAt(a).findWrapping(i.firstChild.type);u=f&&c.canReplaceWith(a,a,f[0])}if(u)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function wn(n,e,t=e,r=w.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return Hl(i,o,r)?new le(e,t,r):new Yi(i,o,r).fit()}function Hl(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}var Yi=class{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=x.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=x.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let a=new w(o,s,l);return e>-1?new J(r.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||r.pos!=this.$to.pos?new le(r.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=Ji(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,f=null;if(t==1&&(s?c.matchType(s.type)||(f=c.fillBefore(x.from(s),!1)):o&&a.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:f};if(t==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Ji(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new w(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Ji(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new w(gn(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new w(gn(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let m=0;m1||a==0||m.content.size)&&(f=g,u.push($l(m.mark(d.allowedMarks(m.marks)),c==1?a:0,c==l.childCount?h:-1)))}let p=c==l.childCount;p||(h=-1),this.placed=yn(this.placed,t,x.from(u)),this.frontier[t].match=f,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=l;m1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t=0;l--){let{match:a,type:c}=this.frontier[l],u=qi(e,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=yn(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=yn(this.placed,this.depth,x.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(x.empty,!0);t.childCount&&(this.placed=yn(this.placed,this.frontier.length,t))}};function gn(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(gn(n.firstChild.content,e-1,t)))}function yn(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(yn(n.lastChild.content,e-1,t)))}function Ji(n,e){for(let t=0;t1&&(r=r.replaceChild(0,$l(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(x.empty,!0)))),n.copy(r)}function qi(n,e,t,r,i){let o=n.node(e),s=i?n.indexAfter(e):n.index(e);if(s==o.childCount&&!t.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!wd(t,o.content,s)?l:null}function wd(n,e,t){for(let r=t;r0;d--,h--){let p=i.node(d).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;s.indexOf(d)>-1?l=d:i.before(d)==h&&s.splice(1,0,-d)}let a=s.indexOf(l),c=[],u=r.openStart;for(let d=r.content,h=0;;h++){let p=d.firstChild;if(c.push(p),h==r.openStart)break;d=p.content}for(let d=u-1;d>=0;d--){let h=c[d],p=Md(h.type);if(p&&!h.sameMarkup(i.node(Math.abs(l)-1)))u=d;else if(p||!h.type.isTextblock)break}for(let d=r.openStart;d>=0;d--){let h=(d+u+1)%(r.openStart+1),p=c[h];if(p)for(let m=0;m=0&&(n.replace(e,t,r),!(n.steps.length>f));d--){let h=s[d];h<0||(e=i.before(h),t=o.after(h))}}function Vl(n,e,t,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(n).append(n);n=s.append(o.matchFragment(s).fillBefore(x.empty,!0))}return n}function vd(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=Sd(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new w(x.from(r),0,0))}function Td(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=Wl(r,i);for(let s=0;s0&&(a||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return n.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&t>r.end(s)&&i.end(s)-t!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return n.delete(r.before(s),t);n.delete(e,t)}function Wl(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let o=n.start(i);if(oe.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&t.push(i)}return t}var sr=class n extends Y{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Z.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Z.fromReplace(e,this.pos,this.pos+1,new w(x.from(i),0,t.isLeaf?0:1))}getMap(){return Je.empty}invert(e){return new n(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new n(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new n(t.pos,t.attr,t.value)}};Y.jsonID("attr",sr);var lr=class n extends Y{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return Z.ok(r)}getMap(){return Je.empty}invert(e){return new n(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new n(t.attr,t.value)}};Y.jsonID("docAttr",lr);var Jt=class extends Error{};Jt=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};Jt.prototype=Object.create(Error.prototype);Jt.prototype.constructor=Jt;Jt.prototype.name="TransformError";var qt=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new xn}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Jt(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=w.empty){let i=wn(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new w(x.from(r),0,0))}delete(e,t){return this.replace(e,t,w.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return Cd(this,e,t,r),this}replaceRangeWith(e,t,r){return vd(this,e,t,r),this}deleteRange(e,t){return Td(this,e,t),this}lift(e,t){return fd(this,e,t),this}join(e,t=1){return kd(this,e,t),this}wrap(e,t){return pd(this,e,t),this}setBlockType(e,t=e,r,i=null){return md(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return yd(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new sr(e,t,r)),this}setDocAttribute(e,t){return this.step(new lr(e,t)),this}addNodeMark(e,t){return this.step(new Sn(e,t)),this}removeNodeMark(e,t){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t instanceof B)t.isInSet(r.marks)&&this.step(new Ut(e,t));else{let i=r.marks,o,s=[];for(;o=t.isInSet(i);)s.push(new Ut(e,o)),i=o.removeFromSet(i);for(let l=s.length-1;l>=0;l--)this.step(s[l])}return this}split(e,t=1,r){return bd(this,e,t,r),this}addMark(e,t,r){return ad(this,e,t,r),this}removeMark(e,t,r){return cd(this,e,t,r),this}clearIncompatible(e,t,r){return Qi(this,e,t,r),this}};var Zi=Object.create(null),A=class{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new ur(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;o--){let s=t<0?Yt(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):Yt(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new fe(e.node(0))}static atStart(e){return Yt(e,e,0,0,1)||new fe(e)}static atEnd(e){return Yt(e,e,e.content.size,e.childCount,-1)||new fe(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Zi[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Zi)throw new RangeError("Duplicate use of selection JSON ID "+e);return Zi[e]=t,t.prototype.jsonID=e,t}getBookmark(){return O.between(this.$anchor,this.$head).getBookmark()}};A.prototype.visible=!0;var ur=class{constructor(e,t){this.$from=e,this.$to=t}},jl=!1;function Kl(n){!jl&&!n.parent.inlineContent&&(jl=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}var O=class n extends A{constructor(e,t=e){Kl(e),Kl(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return A.near(r);let i=e.resolve(t.map(this.anchor));return new n(i.parent.inlineContent?i:r,r)}replace(e,t=w.empty){if(super.replace(e,t),t==w.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof n&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new fr(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new n(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let o=A.findFrom(t,r,!0)||A.findFrom(t,-r,!0);if(o)t=o.$head;else return A.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(A.findFrom(e,-r,!0)||A.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&v.isSelectable(l))return v.create(n,t-(i<0?l.nodeSize:0))}else{let a=Yt(n,l,t+i,i<0?l.childCount:0,i,o);if(a)return a}t+=l.nodeSize*i}return null}function _l(n,e,t){let r=n.steps.length-1;if(r{s==null&&(s=u)}),n.setSelection(A.near(n.doc.resolve(s),t))}var Ul=1,cr=2,Jl=4,no=class extends qt{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=cr,this}ensureMarks(e){return B.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&cr)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~cr,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||B.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(t);o=r==t?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,o)),this.selection.empty||this.setSelection(A.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=Jl,this}get scrolledIntoView(){return(this.updated&Jl)>0}};function ql(n,e){return!e||!n?n:n.bind(e)}var Ct=class{constructor(e,t,r){this.name=e,this.init=ql(t.init,r),this.apply=ql(t.apply,r)}},Ad=[new Ct("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Ct("selection",{init(n,e){return n.selection||A.atStart(e.doc)},apply(n){return n.selection}}),new Ct("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Ct("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})],Mn=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Ad.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Ct(r.key,r.spec.state,r))})}},dr=class n{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(t[r]=o.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Mn(e.schema,e.plugins),o=new n(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=G.fromJSON(e.schema,t.doc);else if(s.name=="selection")o.selection=A.fromJSON(o.doc,t.selection);else if(s.name=="storedMarks")t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){o[s.name]=c.fromJSON.call(a,e,t[l],o);return}}o[s.name]=s.init(e,o)}}),o}};function Gl(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Gl(i,e,{})),t[r]=i}return t}var E=class{constructor(e){this.spec=e,this.props={},e.props&&Gl(e.props,this,this.props),this.key=e.key?e.key.key:Yl("plugin")}getState(e){return e[this.key]}},eo=Object.create(null);function Yl(n){return n in eo?n+"$"+ ++eo[n]:(eo[n]=0,n+"$")}var P=class{constructor(e="key"){this.key=Yl(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};var ee=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},tn=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e},ao=null,Xe=function(n,e,t){let r=ao||(ao=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},Od=function(){ao=null},Dt=function(n,e,t,r){return t&&(Xl(n,e,t,r,-1)||Xl(n,e,t,r,1))},Nd=/^(img|br|input|textarea|hr)$/i;function Xl(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:Me(n))){let o=n.parentNode;if(!o||o.nodeType!=1||Nn(n)||Nd.test(n.nodeName)||n.contentEditable=="false")return!1;e=ee(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?Me(n):0}else return!1}}function Me(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Dd(n,e){for(;;){if(n.nodeType==3&&e)return n;if(n.nodeType==1&&e>0){if(n.contentEditable=="false")return null;n=n.childNodes[e-1],e=Me(n)}else if(n.parentNode&&!Nn(n))e=ee(n),n=n.parentNode;else return null}}function Rd(n,e){for(;;){if(n.nodeType==3&&e2),we=nn||(Le?/Mac/.test(Le.platform):!1),Bd=Le?/Win/.test(Le.platform):!1,Qe=/Android \d/.test(dt),Dn=!!Ql&&"webkitFontSmoothing"in Ql.documentElement.style,Fd=Dn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function zd(n){let e=n.defaultView&&n.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Ye(n,e){return typeof n=="number"?n:n[e]}function Hd(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function Zl(n,e,t){let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,o=n.dom.ownerDocument;for(let s=t||n.dom;s;){if(s.nodeType!=1){s=tn(s);continue}let l=s,a=l==o.body,c=a?zd(o):Hd(l),u=0,f=0;if(e.topc.bottom-Ye(r,"bottom")&&(f=e.bottom-e.top>c.bottom-c.top?e.top+Ye(i,"top")-c.top:e.bottom-c.bottom+Ye(i,"bottom")),e.leftc.right-Ye(r,"right")&&(u=e.right-c.right+Ye(i,"right")),u||f)if(a)o.defaultView.scrollBy(u,f);else{let h=l.scrollLeft,p=l.scrollTop;f&&(l.scrollTop+=f),u&&(l.scrollLeft+=u);let m=l.scrollLeft-h,g=l.scrollTop-p;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}let d=a?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(d))break;s=d=="absolute"?s.offsetParent:tn(s)}}function $d(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=t+1;s=t-20){r=l,i=a.top;break}}return{refDOM:r,refTop:i,stack:Ra(n.dom)}}function Ra(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=tn(r));return e}function Vd({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;Pa(t,r==0?0:r-e)}function Pa(n,e){for(let t=0;t=l){s=Math.max(p.bottom,s),l=Math.min(p.top,l);let m=p.left>e.left?p.left-e.left:p.right=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!a&&p.left<=e.left&&p.right>=e.left&&(a=u,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!t&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(o=f+1)}}return!t&&a&&(t=a,i=c,r=0),t&&t.nodeType==3?jd(t,i):!t||r&&t.nodeType==1?{node:n,offset:o}:Ia(t,i)}function jd(n,e){let t=n.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:n,offset:0}}function Eo(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function Kd(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left(s.left+s.right)/2?1:-1}return n.docView.posFromDOM(r,i,o)}function Ud(n,e,t,r){let i=-1;for(let o=e,s=!1;o!=n.dom;){let l=n.docView.nearestDesc(o,!0),a;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((a=l.dom.getBoundingClientRect()).width||a.height)&&(l.node.isBlock&&l.parent&&(!s&&a.left>r.left||a.top>r.top?i=l.posBefore:(!s&&a.right-1?i:n.docView.posFromDOM(e,t,-1)}function La(n,e,t){let r=n.childNodes.length;if(r&&t.tope.top&&i++}let c;Dn&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==n.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=n.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=Ud(n,r,i,e))}l==null&&(l=_d(n,s,e));let a=n.docView.nearestDesc(s,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function ea(n){return n.top=0&&i==r.nodeValue.length?(a--,u=1):t<0?a--:c++,Cn(lt(Xe(r,a,c),u),u<0)}if(!n.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(t<0||i==Me(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return ro(a.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(t<0||i==Me(r))){let a=r.childNodes[i-1],c=a.nodeType==3?Xe(a,Me(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return Cn(lt(c,1),!1)}if(o==null&&i=0)}function Cn(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function ro(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function Fa(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}function Gd(n,e,t){let r=e.selection,i=t=="up"?r.$from:r.$to;return Fa(n,e,()=>{let{node:o}=n.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let l=n.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=Ba(n,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Xe(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(t=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}var Yd=/[\u0590-\u08ac]/;function Xd(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=n.domSelection();return l?!Yd.test(r.parent.textContent)||!l.modify?t=="left"||t=="backward"?o:s:Fa(n,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:f}=n.domSelectionRange(),d=l.caretBidiLevel;l.modify("move",t,"character");let h=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:p,focusOffset:m}=n.domSelectionRange(),g=p&&!h.contains(p.nodeType==1?p:p.parentNode)||a==p&&c==m;try{l.collapse(u,f),a&&(a!=u||c!=f)&&l.extend&&l.extend(a,c)}catch{}return d!=null&&(l.caretBidiLevel=d),g}):r.pos==r.start()||r.pos==r.end()}var ta=null,na=null,ra=!1;function Qd(n,e,t){return ta==e&&na==t?ra:(ta=e,na=t,ra=t=="up"||t=="down"?Gd(n,e,t):Xd(n,e,t))}var Ce=0,ia=1,Tt=2,Be=3,Rt=class{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=Ce,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tee(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!t||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;te||s instanceof mr){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof hr&&o.side>=0;r--);if(t<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&t&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,t):{node:this.contentDOM,offset:o?ee(o.dom)+1:0}}else{let o,s=!0;for(;o=r=u&&t<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,u);e=s;for(let f=l;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=ee(d.dom)+1;break}e-=d.size}i==-1&&(i=0)}if(i>-1&&(c>t||l==this.children.length-1)){t=c;for(let u=l+1;up&&st){let p=l;l=a,a=p}let h=document.createRange();h.setEnd(a.node,a.offset),h.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,i=0;i=r:er){let l=r+o.border,a=s-o.border;if(e>=l&&t<=a){this.dirty=e==r||t==s?Tt:ia,e==l&&t==a&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Be:o.markDirty(e-l,t-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Tt:Be}r=s}this.dirty=Tt}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?Tt:ia;t.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!t.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return this.dirty==Ce&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}},ho=class extends Rt{constructor(e,t,r,i){super(e,[],t,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}},rn=class n extends Rt{constructor(e,t,r,i,o){super(e,[],r,i),this.mark=t,this.spec=o}static create(e,t,r,i){let o=i.nodeViews[t.type.name],s=o&&o(t,i,r);return(!s||!s.dom)&&(s=Ue.renderSpec(document,t.type.spec.toDOM(t,r),null,t.attrs)),new n(e,t,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Be||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Be&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Ce){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=yo(o,0,e,r));for(let l=0;l{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,i),u=c&&c.dom,f=c&&c.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=Ue.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!f&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let d=u;return u=$a(u,r,t),c?a=new po(e,t,r,i,u,f||null,d,c,o,s+1):t.isText?new pr(e,t,r,i,u,d,o):new n(e,t,r,i,u,f||null,d,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>x.empty)}return e}matchesNode(e,t,r){return this.dirty==Ce&&e.eq(this.node)&&gr(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,i=t,o=e.composing?this.localCompositionInfo(e,t):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,a=new go(this,s&&s.node,e);nh(this.node,this.innerDeco,(c,u,f)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!f&&a.syncToMarks(u==this.node.childCount?B.none:this.node.child(u).marks,r,e),a.placeWidget(c,e,i)},(c,u,f,d)=>{a.syncToMarks(c.marks,r,e);let h;a.findNodeMatch(c,u,f,d)||l&&e.state.selection.from>i&&e.state.selection.to-1&&a.updateNodeAt(c,u,f,h,e)||a.updateNextNode(c,u,f,e,d,i)||a.addNode(c,u,f,e,i),i+=c.nodeSize}),a.syncToMarks([],r,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Tt)&&(s&&this.protectLocalComposition(e,s),za(this.contentDOM,this.children,e),nn&&rh(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof O)||rt+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,l=ih(this.node.content,s,r-t,i-t);return l<0?null:{node:o,pos:l,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:i}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new ho(this,o,t,i);e.input.compositionNodes.push(s),this.children=yo(this.children,r,r+i.length,e,s)}update(e,t,r,i){return this.dirty==Be||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,i),!0)}updateInner(e,t,r,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Ce}updateOuterDeco(e){if(gr(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=Ha(this.dom,this.nodeDOM,mo(this.outerDeco,this.node,t),mo(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}};function oa(n,e,t,r,i){$a(r,e,n);let o=new ft(void 0,n,e,t,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}var pr=class n extends ft{constructor(e,t,r,i,o,s,l){super(e,t,r,i,o,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,i){return this.dirty==Be||this.dirty!=Ce&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Ce||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Ce,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let i=this.node.cut(e,t),o=document.createTextNode(i.text);return new n(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Be)}get domAtom(){return!1}isText(e){return this.node.text==e}},mr=class extends Rt{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ce&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},po=class extends ft{constructor(e,t,r,i,o,s,l,a,c,u){super(e,t,r,i,o,s,l,c,u),this.spec=a}update(e,t,r,i){if(this.dirty==Be)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,t,r);return o&&this.updateInner(e,t,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r.root):super.setSelection(e,t,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function za(n,e,t){let r=n.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=rn.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,t,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(r){let c=t.children[r-1];if(c instanceof rn)t=c,r=c.children.length;else{l=c,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let a=l.node;if(a){if(a!=n.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function th(n,e){return n.type.side-e.type.side}function nh(n,e,t,r){let i=e.locals(n),o=0;if(i.length==0){for(let c=0;co;)l.push(i[s++]);let p=o+d.nodeSize;if(d.isText){let g=p;s!g.inline):l.slice();r(d,m,e.forChild(o,d),h),o=p}}function rh(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function ih(n,e,t,r){for(let i=0,o=0;i=t){if(o>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l=0&&c+e.length+l>=t)return l+c;if(t==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function yo(n,e,t,r,i){let o=[];for(let s=0,l=0;s=t||u<=e?o.push(a):(ct&&o.push(a.slice(t-c,a.size,r)))}return o}function Ao(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,s=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,c;if(Cr(t)){for(a=s;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&v.isSelectable(f)&&i.parent&&!(f.isInline&&Pd(t.focusNode,t.focusOffset,i.dom))){let d=i.posBefore;c=new v(s==d?l:r.resolve(d))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let f=s,d=s;for(let h=0;h{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Va(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function sh(n){let e=n.domSelection(),t=document.createRange();if(!e)return;let r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setStart(r.parentNode,ee(r)+1):t.setStart(r,0),t.collapse(!0),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&ge&&ut<=11&&(r.disabled=!0,r.disabled=!1)}function Wa(n,e){if(e instanceof v){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(ua(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else ua(n)}function ua(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function Oo(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||O.between(e,t,r)}function fa(n){return n.editable&&!n.hasFocus()?!1:ja(n)}function ja(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function lh(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return Dt(e.node,e.offset,t.anchorNode,t.anchorOffset)}function bo(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&A.findFrom(o,e)}function at(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function da(n,e,t){let r=n.state.selection;if(r instanceof O)if(t.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=n.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return at(n,new O(r.$anchor,s))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=bo(n.state,e);return i&&i instanceof v?at(n,i):!1}else if(!(we&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=n.docView.descAt(l))&&!s.contentDOM?v.isSelectable(o)?at(n,new v(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):Dn?at(n,new O(n.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof v&&r.node.isInline)return at(n,new O(e>0?r.$to:r.$from));{let i=bo(n.state,e);return i?at(n,i):!1}}}function yr(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Tn(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function Qt(n,e){return e<0?ah(n):ch(n)}function ah(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,s=!1;for(De&&t.nodeType==1&&r0){if(t.nodeType!=1)break;{let l=t.childNodes[r-1];if(Tn(l,-1))i=t,o=--r;else if(l.nodeType==3)t=l,r=t.nodeValue.length;else break}}else{if(Ka(t))break;{let l=t.previousSibling;for(;l&&Tn(l,-1);)i=t.parentNode,o=ee(l),l=l.previousSibling;if(l)t=l,r=yr(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}s?xo(n,t,r):i&&xo(n,i,o)}function ch(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=yr(t),o,s;for(;;)if(r{n.state==i&&Ze(n)},50)}function ha(n,e){let t=n.state.doc.resolve(e);if(!(ce||Bd)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let o=n.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function pa(n,e,t){let r=n.state.selection;if(r instanceof O&&!r.empty||t.indexOf("s")>-1||we&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let s=bo(n.state,e);if(s&&s instanceof v)return at(n,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof fe?A.near(s,e):A.findFrom(s,e);return l?at(n,l):!1}return!1}function ma(n,e){if(!(n.state.selection instanceof O))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let s=n.state.tr;return e<0?s.delete(t.pos-o.nodeSize,t.pos):s.delete(t.pos,t.pos+o.nodeSize),n.dispatch(s),!0}return!1}function ga(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function dh(n){if(!de||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;ga(n,r,"true"),setTimeout(()=>ga(n,r,"false"),20)}return!1}function hh(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function ph(n,e){let t=e.keyCode,r=hh(e);if(t==8||we&&t==72&&r=="c")return ma(n,-1)||Qt(n,-1);if(t==46&&!e.shiftKey||we&&t==68&&r=="c")return ma(n,1)||Qt(n,1);if(t==13||t==27)return!0;if(t==37||we&&t==66&&r=="c"){let i=t==37?ha(n,n.state.selection.from)=="ltr"?-1:1:-1;return da(n,i,r)||Qt(n,i)}else if(t==39||we&&t==70&&r=="c"){let i=t==39?ha(n,n.state.selection.from)=="ltr"?1:-1:1;return da(n,i,r)||Qt(n,i)}else{if(t==38||we&&t==80&&r=="c")return pa(n,-1,r)||Qt(n,-1);if(t==40||we&&t==78&&r=="c")return dh(n)||pa(n,1,r)||Qt(n,1);if(r==(we?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function No(n,e){n.someProp("transformCopied",h=>{e=h(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let h=r.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let s=n.someProp("clipboardSerializer")||Ue.fromSchema(n.state.schema),l=Ya(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c=a.firstChild,u,f=0;for(;c&&c.nodeType==1&&(u=Ga[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let p=l.createElement(u[h]);for(;a.firstChild;)p.appendChild(a.firstChild);a.appendChild(p),f++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(t)}`);let d=n.someProp("clipboardTextSerializer",h=>h(e,n))||e.content.textBetween(0,e.content.size,` +function se(n){this.content=n}se.prototype={constructor:se,find:function(n){for(var e=0;e>1}};se.from=function(n){if(n instanceof se)return n;var e=[];if(n)for(var t in n)e.push(t,n[t]);return new se(e)};var Fi=se;function pl(n,e,t){for(let r=0;;r++){if(r==n.childCount||r==e.childCount)return n.childCount==e.childCount?null:t;let i=n.child(r),o=e.child(r);if(i==o){t+=i.nodeSize;continue}if(!i.sameMarkup(o))return t;if(i.isText&&i.text!=o.text){for(let s=0;i.text[s]==o.text[s];s++)t++;return t}if(i.content.size||o.content.size){let s=pl(i.content,o.content,t+1);if(s!=null)return s}t+=i.nodeSize}}function ml(n,e,t,r){for(let i=n.childCount,o=e.childCount;;){if(i==0||o==0)return i==o?null:{a:t,b:r};let s=n.child(--i),l=e.child(--o),a=s.nodeSize;if(s==l){t-=a,r-=a;continue}if(!s.sameMarkup(l))return{a:t,b:r};if(s.isText&&s.text!=l.text){let c=0,u=Math.min(s.text.length,l.text.length);for(;ce&&r(a,i+l,o||null,s)!==!1&&a.content.size){let u=l+1;a.nodesBetween(Math.max(0,e-u),Math.min(a.content.size,t-u),r,i+u)}l=c}}descendants(e){this.nodesBetween(0,this.size,e)}textBetween(e,t,r,i){let o="",s=!0;return this.nodesBetween(e,t,(l,a)=>{let c=l.isText?l.text.slice(Math.max(e,a)-a,t-a):l.isLeaf?i?typeof i=="function"?i(l):i:l.type.spec.leafText?l.type.spec.leafText(l):"":"";l.isBlock&&(l.isLeaf&&c||l.isTextblock)&&r&&(s?s=!1:o+=r),o+=c},0),o}append(e){if(!e.size)return this;if(!this.size)return e;let t=this.lastChild,r=e.firstChild,i=this.content.slice(),o=0;for(t.isText&&t.sameMarkup(r)&&(i[i.length-1]=t.withText(t.text+r.text),o=1);oe)for(let o=0,s=0;se&&((st)&&(l.isText?l=l.cut(Math.max(0,e-s),Math.min(l.text.length,t-s)):l=l.cut(Math.max(0,e-s-1),Math.min(l.content.size,t-s-1))),r.push(l),i+=l.nodeSize),s=a}return new n(r,i)}cutByIndex(e,t){return e==t?n.empty:e==0&&t==this.content.length?this:new n(this.content.slice(e,t))}replaceChild(e,t){let r=this.content[e];if(r==t)return this;let i=this.content.slice(),o=this.size+t.nodeSize-r.nodeSize;return i[e]=t,new n(i,o)}addToStart(e){return new n([e].concat(this.content),this.size+e.nodeSize)}addToEnd(e){return new n(this.content.concat(e),this.size+e.nodeSize)}eq(e){if(this.content.length!=e.content.length)return!1;for(let t=0;tthis.size||e<0)throw new RangeError(`Position ${e} outside of fragment (${this})`);for(let r=0,i=0;;r++){let o=this.child(r),s=i+o.nodeSize;if(s>=e)return s==e||t>0?Qn(r+1,s):Qn(r,i);i=s}}toString(){return"<"+this.toStringInner()+">"}toStringInner(){return this.content.join(", ")}toJSON(){return this.content.length?this.content.map(e=>e.toJSON()):null}static fromJSON(e,t){if(!t)return n.empty;if(!Array.isArray(t))throw new RangeError("Invalid input for Fragment.fromJSON");return new n(t.map(e.nodeFromJSON))}static fromArray(e){if(!e.length)return n.empty;let t,r=0;for(let i=0;ithis.type.rank&&(t||(t=e.slice(0,i)),t.push(this),r=!0),t&&t.push(o)}}return t||(t=e.slice()),r||t.push(this),t}removeFromSet(e){for(let t=0;tr.type.rank-i.type.rank),t}};B.none=[];var kt=class extends Error{},w=class n{constructor(e,t,r){this.content=e,this.openStart=t,this.openEnd=r}get size(){return this.content.size-this.openStart-this.openEnd}insertAt(e,t){let r=yl(this.content,e+this.openStart,t);return r&&new n(r,this.openStart,this.openEnd)}removeBetween(e,t){return new n(gl(this.content,e+this.openStart,t+this.openStart),this.openStart,this.openEnd)}eq(e){return this.content.eq(e.content)&&this.openStart==e.openStart&&this.openEnd==e.openEnd}toString(){return this.content+"("+this.openStart+","+this.openEnd+")"}toJSON(){if(!this.content.size)return null;let e={content:this.content.toJSON()};return this.openStart>0&&(e.openStart=this.openStart),this.openEnd>0&&(e.openEnd=this.openEnd),e}static fromJSON(e,t){if(!t)return n.empty;let r=t.openStart||0,i=t.openEnd||0;if(typeof r!="number"||typeof i!="number")throw new RangeError("Invalid input for Slice.fromJSON");return new n(x.fromJSON(e,t.content),r,i)}static maxOpen(e,t=!0){let r=0,i=0;for(let o=e.firstChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.firstChild)r++;for(let o=e.lastChild;o&&!o.isLeaf&&(t||!o.type.spec.isolating);o=o.lastChild)i++;return new n(e,r,i)}};w.empty=new w(x.empty,0,0);function gl(n,e,t){let{index:r,offset:i}=n.findIndex(e),o=n.maybeChild(r),{index:s,offset:l}=n.findIndex(t);if(i==e||o.isText){if(l!=t&&!n.child(s).isText)throw new RangeError("Removing non-flat range");return n.cut(0,e).append(n.cut(t))}if(r!=s)throw new RangeError("Removing non-flat range");return n.replaceChild(r,o.copy(gl(o.content,e-i-1,t-i-1)))}function yl(n,e,t,r){let{index:i,offset:o}=n.findIndex(e),s=n.maybeChild(i);if(o==e||s.isText)return r&&!r.canReplace(i,i,t)?null:n.cut(0,e).append(t).append(n.cut(e));let l=yl(s.content,e-o-1,t);return l&&n.replaceChild(i,s.copy(l))}function Wf(n,e,t){if(t.openStart>n.depth)throw new kt("Inserted content deeper than insertion position");if(n.depth-t.openStart!=e.depth-t.openEnd)throw new kt("Inconsistent open depths");return bl(n,e,t,0)}function bl(n,e,t,r){let i=n.index(r),o=n.node(r);if(i==e.index(r)&&r=0&&n.isText&&n.sameMarkup(e[t])?e[t]=n.withText(e[t].text+n.text):e.push(n)}function dn(n,e,t,r){let i=(e||n).node(t),o=0,s=e?e.index(t):i.childCount;n&&(o=n.index(t),n.depth>t?o++:n.textOffset&&(bt(n.nodeAfter,r),o++));for(let l=o;li&&$i(n,e,i+1),s=r.depth>i&&$i(t,r,i+1),l=[];return dn(null,n,i,l),o&&s&&e.index(i)==t.index(i)?(xl(o,s),bt(xt(o,kl(n,e,t,r,i+1)),l)):(o&&bt(xt(o,tr(n,e,i+1)),l),dn(e,t,i,l),s&&bt(xt(s,tr(t,r,i+1)),l)),dn(r,null,i,l),new x(l)}function tr(n,e,t){let r=[];if(dn(null,n,t,r),n.depth>t){let i=$i(n,e,t+1);bt(xt(i,tr(n,e,t+1)),r)}return dn(e,null,t,r),new x(r)}function jf(n,e){let t=e.depth-n.openStart,i=e.node(t).copy(n.content);for(let o=t-1;o>=0;o--)i=e.node(o).copy(x.from(i));return{start:i.resolveNoCache(n.openStart+t),end:i.resolveNoCache(i.content.size-n.openEnd-t)}}var nr=class n{constructor(e,t,r){this.pos=e,this.path=t,this.parentOffset=r,this.depth=t.length/3-1}resolveDepth(e){return e==null?this.depth:e<0?this.depth+e:e}get parent(){return this.node(this.depth)}get doc(){return this.node(0)}node(e){return this.path[this.resolveDepth(e)*3]}index(e){return this.path[this.resolveDepth(e)*3+1]}indexAfter(e){return e=this.resolveDepth(e),this.index(e)+(e==this.depth&&!this.textOffset?0:1)}start(e){return e=this.resolveDepth(e),e==0?0:this.path[e*3-1]+1}end(e){return e=this.resolveDepth(e),this.start(e)+this.node(e).content.size}before(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position before the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]}after(e){if(e=this.resolveDepth(e),!e)throw new RangeError("There is no position after the top-level node");return e==this.depth+1?this.pos:this.path[e*3-1]+this.path[e*3].nodeSize}get textOffset(){return this.pos-this.path[this.path.length-1]}get nodeAfter(){let e=this.parent,t=this.index(this.depth);if(t==e.childCount)return null;let r=this.pos-this.path[this.path.length-1],i=e.child(t);return r?e.child(t).cut(r):i}get nodeBefore(){let e=this.index(this.depth),t=this.pos-this.path[this.path.length-1];return t?this.parent.child(e).cut(0,t):e==0?null:this.parent.child(e-1)}posAtIndex(e,t){t=this.resolveDepth(t);let r=this.path[t*3],i=t==0?0:this.path[t*3-1]+1;for(let o=0;o0;t--)if(this.start(t)<=e&&this.end(t)>=e)return t;return 0}blockRange(e=this,t){if(e.pos=0;r--)if(e.pos<=this.end(r)&&(!t||t(this.node(r))))return new St(this,e,r);return null}sameParent(e){return this.pos-this.parentOffset==e.pos-e.parentOffset}max(e){return e.pos>this.pos?e:this}min(e){return e.pos=0&&t<=e.content.size))throw new RangeError("Position "+t+" out of range");let r=[],i=0,o=t;for(let s=e;;){let{index:l,offset:a}=s.content.findIndex(o),c=o-a;if(r.push(s,l,i+a),!c||(s=s.child(l),s.isText))break;o=c-1,i+=a+1}return new n(t,r,o)}static resolveCached(e,t){let r=ol.get(e);if(r)for(let o=0;oe&&this.nodesBetween(e,t,o=>(r.isInSet(o.marks)&&(i=!0),!i)),i}get isBlock(){return this.type.isBlock}get isTextblock(){return this.type.isTextblock}get inlineContent(){return this.type.inlineContent}get isInline(){return this.type.isInline}get isText(){return this.type.isText}get isLeaf(){return this.type.isLeaf}get isAtom(){return this.type.isAtom}toString(){if(this.type.spec.toDebugString)return this.type.spec.toDebugString(this);let e=this.type.name;return this.content.size&&(e+="("+this.content.toStringInner()+")"),Sl(this.marks,e)}contentMatchAt(e){let t=this.type.contentMatch.matchFragment(this.content,0,e);if(!t)throw new Error("Called contentMatchAt on a node with invalid content");return t}canReplace(e,t,r=x.empty,i=0,o=r.childCount){let s=this.contentMatchAt(e).matchFragment(r,i,o),l=s&&s.matchFragment(this.content,t);if(!l||!l.validEnd)return!1;for(let a=i;at.type.name)}`);this.content.forEach(t=>t.check())}toJSON(){let e={type:this.type.name};for(let t in this.attrs){e.attrs=this.attrs;break}return this.content.size&&(e.content=this.content.toJSON()),this.marks.length&&(e.marks=this.marks.map(t=>t.toJSON())),e}static fromJSON(e,t){if(!t)throw new RangeError("Invalid input for Node.fromJSON");let r;if(t.marks){if(!Array.isArray(t.marks))throw new RangeError("Invalid mark data for Node.fromJSON");r=t.marks.map(e.markFromJSON)}if(t.type=="text"){if(typeof t.text!="string")throw new RangeError("Invalid text node in JSON");return e.text(t.text,r)}let i=x.fromJSON(e,t.content),o=e.nodeType(t.type).create(t.attrs,i,r);return o.type.checkAttrs(o.attrs),o}};G.prototype.text=void 0;var Wi=class n extends G{constructor(e,t,r,i){if(super(e,t,null,i),!r)throw new RangeError("Empty text nodes are not allowed");this.text=r}toString(){return this.type.spec.toDebugString?this.type.spec.toDebugString(this):Sl(this.marks,JSON.stringify(this.text))}get textContent(){return this.text}textBetween(e,t){return this.text.slice(e,t)}get nodeSize(){return this.text.length}mark(e){return e==this.marks?this:new n(this.type,this.attrs,this.text,e)}withText(e){return e==this.text?this:new n(this.type,this.attrs,e,this.marks)}cut(e=0,t=this.text.length){return e==0&&t==this.text.length?this:this.withText(this.text.slice(e,t))}eq(e){return this.sameMarkup(e)&&this.text==e.text}toJSON(){let e=super.toJSON();return e.text=this.text,e}};function Sl(n,e){for(let t=n.length-1;t>=0;t--)e=n[t].type.name+"("+e+")";return e}var wt=class n{constructor(e){this.validEnd=e,this.next=[],this.wrapCache=[]}static parse(e,t){let r=new ji(e,t);if(r.next==null)return n.empty;let i=wl(r);r.next&&r.err("Unexpected trailing text");let o=Qf(Xf(i));return Zf(o,r),o}matchType(e){for(let t=0;tc.createAndFill()));for(let c=0;c=this.next.length)throw new RangeError(`There's no ${e}th edge in this content match`);return this.next[e]}toString(){let e=[];function t(r){e.push(r);for(let i=0;i{let o=i+(r.validEnd?"*":" ")+" ";for(let s=0;s"+e.indexOf(r.next[s].next);return o}).join(` +`)}};wt.empty=new wt(!0);var ji=class{constructor(e,t){this.string=e,this.nodeTypes=t,this.inline=null,this.pos=0,this.tokens=e.split(/\s*(?=\b|\W|$)/),this.tokens[this.tokens.length-1]==""&&this.tokens.pop(),this.tokens[0]==""&&this.tokens.shift()}get next(){return this.tokens[this.pos]}eat(e){return this.next==e&&(this.pos++||!0)}err(e){throw new SyntaxError(e+" (in content expression '"+this.string+"')")}};function wl(n){let e=[];do e.push(Uf(n));while(n.eat("|"));return e.length==1?e[0]:{type:"choice",exprs:e}}function Uf(n){let e=[];do e.push(Jf(n));while(n.next&&n.next!=")"&&n.next!="|");return e.length==1?e[0]:{type:"seq",exprs:e}}function Jf(n){let e=Yf(n);for(;;)if(n.eat("+"))e={type:"plus",expr:e};else if(n.eat("*"))e={type:"star",expr:e};else if(n.eat("?"))e={type:"opt",expr:e};else if(n.eat("{"))e=qf(n,e);else break;return e}function sl(n){/\D/.test(n.next)&&n.err("Expected number, got '"+n.next+"'");let e=Number(n.next);return n.pos++,e}function qf(n,e){let t=sl(n),r=t;return n.eat(",")&&(n.next!="}"?r=sl(n):r=-1),n.eat("}")||n.err("Unclosed braced range"),{type:"range",min:t,max:r,expr:e}}function Gf(n,e){let t=n.nodeTypes,r=t[e];if(r)return[r];let i=[];for(let o in t){let s=t[o];s.isInGroup(e)&&i.push(s)}return i.length==0&&n.err("No node type or group '"+e+"' found"),i}function Yf(n){if(n.eat("(")){let e=wl(n);return n.eat(")")||n.err("Missing closing paren"),e}else if(/\W/.test(n.next))n.err("Unexpected token '"+n.next+"'");else{let e=Gf(n,n.next).map(t=>(n.inline==null?n.inline=t.isInline:n.inline!=t.isInline&&n.err("Mixing inline and block content"),{type:"name",value:t}));return n.pos++,e.length==1?e[0]:{type:"choice",exprs:e}}}function Xf(n){let e=[[]];return i(o(n,0),t()),e;function t(){return e.push([])-1}function r(s,l,a){let c={term:a,to:l};return e[s].push(c),c}function i(s,l){s.forEach(a=>a.to=l)}function o(s,l){if(s.type=="choice")return s.exprs.reduce((a,c)=>a.concat(o(c,l)),[]);if(s.type=="seq")for(let a=0;;a++){let c=o(s.exprs[a],l);if(a==s.exprs.length-1)return c;i(c,l=t())}else if(s.type=="star"){let a=t();return r(l,a),i(o(s.expr,a),a),[r(a)]}else if(s.type=="plus"){let a=t();return i(o(s.expr,l),a),i(o(s.expr,a),a),[r(a)]}else{if(s.type=="opt")return[r(l)].concat(o(s.expr,l));if(s.type=="range"){let a=l;for(let c=0;c{n[s].forEach(({term:l,to:a})=>{if(!l)return;let c;for(let u=0;u{c||i.push([l,c=[]]),c.indexOf(u)==-1&&c.push(u)})})});let o=e[r.join(",")]=new wt(r.indexOf(n.length-1)>-1);for(let s=0;s-1}get whitespace(){return this.spec.whitespace||(this.spec.code?"pre":"normal")}hasRequiredAttrs(){for(let e in this.attrs)if(this.attrs[e].isRequired)return!0;return!1}compatibleContent(e){return this==e||this.contentMatch.compatible(e.contentMatch)}computeAttrs(e){return!e&&this.defaultAttrs?this.defaultAttrs:vl(this.attrs,e)}create(e=null,t,r){if(this.isText)throw new Error("NodeType.create can't construct text nodes");return new G(this,this.computeAttrs(e),x.from(t),B.setFrom(r))}createChecked(e=null,t,r){return t=x.from(t),this.checkContent(t),new G(this,this.computeAttrs(e),t,B.setFrom(r))}createAndFill(e=null,t,r){if(e=this.computeAttrs(e),t=x.from(t),t.size){let s=this.contentMatch.fillBefore(t);if(!s)return null;t=s.append(t)}let i=this.contentMatch.matchFragment(t),o=i&&i.fillBefore(x.empty,!0);return o?new G(this,e,t.append(o),B.setFrom(r)):null}validContent(e){let t=this.contentMatch.matchFragment(e);if(!t||!t.validEnd)return!1;for(let r=0;r-1}allowsMarks(e){if(this.markSet==null)return!0;for(let t=0;tr[o]=new n(o,t,s));let i=t.spec.topNode||"doc";if(!r[i])throw new RangeError("Schema is missing its top node type ('"+i+"')");if(!r.text)throw new RangeError("Every schema needs a 'text' type");for(let o in r.text.attrs)throw new RangeError("The text node type should not have attributes");return r}};function ed(n,e,t){let r=t.split("|");return i=>{let o=i===null?"null":typeof i;if(r.indexOf(o)<0)throw new RangeError(`Expected value of type ${r} for attribute ${e} on type ${n}, got ${o}`)}}var Ki=class{constructor(e,t,r){this.hasDefault=Object.prototype.hasOwnProperty.call(r,"default"),this.default=r.default,this.validate=typeof r.validate=="string"?ed(e,t,r.validate):r.validate}get isRequired(){return!this.hasDefault}},pn=class n{constructor(e,t,r,i){this.name=e,this.rank=t,this.schema=r,this.spec=i,this.attrs=El(e,i.attrs),this.excluded=null;let o=Cl(this.attrs);this.instance=o?new B(this,o):null}create(e=null){return!e&&this.instance?this.instance:new B(this,vl(this.attrs,e))}static compile(e,t){let r=Object.create(null),i=0;return e.forEach((o,s)=>r[o]=new n(o,i++,t,s)),r}removeFromSet(e){for(var t=0;t-1}},_t=class{constructor(e){this.linebreakReplacement=null,this.cached=Object.create(null);let t=this.spec={};for(let i in e)t[i]=e[i];t.nodes=Fi.from(e.nodes),t.marks=Fi.from(e.marks||{}),this.nodes=rr.compile(this.spec.nodes,this),this.marks=pn.compile(this.spec.marks,this);let r=Object.create(null);for(let i in this.nodes){if(i in this.marks)throw new RangeError(i+" can not be both a node and a mark");let o=this.nodes[i],s=o.spec.content||"",l=o.spec.marks;if(o.contentMatch=r[s]||(r[s]=wt.parse(s,this.nodes)),o.inlineContent=o.contentMatch.inlineContent,o.spec.linebreakReplacement){if(this.linebreakReplacement)throw new RangeError("Multiple linebreak nodes defined");if(!o.isInline||!o.isLeaf)throw new RangeError("Linebreak replacement nodes must be inline leaf nodes");this.linebreakReplacement=o}o.markSet=l=="_"?null:l?al(this,l.split(" ")):l==""||!o.inlineContent?[]:null}for(let i in this.marks){let o=this.marks[i],s=o.spec.excludes;o.excluded=s==null?[o]:s==""?[]:al(this,s.split(" "))}this.nodeFromJSON=this.nodeFromJSON.bind(this),this.markFromJSON=this.markFromJSON.bind(this),this.topNodeType=this.nodes[this.spec.topNode||"doc"],this.cached.wrappings=Object.create(null)}node(e,t=null,r,i){if(typeof e=="string")e=this.nodeType(e);else if(e instanceof rr){if(e.schema!=this)throw new RangeError("Node type from different schema used ("+e.name+")")}else throw new RangeError("Invalid node type: "+e);return e.createChecked(t,r,i)}text(e,t){let r=this.nodes.text;return new Wi(r,r.defaultAttrs,e,B.setFrom(t))}mark(e,t){return typeof e=="string"&&(e=this.marks[e]),e.create(t)}nodeFromJSON(e){return G.fromJSON(this,e)}markFromJSON(e){return B.fromJSON(this,e)}nodeType(e){let t=this.nodes[e];if(!t)throw new RangeError("Unknown node type: "+e);return t}};function al(n,e){let t=[];for(let r=0;r-1)&&t.push(s=a)}if(!s)throw new SyntaxError("Unknown mark type: '"+e[r]+"'")}return t}function td(n){return n.tag!=null}function nd(n){return n.style!=null}var Ie=class n{constructor(e,t){this.schema=e,this.rules=t,this.tags=[],this.styles=[];let r=this.matchedStyles=[];t.forEach(i=>{if(td(i))this.tags.push(i);else if(nd(i)){let o=/[^=]*/.exec(i.style)[0];r.indexOf(o)<0&&r.push(o),this.styles.push(i)}}),this.normalizeLists=!this.tags.some(i=>{if(!/^(ul|ol)\b/.test(i.tag)||!i.node)return!1;let o=e.nodes[i.node];return o.contentMatch.matchType(o)})}parse(e,t={}){let r=new ir(this,t,!1);return r.addAll(e,B.none,t.from,t.to),r.finish()}parseSlice(e,t={}){let r=new ir(this,t,!0);return r.addAll(e,B.none,t.from,t.to),w.maxOpen(r.finish())}matchTag(e,t,r){for(let i=r?this.tags.indexOf(r)+1:0;ie.length&&(l.charCodeAt(e.length)!=61||l.slice(e.length+1)!=t))){if(s.getAttrs){let a=s.getAttrs(t);if(a===!1)continue;s.attrs=a||void 0}return s}}}static schemaRules(e){let t=[];function r(i){let o=i.priority==null?50:i.priority,s=0;for(;s{r(s=ul(s)),s.mark||s.ignore||s.clearMark||(s.mark=i)})}for(let i in e.nodes){let o=e.nodes[i].spec.parseDOM;o&&o.forEach(s=>{r(s=ul(s)),s.node||s.ignore||s.mark||(s.node=i)})}return t}static fromSchema(e){return e.cached.domParser||(e.cached.domParser=new n(e,n.schemaRules(e)))}},Al={address:!0,article:!0,aside:!0,blockquote:!0,canvas:!0,dd:!0,div:!0,dl:!0,fieldset:!0,figcaption:!0,figure:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,li:!0,noscript:!0,ol:!0,output:!0,p:!0,pre:!0,section:!0,table:!0,tfoot:!0,ul:!0},rd={head:!0,noscript:!0,object:!0,script:!0,style:!0,title:!0},Ol={ol:!0,ul:!0},mn=1,_i=2,hn=4;function cl(n,e,t){return e!=null?(e?mn:0)|(e==="full"?_i:0):n&&n.whitespace=="pre"?mn|_i:t&~hn}var Kt=class{constructor(e,t,r,i,o,s){this.type=e,this.attrs=t,this.marks=r,this.solid=i,this.options=s,this.content=[],this.activeMarks=B.none,this.match=o||(s&hn?null:e.contentMatch)}findWrapping(e){if(!this.match){if(!this.type)return[];let t=this.type.contentMatch.fillBefore(x.from(e));if(t)this.match=this.type.contentMatch.matchFragment(t);else{let r=this.type.contentMatch,i;return(i=r.findWrapping(e.type))?(this.match=r,i):null}}return this.match.findWrapping(e.type)}finish(e){if(!(this.options&mn)){let r=this.content[this.content.length-1],i;if(r&&r.isText&&(i=/[ \t\r\n\u000c]+$/.exec(r.text))){let o=r;r.text.length==i[0].length?this.content.pop():this.content[this.content.length-1]=o.withText(o.text.slice(0,o.text.length-i[0].length))}}let t=x.from(this.content);return!e&&this.match&&(t=t.append(this.match.fillBefore(x.empty,!0))),this.type?this.type.create(this.attrs,t,this.marks):t}inlineContext(e){return this.type?this.type.inlineContent:this.content.length?this.content[0].isInline:e.parentNode&&!Al.hasOwnProperty(e.parentNode.nodeName.toLowerCase())}},ir=class{constructor(e,t,r){this.parser=e,this.options=t,this.isOpen=r,this.open=0,this.localPreserveWS=!1;let i=t.topNode,o,s=cl(null,t.preserveWhitespace,0)|(r?hn:0);i?o=new Kt(i.type,i.attrs,B.none,!0,t.topMatch||i.type.contentMatch,s):r?o=new Kt(null,null,B.none,!0,null,s):o=new Kt(e.schema.topNodeType,null,B.none,!0,null,s),this.nodes=[o],this.find=t.findPositions,this.needsBlock=!1}get top(){return this.nodes[this.open]}addDOM(e,t){e.nodeType==3?this.addTextNode(e,t):e.nodeType==1&&this.addElement(e,t)}addTextNode(e,t){let r=e.nodeValue,i=this.top,o=i.options&_i?"full":this.localPreserveWS||(i.options&mn)>0;if(o==="full"||i.inlineContext(e)||/[^ \t\r\n\u000c]/.test(r)){if(o)o!=="full"?r=r.replace(/\r?\n|\r/g," "):r=r.replace(/\r\n?/g,` +`);else if(r=r.replace(/[ \t\r\n\u000c]+/g," "),/^[ \t\r\n\u000c]/.test(r)&&this.open==this.nodes.length-1){let s=i.content[i.content.length-1],l=e.previousSibling;(!s||l&&l.nodeName=="BR"||s.isText&&/[ \t\r\n\u000c]$/.test(s.text))&&(r=r.slice(1))}r&&this.insertNode(this.parser.schema.text(r),t,!/\S/.test(r)),this.findInText(e)}else this.findInside(e)}addElement(e,t,r){let i=this.localPreserveWS,o=this.top;(e.tagName=="PRE"||/pre/.test(e.style&&e.style.whiteSpace))&&(this.localPreserveWS=!0);let s=e.nodeName.toLowerCase(),l;Ol.hasOwnProperty(s)&&this.parser.normalizeLists&&id(e);let a=this.options.ruleFromNode&&this.options.ruleFromNode(e)||(l=this.parser.matchTag(e,this,r));e:if(a?a.ignore:rd.hasOwnProperty(s))this.findInside(e),this.ignoreFallback(e,t);else if(!a||a.skip||a.closeParent){a&&a.closeParent?this.open=Math.max(0,this.open-1):a&&a.skip.nodeType&&(e=a.skip);let c,u=this.needsBlock;if(Al.hasOwnProperty(s))o.content.length&&o.content[0].isInline&&this.open&&(this.open--,o=this.top),c=!0,o.type||(this.needsBlock=!0);else if(!e.firstChild){this.leafFallback(e,t);break e}let f=a&&a.skip?t:this.readStyles(e,t);f&&this.addAll(e,f),c&&this.sync(o),this.needsBlock=u}else{let c=this.readStyles(e,t);c&&this.addElementByRule(e,a,c,a.consuming===!1?l:void 0)}this.localPreserveWS=i}leafFallback(e,t){e.nodeName=="BR"&&this.top.type&&this.top.type.inlineContent&&this.addTextNode(e.ownerDocument.createTextNode(` +`),t)}ignoreFallback(e,t){e.nodeName=="BR"&&(!this.top.type||!this.top.type.inlineContent)&&this.findPlace(this.parser.schema.text("-"),t,!0)}readStyles(e,t){let r=e.style;if(r&&r.length)for(let i=0;i!a.clearMark(c)):t=t.concat(this.parser.schema.marks[a.mark].create(a.attrs)),a.consuming===!1)l=a;else break}}return t}addElementByRule(e,t,r,i){let o,s;if(t.node)if(s=this.parser.schema.nodes[t.node],s.isLeaf)this.insertNode(s.create(t.attrs),r,e.nodeName=="BR")||this.leafFallback(e,r);else{let a=this.enter(s,t.attrs||null,r,t.preserveWhitespace);a&&(o=!0,r=a)}else{let a=this.parser.schema.marks[t.mark];r=r.concat(a.create(t.attrs))}let l=this.top;if(s&&s.isLeaf)this.findInside(e);else if(i)this.addElement(e,r,i);else if(t.getContent)this.findInside(e),t.getContent(e,this.parser.schema).forEach(a=>this.insertNode(a,r,!1));else{let a=e;typeof t.contentElement=="string"?a=e.querySelector(t.contentElement):typeof t.contentElement=="function"?a=t.contentElement(e):t.contentElement&&(a=t.contentElement),this.findAround(e,a,!0),this.addAll(a,r),this.findAround(e,a,!1)}o&&this.sync(l)&&this.open--}addAll(e,t,r,i){let o=r||0;for(let s=r?e.childNodes[r]:e.firstChild,l=i==null?null:e.childNodes[i];s!=l;s=s.nextSibling,++o)this.findAtPoint(e,o),this.addDOM(s,t);this.findAtPoint(e,o)}findPlace(e,t,r){let i,o;for(let s=this.open,l=0;s>=0;s--){let a=this.nodes[s],c=a.findWrapping(e);if(c&&(!i||i.length>c.length+l)&&(i=c,o=a,!c.length))break;if(a.solid){if(r)break;l+=2}}if(!i)return null;this.sync(o);for(let s=0;s(s.type?s.type.allowsMarkType(c.type):fl(c.type,e))?(a=c.addToSet(a),!1):!0),this.nodes.push(new Kt(e,t,a,i,null,l)),this.open++,r}closeExtra(e=!1){let t=this.nodes.length-1;if(t>this.open){for(;t>this.open;t--)this.nodes[t-1].content.push(this.nodes[t].finish(e));this.nodes.length=this.open+1}}finish(){return this.open=0,this.closeExtra(this.isOpen),this.nodes[0].finish(!!(this.isOpen||this.options.topOpen))}sync(e){for(let t=this.open;t>=0;t--){if(this.nodes[t]==e)return this.open=t,!0;this.localPreserveWS&&(this.nodes[t].options|=mn)}return!1}get currentPos(){this.closeExtra();let e=0;for(let t=this.open;t>=0;t--){let r=this.nodes[t].content;for(let i=r.length-1;i>=0;i--)e+=r[i].nodeSize;t&&e++}return e}findAtPoint(e,t){if(this.find)for(let r=0;r-1)return e.split(/\s*\|\s*/).some(this.matchesContext,this);let t=e.split("/"),r=this.options.context,i=!this.isOpen&&(!r||r.parent.type==this.nodes[0].type),o=-(r?r.depth+1:0)+(i?0:1),s=(l,a)=>{for(;l>=0;l--){let c=t[l];if(c==""){if(l==t.length-1||l==0)continue;for(;a>=o;a--)if(s(l-1,a))return!0;return!1}else{let u=a>0||a==0&&i?this.nodes[a].type:r&&a>=o?r.node(a-o).type:null;if(!u||u.name!=c&&!u.isInGroup(c))return!1;a--}}return!0};return s(t.length-1,this.open)}textblockFromContext(){let e=this.options.context;if(e)for(let t=e.depth;t>=0;t--){let r=e.node(t).contentMatchAt(e.indexAfter(t)).defaultType;if(r&&r.isTextblock&&r.defaultAttrs)return r}for(let t in this.parser.schema.nodes){let r=this.parser.schema.nodes[t];if(r.isTextblock&&r.defaultAttrs)return r}}};function id(n){for(let e=n.firstChild,t=null;e;e=e.nextSibling){let r=e.nodeType==1?e.nodeName.toLowerCase():null;r&&Ol.hasOwnProperty(r)&&t?(t.appendChild(e),e=t):r=="li"?t=e:r&&(t=null)}}function od(n,e){return(n.matches||n.msMatchesSelector||n.webkitMatchesSelector||n.mozMatchesSelector).call(n,e)}function ul(n){let e={};for(let t in n)e[t]=n[t];return e}function fl(n,e){let t=e.schema.nodes;for(let r in t){let i=t[r];if(!i.allowsMarkType(n))continue;let o=[],s=l=>{o.push(l);for(let a=0;a{if(o.length||s.marks.length){let l=0,a=0;for(;l=0;i--){let o=this.serializeMark(e.marks[i],e.isInline,t);o&&((o.contentDOM||o.dom).appendChild(r),r=o.dom)}return r}serializeMark(e,t,r={}){let i=this.marks[e.type.name];return i&&Zn(Hi(r),i(e,t),null,e.attrs)}static renderSpec(e,t,r=null,i){return Zn(e,t,r,i)}static fromSchema(e){return e.cached.domSerializer||(e.cached.domSerializer=new n(this.nodesFromSchema(e),this.marksFromSchema(e)))}static nodesFromSchema(e){let t=dl(e.nodes);return t.text||(t.text=r=>r.text),t}static marksFromSchema(e){return dl(e.marks)}};function dl(n){let e={};for(let t in n){let r=n[t].spec.toDOM;r&&(e[t]=r)}return e}function Hi(n){return n.document||window.document}var hl=new WeakMap;function sd(n){let e=hl.get(n);return e===void 0&&hl.set(n,e=ld(n)),e}function ld(n){let e=null;function t(r){if(r&&typeof r=="object")if(Array.isArray(r))if(typeof r[0]=="string")e||(e=[]),e.push(r);else for(let i=0;i-1)throw new RangeError("Using an array from an attribute object as a DOM spec. This may be an attempted cross site scripting attack.");let s=i.indexOf(" ");s>0&&(t=i.slice(0,s),i=i.slice(s+1));let l,a=t?n.createElementNS(t,i):n.createElement(i),c=e[1],u=1;if(c&&typeof c=="object"&&c.nodeType==null&&!Array.isArray(c)){u=2;for(let f in c)if(c[f]!=null){let d=f.indexOf(" ");d>0?a.setAttributeNS(f.slice(0,d),f.slice(d+1),c[f]):a.setAttribute(f,c[f])}}for(let f=u;fu)throw new RangeError("Content hole must be the only child of its parent node");return{dom:a,contentDOM:a}}else{let{dom:h,contentDOM:p}=Zn(n,d,t,r);if(a.appendChild(h),p){if(l)throw new RangeError("Multiple content holes");l=p}}}return{dom:a,contentDOM:l}}var Rl=65535,Pl=Math.pow(2,16);function ad(n,e){return n+e*Pl}function Nl(n){return n&Rl}function cd(n){return(n-(n&Rl))/Pl}var Il=1,Ll=2,or=4,Bl=8,bn=class{constructor(e,t,r){this.pos=e,this.delInfo=t,this.recover=r}get deleted(){return(this.delInfo&Bl)>0}get deletedBefore(){return(this.delInfo&(Il|or))>0}get deletedAfter(){return(this.delInfo&(Ll|or))>0}get deletedAcross(){return(this.delInfo&or)>0}},Je=class n{constructor(e,t=!1){if(this.ranges=e,this.inverted=t,!e.length&&n.empty)return n.empty}recover(e){let t=0,r=Nl(e);if(!this.inverted)for(let i=0;ie)break;let c=this.ranges[l+o],u=this.ranges[l+s],f=a+c;if(e<=f){let d=c?e==a?-1:e==f?1:t:t,h=a+i+(d<0?0:u);if(r)return h;let p=e==(t<0?a:f)?null:ad(l/3,e-a),m=e==a?Ll:e==f?Il:or;return(t<0?e!=a:e!=f)&&(m|=Bl),new bn(h,m,p)}i+=u-c}return r?e+i:new bn(e+i,0,null)}touches(e,t){let r=0,i=Nl(t),o=this.inverted?2:1,s=this.inverted?1:2;for(let l=0;le)break;let c=this.ranges[l+o],u=a+c;if(e<=u&&l==i*3)return!0;r+=this.ranges[l+s]-c}return!1}forEach(e){let t=this.inverted?2:1,r=this.inverted?1:2;for(let i=0,o=0;i=0;t--){let i=e.getMirror(t);this.appendMap(e._maps[t].invert(),i!=null&&i>t?r-i-1:void 0)}}invert(){let e=new n;return e.appendMappingInverted(this),e}map(e,t=1){if(this.mirror)return this._map(e,t,!0);for(let r=this.from;ro&&a!s.isAtom||!l.type.allowsMarkType(this.mark.type)?s:s.mark(this.mark.addToSet(s.marks)),i),t.openStart,t.openEnd);return Z.fromReplace(e,this.from,this.to,o)}invert(){return new qe(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new n(t.pos,r.pos,this.mark)}merge(e){return e instanceof n&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new n(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"addMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for AddMarkStep.fromJSON");return new n(t.from,t.to,e.markFromJSON(t.mark))}};Y.jsonID("addMark",kn);var qe=class n extends Y{constructor(e,t,r){super(),this.from=e,this.to=t,this.mark=r}apply(e){let t=e.slice(this.from,this.to),r=new w(Xi(t.content,i=>i.mark(this.mark.removeFromSet(i.marks)),e),t.openStart,t.openEnd);return Z.fromReplace(e,this.from,this.to,r)}invert(){return new kn(this.from,this.to,this.mark)}map(e){let t=e.mapResult(this.from,1),r=e.mapResult(this.to,-1);return t.deleted&&r.deleted||t.pos>=r.pos?null:new n(t.pos,r.pos,this.mark)}merge(e){return e instanceof n&&e.mark.eq(this.mark)&&this.from<=e.to&&this.to>=e.from?new n(Math.min(this.from,e.from),Math.max(this.to,e.to),this.mark):null}toJSON(){return{stepType:"removeMark",mark:this.mark.toJSON(),from:this.from,to:this.to}}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number")throw new RangeError("Invalid input for RemoveMarkStep.fromJSON");return new n(t.from,t.to,e.markFromJSON(t.mark))}};Y.jsonID("removeMark",qe);var Sn=class n extends Y{constructor(e,t){super(),this.pos=e,this.mark=t}apply(e){let t=e.nodeAt(this.pos);if(!t)return Z.fail("No node at mark step's position");let r=t.type.create(t.attrs,null,this.mark.addToSet(t.marks));return Z.fromReplace(e,this.pos,this.pos+1,new w(x.from(r),0,t.isLeaf?0:1))}invert(e){let t=e.nodeAt(this.pos);if(t){let r=this.mark.addToSet(t.marks);if(r.length==t.marks.length){for(let i=0;ir.pos?null:new n(t.pos,r.pos,i,o,this.slice,this.insert,this.structure)}toJSON(){let e={stepType:"replaceAround",from:this.from,to:this.to,gapFrom:this.gapFrom,gapTo:this.gapTo,insert:this.insert};return this.slice.size&&(e.slice=this.slice.toJSON()),this.structure&&(e.structure=!0),e}static fromJSON(e,t){if(typeof t.from!="number"||typeof t.to!="number"||typeof t.gapFrom!="number"||typeof t.gapTo!="number"||typeof t.insert!="number")throw new RangeError("Invalid input for ReplaceAroundStep.fromJSON");return new n(t.from,t.to,t.gapFrom,t.gapTo,w.fromJSON(e,t.slice),t.insert,!!t.structure)}};Y.jsonID("replaceAround",J);function Gi(n,e,t){let r=n.resolve(e),i=t-e,o=r.depth;for(;i>0&&o>0&&r.indexAfter(o)==r.node(o).childCount;)o--,i--;if(i>0){let s=r.node(o).maybeChild(r.indexAfter(o));for(;i>0;){if(!s||s.isLeaf)return!0;s=s.firstChild,i--}}return!1}function ud(n,e,t,r){let i=[],o=[],s,l;n.doc.nodesBetween(e,t,(a,c,u)=>{if(!a.isInline)return;let f=a.marks;if(!r.isInSet(f)&&u.type.allowsMarkType(r.type)){let d=Math.max(c,e),h=Math.min(c+a.nodeSize,t),p=r.addToSet(f);for(let m=0;mn.step(a)),o.forEach(a=>n.step(a))}function fd(n,e,t,r){let i=[],o=0;n.doc.nodesBetween(e,t,(s,l)=>{if(!s.isInline)return;o++;let a=null;if(r instanceof pn){let c=s.marks,u;for(;u=r.isInSet(c);)(a||(a=[])).push(u),c=u.removeFromSet(c)}else r?r.isInSet(s.marks)&&(a=[r]):a=s.marks;if(a&&a.length){let c=Math.min(l+s.nodeSize,t);for(let u=0;un.step(new qe(s.from,s.to,s.style)))}function Qi(n,e,t,r=t.contentMatch,i=!0){let o=n.doc.nodeAt(e),s=[],l=e+1;for(let a=0;a=0;a--)n.step(s[a])}function dd(n,e,t){return(e==0||n.canReplace(e,n.childCount))&&(t==n.childCount||n.canReplace(0,t))}function Ge(n){let t=n.parent.content.cutByIndex(n.startIndex,n.endIndex);for(let r=n.depth;;--r){let i=n.$from.node(r),o=n.$from.index(r),s=n.$to.indexAfter(r);if(rt;p--)m||r.index(p)>0?(m=!0,u=x.from(r.node(p).copy(u)),f++):a--;let d=x.empty,h=0;for(let p=o,m=!1;p>t;p--)m||i.after(p+1)=0;s--){if(r.size){let l=t[s].type.contentMatch.matchFragment(r);if(!l||!l.validEnd)throw new RangeError("Wrapper type given to Transform.wrap does not form valid content of its parent wrapper")}r=x.from(t[s].type.create(t[s].attrs,r))}let i=e.start,o=e.end;n.step(new J(i,o,i,o,new w(r,0,0),t.length,!0))}function yd(n,e,t,r,i){if(!r.isTextblock)throw new RangeError("Type given to setBlockType should be a textblock");let o=n.steps.length;n.doc.nodesBetween(e,t,(s,l)=>{let a=typeof i=="function"?i(s):i;if(s.isTextblock&&!s.hasMarkup(r,a)&&bd(n.doc,n.mapping.slice(o).map(l),r)){let c=null;if(r.schema.linebreakReplacement){let h=r.whitespace=="pre",p=!!r.contentMatch.matchType(r.schema.linebreakReplacement);h&&!p?c=!1:!h&&p&&(c=!0)}c===!1&&zl(n,s,l,o),Qi(n,n.mapping.slice(o).map(l,1),r,void 0,c===null);let u=n.mapping.slice(o),f=u.map(l,1),d=u.map(l+s.nodeSize,1);return n.step(new J(f,d,f+1,d-1,new w(x.from(r.create(a,null,s.marks)),0,0),1,!0)),c===!0&&Fl(n,s,l,o),!1}})}function Fl(n,e,t,r){e.forEach((i,o)=>{if(i.isText){let s,l=/\r?\n|\r/g;for(;s=l.exec(i.text);){let a=n.mapping.slice(r).map(t+1+o+s.index);n.replaceWith(a,a+1,e.type.schema.linebreakReplacement.create())}}})}function zl(n,e,t,r){e.forEach((i,o)=>{if(i.type==i.type.schema.linebreakReplacement){let s=n.mapping.slice(r).map(t+1+o);n.replaceWith(s,s+1,e.type.schema.text(` +`))}})}function bd(n,e,t){let r=n.resolve(e),i=r.index();return r.parent.canReplaceWith(i,i+1,t)}function xd(n,e,t,r,i){let o=n.doc.nodeAt(e);if(!o)throw new RangeError("No node at given position");t||(t=o.type);let s=t.create(r,null,i||o.marks);if(o.isLeaf)return n.replaceWith(e,e+o.nodeSize,s);if(!t.validContent(o.content))throw new RangeError("Invalid content for node type "+t.name);n.step(new J(e,e+o.nodeSize,e+1,e+o.nodeSize-1,new w(x.from(s),0,0),1,!0))}function xe(n,e,t=1,r){let i=n.resolve(e),o=i.depth-t,s=r&&r[r.length-1]||i.parent;if(o<0||i.parent.type.spec.isolating||!i.parent.canReplace(i.index(),i.parent.childCount)||!s.type.validContent(i.parent.content.cutByIndex(i.index(),i.parent.childCount)))return!1;for(let c=i.depth-1,u=t-2;c>o;c--,u--){let f=i.node(c),d=i.index(c);if(f.type.spec.isolating)return!1;let h=f.content.cutByIndex(d,f.childCount),p=r&&r[u+1];p&&(h=h.replaceChild(0,p.type.create(p.attrs)));let m=r&&r[u]||f;if(!f.canReplace(d+1,f.childCount)||!m.type.validContent(h))return!1}let l=i.indexAfter(o),a=r&&r[0];return i.node(o).canReplaceWith(l,l,a?a.type:i.node(o+1).type)}function kd(n,e,t=1,r){let i=n.doc.resolve(e),o=x.empty,s=x.empty;for(let l=i.depth,a=i.depth-t,c=t-1;l>a;l--,c--){o=x.from(i.node(l).copy(o));let u=r&&r[c];s=x.from(u?u.type.create(u.attrs,s):i.node(l).copy(s))}n.step(new le(e,e,new w(o.append(s),t,t),!0))}function Se(n,e){let t=n.resolve(e),r=t.index();return Hl(t.nodeBefore,t.nodeAfter)&&t.parent.canReplace(r,r+1)}function Sd(n,e){e.content.size||n.type.compatibleContent(e.type);let t=n.contentMatchAt(n.childCount),{linebreakReplacement:r}=n.type.schema;for(let i=0;i0?(o=r.node(i+1),l++,s=r.node(i).maybeChild(l)):(o=r.node(i).maybeChild(l-1),s=r.node(i+1)),o&&!o.isTextblock&&Hl(o,s)&&r.node(i).canReplace(l,l+1))return e;if(i==0)break;e=t<0?r.before(i):r.after(i)}}function wd(n,e,t){let r=null,{linebreakReplacement:i}=n.doc.type.schema,o=n.doc.resolve(e-t),s=o.node().type;if(i&&s.inlineContent){let u=s.whitespace=="pre",f=!!s.contentMatch.matchType(i);u&&!f?r=!1:!u&&f&&(r=!0)}let l=n.steps.length;if(r===!1){let u=n.doc.resolve(e+t);zl(n,u.node(),u.before(),l)}s.inlineContent&&Qi(n,e+t-1,s,o.node().contentMatchAt(o.index()),r==null);let a=n.mapping.slice(l),c=a.map(e-t);if(n.step(new le(c,a.map(e+t,-1),w.empty,!0)),r===!0){let u=n.doc.resolve(c);Fl(n,u.node(),u.before(),n.steps.length)}return n}function Md(n,e,t){let r=n.resolve(e);if(r.parent.canReplaceWith(r.index(),r.index(),t))return e;if(r.parentOffset==0)for(let i=r.depth-1;i>=0;i--){let o=r.index(i);if(r.node(i).canReplaceWith(o,o,t))return r.before(i+1);if(o>0)return null}if(r.parentOffset==r.parent.content.size)for(let i=r.depth-1;i>=0;i--){let o=r.indexAfter(i);if(r.node(i).canReplaceWith(o,o,t))return r.after(i+1);if(o=0;s--){let l=s==r.depth?0:r.pos<=(r.start(s+1)+r.end(s+1))/2?-1:1,a=r.index(s)+(l>0?1:0),c=r.node(s),u=!1;if(o==1)u=c.canReplace(a,a,i);else{let f=c.contentMatchAt(a).findWrapping(i.firstChild.type);u=f&&c.canReplaceWith(a,a,f[0])}if(u)return l==0?r.pos:l<0?r.before(s+1):r.after(s+1)}return null}function wn(n,e,t=e,r=w.empty){if(e==t&&!r.size)return null;let i=n.resolve(e),o=n.resolve(t);return $l(i,o,r)?new le(e,t,r):new Yi(i,o,r).fit()}function $l(n,e,t){return!t.openStart&&!t.openEnd&&n.start()==e.start()&&n.parent.canReplace(n.index(),e.index(),t.content)}var Yi=class{constructor(e,t,r){this.$from=e,this.$to=t,this.unplaced=r,this.frontier=[],this.placed=x.empty;for(let i=0;i<=e.depth;i++){let o=e.node(i);this.frontier.push({type:o.type,match:o.contentMatchAt(e.indexAfter(i))})}for(let i=e.depth;i>0;i--)this.placed=x.from(e.node(i).copy(this.placed))}get depth(){return this.frontier.length-1}fit(){for(;this.unplaced.size;){let c=this.findFittable();c?this.placeNodes(c):this.openMore()||this.dropNode()}let e=this.mustMoveInline(),t=this.placed.size-this.depth-this.$from.depth,r=this.$from,i=this.close(e<0?this.$to:r.doc.resolve(e));if(!i)return null;let o=this.placed,s=r.depth,l=i.depth;for(;s&&l&&o.childCount==1;)o=o.firstChild.content,s--,l--;let a=new w(o,s,l);return e>-1?new J(r.pos,e,this.$to.pos,this.$to.end(),a,t):a.size||r.pos!=this.$to.pos?new le(r.pos,i.pos,a):null}findFittable(){let e=this.unplaced.openStart;for(let t=this.unplaced.content,r=0,i=this.unplaced.openEnd;r1&&(i=0),o.type.spec.isolating&&i<=r){e=r;break}t=o.content}for(let t=1;t<=2;t++)for(let r=t==1?e:this.unplaced.openStart;r>=0;r--){let i,o=null;r?(o=Ji(this.unplaced.content,r-1).firstChild,i=o.content):i=this.unplaced.content;let s=i.firstChild;for(let l=this.depth;l>=0;l--){let{type:a,match:c}=this.frontier[l],u,f=null;if(t==1&&(s?c.matchType(s.type)||(f=c.fillBefore(x.from(s),!1)):o&&a.compatibleContent(o.type)))return{sliceDepth:r,frontierDepth:l,parent:o,inject:f};if(t==2&&s&&(u=c.findWrapping(s.type)))return{sliceDepth:r,frontierDepth:l,parent:o,wrap:u};if(o&&c.matchType(o.type))break}}}openMore(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Ji(e,t);return!i.childCount||i.firstChild.isLeaf?!1:(this.unplaced=new w(e,t+1,Math.max(r,i.size+t>=e.size-r?t+1:0)),!0)}dropNode(){let{content:e,openStart:t,openEnd:r}=this.unplaced,i=Ji(e,t);if(i.childCount<=1&&t>0){let o=e.size-t<=t+i.size;this.unplaced=new w(gn(e,t-1,1),t-1,o?t-1:r)}else this.unplaced=new w(gn(e,t,1),t,r)}placeNodes({sliceDepth:e,frontierDepth:t,parent:r,inject:i,wrap:o}){for(;this.depth>t;)this.closeFrontierNode();if(o)for(let m=0;m1||a==0||m.content.size)&&(f=g,u.push(Vl(m.mark(d.allowedMarks(m.marks)),c==1?a:0,c==l.childCount?h:-1)))}let p=c==l.childCount;p||(h=-1),this.placed=yn(this.placed,t,x.from(u)),this.frontier[t].match=f,p&&h<0&&r&&r.type==this.frontier[this.depth].type&&this.frontier.length>1&&this.closeFrontierNode();for(let m=0,g=l;m1&&i==this.$to.end(--r);)++i;return i}findCloseLevel(e){e:for(let t=Math.min(this.depth,e.depth);t>=0;t--){let{match:r,type:i}=this.frontier[t],o=t=0;l--){let{match:a,type:c}=this.frontier[l],u=qi(e,l,c,a,!0);if(!u||u.childCount)continue e}return{depth:t,fit:s,move:o?e.doc.resolve(e.after(t+1)):e}}}}close(e){let t=this.findCloseLevel(e);if(!t)return null;for(;this.depth>t.depth;)this.closeFrontierNode();t.fit.childCount&&(this.placed=yn(this.placed,t.depth,t.fit)),e=t.move;for(let r=t.depth+1;r<=e.depth;r++){let i=e.node(r),o=i.type.contentMatch.fillBefore(i.content,!0,e.index(r));this.openFrontierNode(i.type,i.attrs,o)}return e}openFrontierNode(e,t=null,r){let i=this.frontier[this.depth];i.match=i.match.matchType(e),this.placed=yn(this.placed,this.depth,x.from(e.create(t,r))),this.frontier.push({type:e,match:e.contentMatch})}closeFrontierNode(){let t=this.frontier.pop().match.fillBefore(x.empty,!0);t.childCount&&(this.placed=yn(this.placed,this.frontier.length,t))}};function gn(n,e,t){return e==0?n.cutByIndex(t,n.childCount):n.replaceChild(0,n.firstChild.copy(gn(n.firstChild.content,e-1,t)))}function yn(n,e,t){return e==0?n.append(t):n.replaceChild(n.childCount-1,n.lastChild.copy(yn(n.lastChild.content,e-1,t)))}function Ji(n,e){for(let t=0;t1&&(r=r.replaceChild(0,Vl(r.firstChild,e-1,r.childCount==1?t-1:0))),e>0&&(r=n.type.contentMatch.fillBefore(r).append(r),t<=0&&(r=r.append(n.type.contentMatch.matchFragment(r).fillBefore(x.empty,!0)))),n.copy(r)}function qi(n,e,t,r,i){let o=n.node(e),s=i?n.indexAfter(e):n.index(e);if(s==o.childCount&&!t.compatibleContent(o.type))return null;let l=r.fillBefore(o.content,!0,s);return l&&!Cd(t,o.content,s)?l:null}function Cd(n,e,t){for(let r=t;r0;d--,h--){let p=i.node(d).type.spec;if(p.defining||p.definingAsContext||p.isolating)break;s.indexOf(d)>-1?l=d:i.before(d)==h&&s.splice(1,0,-d)}let a=s.indexOf(l),c=[],u=r.openStart;for(let d=r.content,h=0;;h++){let p=d.firstChild;if(c.push(p),h==r.openStart)break;d=p.content}for(let d=u-1;d>=0;d--){let h=c[d],p=vd(h.type);if(p&&!h.sameMarkup(i.node(Math.abs(l)-1)))u=d;else if(p||!h.type.isTextblock)break}for(let d=r.openStart;d>=0;d--){let h=(d+u+1)%(r.openStart+1),p=c[h];if(p)for(let m=0;m=0&&(n.replace(e,t,r),!(n.steps.length>f));d--){let h=s[d];h<0||(e=i.before(h),t=o.after(h))}}function Wl(n,e,t,r,i){if(er){let o=i.contentMatchAt(0),s=o.fillBefore(n).append(n);n=s.append(o.matchFragment(s).fillBefore(x.empty,!0))}return n}function Ed(n,e,t,r){if(!r.isInline&&e==t&&n.doc.resolve(e).parent.content.size){let i=Md(n.doc,e,r.type);i!=null&&(e=t=i)}n.replaceRange(e,t,new w(x.from(r),0,0))}function Ad(n,e,t){let r=n.doc.resolve(e),i=n.doc.resolve(t),o=jl(r,i);for(let s=0;s0&&(a||r.node(l-1).canReplace(r.index(l-1),i.indexAfter(l-1))))return n.delete(r.before(l),i.after(l))}for(let s=1;s<=r.depth&&s<=i.depth;s++)if(e-r.start(s)==r.depth-s&&t>r.end(s)&&i.end(s)-t!=i.depth-s&&r.start(s-1)==i.start(s-1)&&r.node(s-1).canReplace(r.index(s-1),i.index(s-1)))return n.delete(r.before(s),t);n.delete(e,t)}function jl(n,e){let t=[],r=Math.min(n.depth,e.depth);for(let i=r;i>=0;i--){let o=n.start(i);if(oe.pos+(e.depth-i)||n.node(i).type.spec.isolating||e.node(i).type.spec.isolating)break;(o==e.start(i)||i==n.depth&&i==e.depth&&n.parent.inlineContent&&e.parent.inlineContent&&i&&e.start(i-1)==o-1)&&t.push(i)}return t}var sr=class n extends Y{constructor(e,t,r){super(),this.pos=e,this.attr=t,this.value=r}apply(e){let t=e.nodeAt(this.pos);if(!t)return Z.fail("No node at attribute step's position");let r=Object.create(null);for(let o in t.attrs)r[o]=t.attrs[o];r[this.attr]=this.value;let i=t.type.create(r,null,t.marks);return Z.fromReplace(e,this.pos,this.pos+1,new w(x.from(i),0,t.isLeaf?0:1))}getMap(){return Je.empty}invert(e){return new n(this.pos,this.attr,e.nodeAt(this.pos).attrs[this.attr])}map(e){let t=e.mapResult(this.pos,1);return t.deletedAfter?null:new n(t.pos,this.attr,this.value)}toJSON(){return{stepType:"attr",pos:this.pos,attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.pos!="number"||typeof t.attr!="string")throw new RangeError("Invalid input for AttrStep.fromJSON");return new n(t.pos,t.attr,t.value)}};Y.jsonID("attr",sr);var lr=class n extends Y{constructor(e,t){super(),this.attr=e,this.value=t}apply(e){let t=Object.create(null);for(let i in e.attrs)t[i]=e.attrs[i];t[this.attr]=this.value;let r=e.type.create(t,e.content,e.marks);return Z.ok(r)}getMap(){return Je.empty}invert(e){return new n(this.attr,e.attrs[this.attr])}map(e){return this}toJSON(){return{stepType:"docAttr",attr:this.attr,value:this.value}}static fromJSON(e,t){if(typeof t.attr!="string")throw new RangeError("Invalid input for DocAttrStep.fromJSON");return new n(t.attr,t.value)}};Y.jsonID("docAttr",lr);var Jt=class extends Error{};Jt=function n(e){let t=Error.call(this,e);return t.__proto__=n.prototype,t};Jt.prototype=Object.create(Error.prototype);Jt.prototype.constructor=Jt;Jt.prototype.name="TransformError";var qt=class{constructor(e){this.doc=e,this.steps=[],this.docs=[],this.mapping=new xn}get before(){return this.docs.length?this.docs[0]:this.doc}step(e){let t=this.maybeStep(e);if(t.failed)throw new Jt(t.failed);return this}maybeStep(e){let t=e.apply(this.doc);return t.failed||this.addStep(e,t.doc),t}get docChanged(){return this.steps.length>0}addStep(e,t){this.docs.push(this.doc),this.steps.push(e),this.mapping.appendMap(e.getMap()),this.doc=t}replace(e,t=e,r=w.empty){let i=wn(this.doc,e,t,r);return i&&this.step(i),this}replaceWith(e,t,r){return this.replace(e,t,new w(x.from(r),0,0))}delete(e,t){return this.replace(e,t,w.empty)}insert(e,t){return this.replaceWith(e,e,t)}replaceRange(e,t,r){return Td(this,e,t,r),this}replaceRangeWith(e,t,r){return Ed(this,e,t,r),this}deleteRange(e,t){return Ad(this,e,t),this}lift(e,t){return hd(this,e,t),this}join(e,t=1){return wd(this,e,t),this}wrap(e,t){return gd(this,e,t),this}setBlockType(e,t=e,r,i=null){return yd(this,e,t,r,i),this}setNodeMarkup(e,t,r=null,i){return xd(this,e,t,r,i),this}setNodeAttribute(e,t,r){return this.step(new sr(e,t,r)),this}setDocAttribute(e,t){return this.step(new lr(e,t)),this}addNodeMark(e,t){return this.step(new Sn(e,t)),this}removeNodeMark(e,t){let r=this.doc.nodeAt(e);if(!r)throw new RangeError("No node at position "+e);if(t instanceof B)t.isInSet(r.marks)&&this.step(new Ut(e,t));else{let i=r.marks,o,s=[];for(;o=t.isInSet(i);)s.push(new Ut(e,o)),i=o.removeFromSet(i);for(let l=s.length-1;l>=0;l--)this.step(s[l])}return this}split(e,t=1,r){return kd(this,e,t,r),this}addMark(e,t,r){return ud(this,e,t,r),this}removeMark(e,t,r){return fd(this,e,t,r),this}clearIncompatible(e,t,r){return Qi(this,e,t,r),this}};var Zi=Object.create(null),A=class{constructor(e,t,r){this.$anchor=e,this.$head=t,this.ranges=r||[new ur(e.min(t),e.max(t))]}get anchor(){return this.$anchor.pos}get head(){return this.$head.pos}get from(){return this.$from.pos}get to(){return this.$to.pos}get $from(){return this.ranges[0].$from}get $to(){return this.ranges[0].$to}get empty(){let e=this.ranges;for(let t=0;t=0;o--){let s=t<0?Yt(e.node(0),e.node(o),e.before(o+1),e.index(o),t,r):Yt(e.node(0),e.node(o),e.after(o+1),e.index(o)+1,t,r);if(s)return s}return null}static near(e,t=1){return this.findFrom(e,t)||this.findFrom(e,-t)||new fe(e.node(0))}static atStart(e){return Yt(e,e,0,0,1)||new fe(e)}static atEnd(e){return Yt(e,e,e.content.size,e.childCount,-1)||new fe(e)}static fromJSON(e,t){if(!t||!t.type)throw new RangeError("Invalid input for Selection.fromJSON");let r=Zi[t.type];if(!r)throw new RangeError(`No selection type ${t.type} defined`);return r.fromJSON(e,t)}static jsonID(e,t){if(e in Zi)throw new RangeError("Duplicate use of selection JSON ID "+e);return Zi[e]=t,t.prototype.jsonID=e,t}getBookmark(){return O.between(this.$anchor,this.$head).getBookmark()}};A.prototype.visible=!0;var ur=class{constructor(e,t){this.$from=e,this.$to=t}},Kl=!1;function _l(n){!Kl&&!n.parent.inlineContent&&(Kl=!0,console.warn("TextSelection endpoint not pointing into a node with inline content ("+n.parent.type.name+")"))}var O=class n extends A{constructor(e,t=e){_l(e),_l(t),super(e,t)}get $cursor(){return this.$anchor.pos==this.$head.pos?this.$head:null}map(e,t){let r=e.resolve(t.map(this.head));if(!r.parent.inlineContent)return A.near(r);let i=e.resolve(t.map(this.anchor));return new n(i.parent.inlineContent?i:r,r)}replace(e,t=w.empty){if(super.replace(e,t),t==w.empty){let r=this.$from.marksAcross(this.$to);r&&e.ensureMarks(r)}}eq(e){return e instanceof n&&e.anchor==this.anchor&&e.head==this.head}getBookmark(){return new fr(this.anchor,this.head)}toJSON(){return{type:"text",anchor:this.anchor,head:this.head}}static fromJSON(e,t){if(typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid input for TextSelection.fromJSON");return new n(e.resolve(t.anchor),e.resolve(t.head))}static create(e,t,r=t){let i=e.resolve(t);return new this(i,r==t?i:e.resolve(r))}static between(e,t,r){let i=e.pos-t.pos;if((!r||i)&&(r=i>=0?1:-1),!t.parent.inlineContent){let o=A.findFrom(t,r,!0)||A.findFrom(t,-r,!0);if(o)t=o.$head;else return A.near(t,r)}return e.parent.inlineContent||(i==0?e=t:(e=(A.findFrom(e,-r,!0)||A.findFrom(e,r,!0)).$anchor,e.pos0?0:1);i>0?s=0;s+=i){let l=e.child(s);if(l.isAtom){if(!o&&v.isSelectable(l))return v.create(n,t-(i<0?l.nodeSize:0))}else{let a=Yt(n,l,t+i,i<0?l.childCount:0,i,o);if(a)return a}t+=l.nodeSize*i}return null}function Ul(n,e,t){let r=n.steps.length-1;if(r{s==null&&(s=u)}),n.setSelection(A.near(n.doc.resolve(s),t))}var Jl=1,cr=2,ql=4,no=class extends qt{constructor(e){super(e.doc),this.curSelectionFor=0,this.updated=0,this.meta=Object.create(null),this.time=Date.now(),this.curSelection=e.selection,this.storedMarks=e.storedMarks}get selection(){return this.curSelectionFor0}setStoredMarks(e){return this.storedMarks=e,this.updated|=cr,this}ensureMarks(e){return B.sameSet(this.storedMarks||this.selection.$from.marks(),e)||this.setStoredMarks(e),this}addStoredMark(e){return this.ensureMarks(e.addToSet(this.storedMarks||this.selection.$head.marks()))}removeStoredMark(e){return this.ensureMarks(e.removeFromSet(this.storedMarks||this.selection.$head.marks()))}get storedMarksSet(){return(this.updated&cr)>0}addStep(e,t){super.addStep(e,t),this.updated=this.updated&~cr,this.storedMarks=null}setTime(e){return this.time=e,this}replaceSelection(e){return this.selection.replace(this,e),this}replaceSelectionWith(e,t=!0){let r=this.selection;return t&&(e=e.mark(this.storedMarks||(r.empty?r.$from.marks():r.$from.marksAcross(r.$to)||B.none))),r.replaceWith(this,e),this}deleteSelection(){return this.selection.replace(this),this}insertText(e,t,r){let i=this.doc.type.schema;if(t==null)return e?this.replaceSelectionWith(i.text(e),!0):this.deleteSelection();{if(r==null&&(r=t),r=r??t,!e)return this.deleteRange(t,r);let o=this.storedMarks;if(!o){let s=this.doc.resolve(t);o=r==t?s.marks():s.marksAcross(this.doc.resolve(r))}return this.replaceRangeWith(t,r,i.text(e,o)),this.selection.empty||this.setSelection(A.near(this.selection.$to)),this}}setMeta(e,t){return this.meta[typeof e=="string"?e:e.key]=t,this}getMeta(e){return this.meta[typeof e=="string"?e:e.key]}get isGeneric(){for(let e in this.meta)return!1;return!0}scrollIntoView(){return this.updated|=ql,this}get scrolledIntoView(){return(this.updated&ql)>0}};function Gl(n,e){return!e||!n?n:n.bind(e)}var Ct=class{constructor(e,t,r){this.name=e,this.init=Gl(t.init,r),this.apply=Gl(t.apply,r)}},Nd=[new Ct("doc",{init(n){return n.doc||n.schema.topNodeType.createAndFill()},apply(n){return n.doc}}),new Ct("selection",{init(n,e){return n.selection||A.atStart(e.doc)},apply(n){return n.selection}}),new Ct("storedMarks",{init(n){return n.storedMarks||null},apply(n,e,t,r){return r.selection.$cursor?n.storedMarks:null}}),new Ct("scrollToSelection",{init(){return 0},apply(n,e){return n.scrolledIntoView?e+1:e}})],Mn=class{constructor(e,t){this.schema=e,this.plugins=[],this.pluginsByKey=Object.create(null),this.fields=Nd.slice(),t&&t.forEach(r=>{if(this.pluginsByKey[r.key])throw new RangeError("Adding different instances of a keyed plugin ("+r.key+")");this.plugins.push(r),this.pluginsByKey[r.key]=r,r.spec.state&&this.fields.push(new Ct(r.key,r.spec.state,r))})}},dr=class n{constructor(e){this.config=e}get schema(){return this.config.schema}get plugins(){return this.config.plugins}apply(e){return this.applyTransaction(e).state}filterTransaction(e,t=-1){for(let r=0;rr.toJSON())),e&&typeof e=="object")for(let r in e){if(r=="doc"||r=="selection")throw new RangeError("The JSON fields `doc` and `selection` are reserved");let i=e[r],o=i.spec.state;o&&o.toJSON&&(t[r]=o.toJSON.call(i,this[i.key]))}return t}static fromJSON(e,t,r){if(!t)throw new RangeError("Invalid input for EditorState.fromJSON");if(!e.schema)throw new RangeError("Required config field 'schema' missing");let i=new Mn(e.schema,e.plugins),o=new n(i);return i.fields.forEach(s=>{if(s.name=="doc")o.doc=G.fromJSON(e.schema,t.doc);else if(s.name=="selection")o.selection=A.fromJSON(o.doc,t.selection);else if(s.name=="storedMarks")t.storedMarks&&(o.storedMarks=t.storedMarks.map(e.schema.markFromJSON));else{if(r)for(let l in r){let a=r[l],c=a.spec.state;if(a.key==s.name&&c&&c.fromJSON&&Object.prototype.hasOwnProperty.call(t,l)){o[s.name]=c.fromJSON.call(a,e,t[l],o);return}}o[s.name]=s.init(e,o)}}),o}};function Yl(n,e,t){for(let r in n){let i=n[r];i instanceof Function?i=i.bind(e):r=="handleDOMEvents"&&(i=Yl(i,e,{})),t[r]=i}return t}var E=class{constructor(e){this.spec=e,this.props={},e.props&&Yl(e.props,this,this.props),this.key=e.key?e.key.key:Xl("plugin")}getState(e){return e[this.key]}},eo=Object.create(null);function Xl(n){return n in eo?n+"$"+ ++eo[n]:(eo[n]=0,n+"$")}var P=class{constructor(e="key"){this.key=Xl(e)}get(e){return e.config.pluginsByKey[this.key]}getState(e){return e[this.key]}};var ee=function(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e},tn=function(n){let e=n.assignedSlot||n.parentNode;return e&&e.nodeType==11?e.host:e},ao=null,Xe=function(n,e,t){let r=ao||(ao=document.createRange());return r.setEnd(n,t??n.nodeValue.length),r.setStart(n,e||0),r},Dd=function(){ao=null},Dt=function(n,e,t,r){return t&&(Ql(n,e,t,r,-1)||Ql(n,e,t,r,1))},Rd=/^(img|br|input|textarea|hr)$/i;function Ql(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:Me(n))){let o=n.parentNode;if(!o||o.nodeType!=1||Nn(n)||Rd.test(n.nodeName)||n.contentEditable=="false")return!1;e=ee(n)+(i<0?0:1),n=o}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.contentEditable=="false")return!1;e=i<0?Me(n):0}else return!1}}function Me(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Pd(n,e){for(;;){if(n.nodeType==3&&e)return n;if(n.nodeType==1&&e>0){if(n.contentEditable=="false")return null;n=n.childNodes[e-1],e=Me(n)}else if(n.parentNode&&!Nn(n))e=ee(n),n=n.parentNode;else return null}}function Id(n,e){for(;;){if(n.nodeType==3&&e2),we=nn||(Le?/Mac/.test(Le.platform):!1),zd=Le?/Win/.test(Le.platform):!1,Qe=/Android \d/.test(dt),Dn=!!Zl&&"webkitFontSmoothing"in Zl.documentElement.style,Hd=Dn?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0;function $d(n){let e=n.defaultView&&n.defaultView.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.documentElement.clientWidth,top:0,bottom:n.documentElement.clientHeight}}function Ye(n,e){return typeof n=="number"?n:n[e]}function Vd(n){let e=n.getBoundingClientRect(),t=e.width/n.offsetWidth||1,r=e.height/n.offsetHeight||1;return{left:e.left,right:e.left+n.clientWidth*t,top:e.top,bottom:e.top+n.clientHeight*r}}function ea(n,e,t){let r=n.someProp("scrollThreshold")||0,i=n.someProp("scrollMargin")||5,o=n.dom.ownerDocument;for(let s=t||n.dom;s;){if(s.nodeType!=1){s=tn(s);continue}let l=s,a=l==o.body,c=a?$d(o):Vd(l),u=0,f=0;if(e.topc.bottom-Ye(r,"bottom")&&(f=e.bottom-e.top>c.bottom-c.top?e.top+Ye(i,"top")-c.top:e.bottom-c.bottom+Ye(i,"bottom")),e.leftc.right-Ye(r,"right")&&(u=e.right-c.right+Ye(i,"right")),u||f)if(a)o.defaultView.scrollBy(u,f);else{let h=l.scrollLeft,p=l.scrollTop;f&&(l.scrollTop+=f),u&&(l.scrollLeft+=u);let m=l.scrollLeft-h,g=l.scrollTop-p;e={left:e.left-m,top:e.top-g,right:e.right-m,bottom:e.bottom-g}}let d=a?"fixed":getComputedStyle(s).position;if(/^(fixed|sticky)$/.test(d))break;s=d=="absolute"?s.offsetParent:tn(s)}}function Wd(n){let e=n.dom.getBoundingClientRect(),t=Math.max(0,e.top),r,i;for(let o=(e.left+e.right)/2,s=t+1;s=t-20){r=l,i=a.top;break}}return{refDOM:r,refTop:i,stack:Pa(n.dom)}}function Pa(n){let e=[],t=n.ownerDocument;for(let r=n;r&&(e.push({dom:r,top:r.scrollTop,left:r.scrollLeft}),n!=t);r=tn(r));return e}function jd({refDOM:n,refTop:e,stack:t}){let r=n?n.getBoundingClientRect().top:0;Ia(t,r==0?0:r-e)}function Ia(n,e){for(let t=0;t=l){s=Math.max(p.bottom,s),l=Math.min(p.top,l);let m=p.left>e.left?p.left-e.left:p.right=(p.left+p.right)/2?1:0));continue}}else p.top>e.top&&!a&&p.left<=e.left&&p.right>=e.left&&(a=u,c={left:Math.max(p.left,Math.min(p.right,e.left)),top:p.top});!t&&(e.left>=p.right&&e.top>=p.top||e.left>=p.left&&e.top>=p.bottom)&&(o=f+1)}}return!t&&a&&(t=a,i=c,r=0),t&&t.nodeType==3?_d(t,i):!t||r&&t.nodeType==1?{node:n,offset:o}:La(t,i)}function _d(n,e){let t=n.nodeValue.length,r=document.createRange();for(let i=0;i=(o.left+o.right)/2?1:0)}}return{node:n,offset:0}}function Eo(n,e){return n.left>=e.left-1&&n.left<=e.right+1&&n.top>=e.top-1&&n.top<=e.bottom+1}function Ud(n,e){let t=n.parentNode;return t&&/^li$/i.test(t.nodeName)&&e.left(s.left+s.right)/2?1:-1}return n.docView.posFromDOM(r,i,o)}function qd(n,e,t,r){let i=-1;for(let o=e,s=!1;o!=n.dom;){let l=n.docView.nearestDesc(o,!0),a;if(!l)return null;if(l.dom.nodeType==1&&(l.node.isBlock&&l.parent||!l.contentDOM)&&((a=l.dom.getBoundingClientRect()).width||a.height)&&(l.node.isBlock&&l.parent&&(!s&&a.left>r.left||a.top>r.top?i=l.posBefore:(!s&&a.right-1?i:n.docView.posFromDOM(e,t,-1)}function Ba(n,e,t){let r=n.childNodes.length;if(r&&t.tope.top&&i++}let c;Dn&&i&&r.nodeType==1&&(c=r.childNodes[i-1]).nodeType==1&&c.contentEditable=="false"&&c.getBoundingClientRect().top>=e.top&&i--,r==n.dom&&i==r.childNodes.length-1&&r.lastChild.nodeType==1&&e.top>r.lastChild.getBoundingClientRect().bottom?l=n.state.doc.content.size:(i==0||r.nodeType!=1||r.childNodes[i-1].nodeName!="BR")&&(l=qd(n,r,i,e))}l==null&&(l=Jd(n,s,e));let a=n.docView.nearestDesc(s,!0);return{pos:l,inside:a?a.posAtStart-a.border:-1}}function ta(n){return n.top=0&&i==r.nodeValue.length?(a--,u=1):t<0?a--:c++,Cn(lt(Xe(r,a,c),u),u<0)}if(!n.state.doc.resolve(e-(o||0)).parent.inlineContent){if(o==null&&i&&(t<0||i==Me(r))){let a=r.childNodes[i-1];if(a.nodeType==1)return ro(a.getBoundingClientRect(),!1)}if(o==null&&i=0)}if(o==null&&i&&(t<0||i==Me(r))){let a=r.childNodes[i-1],c=a.nodeType==3?Xe(a,Me(a)-(s?0:1)):a.nodeType==1&&(a.nodeName!="BR"||!a.nextSibling)?a:null;if(c)return Cn(lt(c,1),!1)}if(o==null&&i=0)}function Cn(n,e){if(n.width==0)return n;let t=e?n.left:n.right;return{top:n.top,bottom:n.bottom,left:t,right:t}}function ro(n,e){if(n.height==0)return n;let t=e?n.top:n.bottom;return{top:t,bottom:t,left:n.left,right:n.right}}function za(n,e,t){let r=n.state,i=n.root.activeElement;r!=e&&n.updateState(e),i!=n.dom&&n.focus();try{return t()}finally{r!=e&&n.updateState(r),i!=n.dom&&i&&i.focus()}}function Xd(n,e,t){let r=e.selection,i=t=="up"?r.$from:r.$to;return za(n,e,()=>{let{node:o}=n.docView.domFromPos(i.pos,t=="up"?-1:1);for(;;){let l=n.docView.nearestDesc(o,!0);if(!l)break;if(l.node.isBlock){o=l.contentDOM||l.dom;break}o=l.dom.parentNode}let s=Fa(n,i.pos,1);for(let l=o.firstChild;l;l=l.nextSibling){let a;if(l.nodeType==1)a=l.getClientRects();else if(l.nodeType==3)a=Xe(l,0,l.nodeValue.length).getClientRects();else continue;for(let c=0;cu.top+1&&(t=="up"?s.top-u.top>(u.bottom-s.top)*2:u.bottom-s.bottom>(s.bottom-u.top)*2))return!1}}return!0})}var Qd=/[\u0590-\u08ac]/;function Zd(n,e,t){let{$head:r}=e.selection;if(!r.parent.isTextblock)return!1;let i=r.parentOffset,o=!i,s=i==r.parent.content.size,l=n.domSelection();return l?!Qd.test(r.parent.textContent)||!l.modify?t=="left"||t=="backward"?o:s:za(n,e,()=>{let{focusNode:a,focusOffset:c,anchorNode:u,anchorOffset:f}=n.domSelectionRange(),d=l.caretBidiLevel;l.modify("move",t,"character");let h=r.depth?n.docView.domAfterPos(r.before()):n.dom,{focusNode:p,focusOffset:m}=n.domSelectionRange(),g=p&&!h.contains(p.nodeType==1?p:p.parentNode)||a==p&&c==m;try{l.collapse(u,f),a&&(a!=u||c!=f)&&l.extend&&l.extend(a,c)}catch{}return d!=null&&(l.caretBidiLevel=d),g}):r.pos==r.start()||r.pos==r.end()}var na=null,ra=null,ia=!1;function eh(n,e,t){return na==e&&ra==t?ia:(na=e,ra=t,ia=t=="up"||t=="down"?Xd(n,e,t):Zd(n,e,t))}var Ce=0,oa=1,Tt=2,Be=3,Rt=class{constructor(e,t,r,i){this.parent=e,this.children=t,this.dom=r,this.contentDOM=i,this.dirty=Ce,r.pmViewDesc=this}matchesWidget(e){return!1}matchesMark(e){return!1}matchesNode(e,t,r){return!1}matchesHack(e){return!1}parseRule(){return null}stopEvent(e){return!1}get size(){let e=0;for(let t=0;tee(this.contentDOM);else if(this.contentDOM&&this.contentDOM!=this.dom&&this.dom.contains(this.contentDOM))i=e.compareDocumentPosition(this.contentDOM)&2;else if(this.dom.firstChild){if(t==0)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!1;break}if(o.previousSibling)break}if(i==null&&t==e.childNodes.length)for(let o=e;;o=o.parentNode){if(o==this.dom){i=!0;break}if(o.nextSibling)break}}return i??r>0?this.posAtEnd:this.posAtStart}nearestDesc(e,t=!1){for(let r=!0,i=e;i;i=i.parentNode){let o=this.getDesc(i),s;if(o&&(!t||o.node))if(r&&(s=o.nodeDOM)&&!(s.nodeType==1?s.contains(e.nodeType==1?e:e.parentNode):s==e))r=!1;else return o}}getDesc(e){let t=e.pmViewDesc;for(let r=t;r;r=r.parent)if(r==this)return t}posFromDOM(e,t,r){for(let i=e;i;i=i.parentNode){let o=this.getDesc(i);if(o)return o.localPosFromDOM(e,t,r)}return-1}descAt(e){for(let t=0,r=0;te||s instanceof mr){i=e-o;break}o=l}if(i)return this.children[r].domFromPos(i-this.children[r].border,t);for(let o;r&&!(o=this.children[r-1]).size&&o instanceof hr&&o.side>=0;r--);if(t<=0){let o,s=!0;for(;o=r?this.children[r-1]:null,!(!o||o.dom.parentNode==this.contentDOM);r--,s=!1);return o&&t&&s&&!o.border&&!o.domAtom?o.domFromPos(o.size,t):{node:this.contentDOM,offset:o?ee(o.dom)+1:0}}else{let o,s=!0;for(;o=r=u&&t<=c-a.border&&a.node&&a.contentDOM&&this.contentDOM.contains(a.contentDOM))return a.parseRange(e,t,u);e=s;for(let f=l;f>0;f--){let d=this.children[f-1];if(d.size&&d.dom.parentNode==this.contentDOM&&!d.emptyChildAt(1)){i=ee(d.dom)+1;break}e-=d.size}i==-1&&(i=0)}if(i>-1&&(c>t||l==this.children.length-1)){t=c;for(let u=l+1;up&&st){let p=l;l=a,a=p}let h=document.createRange();h.setEnd(a.node,a.offset),h.setStart(l.node,l.offset),c.removeAllRanges(),c.addRange(h)}}ignoreMutation(e){return!this.contentDOM&&e.type!="selection"}get contentLost(){return this.contentDOM&&this.contentDOM!=this.dom&&!this.dom.contains(this.contentDOM)}markDirty(e,t){for(let r=0,i=0;i=r:er){let l=r+o.border,a=s-o.border;if(e>=l&&t<=a){this.dirty=e==r||t==s?Tt:oa,e==l&&t==a&&(o.contentLost||o.dom.parentNode!=this.contentDOM)?o.dirty=Be:o.markDirty(e-l,t-l);return}else o.dirty=o.dom==o.contentDOM&&o.dom.parentNode==this.contentDOM&&!o.children.length?Tt:Be}r=s}this.dirty=Tt}markParentsDirty(){let e=1;for(let t=this.parent;t;t=t.parent,e++){let r=e==1?Tt:oa;t.dirty{if(!o)return i;if(o.parent)return o.parent.posBeforeChild(o)})),!t.type.spec.raw){if(s.nodeType!=1){let l=document.createElement("span");l.appendChild(s),s=l}s.contentEditable="false",s.classList.add("ProseMirror-widget")}super(e,[],s,null),this.widget=t,this.widget=t,o=this}matchesWidget(e){return this.dirty==Ce&&e.type.eq(this.widget.type)}parseRule(){return{ignore:!0}}stopEvent(e){let t=this.widget.spec.stopEvent;return t?t(e):!1}ignoreMutation(e){return e.type!="selection"||this.widget.spec.ignoreSelection}destroy(){this.widget.type.destroy(this.dom),super.destroy()}get domAtom(){return!0}get side(){return this.widget.type.side}},ho=class extends Rt{constructor(e,t,r,i){super(e,[],t,null),this.textDOM=r,this.text=i}get size(){return this.text.length}localPosFromDOM(e,t){return e!=this.textDOM?this.posAtStart+(t?this.size:0):this.posAtStart+t}domFromPos(e){return{node:this.textDOM,offset:e}}ignoreMutation(e){return e.type==="characterData"&&e.target.nodeValue==e.oldValue}},rn=class n extends Rt{constructor(e,t,r,i,o){super(e,[],r,i),this.mark=t,this.spec=o}static create(e,t,r,i){let o=i.nodeViews[t.type.name],s=o&&o(t,i,r);return(!s||!s.dom)&&(s=Ue.renderSpec(document,t.type.spec.toDOM(t,r),null,t.attrs)),new n(e,t,s.dom,s.contentDOM||s.dom,s)}parseRule(){return this.dirty&Be||this.mark.type.spec.reparseInView?null:{mark:this.mark.type.name,attrs:this.mark.attrs,contentElement:this.contentDOM}}matchesMark(e){return this.dirty!=Be&&this.mark.eq(e)}markDirty(e,t){if(super.markDirty(e,t),this.dirty!=Ce){let r=this.parent;for(;!r.node;)r=r.parent;r.dirty0&&(o=yo(o,0,e,r));for(let l=0;l{if(!a)return s;if(a.parent)return a.parent.posBeforeChild(a)},r,i),u=c&&c.dom,f=c&&c.contentDOM;if(t.isText){if(!u)u=document.createTextNode(t.text);else if(u.nodeType!=3)throw new RangeError("Text must be rendered as a DOM text node")}else u||({dom:u,contentDOM:f}=Ue.renderSpec(document,t.type.spec.toDOM(t),null,t.attrs));!f&&!t.isText&&u.nodeName!="BR"&&(u.hasAttribute("contenteditable")||(u.contentEditable="false"),t.type.spec.draggable&&(u.draggable=!0));let d=u;return u=Va(u,r,t),c?a=new po(e,t,r,i,u,f||null,d,c,o,s+1):t.isText?new pr(e,t,r,i,u,d,o):new n(e,t,r,i,u,f||null,d,o,s+1)}parseRule(){if(this.node.type.spec.reparseInView)return null;let e={node:this.node.type.name,attrs:this.node.attrs};if(this.node.type.whitespace=="pre"&&(e.preserveWhitespace="full"),!this.contentDOM)e.getContent=()=>this.node.content;else if(!this.contentLost)e.contentElement=this.contentDOM;else{for(let t=this.children.length-1;t>=0;t--){let r=this.children[t];if(this.dom.contains(r.dom.parentNode)){e.contentElement=r.dom.parentNode;break}}e.contentElement||(e.getContent=()=>x.empty)}return e}matchesNode(e,t,r){return this.dirty==Ce&&e.eq(this.node)&&gr(t,this.outerDeco)&&r.eq(this.innerDeco)}get size(){return this.node.nodeSize}get border(){return this.node.isLeaf?0:1}updateChildren(e,t){let r=this.node.inlineContent,i=t,o=e.composing?this.localCompositionInfo(e,t):null,s=o&&o.pos>-1?o:null,l=o&&o.pos<0,a=new go(this,s&&s.node,e);ih(this.node,this.innerDeco,(c,u,f)=>{c.spec.marks?a.syncToMarks(c.spec.marks,r,e):c.type.side>=0&&!f&&a.syncToMarks(u==this.node.childCount?B.none:this.node.child(u).marks,r,e),a.placeWidget(c,e,i)},(c,u,f,d)=>{a.syncToMarks(c.marks,r,e);let h;a.findNodeMatch(c,u,f,d)||l&&e.state.selection.from>i&&e.state.selection.to-1&&a.updateNodeAt(c,u,f,h,e)||a.updateNextNode(c,u,f,e,d,i)||a.addNode(c,u,f,e,i),i+=c.nodeSize}),a.syncToMarks([],r,e),this.node.isTextblock&&a.addTextblockHacks(),a.destroyRest(),(a.changed||this.dirty==Tt)&&(s&&this.protectLocalComposition(e,s),Ha(this.contentDOM,this.children,e),nn&&oh(this.dom))}localCompositionInfo(e,t){let{from:r,to:i}=e.state.selection;if(!(e.state.selection instanceof O)||rt+this.node.content.size)return null;let o=e.input.compositionNode;if(!o||!this.dom.contains(o.parentNode))return null;if(this.node.inlineContent){let s=o.nodeValue,l=sh(this.node.content,s,r-t,i-t);return l<0?null:{node:o,pos:l,text:s}}else return{node:o,pos:-1,text:""}}protectLocalComposition(e,{node:t,pos:r,text:i}){if(this.getDesc(t))return;let o=t;for(;o.parentNode!=this.contentDOM;o=o.parentNode){for(;o.previousSibling;)o.parentNode.removeChild(o.previousSibling);for(;o.nextSibling;)o.parentNode.removeChild(o.nextSibling);o.pmViewDesc&&(o.pmViewDesc=void 0)}let s=new ho(this,o,t,i);e.input.compositionNodes.push(s),this.children=yo(this.children,r,r+i.length,e,s)}update(e,t,r,i){return this.dirty==Be||!e.sameMarkup(this.node)?!1:(this.updateInner(e,t,r,i),!0)}updateInner(e,t,r,i){this.updateOuterDeco(t),this.node=e,this.innerDeco=r,this.contentDOM&&this.updateChildren(i,this.posAtStart),this.dirty=Ce}updateOuterDeco(e){if(gr(e,this.outerDeco))return;let t=this.nodeDOM.nodeType!=1,r=this.dom;this.dom=$a(this.dom,this.nodeDOM,mo(this.outerDeco,this.node,t),mo(e,this.node,t)),this.dom!=r&&(r.pmViewDesc=void 0,this.dom.pmViewDesc=this),this.outerDeco=e}selectNode(){this.nodeDOM.nodeType==1&&this.nodeDOM.classList.add("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&(this.dom.draggable=!0)}deselectNode(){this.nodeDOM.nodeType==1&&(this.nodeDOM.classList.remove("ProseMirror-selectednode"),(this.contentDOM||!this.node.type.spec.draggable)&&this.dom.removeAttribute("draggable"))}get domAtom(){return this.node.isAtom}};function sa(n,e,t,r,i){Va(r,e,n);let o=new ft(void 0,n,e,t,r,r,r,i,0);return o.contentDOM&&o.updateChildren(i,0),o}var pr=class n extends ft{constructor(e,t,r,i,o,s,l){super(e,t,r,i,o,null,s,l,0)}parseRule(){let e=this.nodeDOM.parentNode;for(;e&&e!=this.dom&&!e.pmIsDeco;)e=e.parentNode;return{skip:e||!0}}update(e,t,r,i){return this.dirty==Be||this.dirty!=Ce&&!this.inParent()||!e.sameMarkup(this.node)?!1:(this.updateOuterDeco(t),(this.dirty!=Ce||e.text!=this.node.text)&&e.text!=this.nodeDOM.nodeValue&&(this.nodeDOM.nodeValue=e.text,i.trackWrites==this.nodeDOM&&(i.trackWrites=null)),this.node=e,this.dirty=Ce,!0)}inParent(){let e=this.parent.contentDOM;for(let t=this.nodeDOM;t;t=t.parentNode)if(t==e)return!0;return!1}domFromPos(e){return{node:this.nodeDOM,offset:e}}localPosFromDOM(e,t,r){return e==this.nodeDOM?this.posAtStart+Math.min(t,this.node.text.length):super.localPosFromDOM(e,t,r)}ignoreMutation(e){return e.type!="characterData"&&e.type!="selection"}slice(e,t,r){let i=this.node.cut(e,t),o=document.createTextNode(i.text);return new n(this.parent,i,this.outerDeco,this.innerDeco,o,o,r)}markDirty(e,t){super.markDirty(e,t),this.dom!=this.nodeDOM&&(e==0||t==this.nodeDOM.nodeValue.length)&&(this.dirty=Be)}get domAtom(){return!1}isText(e){return this.node.text==e}},mr=class extends Rt{parseRule(){return{ignore:!0}}matchesHack(e){return this.dirty==Ce&&this.dom.nodeName==e}get domAtom(){return!0}get ignoreForCoords(){return this.dom.nodeName=="IMG"}},po=class extends ft{constructor(e,t,r,i,o,s,l,a,c,u){super(e,t,r,i,o,s,l,c,u),this.spec=a}update(e,t,r,i){if(this.dirty==Be)return!1;if(this.spec.update&&(this.node.type==e.type||this.spec.multiType)){let o=this.spec.update(e,t,r);return o&&this.updateInner(e,t,r,i),o}else return!this.contentDOM&&!e.isLeaf?!1:super.update(e,t,r,i)}selectNode(){this.spec.selectNode?this.spec.selectNode():super.selectNode()}deselectNode(){this.spec.deselectNode?this.spec.deselectNode():super.deselectNode()}setSelection(e,t,r,i){this.spec.setSelection?this.spec.setSelection(e,t,r.root):super.setSelection(e,t,r,i)}destroy(){this.spec.destroy&&this.spec.destroy(),super.destroy()}stopEvent(e){return this.spec.stopEvent?this.spec.stopEvent(e):!1}ignoreMutation(e){return this.spec.ignoreMutation?this.spec.ignoreMutation(e):super.ignoreMutation(e)}};function Ha(n,e,t){let r=n.firstChild,i=!1;for(let o=0;o>1,s=Math.min(o,e.length);for(;i-1)l>this.index&&(this.changed=!0,this.destroyBetween(this.index,l)),this.top=this.top.children[this.index];else{let a=rn.create(this.top,e[o],t,r);this.top.children.splice(this.index,0,a),this.top=a,this.changed=!0}this.index=0,o++}}findNodeMatch(e,t,r,i){let o=-1,s;if(i>=this.preMatch.index&&(s=this.preMatch.matches[i-this.preMatch.index]).parent==this.top&&s.matchesNode(e,t,r))o=this.top.children.indexOf(s,this.index);else for(let l=this.index,a=Math.min(this.top.children.length,l+5);l0;){let l;for(;;)if(r){let c=t.children[r-1];if(c instanceof rn)t=c,r=c.children.length;else{l=c,r--;break}}else{if(t==e)break e;r=t.parent.children.indexOf(t),t=t.parent}let a=l.node;if(a){if(a!=n.child(i-1))break;--i,o.set(l,i),s.push(l)}}return{index:i,matched:o,matches:s.reverse()}}function rh(n,e){return n.type.side-e.type.side}function ih(n,e,t,r){let i=e.locals(n),o=0;if(i.length==0){for(let c=0;co;)l.push(i[s++]);let p=o+d.nodeSize;if(d.isText){let g=p;s!g.inline):l.slice();r(d,m,e.forChild(o,d),h),o=p}}function oh(n){if(n.nodeName=="UL"||n.nodeName=="OL"){let e=n.style.cssText;n.style.cssText=e+"; list-style: square !important",window.getComputedStyle(n).listStyle,n.style.cssText=e}}function sh(n,e,t,r){for(let i=0,o=0;i=t){if(o>=r&&a.slice(r-e.length-l,r-l)==e)return r-e.length;let c=l=0&&c+e.length+l>=t)return l+c;if(t==r&&a.length>=r+e.length-l&&a.slice(r-l,r-l+e.length)==e)return r}}return-1}function yo(n,e,t,r,i){let o=[];for(let s=0,l=0;s=t||u<=e?o.push(a):(ct&&o.push(a.slice(t-c,a.size,r)))}return o}function Ao(n,e=null){let t=n.domSelectionRange(),r=n.state.doc;if(!t.focusNode)return null;let i=n.docView.nearestDesc(t.focusNode),o=i&&i.size==0,s=n.docView.posFromDOM(t.focusNode,t.focusOffset,1);if(s<0)return null;let l=r.resolve(s),a,c;if(Cr(t)){for(a=s;i&&!i.node;)i=i.parent;let f=i.node;if(i&&f.isAtom&&v.isSelectable(f)&&i.parent&&!(f.isInline&&Ld(t.focusNode,t.focusOffset,i.dom))){let d=i.posBefore;c=new v(s==d?l:r.resolve(d))}}else{if(t instanceof n.dom.ownerDocument.defaultView.Selection&&t.rangeCount>1){let f=s,d=s;for(let h=0;h{(t.anchorNode!=r||t.anchorOffset!=i)&&(e.removeEventListener("selectionchange",n.input.hideSelectionGuard),setTimeout(()=>{(!Wa(n)||n.state.selection.visible)&&n.dom.classList.remove("ProseMirror-hideselection")},20))})}function ah(n){let e=n.domSelection(),t=document.createRange();if(!e)return;let r=n.cursorWrapper.dom,i=r.nodeName=="IMG";i?t.setStart(r.parentNode,ee(r)+1):t.setStart(r,0),t.collapse(!0),e.removeAllRanges(),e.addRange(t),!i&&!n.state.selection.visible&&ge&&ut<=11&&(r.disabled=!0,r.disabled=!1)}function ja(n,e){if(e instanceof v){let t=n.docView.descAt(e.from);t!=n.lastSelectedViewDesc&&(fa(n),t&&t.selectNode(),n.lastSelectedViewDesc=t)}else fa(n)}function fa(n){n.lastSelectedViewDesc&&(n.lastSelectedViewDesc.parent&&n.lastSelectedViewDesc.deselectNode(),n.lastSelectedViewDesc=void 0)}function Oo(n,e,t,r){return n.someProp("createSelectionBetween",i=>i(n,e,t))||O.between(e,t,r)}function da(n){return n.editable&&!n.hasFocus()?!1:Ka(n)}function Ka(n){let e=n.domSelectionRange();if(!e.anchorNode)return!1;try{return n.dom.contains(e.anchorNode.nodeType==3?e.anchorNode.parentNode:e.anchorNode)&&(n.editable||n.dom.contains(e.focusNode.nodeType==3?e.focusNode.parentNode:e.focusNode))}catch{return!1}}function ch(n){let e=n.docView.domFromPos(n.state.selection.anchor,0),t=n.domSelectionRange();return Dt(e.node,e.offset,t.anchorNode,t.anchorOffset)}function bo(n,e){let{$anchor:t,$head:r}=n.selection,i=e>0?t.max(r):t.min(r),o=i.parent.inlineContent?i.depth?n.doc.resolve(e>0?i.after():i.before()):null:i;return o&&A.findFrom(o,e)}function at(n,e){return n.dispatch(n.state.tr.setSelection(e).scrollIntoView()),!0}function ha(n,e,t){let r=n.state.selection;if(r instanceof O)if(t.indexOf("s")>-1){let{$head:i}=r,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter;if(!o||o.isText||!o.isLeaf)return!1;let s=n.state.doc.resolve(i.pos+o.nodeSize*(e<0?-1:1));return at(n,new O(r.$anchor,s))}else if(r.empty){if(n.endOfTextblock(e>0?"forward":"backward")){let i=bo(n.state,e);return i&&i instanceof v?at(n,i):!1}else if(!(we&&t.indexOf("m")>-1)){let i=r.$head,o=i.textOffset?null:e<0?i.nodeBefore:i.nodeAfter,s;if(!o||o.isText)return!1;let l=e<0?i.pos-o.nodeSize:i.pos;return o.isAtom||(s=n.docView.descAt(l))&&!s.contentDOM?v.isSelectable(o)?at(n,new v(e<0?n.state.doc.resolve(i.pos-o.nodeSize):i)):Dn?at(n,new O(n.state.doc.resolve(e<0?l:l+o.nodeSize))):!1:!1}}else return!1;else{if(r instanceof v&&r.node.isInline)return at(n,new O(e>0?r.$to:r.$from));{let i=bo(n.state,e);return i?at(n,i):!1}}}function yr(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Tn(n,e){let t=n.pmViewDesc;return t&&t.size==0&&(e<0||n.nextSibling||n.nodeName!="BR")}function Qt(n,e){return e<0?uh(n):fh(n)}function uh(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i,o,s=!1;for(De&&t.nodeType==1&&r0){if(t.nodeType!=1)break;{let l=t.childNodes[r-1];if(Tn(l,-1))i=t,o=--r;else if(l.nodeType==3)t=l,r=t.nodeValue.length;else break}}else{if(_a(t))break;{let l=t.previousSibling;for(;l&&Tn(l,-1);)i=t.parentNode,o=ee(l),l=l.previousSibling;if(l)t=l,r=yr(t);else{if(t=t.parentNode,t==n.dom)break;r=0}}}s?xo(n,t,r):i&&xo(n,i,o)}function fh(n){let e=n.domSelectionRange(),t=e.focusNode,r=e.focusOffset;if(!t)return;let i=yr(t),o,s;for(;;)if(r{n.state==i&&Ze(n)},50)}function pa(n,e){let t=n.state.doc.resolve(e);if(!(ce||zd)&&t.parent.inlineContent){let i=n.coordsAtPos(e);if(e>t.start()){let o=n.coordsAtPos(e-1),s=(o.top+o.bottom)/2;if(s>i.top&&s1)return o.lefti.top&&s1)return o.left>i.left?"ltr":"rtl"}}return getComputedStyle(n.dom).direction=="rtl"?"rtl":"ltr"}function ma(n,e,t){let r=n.state.selection;if(r instanceof O&&!r.empty||t.indexOf("s")>-1||we&&t.indexOf("m")>-1)return!1;let{$from:i,$to:o}=r;if(!i.parent.inlineContent||n.endOfTextblock(e<0?"up":"down")){let s=bo(n.state,e);if(s&&s instanceof v)return at(n,s)}if(!i.parent.inlineContent){let s=e<0?i:o,l=r instanceof fe?A.near(s,e):A.findFrom(s,e);return l?at(n,l):!1}return!1}function ga(n,e){if(!(n.state.selection instanceof O))return!0;let{$head:t,$anchor:r,empty:i}=n.state.selection;if(!t.sameParent(r))return!0;if(!i)return!1;if(n.endOfTextblock(e>0?"forward":"backward"))return!0;let o=!t.textOffset&&(e<0?t.nodeBefore:t.nodeAfter);if(o&&!o.isText){let s=n.state.tr;return e<0?s.delete(t.pos-o.nodeSize,t.pos):s.delete(t.pos,t.pos+o.nodeSize),n.dispatch(s),!0}return!1}function ya(n,e,t){n.domObserver.stop(),e.contentEditable=t,n.domObserver.start()}function ph(n){if(!de||n.state.selection.$head.parentOffset>0)return!1;let{focusNode:e,focusOffset:t}=n.domSelectionRange();if(e&&e.nodeType==1&&t==0&&e.firstChild&&e.firstChild.contentEditable=="false"){let r=e.firstChild;ya(n,r,"true"),setTimeout(()=>ya(n,r,"false"),20)}return!1}function mh(n){let e="";return n.ctrlKey&&(e+="c"),n.metaKey&&(e+="m"),n.altKey&&(e+="a"),n.shiftKey&&(e+="s"),e}function gh(n,e){let t=e.keyCode,r=mh(e);if(t==8||we&&t==72&&r=="c")return ga(n,-1)||Qt(n,-1);if(t==46&&!e.shiftKey||we&&t==68&&r=="c")return ga(n,1)||Qt(n,1);if(t==13||t==27)return!0;if(t==37||we&&t==66&&r=="c"){let i=t==37?pa(n,n.state.selection.from)=="ltr"?-1:1:-1;return ha(n,i,r)||Qt(n,i)}else if(t==39||we&&t==70&&r=="c"){let i=t==39?pa(n,n.state.selection.from)=="ltr"?1:-1:1;return ha(n,i,r)||Qt(n,i)}else{if(t==38||we&&t==80&&r=="c")return ma(n,-1,r)||Qt(n,-1);if(t==40||we&&t==78&&r=="c")return ph(n)||ma(n,1,r)||Qt(n,1);if(r==(we?"m":"c")&&(t==66||t==73||t==89||t==90))return!0}return!1}function No(n,e){n.someProp("transformCopied",h=>{e=h(e,n)});let t=[],{content:r,openStart:i,openEnd:o}=e;for(;i>1&&o>1&&r.childCount==1&&r.firstChild.childCount==1;){i--,o--;let h=r.firstChild;t.push(h.type.name,h.attrs!=h.type.defaultAttrs?h.attrs:null),r=h.content}let s=n.someProp("clipboardSerializer")||Ue.fromSchema(n.state.schema),l=Xa(),a=l.createElement("div");a.appendChild(s.serializeFragment(r,{document:l}));let c=a.firstChild,u,f=0;for(;c&&c.nodeType==1&&(u=Ya[c.nodeName.toLowerCase()]);){for(let h=u.length-1;h>=0;h--){let p=l.createElement(u[h]);for(;a.firstChild;)p.appendChild(a.firstChild);a.appendChild(p),f++}c=a.firstChild}c&&c.nodeType==1&&c.setAttribute("data-pm-slice",`${i} ${o}${f?` -${f}`:""} ${JSON.stringify(t)}`);let d=n.someProp("clipboardTextSerializer",h=>h(e,n))||e.content.textBetween(0,e.content.size,` -`);return{dom:a,text:d,slice:e}}function _a(n,e,t,r,i){let o=i.parent.type.spec.code,s,l;if(!t&&!e)return null;let a=e&&(r||o||!t);if(a){if(n.someProp("transformPastedText",d=>{e=d(e,o||r,n)}),o)return e?new w(x.from(n.state.schema.text(e.replace(/\r\n?/g,` -`))),0,0):w.empty;let f=n.someProp("clipboardTextParser",d=>d(e,i,r,n));if(f)l=f;else{let d=i.marks(),{schema:h}=n.state,p=Ue.fromSchema(h);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(p.serializeNode(h.text(m,d)))})}}else n.someProp("transformPastedHTML",f=>{t=f(t,n)}),s=bh(t),Dn&&xh(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let d=s.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;s=d}if(l||(l=(n.someProp("clipboardParser")||n.someProp("domParser")||Ie.fromSchema(n.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||u),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!mh.test(d.parentNode.nodeName)?{ignore:!0}:null}})),u)l=kh(ya(l,+u[1],+u[2]),u[4]);else if(l=w.maxOpen(gh(l.content,i),!0),l.openStart||l.openEnd){let f=0,d=0;for(let h=l.content.firstChild;f{l=f(l,n)}),l}var mh=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function gh(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),o,s=[];if(n.forEach(l=>{if(!s)return;let a=i.findWrapping(l.type),c;if(!a)return s=null;if(c=s.length&&o.length&&Ja(a,o,l,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=qa(s[s.length-1],o.length));let u=Ua(l,a);s.push(u),i=i.matchType(u.type),o=a}}),s)return x.from(s)}return n}function Ua(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,x.from(n));return n}function Ja(n,e,t,r,i){if(i1&&(o=0),i=t&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(x.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,s.copy(l))}function ya(n,e,t){return et})),oo.createHTML(n)):n}function bh(n){let e=/^(\s*]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=Ya().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&Ga[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"").reverse().join("")),t.innerHTML=yh(n),i)for(let o=0;o=0;l-=2){let a=t.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;i=x.from(a.create(r[l+1],i)),o++,s++}return new w(i,o,s)}var he={},pe={},Sh={touchstart:!0,touchmove:!0},So=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function wh(n){for(let e in he){let t=he[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{Ch(n,r)&&!Do(n,r)&&(n.editable||!(r.type in pe))&&t(n,r)},Sh[e]?{passive:!0}:void 0)}de&&n.dom.addEventListener("input",()=>null),wo(n)}function ct(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function Mh(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function wo(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>Do(n,r))})}function Do(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function Ch(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function vh(n,e){!Do(n,e)&&he[e.type]&&(n.editable||!(e.type in pe))&&he[e.type](n,e)}pe.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Qa(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Qe&&ce&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),nn&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,vt(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||ph(n,t)?t.preventDefault():ct(n,"key")};pe.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};pe.keypress=(n,e)=>{let t=e;if(Qa(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||we&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof O)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))&&n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function vr(n){return{left:n.clientX,top:n.clientY}}function Th(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Ro(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(n.someProp(e,l=>s>o.depth?l(n,t,o.nodeAfter,o.before(s),i,!0):l(n,t,o.node(s),o.before(s),i,!1)))return!0;return!1}function en(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);t=="pointer"&&r.setMeta("pointer",!0),n.dispatch(r)}function Eh(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&v.isSelectable(r)?(en(n,new v(t),"pointer"),!0):!1}function Ah(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof v&&(r=t.node);let o=n.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(v.isSelectable(l)){r&&t.$from.depth>0&&s>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(s);break}}return i!=null?(en(n,v.create(n.state.doc,i),"pointer"),!0):!1}function Oh(n,e,t,r,i){return Ro(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?Ah(n,t):Eh(n,t))}function Nh(n,e,t,r){return Ro(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function Dh(n,e,t,r){return Ro(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||Rh(n,t,r)}function Rh(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(en(n,O.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)en(n,O.create(r,l+1,l+1+s.content.size),"pointer");else if(v.isSelectable(s))en(n,v.create(r,l),"pointer");else continue;return!0}}function Po(n){return br(n)}var Xa=we?"metaKey":"ctrlKey";he.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Po(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&Th(t,n.input.lastClick)&&!t[Xa]&&n.input.lastClick.button==t.button&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o,button:t.button};let s=n.posAtCoords(vr(t));s&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new Mo(n,s,t,!!r)):(o=="doubleClick"?Nh:Dh)(n,s.pos,s.inside,t)?t.preventDefault():ct(n,"pointer"))};var Mo=class{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Xa],this.allowDefault=r.shiftKey;let o,s;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),s=t.inside;else{let u=e.state.doc.resolve(t.pos);o=u.parent,s=u.depth?u.before():0}let l=i?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.dom.nodeType==1?a.dom:null;let{selection:c}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof v&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&De&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),ct(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Ze(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(vr(e))),this.updateAllowDefault(e),this.allowDefault||!t?ct(this.view,"pointer"):Oh(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||de&&this.mightDrag&&!this.mightDrag.node.isAtom||ce&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(en(this.view,A.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):ct(this.view,"pointer")}move(e){this.updateAllowDefault(e),ct(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};he.touchstart=n=>{n.input.lastTouch=Date.now(),Po(n),ct(n,"pointer")};he.touchmove=n=>{n.input.lastTouch=Date.now(),ct(n,"pointer")};he.contextmenu=n=>Po(n);function Qa(n,e){return n.composing?!0:de&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}var Ph=Qe?5e3:-1;pe.compositionstart=pe.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof O&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),br(n,!0),n.markCursor=null;else if(br(n,!e.selection.empty),De&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let l=n.domSelection();l&&l.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}n.input.composing=!0}Za(n,Ph)};pe.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,Za(n,20))};function Za(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>br(n),e))}function ec(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Lh());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function Ih(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=Dd(e.focusNode,e.focusOffset),r=Rd(e.focusNode,e.focusOffset);if(t&&r&&t!=r){let i=r.pmViewDesc,o=n.domObserver.lastChangedTextNode;if(t==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(n.input.compositionNode==r){let s=t.pmViewDesc;if(!(!s||!s.isText(t.nodeValue)))return r}}return t||r}function Lh(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function br(n,e=!1){if(!(Qe&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),ec(n),e||n.docView&&n.docView.dirty){let t=Ao(n),r=n.state.selection;return t&&!t.eq(r)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function Bh(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}var En=ge&&ut<15||nn&&Fd<604;he.copy=pe.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=En?null:t.clipboardData,s=r.content(),{dom:l,text:a}=No(n,s);o?(t.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):Bh(n,l),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Fh(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function zh(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?An(n,r.value,null,i,e):An(n,r.textContent,r.innerHTML,i,e)},50)}function An(n,e,t,r,i){let o=_a(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",a=>a(n,i,o||w.empty)))return!0;if(!o)return!1;let s=Fh(o),l=s?n.state.tr.replaceSelectionWith(s,r):n.state.tr.replaceSelection(o);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function tc(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}pe.paste=(n,e)=>{let t=e;if(n.composing&&!Qe)return;let r=En?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&An(n,tc(r),r.getData("text/html"),i,t)?t.preventDefault():zh(n,t)};var xr=class{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}},Hh=we?"altKey":"ctrlKey";function nc(n,e){let t=n.someProp("dragCopies",r=>!r(e));return t??!e[Hh]}he.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,o=i.empty?null:n.posAtCoords(vr(t)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof v?i.to-1:i.to))){if(r&&r.mightDrag)s=v.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let f=n.docView.nearestDesc(t.target,!0);f&&f.node.type.spec.draggable&&f!=n.docView&&(s=v.create(n.state.doc,f.posBefore))}}let l=(s||n.state.selection).content(),{dom:a,text:c,slice:u}=No(n,l);(!t.dataTransfer.files.length||!ce||Da>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(En?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",En||t.dataTransfer.setData("text/plain",c),n.dragging=new xr(u,nc(n,t),s)};he.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};pe.dragover=pe.dragenter=(n,e)=>e.preventDefault();pe.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(vr(t));if(!i)return;let o=n.state.doc.resolve(i.pos),s=r&&r.slice;s?n.someProp("transformPasted",p=>{s=p(s,n)}):s=_a(n,tc(t.dataTransfer),En?null:t.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&nc(n,t));if(n.someProp("handleDrop",p=>p(n,t,s||w.empty,l))){t.preventDefault();return}if(!s)return;t.preventDefault();let a=s?ar(n.state.doc,o.pos,s):o.pos;a==null&&(a=o.pos);let c=n.state.tr;if(l){let{node:p}=r;p?p.replace(c):c.deleteSelection()}let u=c.mapping.map(a),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=c.doc;if(f?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(d))return;let h=c.doc.resolve(u);if(f&&v.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new v(h));else{let p=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((m,g,y,b)=>p=b),c.setSelection(Oo(n,h,c.doc.resolve(p)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))};he.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&Ze(n)},20))};he.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};he.beforeinput=(n,e)=>{if(ce&&Qe&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,vt(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in pe)he[n]=pe[n];function On(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}var kr=class n{constructor(e,t){this.toDOM=e,this.spec=t||Ot,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:s}=e.mapResult(t.from+i,this.side<0?-1:1);return s?null:new X(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof n&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&On(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},At=class n{constructor(e,t){this.attrs=e,this.spec=t||Ot}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new X(o,s,this)}valid(e,t){return t.from=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;se){let l=this.children[s]+1;this.children[s+2].findInner(e-l,t-l,r,i+l,o)}}map(e,t,r){return this==ae||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Ot)}mapInner(e,t,r,i,o){let s;for(let l=0;l{let c=a+r,u;if(u=ic(t,l,c)){for(i||(i=this.children.slice());ol&&f.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+t.content.size;for(let l=0;lo&&a.type instanceof At){let c=Math.max(o,a.from)-o,u=Math.min(s,a.to)-o;ci.map(e,t,Ot));return n.from(r)}forChild(e,t){if(t.isLeaf)return K.empty;let r=[];for(let i=0;it instanceof K)?e:e.reduce((t,r)=>t.concat(r instanceof K?r:r.members),[]))}}forEachSet(e){for(let t=0;t{let g=m-p-(h-d);for(let y=0;yb+u-f)continue;let S=l[y]+u-f;h>=S?l[y+1]=d<=S?-2:-1:d>=u&&g&&(l[y]+=g,l[y+1]+=g)}f+=g}),u=t.maps[c].map(u,-1)}let a=!1;for(let c=0;c=r.content.size){a=!0;continue}let d=t.map(n[c+1]+o,-1),h=d-i,{index:p,offset:m}=r.content.findIndex(f),g=r.maybeChild(p);if(g&&m==f&&m+g.nodeSize==h){let y=l[c+2].mapInner(t,g,u+1,n[c]+o+1,s);y!=ae?(l[c]=f,l[c+1]=h,l[c+2]=y):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=Vh(l,n,e,t,i,o,s),u=wr(c,r,0,s);e=u.local;for(let f=0;ft&&s.to{let c=ic(n,l,a+t);if(c){o=!0;let u=wr(c,l,t+a+1,r);u!=ae&&i.push(a,a+l.nodeSize,u)}});let s=rc(o?oc(n):n,-t).sort(Nt);for(let l=0;l0;)e++;n.splice(e,0,t)}function so(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=ae&&e.push(r)}),n.cursorWrapper&&e.push(K.create(n.state.doc,[n.cursorWrapper.deco])),Sr.from(e)}var Wh={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},jh=ge&&ut<=11,vo=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},To=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new vo,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),jh&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Wh)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(fa(this.view)){if(this.suppressingSelectionUpdates)return Ze(this.view);if(ge&&ut<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Dt(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,r;for(let o=e.focusNode;o;o=tn(o))t.add(o);for(let o=e.anchorNode;o;o=tn(o))if(t.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&fa(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,a=[];if(e.editable)for(let u=0;uf.nodeName=="BR");if(u.length==2){let[f,d]=u;f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let d of u){let h=d.parentNode;h&&h.nodeName=="LI"&&(!f||Uh(e,f)!=h)&&d.remove()}}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),Kh(e)),this.handleDOMChange(o,s,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Ze(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;ui;g--){let y=r.childNodes[g-1],b=y.pmViewDesc;if(y.nodeName=="BR"&&!b){o=g;break}if(!b||b.size)break}let f=n.state.doc,d=n.someProp("domParser")||Ie.fromSchema(n.state.schema),h=f.resolve(s),p=null,m=d.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:o,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:qh,context:h});if(c&&c[0].pos!=null){let g=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=g),p={anchor:g+s,head:y+s}}return{doc:m,sel:p,from:s,to:l}}function qh(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(de&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||de&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}var Gh=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Yh(n,e,t,r,i){let o=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let N=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,I=Ao(n,N);if(I&&!n.state.selection.eq(I)){if(ce&&Qe&&n.input.lastKeyCode===13&&Date.now()-100me(n,vt(13,"Enter"))))return;let j=n.state.tr.setSelection(I);N=="pointer"?j.setMeta("pointer",!0):N=="key"&&j.scrollIntoView(),o&&j.setMeta("composition",o),n.dispatch(j)}return}let s=n.state.doc.resolve(e),l=s.sharedDepth(t);e=s.before(l+1),t=n.state.doc.resolve(t).after(l+1);let a=n.state.selection,c=Jh(n,e,t),u=n.state.doc,f=u.slice(c.from,c.to),d,h;n.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Qe)&&i.some(N=>N.nodeType==1&&!Gh.test(N.nodeName))&&(!p||p.endA>=p.endB)&&n.someProp("handleKeyDown",N=>N(n,vt(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!p)if(r&&a instanceof O&&!a.empty&&a.$head.sameParent(a.$anchor)&&!n.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let N=Ma(n,n.state.doc,c.sel);if(N&&!N.eq(n.state.selection)){let I=n.state.tr.setSelection(N);o&&I.setMeta("composition",o),n.dispatch(I)}}return}n.state.selection.fromn.state.selection.from&&p.start<=n.state.selection.from+2&&n.state.selection.from>=c.from?p.start=n.state.selection.from:p.endA=n.state.selection.to-2&&n.state.selection.to<=c.to&&(p.endB+=n.state.selection.to-p.endA,p.endA=n.state.selection.to)),ge&&ut<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)==" \xA0"&&(p.start--,p.endA--,p.endB--);let m=c.doc.resolveNoCache(p.start-c.from),g=c.doc.resolveNoCache(p.endB-c.from),y=u.resolve(p.start),b=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=p.endA,S;if((nn&&n.input.lastIOSEnter>Date.now()-225&&(!b||i.some(N=>N.nodeName=="DIV"||N.nodeName=="P"))||!b&&m.posm.pos)&&n.someProp("handleKeyDown",N=>N(n,vt(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>p.start&&Qh(u,p.start,p.endA,m,g)&&n.someProp("handleKeyDown",N=>N(n,vt(8,"Backspace")))){Qe&&ce&&n.domObserver.suppressSelectionUpdates();return}ce&&p.endB==p.start&&(n.input.lastChromeDelete=Date.now()),Qe&&!b&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,g=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{n.someProp("handleKeyDown",function(N){return N(n,vt(13,"Enter"))})},20));let C=p.start,M=p.endA,R,z,V;if(b){if(m.pos==g.pos)ge&&ut<=11&&m.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ze(n),20)),R=n.state.tr.delete(C,M),z=u.resolve(p.start).marksAcross(u.resolve(p.endA));else if(p.endA==p.endB&&(V=Xh(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start()))))R=n.state.tr,V.type=="add"?R.addMark(C,M,V.mark):R.removeMark(C,M,V.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let N=m.parent.textBetween(m.parentOffset,g.parentOffset);if(n.someProp("handleTextInput",I=>I(n,C,M,N)))return;R=n.state.tr.insertText(N,C,M)}}if(R||(R=n.state.tr.replace(C,M,c.doc.slice(p.start-c.from,p.endB-c.from))),c.sel){let N=Ma(n,R.doc,c.sel);N&&!(ce&&n.composing&&N.empty&&(p.start!=p.endB||n.input.lastChromeDeletee.content.size?null:Oo(n,e.resolve(t.anchor),e.resolve(t.head))}function Xh(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,i=t,o=r,s,l,a;for(let u=0;uu.mark(l.addToSet(u.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;ut||lo(s,!0,!1)0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let o=n.node(r).maybeChild(n.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function Zh(n,e,t,r,i){let o=n.findDiffStart(e,t);if(o==null)return null;let{a:s,b:l}=n.findDiffEnd(e,t+n.size,t+e.size);if(i=="end"){let a=Math.max(0,o-Math.min(s,l));r-=s+a-o}if(s=s?o-r:0;o-=a,o&&o=l?o-r:0;o-=a,o&&o=56320&&e<=57343&&t>=55296&&t<=56319}var Mr=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new So,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Oa),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Ea(this),Ta(this),this.nodeViews=Aa(this),this.docView=oa(this.state.doc,va(this),so(this),this.dom,this),this.domObserver=new To(this,(r,i,o,s)=>Yh(this,r,i,o,s)),this.domObserver.start(),wh(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&wo(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Oa),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(ec(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let h=Aa(this);tp(h,this.nodeViews)&&(this.nodeViews=h,o=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&wo(this),this.editable=Ea(this),Ta(this);let a=so(this),c=va(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,c,a);(f||!e.selection.eq(i.selection))&&(s=!0);let d=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&$d(this);if(s){this.domObserver.stop();let h=f&&(ge||ce)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&ep(i.selection,e.selection);if(f){let p=ce?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Ih(this)),(o||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=oa(e.doc,c,a,this.dom,this)),p&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&lh(this))?Ze(this,h):(Wa(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():d&&Vd(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof v){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&Zl(this,t.getBoundingClientRect(),e)}else Zl(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new xr(e.slice,e.move,i<0?void 0:v.create(this.state.doc,i))}someProp(e,t){let r=this._props&&this._props[e],i;if(r!=null&&(i=t?t(r):r))return i;for(let s=0;st.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Jd(this,e)}coordsAtPos(e,t=1){return Ba(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let i=this.docView.posFromDOM(e,t,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return Qd(this,t||this.state,e)}pasteHTML(e,t){return An(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return An(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return No(this,e)}destroy(){this.docView&&(Mh(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],so(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Od())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return vh(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?de&&this.root.nodeType===11&&Id(this.dom.ownerDocument)==this.dom&&_h(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};function va(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[X.node(0,n.state.doc.content.size,e)]}function Ta(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:X.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function Ea(n){return!n.someProp("editable",e=>e(n.state)===!1)}function ep(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function Aa(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function tp(n,e){let t=0,r=0;for(let i in n){if(n[i]!=e[i])return!0;t++}for(let i in e)r++;return t!=r}function Oa(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var et={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Er={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},np=typeof navigator<"u"&&/Mac/.test(navigator.platform),rp=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(q=0;q<10;q++)et[48+q]=et[96+q]=String(q);var q;for(q=1;q<=24;q++)et[q+111]="F"+q;var q;for(q=65;q<=90;q++)et[q]=String.fromCharCode(q+32),Er[q]=String.fromCharCode(q);var q;for(Tr in et)Er.hasOwnProperty(Tr)||(Er[Tr]=et[Tr]);var Tr;function sc(n){var e=np&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||rp&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Er:et)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}var ip=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),op=typeof navigator<"u"&&/Win/.test(navigator.platform);function sp(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,s;for(let l=0;ln.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function cc(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}var zo=(n,e,t)=>{let r=cc(n,t);if(!r)return!1;let i=$o(r);if(!i){let s=r.blockRange(),l=s&&Ge(s);return l==null?!1:(e&&e(n.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(bc(n,i,e,-1))return!0;if(r.parent.content.size==0&&(on(o,"end")||v.isSelectable(o)))for(let s=r.depth;;s--){let l=wn(n.doc,r.before(s),r.after(s),w.empty);if(l&&l.slice.size1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},uc=(n,e,t)=>{let r=cc(n,t);if(!r)return!1;let i=$o(r);return i?dc(n,i,e):!1},fc=(n,e,t)=>{let r=hc(n,t);if(!r)return!1;let i=jo(r);return i?dc(n,i,e):!1};function dc(n,e,t){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let s=e.nodeAfter,l=s,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let c=wn(n.doc,o,a,w.empty);if(!c||c.from!=o||c instanceof le&&c.slice.size>=a-o)return!1;if(t){let u=n.tr.step(c);u.setSelection(O.create(u.doc,o)),t(u.scrollIntoView())}return!0}function on(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}var Ho=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=$o(r)}let s=o&&o.nodeBefore;return!s||!v.isSelectable(s)?!1:(e&&e(n.tr.setSelection(v.create(n.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function $o(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function hc(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset{let r=hc(n,t);if(!r)return!1;let i=jo(r);if(!i)return!1;let o=i.nodeAfter;if(bc(n,i,e,1))return!0;if(r.parent.content.size==0&&(on(o,"start")||v.isSelectable(o))){let s=wn(n.doc,r.before(),r.after(),w.empty);if(s&&s.slice.size{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset=0;e--){let t=n.node(e);if(n.index(e)+1{let t=n.selection,r=t instanceof v,i;if(r){if(t.node.isTextblock||!Se(n.doc,t.from))return!1;i=t.from}else if(i=Mt(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(v.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},mc=(n,e)=>{let t=n.selection,r;if(t instanceof v){if(t.node.isTextblock||!Se(n.doc,t.to))return!1;r=t.to}else if(r=Mt(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},gc=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&Ge(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},Ko=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(` -`).scrollIntoView()),!0)};function _o(n){for(let e=0;e{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),s=_o(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=t.after(),a=n.tr.replaceWith(l,l,s.createAndFill());a.setSelection(A.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},Jo=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof fe||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=_o(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(xe(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&Ge(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)};function ap(n){return(e,t)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof v&&e.selection.node.isBlock)return!r.parentOffset||!xe(e.doc,r.pos)?!1:(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,l,a=!1,c=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){a=r.end(h)==r.pos+(r.depth-h),c=r.start(h)==r.pos-(r.depth-h),l=_o(r.node(h-1).contentMatchAt(r.indexAfter(h-1)));let m=n&&n(i.parent,a,r);o.unshift(m||(a&&l?{type:l}:null)),s=h;break}else{if(h==1)return!1;o.unshift(null)}let u=e.tr;(e.selection instanceof O||e.selection instanceof fe)&&u.deleteSelection();let f=u.mapping.map(r.pos),d=xe(u.doc,f,o.length,o);if(d||(o[0]=l?{type:l}:null,d=xe(u.doc,f,o.length,o)),!d)return!1;if(u.split(f,o.length,o),!a&&c&&r.node(s).type!=l){let h=u.mapping.map(r.before(s)),p=u.doc.resolve(h);l&&r.node(s-1).canReplaceWith(p.index(),p.index()+1,l)&&u.setNodeMarkup(u.mapping.map(r.before(s)),l)}return t&&t(u.scrollIntoView()),!0}}var cp=ap();var yc=(n,e)=>{let{$from:t,to:r}=n.selection,i,o=t.sharedDepth(r);return o==0?!1:(i=t.before(o),e&&e(n.tr.setSelection(v.create(n.doc,i))),!0)},up=(n,e)=>(e&&e(n.tr.setSelection(new fe(n.doc))),!0);function fp(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Se(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function bc(n,e,t,r){let i=e.nodeBefore,o=e.nodeAfter,s,l,a=i.type.spec.isolating||o.type.spec.isolating;if(!a&&fp(n,e,t))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(l=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&l.matchType(s[0]||o.type).validEnd){if(t){let h=e.pos+o.nodeSize,p=x.empty;for(let y=s.length-1;y>=0;y--)p=x.from(s[y].create(null,p));p=x.from(i.copy(p));let m=n.tr.step(new J(e.pos-1,h,e.pos,h,new w(p,1,0),s.length,!0)),g=m.doc.resolve(h+2*s.length);g.nodeAfter&&g.nodeAfter.type==i.type&&Se(m.doc,g.pos)&&m.join(g.pos),t(m.scrollIntoView())}return!0}let u=o.type.spec.isolating||r>0&&a?null:A.findFrom(e,1),f=u&&u.$from.blockRange(u.$to),d=f&&Ge(f);if(d!=null&&d>=e.depth)return t&&t(n.tr.lift(f,d).scrollIntoView()),!0;if(c&&on(o,"start",!0)&&on(i,"end")){let h=i,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let m=o,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(h.canReplace(h.childCount,h.childCount,m.content)){if(t){let y=x.empty;for(let S=p.length-1;S>=0;S--)y=x.from(p[S].copy(y));let b=n.tr.step(new J(e.pos-p.length,e.pos+o.nodeSize,e.pos+g,e.pos+o.nodeSize-g,new w(y,p.length,0),0,!0));t(b.scrollIntoView())}return!0}}return!1}function xc(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(t&&t(e.tr.setSelection(O.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}var Go=xc(-1),Yo=xc(1);function kc(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,s=i.blockRange(o),l=s&&Gt(s,n,e);return l?(r&&r(t.tr.wrap(s,l).scrollIntoView()),!0):!1}}function Xo(n,e=null){return function(t,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(n,e)))if(a.type==n)i=!0;else{let u=t.doc.resolve(c),f=u.index();i=u.parent.canReplaceWith(f,f+1,n)}})}if(!i)return!1;if(r){let o=t.tr;for(let s=0;s=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let a=s.resolve(e.start-2);o=new St(a,a,e.depth),e.endIndex=0;u--)o=x.from(t[u].type.create(t[u].attrs,o));n.step(new J(e.start-(r?2:0),e.end,e.start,e.end,new w(o,0,0),t.length,!0));let s=0;for(let u=0;us.childCount>0&&s.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?mp(e,t,n,o):gp(e,t,o):!0:!1}}function mp(n,e,t,r){let i=n.tr,o=r.end,s=r.$to.end(r.depth);om;p--)h-=i.child(p).nodeSize,r.delete(h-1,h+1);let o=r.doc.resolve(t.start),s=o.nodeAfter;if(r.mapping.map(t.end)!=t.start+o.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(l?0:1),u+1,s.content.append(a?x.empty:x.from(i))))return!1;let f=o.pos,d=f+s.nodeSize;return r.step(new J(f-(l?1:0),d+(a?1:0),f+1,d-1,new w((l?x.empty:x.from(i.copy(x.empty))).append(a?x.empty:x.from(i.copy(x.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function Mc(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==n);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let l=o.parent,a=l.child(s-1);if(a.type!=n)return!1;if(t){let c=a.lastChild&&a.lastChild.type==l.type,u=x.from(c?n.create():null),f=new w(x.from(n.create(null,x.from(l.type.create(null,u)))),c?3:1,0),d=o.start,h=o.end;t(e.tr.step(new J(d-(c?3:1),h,d,h,f,1,!0)).scrollIntoView())}return!0}}var yp=Object.defineProperty,Dc=(n,e)=>{for(var t in e)yp(n,t,{get:e[t],enumerable:!0})};function Fr(n){let{state:e,transaction:t}=n,{selection:r}=t,{doc:i}=t,{storedMarks:o}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,o=t.storedMarks,t}}}var zr=class{constructor(n){this.editor=n.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=n.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:n,editor:e,state:t}=this,{view:r}=e,{tr:i}=t,o=this.buildProps(i);return Object.fromEntries(Object.entries(n).map(([s,l])=>[s,(...c)=>{let u=l(...c)(o);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(n,e=!0){let{rawCommands:t,editor:r,state:i}=this,{view:o}=r,s=[],l=!!n,a=n||i.tr,c=()=>(!l&&e&&!a.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(a),s.every(f=>f===!0)),u={...Object.fromEntries(Object.entries(t).map(([f,d])=>[f,(...p)=>{let m=this.buildProps(a,e),g=d(...p)(m);return s.push(g),u}])),run:c};return u}createCan(n){let{rawCommands:e,state:t}=this,r=!1,i=n||t.tr,o=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...c)=>a(...c)({...o,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}buildProps(n,e=!0){let{rawCommands:t,editor:r,state:i}=this,{view:o}=r,s={tr:n,editor:r,view:o,state:Fr({state:i,transaction:n}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(n,e),can:()=>this.createCan(n),get commands(){return Object.fromEntries(Object.entries(t).map(([l,a])=>[l,(...c)=>a(...c)(s)]))}};return s}},bp=class{constructor(){this.callbacks={}}on(n,e){return this.callbacks[n]||(this.callbacks[n]=[]),this.callbacks[n].push(e),this}emit(n,...e){let t=this.callbacks[n];return t&&t.forEach(r=>r.apply(this,e)),this}off(n,e){let t=this.callbacks[n];return t&&(e?this.callbacks[n]=t.filter(r=>r!==e):delete this.callbacks[n]),this}once(n,e){let t=(...r)=>{this.off(n,t),e.apply(this,r)};return this.on(n,t)}removeAllListeners(){this.callbacks={}}};function is(n,e){let t=new qt(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}var Rc=n=>{let e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){let r=e[t];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&Rc(r)}return n};function Or(n){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");let e=`${n}`,t=new window.DOMParser().parseFromString(e,"text/html").body;return Rc(t)}function Ir(n,e,t){if(n instanceof G||n instanceof x)return n;t={slice:!0,parseOptions:{},...t};let r=typeof n=="object"&&n!==null,i=typeof n=="string";if(r)try{if(Array.isArray(n)&&n.length>0)return x.fromArray(n.map(l=>e.nodeFromJSON(l)));let s=e.nodeFromJSON(n);return t.errorOnInvalidContent&&s.check(),s}catch(o){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",o),Ir("",e,t)}if(i){if(t.errorOnInvalidContent){let s=!1,l="",a=new _t({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,l=typeof c=="string"?c:c.outerHTML,null)}]}})});if(t.slice?Ie.fromSchema(a).parseSlice(Or(n),t.parseOptions):Ie.fromSchema(a).parse(Or(n),t.parseOptions),t.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}let o=Ie.fromSchema(e);return t.slice?o.parseSlice(Or(n),t.parseOptions).content:o.parse(Or(n),t.parseOptions)}return Ir("",e,t)}function ns(n,e,t={},r={}){return Ir(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}function xp(n){for(let e=0;e{t(i)&&r.push({node:i,pos:o})}),r}function kp(n,e){for(let t=n.depth;t>0;t-=1){let r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function Hr(n){return e=>kp(e.$from,n)}function T(n,e,t){return n.config[e]===void 0&&n.parent?T(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?T(n.parent,e,t):null}):n.config[e]}function ss(n){return n.map(e=>{let t={name:e.name,options:e.options,storage:e.storage},r=T(e,"addExtensions",t);return r?[e,...ss(r())]:e}).flat(10)}function ls(n,e){let t=Ue.fromSchema(e).serializeFragment(n),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}function Ic(n){return typeof n=="function"}function H(n,e=void 0,...t){return Ic(n)?e?n.bind(e)(...t):n(...t):n}function Sp(n={}){return Object.keys(n).length===0&&n.constructor===Object}function Rn(n){let e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function Lc(n){let e=[],{nodeExtensions:t,markExtensions:r}=Rn(n),i=[...t,...r],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(s=>{let l={name:s.name,options:s.options,storage:s.storage,extensions:i},a=T(s,"addGlobalAttributes",l);if(!a)return;a().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([d,h])=>{e.push({type:f,name:d,attribute:{...o,...h}})})})})}),i.forEach(s=>{let l={name:s.name,options:s.options,storage:s.storage},a=T(s,"addAttributes",l);if(!a)return;let c=a();Object.entries(c).forEach(([u,f])=>{let d={...o,...f};typeof d?.default=="function"&&(d.default=d.default()),d?.isRequired&&d?.default===void 0&&delete d.default,e.push({type:s.name,name:u,attribute:d})})}),e}function D(...n){return n.filter(e=>!!e).reduce((e,t)=>{let r={...e};return Object.entries(t).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){let l=o?String(o).split(" "):[],a=r[i]?r[i].split(" "):[],c=l.filter(u=>!a.includes(u));r[i]=[...a,...c].join(" ")}else if(i==="style"){let l=o?o.split(";").map(u=>u.trim()).filter(Boolean):[],a=r[i]?r[i].split(";").map(u=>u.trim()).filter(Boolean):[],c=new Map;a.forEach(u=>{let[f,d]=u.split(":").map(h=>h.trim());c.set(f,d)}),l.forEach(u=>{let[f,d]=u.split(":").map(h=>h.trim());c.set(f,d)}),r[i]=Array.from(c.entries()).map(([u,f])=>`${u}: ${f}`).join("; ")}else r[i]=o}),r},{})}function Lr(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>D(t,r),{})}function wp(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function Cc(n,e){return"style"in n?n:{...n,getAttrs:t=>{let r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;let i=e.reduce((o,s)=>{let l=s.attribute.parseHTML?s.attribute.parseHTML(t):wp(t.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function vc(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&Sp(t)?!1:t!=null))}function Mp(n,e){var t;let r=Lc(n),{nodeExtensions:i,markExtensions:o}=Rn(n),s=(t=i.find(c=>T(c,"topNode")))==null?void 0:t.name,l=Object.fromEntries(i.map(c=>{let u=r.filter(y=>y.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},d=n.reduce((y,b)=>{let S=T(b,"extendNodeSchema",f);return{...y,...S?S(c):{}}},{}),h=vc({...d,content:H(T(c,"content",f)),marks:H(T(c,"marks",f)),group:H(T(c,"group",f)),inline:H(T(c,"inline",f)),atom:H(T(c,"atom",f)),selectable:H(T(c,"selectable",f)),draggable:H(T(c,"draggable",f)),code:H(T(c,"code",f)),whitespace:H(T(c,"whitespace",f)),linebreakReplacement:H(T(c,"linebreakReplacement",f)),defining:H(T(c,"defining",f)),isolating:H(T(c,"isolating",f)),attrs:Object.fromEntries(u.map(y=>{var b,S;return[y.name,{default:(b=y?.attribute)==null?void 0:b.default,validate:(S=y?.attribute)==null?void 0:S.validate}]}))}),p=H(T(c,"parseHTML",f));p&&(h.parseDOM=p.map(y=>Cc(y,u)));let m=T(c,"renderHTML",f);m&&(h.toDOM=y=>m({node:y,HTMLAttributes:Lr(y,u)}));let g=T(c,"renderText",f);return g&&(h.toText=g),[c.name,h]})),a=Object.fromEntries(o.map(c=>{let u=r.filter(g=>g.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},d=n.reduce((g,y)=>{let b=T(y,"extendMarkSchema",f);return{...g,...b?b(c):{}}},{}),h=vc({...d,inclusive:H(T(c,"inclusive",f)),excludes:H(T(c,"excludes",f)),group:H(T(c,"group",f)),spanning:H(T(c,"spanning",f)),code:H(T(c,"code",f)),attrs:Object.fromEntries(u.map(g=>{var y,b;return[g.name,{default:(y=g?.attribute)==null?void 0:y.default,validate:(b=g?.attribute)==null?void 0:b.validate}]}))}),p=H(T(c,"parseHTML",f));p&&(h.parseDOM=p.map(g=>Cc(g,u)));let m=T(c,"renderHTML",f);return m&&(h.toDOM=g=>m({mark:g,HTMLAttributes:Lr(g,u)})),[c.name,h]}));return new _t({topNode:s,nodes:l,marks:a})}function Cp(n){let e=n.filter((t,r)=>n.indexOf(t)!==r);return Array.from(new Set(e))}function as(n){return n.sort((t,r)=>{let i=T(t,"priority")||100,o=T(r,"priority")||100;return i>o?-1:ir.name));return t.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${t.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function Fc(n,e,t){let{from:r,to:i}=e,{blockSeparator:o=` +`);return{dom:a,text:d,slice:e}}function Ua(n,e,t,r,i){let o=i.parent.type.spec.code,s,l;if(!t&&!e)return null;let a=e&&(r||o||!t);if(a){if(n.someProp("transformPastedText",d=>{e=d(e,o||r,n)}),o)return e?new w(x.from(n.state.schema.text(e.replace(/\r\n?/g,` +`))),0,0):w.empty;let f=n.someProp("clipboardTextParser",d=>d(e,i,r,n));if(f)l=f;else{let d=i.marks(),{schema:h}=n.state,p=Ue.fromSchema(h);s=document.createElement("div"),e.split(/(?:\r\n?|\n)+/).forEach(m=>{let g=s.appendChild(document.createElement("p"));m&&g.appendChild(p.serializeNode(h.text(m,d)))})}}else n.someProp("transformPastedHTML",f=>{t=f(t,n)}),s=kh(t),Dn&&Sh(s);let c=s&&s.querySelector("[data-pm-slice]"),u=c&&/^(\d+) (\d+)(?: -(\d+))? (.*)/.exec(c.getAttribute("data-pm-slice")||"");if(u&&u[3])for(let f=+u[3];f>0;f--){let d=s.firstChild;for(;d&&d.nodeType!=1;)d=d.nextSibling;if(!d)break;s=d}if(l||(l=(n.someProp("clipboardParser")||n.someProp("domParser")||Ie.fromSchema(n.state.schema)).parseSlice(s,{preserveWhitespace:!!(a||u),context:i,ruleFromNode(d){return d.nodeName=="BR"&&!d.nextSibling&&d.parentNode&&!yh.test(d.parentNode.nodeName)?{ignore:!0}:null}})),u)l=wh(ba(l,+u[1],+u[2]),u[4]);else if(l=w.maxOpen(bh(l.content,i),!0),l.openStart||l.openEnd){let f=0,d=0;for(let h=l.content.firstChild;f{l=f(l,n)}),l}var yh=/^(a|abbr|acronym|b|cite|code|del|em|i|ins|kbd|label|output|q|ruby|s|samp|span|strong|sub|sup|time|u|tt|var)$/i;function bh(n,e){if(n.childCount<2)return n;for(let t=e.depth;t>=0;t--){let i=e.node(t).contentMatchAt(e.index(t)),o,s=[];if(n.forEach(l=>{if(!s)return;let a=i.findWrapping(l.type),c;if(!a)return s=null;if(c=s.length&&o.length&&qa(a,o,l,s[s.length-1],0))s[s.length-1]=c;else{s.length&&(s[s.length-1]=Ga(s[s.length-1],o.length));let u=Ja(l,a);s.push(u),i=i.matchType(u.type),o=a}}),s)return x.from(s)}return n}function Ja(n,e,t=0){for(let r=e.length-1;r>=t;r--)n=e[r].create(null,x.from(n));return n}function qa(n,e,t,r,i){if(i1&&(o=0),i=t&&(l=e<0?s.contentMatchAt(0).fillBefore(l,o<=i).append(l):l.append(s.contentMatchAt(s.childCount).fillBefore(x.empty,!0))),n.replaceChild(e<0?0:n.childCount-1,s.copy(l))}function ba(n,e,t){return et})),oo.createHTML(n)):n}function kh(n){let e=/^(\s*]*>)*/.exec(n);e&&(n=n.slice(e[0].length));let t=Xa().createElement("div"),r=/<([a-z][^>\s]+)/i.exec(n),i;if((i=r&&Ya[r[1].toLowerCase()])&&(n=i.map(o=>"<"+o+">").join("")+n+i.map(o=>"").reverse().join("")),t.innerHTML=xh(n),i)for(let o=0;o=0;l-=2){let a=t.nodes[r[l]];if(!a||a.hasRequiredAttrs())break;i=x.from(a.create(r[l+1],i)),o++,s++}return new w(i,o,s)}var he={},pe={},Mh={touchstart:!0,touchmove:!0},So=class{constructor(){this.shiftKey=!1,this.mouseDown=null,this.lastKeyCode=null,this.lastKeyCodeTime=0,this.lastClick={time:0,x:0,y:0,type:"",button:0},this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastIOSEnter=0,this.lastIOSEnterFallbackTimeout=-1,this.lastFocus=0,this.lastTouch=0,this.lastChromeDelete=0,this.composing=!1,this.compositionNode=null,this.composingTimeout=-1,this.compositionNodes=[],this.compositionEndedAt=-2e8,this.compositionID=1,this.compositionPendingChanges=0,this.domChangeCount=0,this.eventHandlers=Object.create(null),this.hideSelectionGuard=null}};function Ch(n){for(let e in he){let t=he[e];n.dom.addEventListener(e,n.input.eventHandlers[e]=r=>{Th(n,r)&&!Do(n,r)&&(n.editable||!(r.type in pe))&&t(n,r)},Mh[e]?{passive:!0}:void 0)}de&&n.dom.addEventListener("input",()=>null),wo(n)}function ct(n,e){n.input.lastSelectionOrigin=e,n.input.lastSelectionTime=Date.now()}function vh(n){n.domObserver.stop();for(let e in n.input.eventHandlers)n.dom.removeEventListener(e,n.input.eventHandlers[e]);clearTimeout(n.input.composingTimeout),clearTimeout(n.input.lastIOSEnterFallbackTimeout)}function wo(n){n.someProp("handleDOMEvents",e=>{for(let t in e)n.input.eventHandlers[t]||n.dom.addEventListener(t,n.input.eventHandlers[t]=r=>Do(n,r))})}function Do(n,e){return n.someProp("handleDOMEvents",t=>{let r=t[e.type];return r?r(n,e)||e.defaultPrevented:!1})}function Th(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target;t!=n.dom;t=t.parentNode)if(!t||t.nodeType==11||t.pmViewDesc&&t.pmViewDesc.stopEvent(e))return!1;return!0}function Eh(n,e){!Do(n,e)&&he[e.type]&&(n.editable||!(e.type in pe))&&he[e.type](n,e)}pe.keydown=(n,e)=>{let t=e;if(n.input.shiftKey=t.keyCode==16||t.shiftKey,!Za(n,t)&&(n.input.lastKeyCode=t.keyCode,n.input.lastKeyCodeTime=Date.now(),!(Qe&&ce&&t.keyCode==13)))if(t.keyCode!=229&&n.domObserver.forceFlush(),nn&&t.keyCode==13&&!t.ctrlKey&&!t.altKey&&!t.metaKey){let r=Date.now();n.input.lastIOSEnter=r,n.input.lastIOSEnterFallbackTimeout=setTimeout(()=>{n.input.lastIOSEnter==r&&(n.someProp("handleKeyDown",i=>i(n,vt(13,"Enter"))),n.input.lastIOSEnter=0)},200)}else n.someProp("handleKeyDown",r=>r(n,t))||gh(n,t)?t.preventDefault():ct(n,"key")};pe.keyup=(n,e)=>{e.keyCode==16&&(n.input.shiftKey=!1)};pe.keypress=(n,e)=>{let t=e;if(Za(n,t)||!t.charCode||t.ctrlKey&&!t.altKey||we&&t.metaKey)return;if(n.someProp("handleKeyPress",i=>i(n,t))){t.preventDefault();return}let r=n.state.selection;if(!(r instanceof O)||!r.$from.sameParent(r.$to)){let i=String.fromCharCode(t.charCode);!/[\r\n]/.test(i)&&!n.someProp("handleTextInput",o=>o(n,r.$from.pos,r.$to.pos,i))&&n.dispatch(n.state.tr.insertText(i).scrollIntoView()),t.preventDefault()}};function vr(n){return{left:n.clientX,top:n.clientY}}function Ah(n,e){let t=e.x-n.clientX,r=e.y-n.clientY;return t*t+r*r<100}function Ro(n,e,t,r,i){if(r==-1)return!1;let o=n.state.doc.resolve(r);for(let s=o.depth+1;s>0;s--)if(n.someProp(e,l=>s>o.depth?l(n,t,o.nodeAfter,o.before(s),i,!0):l(n,t,o.node(s),o.before(s),i,!1)))return!0;return!1}function en(n,e,t){if(n.focused||n.focus(),n.state.selection.eq(e))return;let r=n.state.tr.setSelection(e);t=="pointer"&&r.setMeta("pointer",!0),n.dispatch(r)}function Oh(n,e){if(e==-1)return!1;let t=n.state.doc.resolve(e),r=t.nodeAfter;return r&&r.isAtom&&v.isSelectable(r)?(en(n,new v(t),"pointer"),!0):!1}function Nh(n,e){if(e==-1)return!1;let t=n.state.selection,r,i;t instanceof v&&(r=t.node);let o=n.state.doc.resolve(e);for(let s=o.depth+1;s>0;s--){let l=s>o.depth?o.nodeAfter:o.node(s);if(v.isSelectable(l)){r&&t.$from.depth>0&&s>=t.$from.depth&&o.before(t.$from.depth+1)==t.$from.pos?i=o.before(t.$from.depth):i=o.before(s);break}}return i!=null?(en(n,v.create(n.state.doc,i),"pointer"),!0):!1}function Dh(n,e,t,r,i){return Ro(n,"handleClickOn",e,t,r)||n.someProp("handleClick",o=>o(n,e,r))||(i?Nh(n,t):Oh(n,t))}function Rh(n,e,t,r){return Ro(n,"handleDoubleClickOn",e,t,r)||n.someProp("handleDoubleClick",i=>i(n,e,r))}function Ph(n,e,t,r){return Ro(n,"handleTripleClickOn",e,t,r)||n.someProp("handleTripleClick",i=>i(n,e,r))||Ih(n,t,r)}function Ih(n,e,t){if(t.button!=0)return!1;let r=n.state.doc;if(e==-1)return r.inlineContent?(en(n,O.create(r,0,r.content.size),"pointer"),!0):!1;let i=r.resolve(e);for(let o=i.depth+1;o>0;o--){let s=o>i.depth?i.nodeAfter:i.node(o),l=i.before(o);if(s.inlineContent)en(n,O.create(r,l+1,l+1+s.content.size),"pointer");else if(v.isSelectable(s))en(n,v.create(r,l),"pointer");else continue;return!0}}function Po(n){return br(n)}var Qa=we?"metaKey":"ctrlKey";he.mousedown=(n,e)=>{let t=e;n.input.shiftKey=t.shiftKey;let r=Po(n),i=Date.now(),o="singleClick";i-n.input.lastClick.time<500&&Ah(t,n.input.lastClick)&&!t[Qa]&&n.input.lastClick.button==t.button&&(n.input.lastClick.type=="singleClick"?o="doubleClick":n.input.lastClick.type=="doubleClick"&&(o="tripleClick")),n.input.lastClick={time:i,x:t.clientX,y:t.clientY,type:o,button:t.button};let s=n.posAtCoords(vr(t));s&&(o=="singleClick"?(n.input.mouseDown&&n.input.mouseDown.done(),n.input.mouseDown=new Mo(n,s,t,!!r)):(o=="doubleClick"?Rh:Ph)(n,s.pos,s.inside,t)?t.preventDefault():ct(n,"pointer"))};var Mo=class{constructor(e,t,r,i){this.view=e,this.pos=t,this.event=r,this.flushed=i,this.delayedSelectionSync=!1,this.mightDrag=null,this.startDoc=e.state.doc,this.selectNode=!!r[Qa],this.allowDefault=r.shiftKey;let o,s;if(t.inside>-1)o=e.state.doc.nodeAt(t.inside),s=t.inside;else{let u=e.state.doc.resolve(t.pos);o=u.parent,s=u.depth?u.before():0}let l=i?null:r.target,a=l?e.docView.nearestDesc(l,!0):null;this.target=a&&a.dom.nodeType==1?a.dom:null;let{selection:c}=e.state;(r.button==0&&o.type.spec.draggable&&o.type.spec.selectable!==!1||c instanceof v&&c.from<=s&&c.to>s)&&(this.mightDrag={node:o,pos:s,addAttr:!!(this.target&&!this.target.draggable),setUneditable:!!(this.target&&De&&!this.target.hasAttribute("contentEditable"))}),this.target&&this.mightDrag&&(this.mightDrag.addAttr||this.mightDrag.setUneditable)&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&(this.target.draggable=!0),this.mightDrag.setUneditable&&setTimeout(()=>{this.view.input.mouseDown==this&&this.target.setAttribute("contentEditable","false")},20),this.view.domObserver.start()),e.root.addEventListener("mouseup",this.up=this.up.bind(this)),e.root.addEventListener("mousemove",this.move=this.move.bind(this)),ct(e,"pointer")}done(){this.view.root.removeEventListener("mouseup",this.up),this.view.root.removeEventListener("mousemove",this.move),this.mightDrag&&this.target&&(this.view.domObserver.stop(),this.mightDrag.addAttr&&this.target.removeAttribute("draggable"),this.mightDrag.setUneditable&&this.target.removeAttribute("contentEditable"),this.view.domObserver.start()),this.delayedSelectionSync&&setTimeout(()=>Ze(this.view)),this.view.input.mouseDown=null}up(e){if(this.done(),!this.view.dom.contains(e.target))return;let t=this.pos;this.view.state.doc!=this.startDoc&&(t=this.view.posAtCoords(vr(e))),this.updateAllowDefault(e),this.allowDefault||!t?ct(this.view,"pointer"):Dh(this.view,t.pos,t.inside,e,this.selectNode)?e.preventDefault():e.button==0&&(this.flushed||de&&this.mightDrag&&!this.mightDrag.node.isAtom||ce&&!this.view.state.selection.visible&&Math.min(Math.abs(t.pos-this.view.state.selection.from),Math.abs(t.pos-this.view.state.selection.to))<=2)?(en(this.view,A.near(this.view.state.doc.resolve(t.pos)),"pointer"),e.preventDefault()):ct(this.view,"pointer")}move(e){this.updateAllowDefault(e),ct(this.view,"pointer"),e.buttons==0&&this.done()}updateAllowDefault(e){!this.allowDefault&&(Math.abs(this.event.x-e.clientX)>4||Math.abs(this.event.y-e.clientY)>4)&&(this.allowDefault=!0)}};he.touchstart=n=>{n.input.lastTouch=Date.now(),Po(n),ct(n,"pointer")};he.touchmove=n=>{n.input.lastTouch=Date.now(),ct(n,"pointer")};he.contextmenu=n=>Po(n);function Za(n,e){return n.composing?!0:de&&Math.abs(e.timeStamp-n.input.compositionEndedAt)<500?(n.input.compositionEndedAt=-2e8,!0):!1}var Lh=Qe?5e3:-1;pe.compositionstart=pe.compositionupdate=n=>{if(!n.composing){n.domObserver.flush();let{state:e}=n,t=e.selection.$to;if(e.selection instanceof O&&(e.storedMarks||!t.textOffset&&t.parentOffset&&t.nodeBefore.marks.some(r=>r.type.spec.inclusive===!1)))n.markCursor=n.state.storedMarks||t.marks(),br(n,!0),n.markCursor=null;else if(br(n,!e.selection.empty),De&&e.selection.empty&&t.parentOffset&&!t.textOffset&&t.nodeBefore.marks.length){let r=n.domSelectionRange();for(let i=r.focusNode,o=r.focusOffset;i&&i.nodeType==1&&o!=0;){let s=o<0?i.lastChild:i.childNodes[o-1];if(!s)break;if(s.nodeType==3){let l=n.domSelection();l&&l.collapse(s,s.nodeValue.length);break}else i=s,o=-1}}n.input.composing=!0}ec(n,Lh)};pe.compositionend=(n,e)=>{n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=e.timeStamp,n.input.compositionPendingChanges=n.domObserver.pendingRecords().length?n.input.compositionID:0,n.input.compositionNode=null,n.input.compositionPendingChanges&&Promise.resolve().then(()=>n.domObserver.flush()),n.input.compositionID++,ec(n,20))};function ec(n,e){clearTimeout(n.input.composingTimeout),e>-1&&(n.input.composingTimeout=setTimeout(()=>br(n),e))}function tc(n){for(n.composing&&(n.input.composing=!1,n.input.compositionEndedAt=Fh());n.input.compositionNodes.length>0;)n.input.compositionNodes.pop().markParentsDirty()}function Bh(n){let e=n.domSelectionRange();if(!e.focusNode)return null;let t=Pd(e.focusNode,e.focusOffset),r=Id(e.focusNode,e.focusOffset);if(t&&r&&t!=r){let i=r.pmViewDesc,o=n.domObserver.lastChangedTextNode;if(t==o||r==o)return o;if(!i||!i.isText(r.nodeValue))return r;if(n.input.compositionNode==r){let s=t.pmViewDesc;if(!(!s||!s.isText(t.nodeValue)))return r}}return t||r}function Fh(){let n=document.createEvent("Event");return n.initEvent("event",!0,!0),n.timeStamp}function br(n,e=!1){if(!(Qe&&n.domObserver.flushingSoon>=0)){if(n.domObserver.forceFlush(),tc(n),e||n.docView&&n.docView.dirty){let t=Ao(n),r=n.state.selection;return t&&!t.eq(r)?n.dispatch(n.state.tr.setSelection(t)):(n.markCursor||e)&&!r.$from.node(r.$from.sharedDepth(r.to)).inlineContent?n.dispatch(n.state.tr.deleteSelection()):n.updateState(n.state),!0}return!1}}function zh(n,e){if(!n.dom.parentNode)return;let t=n.dom.parentNode.appendChild(document.createElement("div"));t.appendChild(e),t.style.cssText="position: fixed; left: -10000px; top: 10px";let r=getSelection(),i=document.createRange();i.selectNodeContents(e),n.dom.blur(),r.removeAllRanges(),r.addRange(i),setTimeout(()=>{t.parentNode&&t.parentNode.removeChild(t),n.focus()},50)}var En=ge&&ut<15||nn&&Hd<604;he.copy=pe.cut=(n,e)=>{let t=e,r=n.state.selection,i=t.type=="cut";if(r.empty)return;let o=En?null:t.clipboardData,s=r.content(),{dom:l,text:a}=No(n,s);o?(t.preventDefault(),o.clearData(),o.setData("text/html",l.innerHTML),o.setData("text/plain",a)):zh(n,l),i&&n.dispatch(n.state.tr.deleteSelection().scrollIntoView().setMeta("uiEvent","cut"))};function Hh(n){return n.openStart==0&&n.openEnd==0&&n.content.childCount==1?n.content.firstChild:null}function $h(n,e){if(!n.dom.parentNode)return;let t=n.input.shiftKey||n.state.selection.$from.parent.type.spec.code,r=n.dom.parentNode.appendChild(document.createElement(t?"textarea":"div"));t||(r.contentEditable="true"),r.style.cssText="position: fixed; left: -10000px; top: 10px",r.focus();let i=n.input.shiftKey&&n.input.lastKeyCode!=45;setTimeout(()=>{n.focus(),r.parentNode&&r.parentNode.removeChild(r),t?An(n,r.value,null,i,e):An(n,r.textContent,r.innerHTML,i,e)},50)}function An(n,e,t,r,i){let o=Ua(n,e,t,r,n.state.selection.$from);if(n.someProp("handlePaste",a=>a(n,i,o||w.empty)))return!0;if(!o)return!1;let s=Hh(o),l=s?n.state.tr.replaceSelectionWith(s,r):n.state.tr.replaceSelection(o);return n.dispatch(l.scrollIntoView().setMeta("paste",!0).setMeta("uiEvent","paste")),!0}function nc(n){let e=n.getData("text/plain")||n.getData("Text");if(e)return e;let t=n.getData("text/uri-list");return t?t.replace(/\r?\n/g," "):""}pe.paste=(n,e)=>{let t=e;if(n.composing&&!Qe)return;let r=En?null:t.clipboardData,i=n.input.shiftKey&&n.input.lastKeyCode!=45;r&&An(n,nc(r),r.getData("text/html"),i,t)?t.preventDefault():$h(n,t)};var xr=class{constructor(e,t,r){this.slice=e,this.move=t,this.node=r}},Vh=we?"altKey":"ctrlKey";function rc(n,e){let t=n.someProp("dragCopies",r=>!r(e));return t??!e[Vh]}he.dragstart=(n,e)=>{let t=e,r=n.input.mouseDown;if(r&&r.done(),!t.dataTransfer)return;let i=n.state.selection,o=i.empty?null:n.posAtCoords(vr(t)),s;if(!(o&&o.pos>=i.from&&o.pos<=(i instanceof v?i.to-1:i.to))){if(r&&r.mightDrag)s=v.create(n.state.doc,r.mightDrag.pos);else if(t.target&&t.target.nodeType==1){let f=n.docView.nearestDesc(t.target,!0);f&&f.node.type.spec.draggable&&f!=n.docView&&(s=v.create(n.state.doc,f.posBefore))}}let l=(s||n.state.selection).content(),{dom:a,text:c,slice:u}=No(n,l);(!t.dataTransfer.files.length||!ce||Ra>120)&&t.dataTransfer.clearData(),t.dataTransfer.setData(En?"Text":"text/html",a.innerHTML),t.dataTransfer.effectAllowed="copyMove",En||t.dataTransfer.setData("text/plain",c),n.dragging=new xr(u,rc(n,t),s)};he.dragend=n=>{let e=n.dragging;window.setTimeout(()=>{n.dragging==e&&(n.dragging=null)},50)};pe.dragover=pe.dragenter=(n,e)=>e.preventDefault();pe.drop=(n,e)=>{let t=e,r=n.dragging;if(n.dragging=null,!t.dataTransfer)return;let i=n.posAtCoords(vr(t));if(!i)return;let o=n.state.doc.resolve(i.pos),s=r&&r.slice;s?n.someProp("transformPasted",p=>{s=p(s,n)}):s=Ua(n,nc(t.dataTransfer),En?null:t.dataTransfer.getData("text/html"),!1,o);let l=!!(r&&rc(n,t));if(n.someProp("handleDrop",p=>p(n,t,s||w.empty,l))){t.preventDefault();return}if(!s)return;t.preventDefault();let a=s?ar(n.state.doc,o.pos,s):o.pos;a==null&&(a=o.pos);let c=n.state.tr;if(l){let{node:p}=r;p?p.replace(c):c.deleteSelection()}let u=c.mapping.map(a),f=s.openStart==0&&s.openEnd==0&&s.content.childCount==1,d=c.doc;if(f?c.replaceRangeWith(u,u,s.content.firstChild):c.replaceRange(u,u,s),c.doc.eq(d))return;let h=c.doc.resolve(u);if(f&&v.isSelectable(s.content.firstChild)&&h.nodeAfter&&h.nodeAfter.sameMarkup(s.content.firstChild))c.setSelection(new v(h));else{let p=c.mapping.map(a);c.mapping.maps[c.mapping.maps.length-1].forEach((m,g,y,b)=>p=b),c.setSelection(Oo(n,h,c.doc.resolve(p)))}n.focus(),n.dispatch(c.setMeta("uiEvent","drop"))};he.focus=n=>{n.input.lastFocus=Date.now(),n.focused||(n.domObserver.stop(),n.dom.classList.add("ProseMirror-focused"),n.domObserver.start(),n.focused=!0,setTimeout(()=>{n.docView&&n.hasFocus()&&!n.domObserver.currentSelection.eq(n.domSelectionRange())&&Ze(n)},20))};he.blur=(n,e)=>{let t=e;n.focused&&(n.domObserver.stop(),n.dom.classList.remove("ProseMirror-focused"),n.domObserver.start(),t.relatedTarget&&n.dom.contains(t.relatedTarget)&&n.domObserver.currentSelection.clear(),n.focused=!1)};he.beforeinput=(n,e)=>{if(ce&&Qe&&e.inputType=="deleteContentBackward"){n.domObserver.flushSoon();let{domChangeCount:r}=n.input;setTimeout(()=>{if(n.input.domChangeCount!=r||(n.dom.blur(),n.focus(),n.someProp("handleKeyDown",o=>o(n,vt(8,"Backspace")))))return;let{$cursor:i}=n.state.selection;i&&i.pos>0&&n.dispatch(n.state.tr.delete(i.pos-1,i.pos).scrollIntoView())},50)}};for(let n in pe)he[n]=pe[n];function On(n,e){if(n==e)return!0;for(let t in n)if(n[t]!==e[t])return!1;for(let t in e)if(!(t in n))return!1;return!0}var kr=class n{constructor(e,t){this.toDOM=e,this.spec=t||Ot,this.side=this.spec.side||0}map(e,t,r,i){let{pos:o,deleted:s}=e.mapResult(t.from+i,this.side<0?-1:1);return s?null:new X(o-r,o-r,this)}valid(){return!0}eq(e){return this==e||e instanceof n&&(this.spec.key&&this.spec.key==e.spec.key||this.toDOM==e.toDOM&&On(this.spec,e.spec))}destroy(e){this.spec.destroy&&this.spec.destroy(e)}},At=class n{constructor(e,t){this.attrs=e,this.spec=t||Ot}map(e,t,r,i){let o=e.map(t.from+i,this.spec.inclusiveStart?-1:1)-r,s=e.map(t.to+i,this.spec.inclusiveEnd?1:-1)-r;return o>=s?null:new X(o,s,this)}valid(e,t){return t.from=e&&(!o||o(l.spec))&&r.push(l.copy(l.from+i,l.to+i))}for(let s=0;se){let l=this.children[s]+1;this.children[s+2].findInner(e-l,t-l,r,i+l,o)}}map(e,t,r){return this==ae||e.maps.length==0?this:this.mapInner(e,t,0,0,r||Ot)}mapInner(e,t,r,i,o){let s;for(let l=0;l{let c=a+r,u;if(u=oc(t,l,c)){for(i||(i=this.children.slice());ol&&f.to=e){this.children[l]==e&&(r=this.children[l+2]);break}let o=e+1,s=o+t.content.size;for(let l=0;lo&&a.type instanceof At){let c=Math.max(o,a.from)-o,u=Math.min(s,a.to)-o;ci.map(e,t,Ot));return n.from(r)}forChild(e,t){if(t.isLeaf)return K.empty;let r=[];for(let i=0;it instanceof K)?e:e.reduce((t,r)=>t.concat(r instanceof K?r:r.members),[]))}}forEachSet(e){for(let t=0;t{let g=m-p-(h-d);for(let y=0;yb+u-f)continue;let S=l[y]+u-f;h>=S?l[y+1]=d<=S?-2:-1:d>=u&&g&&(l[y]+=g,l[y+1]+=g)}f+=g}),u=t.maps[c].map(u,-1)}let a=!1;for(let c=0;c=r.content.size){a=!0;continue}let d=t.map(n[c+1]+o,-1),h=d-i,{index:p,offset:m}=r.content.findIndex(f),g=r.maybeChild(p);if(g&&m==f&&m+g.nodeSize==h){let y=l[c+2].mapInner(t,g,u+1,n[c]+o+1,s);y!=ae?(l[c]=f,l[c+1]=h,l[c+2]=y):(l[c+1]=-2,a=!0)}else a=!0}if(a){let c=jh(l,n,e,t,i,o,s),u=wr(c,r,0,s);e=u.local;for(let f=0;ft&&s.to{let c=oc(n,l,a+t);if(c){o=!0;let u=wr(c,l,t+a+1,r);u!=ae&&i.push(a,a+l.nodeSize,u)}});let s=ic(o?sc(n):n,-t).sort(Nt);for(let l=0;l0;)e++;n.splice(e,0,t)}function so(n){let e=[];return n.someProp("decorations",t=>{let r=t(n.state);r&&r!=ae&&e.push(r)}),n.cursorWrapper&&e.push(K.create(n.state.doc,[n.cursorWrapper.deco])),Sr.from(e)}var Kh={childList:!0,characterData:!0,characterDataOldValue:!0,attributes:!0,attributeOldValue:!0,subtree:!0},_h=ge&&ut<=11,vo=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}set(e){this.anchorNode=e.anchorNode,this.anchorOffset=e.anchorOffset,this.focusNode=e.focusNode,this.focusOffset=e.focusOffset}clear(){this.anchorNode=this.focusNode=null}eq(e){return e.anchorNode==this.anchorNode&&e.anchorOffset==this.anchorOffset&&e.focusNode==this.focusNode&&e.focusOffset==this.focusOffset}},To=class{constructor(e,t){this.view=e,this.handleDOMChange=t,this.queue=[],this.flushingSoon=-1,this.observer=null,this.currentSelection=new vo,this.onCharData=null,this.suppressingSelectionUpdates=!1,this.lastChangedTextNode=null,this.observer=window.MutationObserver&&new window.MutationObserver(r=>{for(let i=0;ii.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),_h&&(this.onCharData=r=>{this.queue.push({target:r.target,type:"characterData",oldValue:r.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this)}flushSoon(){this.flushingSoon<0&&(this.flushingSoon=window.setTimeout(()=>{this.flushingSoon=-1,this.flush()},20))}forceFlush(){this.flushingSoon>-1&&(window.clearTimeout(this.flushingSoon),this.flushingSoon=-1,this.flush())}start(){this.observer&&(this.observer.takeRecords(),this.observer.observe(this.view.dom,Kh)),this.onCharData&&this.view.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.connectSelection()}stop(){if(this.observer){let e=this.observer.takeRecords();if(e.length){for(let t=0;tthis.flush(),20)}this.observer.disconnect()}this.onCharData&&this.view.dom.removeEventListener("DOMCharacterDataModified",this.onCharData),this.disconnectSelection()}connectSelection(){this.view.dom.ownerDocument.addEventListener("selectionchange",this.onSelectionChange)}disconnectSelection(){this.view.dom.ownerDocument.removeEventListener("selectionchange",this.onSelectionChange)}suppressSelectionUpdates(){this.suppressingSelectionUpdates=!0,setTimeout(()=>this.suppressingSelectionUpdates=!1,50)}onSelectionChange(){if(da(this.view)){if(this.suppressingSelectionUpdates)return Ze(this.view);if(ge&&ut<=11&&!this.view.state.selection.empty){let e=this.view.domSelectionRange();if(e.focusNode&&Dt(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset))return this.flushSoon()}this.flush()}}setCurSelection(){this.currentSelection.set(this.view.domSelectionRange())}ignoreSelectionChange(e){if(!e.focusNode)return!0;let t=new Set,r;for(let o=e.focusNode;o;o=tn(o))t.add(o);for(let o=e.anchorNode;o;o=tn(o))if(t.has(o)){r=o;break}let i=r&&this.view.docView.nearestDesc(r);if(i&&i.ignoreMutation({type:"selection",target:r.nodeType==3?r.parentNode:r}))return this.setCurSelection(),!0}pendingRecords(){if(this.observer)for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}flush(){let{view:e}=this;if(!e.docView||this.flushingSoon>-1)return;let t=this.pendingRecords();t.length&&(this.queue=[]);let r=e.domSelectionRange(),i=!this.suppressingSelectionUpdates&&!this.currentSelection.eq(r)&&da(e)&&!this.ignoreSelectionChange(r),o=-1,s=-1,l=!1,a=[];if(e.editable)for(let u=0;uf.nodeName=="BR");if(u.length==2){let[f,d]=u;f.parentNode&&f.parentNode.parentNode==d.parentNode?d.remove():f.remove()}else{let{focusNode:f}=this.currentSelection;for(let d of u){let h=d.parentNode;h&&h.nodeName=="LI"&&(!f||qh(e,f)!=h)&&d.remove()}}}let c=null;o<0&&i&&e.input.lastFocus>Date.now()-200&&Math.max(e.input.lastTouch,e.input.lastClick.time)-1||i)&&(o>-1&&(e.docView.markDirty(o,s),Uh(e)),this.handleDOMChange(o,s,l,a),e.docView&&e.docView.dirty?e.updateState(e.state):this.currentSelection.eq(r)||Ze(e),this.currentSelection.set(r))}registerMutation(e,t){if(t.indexOf(e.target)>-1)return null;let r=this.view.docView.nearestDesc(e.target);if(e.type=="attributes"&&(r==this.view.docView||e.attributeName=="contenteditable"||e.attributeName=="style"&&!e.oldValue&&!e.target.getAttribute("style"))||!r||r.ignoreMutation(e))return null;if(e.type=="childList"){for(let u=0;ui;g--){let y=r.childNodes[g-1],b=y.pmViewDesc;if(y.nodeName=="BR"&&!b){o=g;break}if(!b||b.size)break}let f=n.state.doc,d=n.someProp("domParser")||Ie.fromSchema(n.state.schema),h=f.resolve(s),p=null,m=d.parse(r,{topNode:h.parent,topMatch:h.parent.contentMatchAt(h.index()),topOpen:!0,from:i,to:o,preserveWhitespace:h.parent.type.whitespace=="pre"?"full":!0,findPositions:c,ruleFromNode:Yh,context:h});if(c&&c[0].pos!=null){let g=c[0].pos,y=c[1]&&c[1].pos;y==null&&(y=g),p={anchor:g+s,head:y+s}}return{doc:m,sel:p,from:s,to:l}}function Yh(n){let e=n.pmViewDesc;if(e)return e.parseRule();if(n.nodeName=="BR"&&n.parentNode){if(de&&/^(ul|ol)$/i.test(n.parentNode.nodeName)){let t=document.createElement("div");return t.appendChild(document.createElement("li")),{skip:t}}else if(n.parentNode.lastChild==n||de&&/^(tr|table)$/i.test(n.parentNode.nodeName))return{ignore:!0}}else if(n.nodeName=="IMG"&&n.getAttribute("mark-placeholder"))return{ignore:!0};return null}var Xh=/^(a|abbr|acronym|b|bd[io]|big|br|button|cite|code|data(list)?|del|dfn|em|i|ins|kbd|label|map|mark|meter|output|q|ruby|s|samp|small|span|strong|su[bp]|time|u|tt|var)$/i;function Qh(n,e,t,r,i){let o=n.input.compositionPendingChanges||(n.composing?n.input.compositionID:0);if(n.input.compositionPendingChanges=0,e<0){let N=n.input.lastSelectionTime>Date.now()-50?n.input.lastSelectionOrigin:null,I=Ao(n,N);if(I&&!n.state.selection.eq(I)){if(ce&&Qe&&n.input.lastKeyCode===13&&Date.now()-100me(n,vt(13,"Enter"))))return;let j=n.state.tr.setSelection(I);N=="pointer"?j.setMeta("pointer",!0):N=="key"&&j.scrollIntoView(),o&&j.setMeta("composition",o),n.dispatch(j)}return}let s=n.state.doc.resolve(e),l=s.sharedDepth(t);e=s.before(l+1),t=n.state.doc.resolve(t).after(l+1);let a=n.state.selection,c=Gh(n,e,t),u=n.state.doc,f=u.slice(c.from,c.to),d,h;n.input.lastKeyCode===8&&Date.now()-100Date.now()-225||Qe)&&i.some(N=>N.nodeType==1&&!Xh.test(N.nodeName))&&(!p||p.endA>=p.endB)&&n.someProp("handleKeyDown",N=>N(n,vt(13,"Enter")))){n.input.lastIOSEnter=0;return}if(!p)if(r&&a instanceof O&&!a.empty&&a.$head.sameParent(a.$anchor)&&!n.composing&&!(c.sel&&c.sel.anchor!=c.sel.head))p={start:a.from,endA:a.to,endB:a.to};else{if(c.sel){let N=Ca(n,n.state.doc,c.sel);if(N&&!N.eq(n.state.selection)){let I=n.state.tr.setSelection(N);o&&I.setMeta("composition",o),n.dispatch(I)}}return}n.state.selection.fromn.state.selection.from&&p.start<=n.state.selection.from+2&&n.state.selection.from>=c.from?p.start=n.state.selection.from:p.endA=n.state.selection.to-2&&n.state.selection.to<=c.to&&(p.endB+=n.state.selection.to-p.endA,p.endA=n.state.selection.to)),ge&&ut<=11&&p.endB==p.start+1&&p.endA==p.start&&p.start>c.from&&c.doc.textBetween(p.start-c.from-1,p.start-c.from+1)==" \xA0"&&(p.start--,p.endA--,p.endB--);let m=c.doc.resolveNoCache(p.start-c.from),g=c.doc.resolveNoCache(p.endB-c.from),y=u.resolve(p.start),b=m.sameParent(g)&&m.parent.inlineContent&&y.end()>=p.endA,S;if((nn&&n.input.lastIOSEnter>Date.now()-225&&(!b||i.some(N=>N.nodeName=="DIV"||N.nodeName=="P"))||!b&&m.posm.pos)&&n.someProp("handleKeyDown",N=>N(n,vt(13,"Enter")))){n.input.lastIOSEnter=0;return}if(n.state.selection.anchor>p.start&&ep(u,p.start,p.endA,m,g)&&n.someProp("handleKeyDown",N=>N(n,vt(8,"Backspace")))){Qe&&ce&&n.domObserver.suppressSelectionUpdates();return}ce&&p.endB==p.start&&(n.input.lastChromeDelete=Date.now()),Qe&&!b&&m.start()!=g.start()&&g.parentOffset==0&&m.depth==g.depth&&c.sel&&c.sel.anchor==c.sel.head&&c.sel.head==p.endA&&(p.endB-=2,g=c.doc.resolveNoCache(p.endB-c.from),setTimeout(()=>{n.someProp("handleKeyDown",function(N){return N(n,vt(13,"Enter"))})},20));let C=p.start,M=p.endA,R,z,V;if(b){if(m.pos==g.pos)ge&&ut<=11&&m.parentOffset==0&&(n.domObserver.suppressSelectionUpdates(),setTimeout(()=>Ze(n),20)),R=n.state.tr.delete(C,M),z=u.resolve(p.start).marksAcross(u.resolve(p.endA));else if(p.endA==p.endB&&(V=Zh(m.parent.content.cut(m.parentOffset,g.parentOffset),y.parent.content.cut(y.parentOffset,p.endA-y.start()))))R=n.state.tr,V.type=="add"?R.addMark(C,M,V.mark):R.removeMark(C,M,V.mark);else if(m.parent.child(m.index()).isText&&m.index()==g.index()-(g.textOffset?0:1)){let N=m.parent.textBetween(m.parentOffset,g.parentOffset);if(n.someProp("handleTextInput",I=>I(n,C,M,N)))return;R=n.state.tr.insertText(N,C,M)}}if(R||(R=n.state.tr.replace(C,M,c.doc.slice(p.start-c.from,p.endB-c.from))),c.sel){let N=Ca(n,R.doc,c.sel);N&&!(ce&&n.composing&&N.empty&&(p.start!=p.endB||n.input.lastChromeDeletee.content.size?null:Oo(n,e.resolve(t.anchor),e.resolve(t.head))}function Zh(n,e){let t=n.firstChild.marks,r=e.firstChild.marks,i=t,o=r,s,l,a;for(let u=0;uu.mark(l.addToSet(u.marks));else if(i.length==0&&o.length==1)l=o[0],s="remove",a=u=>u.mark(l.removeFromSet(u.marks));else return null;let c=[];for(let u=0;ut||lo(s,!0,!1)0&&(e||n.indexAfter(r)==n.node(r).childCount);)r--,i++,e=!1;if(t){let o=n.node(r).maybeChild(n.indexAfter(r));for(;o&&!o.isLeaf;)o=o.firstChild,i++}return i}function tp(n,e,t,r,i){let o=n.findDiffStart(e,t);if(o==null)return null;let{a:s,b:l}=n.findDiffEnd(e,t+n.size,t+e.size);if(i=="end"){let a=Math.max(0,o-Math.min(s,l));r-=s+a-o}if(s=s?o-r:0;o-=a,o&&o=l?o-r:0;o-=a,o&&o=56320&&e<=57343&&t>=55296&&t<=56319}var Mr=class{constructor(e,t){this._root=null,this.focused=!1,this.trackWrites=null,this.mounted=!1,this.markCursor=null,this.cursorWrapper=null,this.lastSelectedViewDesc=void 0,this.input=new So,this.prevDirectPlugins=[],this.pluginViews=[],this.requiresGeckoHackNode=!1,this.dragging=null,this._props=t,this.state=t.state,this.directPlugins=t.plugins||[],this.directPlugins.forEach(Na),this.dispatch=this.dispatch.bind(this),this.dom=e&&e.mount||document.createElement("div"),e&&(e.appendChild?e.appendChild(this.dom):typeof e=="function"?e(this.dom):e.mount&&(this.mounted=!0)),this.editable=Aa(this),Ea(this),this.nodeViews=Oa(this),this.docView=sa(this.state.doc,Ta(this),so(this),this.dom,this),this.domObserver=new To(this,(r,i,o,s)=>Qh(this,r,i,o,s)),this.domObserver.start(),Ch(this),this.updatePluginViews()}get composing(){return this.input.composing}get props(){if(this._props.state!=this.state){let e=this._props;this._props={};for(let t in e)this._props[t]=e[t];this._props.state=this.state}return this._props}update(e){e.handleDOMEvents!=this._props.handleDOMEvents&&wo(this);let t=this._props;this._props=e,e.plugins&&(e.plugins.forEach(Na),this.directPlugins=e.plugins),this.updateStateInner(e.state,t)}setProps(e){let t={};for(let r in this._props)t[r]=this._props[r];t.state=this.state;for(let r in e)t[r]=e[r];this.update(t)}updateState(e){this.updateStateInner(e,this._props)}updateStateInner(e,t){var r;let i=this.state,o=!1,s=!1;e.storedMarks&&this.composing&&(tc(this),s=!0),this.state=e;let l=i.plugins!=e.plugins||this._props.plugins!=t.plugins;if(l||this._props.plugins!=t.plugins||this._props.nodeViews!=t.nodeViews){let h=Oa(this);rp(h,this.nodeViews)&&(this.nodeViews=h,o=!0)}(l||t.handleDOMEvents!=this._props.handleDOMEvents)&&wo(this),this.editable=Aa(this),Ea(this);let a=so(this),c=Ta(this),u=i.plugins!=e.plugins&&!i.doc.eq(e.doc)?"reset":e.scrollToSelection>i.scrollToSelection?"to selection":"preserve",f=o||!this.docView.matchesNode(e.doc,c,a);(f||!e.selection.eq(i.selection))&&(s=!0);let d=u=="preserve"&&s&&this.dom.style.overflowAnchor==null&&Wd(this);if(s){this.domObserver.stop();let h=f&&(ge||ce)&&!this.composing&&!i.selection.empty&&!e.selection.empty&&np(i.selection,e.selection);if(f){let p=ce?this.trackWrites=this.domSelectionRange().focusNode:null;this.composing&&(this.input.compositionNode=Bh(this)),(o||!this.docView.update(e.doc,c,a,this))&&(this.docView.updateOuterDeco(c),this.docView.destroy(),this.docView=sa(e.doc,c,a,this.dom,this)),p&&!this.trackWrites&&(h=!0)}h||!(this.input.mouseDown&&this.domObserver.currentSelection.eq(this.domSelectionRange())&&ch(this))?Ze(this,h):(ja(this,e.selection),this.domObserver.setCurSelection()),this.domObserver.start()}this.updatePluginViews(i),!((r=this.dragging)===null||r===void 0)&&r.node&&!i.doc.eq(e.doc)&&this.updateDraggedNode(this.dragging,i),u=="reset"?this.dom.scrollTop=0:u=="to selection"?this.scrollToSelection():d&&jd(d)}scrollToSelection(){let e=this.domSelectionRange().focusNode;if(!(!e||!this.dom.contains(e.nodeType==1?e:e.parentNode))){if(!this.someProp("handleScrollToSelection",t=>t(this)))if(this.state.selection instanceof v){let t=this.docView.domAfterPos(this.state.selection.from);t.nodeType==1&&ea(this,t.getBoundingClientRect(),e)}else ea(this,this.coordsAtPos(this.state.selection.head,1),e)}}destroyPluginViews(){let e;for(;e=this.pluginViews.pop();)e.destroy&&e.destroy()}updatePluginViews(e){if(!e||e.plugins!=this.state.plugins||this.directPlugins!=this.prevDirectPlugins){this.prevDirectPlugins=this.directPlugins,this.destroyPluginViews();for(let t=0;t0&&this.state.doc.nodeAt(o))==r.node&&(i=o)}this.dragging=new xr(e.slice,e.move,i<0?void 0:v.create(this.state.doc,i))}someProp(e,t){let r=this._props&&this._props[e],i;if(r!=null&&(i=t?t(r):r))return i;for(let s=0;st.ownerDocument.getSelection()),this._root=t}return e||document}updateRoot(){this._root=null}posAtCoords(e){return Gd(this,e)}coordsAtPos(e,t=1){return Fa(this,e,t)}domAtPos(e,t=0){return this.docView.domFromPos(e,t)}nodeDOM(e){let t=this.docView.descAt(e);return t?t.nodeDOM:null}posAtDOM(e,t,r=-1){let i=this.docView.posFromDOM(e,t,r);if(i==null)throw new RangeError("DOM position not inside the editor");return i}endOfTextblock(e,t){return eh(this,t||this.state,e)}pasteHTML(e,t){return An(this,"",e,!1,t||new ClipboardEvent("paste"))}pasteText(e,t){return An(this,e,null,!0,t||new ClipboardEvent("paste"))}serializeForClipboard(e){return No(this,e)}destroy(){this.docView&&(vh(this),this.destroyPluginViews(),this.mounted?(this.docView.update(this.state.doc,[],so(this),this),this.dom.textContent=""):this.dom.parentNode&&this.dom.parentNode.removeChild(this.dom),this.docView.destroy(),this.docView=null,Dd())}get isDestroyed(){return this.docView==null}dispatchEvent(e){return Eh(this,e)}dispatch(e){let t=this._props.dispatchTransaction;t?t.call(this,e):this.updateState(this.state.apply(e))}domSelectionRange(){let e=this.domSelection();return e?de&&this.root.nodeType===11&&Bd(this.dom.ownerDocument)==this.dom&&Jh(this,e)||e:{focusNode:null,focusOffset:0,anchorNode:null,anchorOffset:0}}domSelection(){return this.root.getSelection()}};function Ta(n){let e=Object.create(null);return e.class="ProseMirror",e.contenteditable=String(n.editable),n.someProp("attributes",t=>{if(typeof t=="function"&&(t=t(n.state)),t)for(let r in t)r=="class"?e.class+=" "+t[r]:r=="style"?e.style=(e.style?e.style+";":"")+t[r]:!e[r]&&r!="contenteditable"&&r!="nodeName"&&(e[r]=String(t[r]))}),e.translate||(e.translate="no"),[X.node(0,n.state.doc.content.size,e)]}function Ea(n){if(n.markCursor){let e=document.createElement("img");e.className="ProseMirror-separator",e.setAttribute("mark-placeholder","true"),e.setAttribute("alt",""),n.cursorWrapper={dom:e,deco:X.widget(n.state.selection.from,e,{raw:!0,marks:n.markCursor})}}else n.cursorWrapper=null}function Aa(n){return!n.someProp("editable",e=>e(n.state)===!1)}function np(n,e){let t=Math.min(n.$anchor.sharedDepth(n.head),e.$anchor.sharedDepth(e.head));return n.$anchor.start(t)!=e.$anchor.start(t)}function Oa(n){let e=Object.create(null);function t(r){for(let i in r)Object.prototype.hasOwnProperty.call(e,i)||(e[i]=r[i])}return n.someProp("nodeViews",t),n.someProp("markViews",t),e}function rp(n,e){let t=0,r=0;for(let i in n){if(n[i]!=e[i])return!0;t++}for(let i in e)r++;return t!=r}function Na(n){if(n.spec.state||n.spec.filterTransaction||n.spec.appendTransaction)throw new RangeError("Plugins passed directly to the view must not have a state component")}var et={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},Er={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},ip=typeof navigator<"u"&&/Mac/.test(navigator.platform),op=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(q=0;q<10;q++)et[48+q]=et[96+q]=String(q);var q;for(q=1;q<=24;q++)et[q+111]="F"+q;var q;for(q=65;q<=90;q++)et[q]=String.fromCharCode(q+32),Er[q]=String.fromCharCode(q);var q;for(Tr in et)Er.hasOwnProperty(Tr)||(Er[Tr]=et[Tr]);var Tr;function lc(n){var e=ip&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||op&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Er:et)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}var sp=typeof navigator<"u"&&/Mac|iP(hone|[oa]d)/.test(navigator.platform),lp=typeof navigator<"u"&&/Win/.test(navigator.platform);function ap(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t=="Space"&&(t=" ");let r,i,o,s;for(let l=0;ln.selection.empty?!1:(e&&e(n.tr.deleteSelection().scrollIntoView()),!0);function uc(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("backward",n):t.parentOffset>0)?null:t}var zo=(n,e,t)=>{let r=uc(n,t);if(!r)return!1;let i=$o(r);if(!i){let s=r.blockRange(),l=s&&Ge(s);return l==null?!1:(e&&e(n.tr.lift(s,l).scrollIntoView()),!0)}let o=i.nodeBefore;if(xc(n,i,e,-1))return!0;if(r.parent.content.size==0&&(on(o,"end")||v.isSelectable(o)))for(let s=r.depth;;s--){let l=wn(n.doc,r.before(s),r.after(s),w.empty);if(l&&l.slice.size1)break}return o.isAtom&&i.depth==r.depth-1?(e&&e(n.tr.delete(i.pos-o.nodeSize,i.pos).scrollIntoView()),!0):!1},fc=(n,e,t)=>{let r=uc(n,t);if(!r)return!1;let i=$o(r);return i?hc(n,i,e):!1},dc=(n,e,t)=>{let r=pc(n,t);if(!r)return!1;let i=jo(r);return i?hc(n,i,e):!1};function hc(n,e,t){let r=e.nodeBefore,i=r,o=e.pos-1;for(;!i.isTextblock;o--){if(i.type.spec.isolating)return!1;let u=i.lastChild;if(!u)return!1;i=u}let s=e.nodeAfter,l=s,a=e.pos+1;for(;!l.isTextblock;a++){if(l.type.spec.isolating)return!1;let u=l.firstChild;if(!u)return!1;l=u}let c=wn(n.doc,o,a,w.empty);if(!c||c.from!=o||c instanceof le&&c.slice.size>=a-o)return!1;if(t){let u=n.tr.step(c);u.setSelection(O.create(u.doc,o)),t(u.scrollIntoView())}return!0}function on(n,e,t=!1){for(let r=n;r;r=e=="start"?r.firstChild:r.lastChild){if(r.isTextblock)return!0;if(t&&r.childCount!=1)return!1}return!1}var Ho=(n,e,t)=>{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("backward",n):r.parentOffset>0)return!1;o=$o(r)}let s=o&&o.nodeBefore;return!s||!v.isSelectable(s)?!1:(e&&e(n.tr.setSelection(v.create(n.doc,o.pos-s.nodeSize)).scrollIntoView()),!0)};function $o(n){if(!n.parent.type.spec.isolating)for(let e=n.depth-1;e>=0;e--){if(n.index(e)>0)return n.doc.resolve(n.before(e+1));if(n.node(e).type.spec.isolating)break}return null}function pc(n,e){let{$cursor:t}=n.selection;return!t||(e?!e.endOfTextblock("forward",n):t.parentOffset{let r=pc(n,t);if(!r)return!1;let i=jo(r);if(!i)return!1;let o=i.nodeAfter;if(xc(n,i,e,1))return!0;if(r.parent.content.size==0&&(on(o,"start")||v.isSelectable(o))){let s=wn(n.doc,r.before(),r.after(),w.empty);if(s&&s.slice.size{let{$head:r,empty:i}=n.selection,o=r;if(!i)return!1;if(r.parent.isTextblock){if(t?!t.endOfTextblock("forward",n):r.parentOffset=0;e--){let t=n.node(e);if(n.index(e)+1{let t=n.selection,r=t instanceof v,i;if(r){if(t.node.isTextblock||!Se(n.doc,t.from))return!1;i=t.from}else if(i=Mt(n.doc,t.from,-1),i==null)return!1;if(e){let o=n.tr.join(i);r&&o.setSelection(v.create(o.doc,i-n.doc.resolve(i).nodeBefore.nodeSize)),e(o.scrollIntoView())}return!0},gc=(n,e)=>{let t=n.selection,r;if(t instanceof v){if(t.node.isTextblock||!Se(n.doc,t.to))return!1;r=t.to}else if(r=Mt(n.doc,t.to,1),r==null)return!1;return e&&e(n.tr.join(r).scrollIntoView()),!0},yc=(n,e)=>{let{$from:t,$to:r}=n.selection,i=t.blockRange(r),o=i&&Ge(i);return o==null?!1:(e&&e(n.tr.lift(i,o).scrollIntoView()),!0)},Ko=(n,e)=>{let{$head:t,$anchor:r}=n.selection;return!t.parent.type.spec.code||!t.sameParent(r)?!1:(e&&e(n.tr.insertText(` +`).scrollIntoView()),!0)};function _o(n){for(let e=0;e{let{$head:t,$anchor:r}=n.selection;if(!t.parent.type.spec.code||!t.sameParent(r))return!1;let i=t.node(-1),o=t.indexAfter(-1),s=_o(i.contentMatchAt(o));if(!s||!i.canReplaceWith(o,o,s))return!1;if(e){let l=t.after(),a=n.tr.replaceWith(l,l,s.createAndFill());a.setSelection(A.near(a.doc.resolve(l),1)),e(a.scrollIntoView())}return!0},Jo=(n,e)=>{let t=n.selection,{$from:r,$to:i}=t;if(t instanceof fe||r.parent.inlineContent||i.parent.inlineContent)return!1;let o=_o(i.parent.contentMatchAt(i.indexAfter()));if(!o||!o.isTextblock)return!1;if(e){let s=(!r.parentOffset&&i.index(){let{$cursor:t}=n.selection;if(!t||t.parent.content.size)return!1;if(t.depth>1&&t.after()!=t.end(-1)){let o=t.before();if(xe(n.doc,o))return e&&e(n.tr.split(o).scrollIntoView()),!0}let r=t.blockRange(),i=r&&Ge(r);return i==null?!1:(e&&e(n.tr.lift(r,i).scrollIntoView()),!0)};function up(n){return(e,t)=>{let{$from:r,$to:i}=e.selection;if(e.selection instanceof v&&e.selection.node.isBlock)return!r.parentOffset||!xe(e.doc,r.pos)?!1:(t&&t(e.tr.split(r.pos).scrollIntoView()),!0);if(!r.depth)return!1;let o=[],s,l,a=!1,c=!1;for(let h=r.depth;;h--)if(r.node(h).isBlock){a=r.end(h)==r.pos+(r.depth-h),c=r.start(h)==r.pos-(r.depth-h),l=_o(r.node(h-1).contentMatchAt(r.indexAfter(h-1)));let m=n&&n(i.parent,a,r);o.unshift(m||(a&&l?{type:l}:null)),s=h;break}else{if(h==1)return!1;o.unshift(null)}let u=e.tr;(e.selection instanceof O||e.selection instanceof fe)&&u.deleteSelection();let f=u.mapping.map(r.pos),d=xe(u.doc,f,o.length,o);if(d||(o[0]=l?{type:l}:null,d=xe(u.doc,f,o.length,o)),!d)return!1;if(u.split(f,o.length,o),!a&&c&&r.node(s).type!=l){let h=u.mapping.map(r.before(s)),p=u.doc.resolve(h);l&&r.node(s-1).canReplaceWith(p.index(),p.index()+1,l)&&u.setNodeMarkup(u.mapping.map(r.before(s)),l)}return t&&t(u.scrollIntoView()),!0}}var fp=up();var bc=(n,e)=>{let{$from:t,to:r}=n.selection,i,o=t.sharedDepth(r);return o==0?!1:(i=t.before(o),e&&e(n.tr.setSelection(v.create(n.doc,i))),!0)},dp=(n,e)=>(e&&e(n.tr.setSelection(new fe(n.doc))),!0);function hp(n,e,t){let r=e.nodeBefore,i=e.nodeAfter,o=e.index();return!r||!i||!r.type.compatibleContent(i.type)?!1:!r.content.size&&e.parent.canReplace(o-1,o)?(t&&t(n.tr.delete(e.pos-r.nodeSize,e.pos).scrollIntoView()),!0):!e.parent.canReplace(o,o+1)||!(i.isTextblock||Se(n.doc,e.pos))?!1:(t&&t(n.tr.join(e.pos).scrollIntoView()),!0)}function xc(n,e,t,r){let i=e.nodeBefore,o=e.nodeAfter,s,l,a=i.type.spec.isolating||o.type.spec.isolating;if(!a&&hp(n,e,t))return!0;let c=!a&&e.parent.canReplace(e.index(),e.index()+1);if(c&&(s=(l=i.contentMatchAt(i.childCount)).findWrapping(o.type))&&l.matchType(s[0]||o.type).validEnd){if(t){let h=e.pos+o.nodeSize,p=x.empty;for(let y=s.length-1;y>=0;y--)p=x.from(s[y].create(null,p));p=x.from(i.copy(p));let m=n.tr.step(new J(e.pos-1,h,e.pos,h,new w(p,1,0),s.length,!0)),g=m.doc.resolve(h+2*s.length);g.nodeAfter&&g.nodeAfter.type==i.type&&Se(m.doc,g.pos)&&m.join(g.pos),t(m.scrollIntoView())}return!0}let u=o.type.spec.isolating||r>0&&a?null:A.findFrom(e,1),f=u&&u.$from.blockRange(u.$to),d=f&&Ge(f);if(d!=null&&d>=e.depth)return t&&t(n.tr.lift(f,d).scrollIntoView()),!0;if(c&&on(o,"start",!0)&&on(i,"end")){let h=i,p=[];for(;p.push(h),!h.isTextblock;)h=h.lastChild;let m=o,g=1;for(;!m.isTextblock;m=m.firstChild)g++;if(h.canReplace(h.childCount,h.childCount,m.content)){if(t){let y=x.empty;for(let S=p.length-1;S>=0;S--)y=x.from(p[S].copy(y));let b=n.tr.step(new J(e.pos-p.length,e.pos+o.nodeSize,e.pos+g,e.pos+o.nodeSize-g,new w(y,p.length,0),0,!0));t(b.scrollIntoView())}return!0}}return!1}function kc(n){return function(e,t){let r=e.selection,i=n<0?r.$from:r.$to,o=i.depth;for(;i.node(o).isInline;){if(!o)return!1;o--}return i.node(o).isTextblock?(t&&t(e.tr.setSelection(O.create(e.doc,n<0?i.start(o):i.end(o)))),!0):!1}}var Go=kc(-1),Yo=kc(1);function Sc(n,e=null){return function(t,r){let{$from:i,$to:o}=t.selection,s=i.blockRange(o),l=s&&Gt(s,n,e);return l?(r&&r(t.tr.wrap(s,l).scrollIntoView()),!0):!1}}function Xo(n,e=null){return function(t,r){let i=!1;for(let o=0;o{if(i)return!1;if(!(!a.isTextblock||a.hasMarkup(n,e)))if(a.type==n)i=!0;else{let u=t.doc.resolve(c),f=u.index();i=u.parent.canReplaceWith(f,f+1,n)}})}if(!i)return!1;if(r){let o=t.tr;for(let s=0;s=2&&e.$from.node(e.depth-1).type.compatibleContent(t)&&e.startIndex==0){if(e.$from.index(e.depth-1)==0)return!1;let a=s.resolve(e.start-2);o=new St(a,a,e.depth),e.endIndex=0;u--)o=x.from(t[u].type.create(t[u].attrs,o));n.step(new J(e.start-(r?2:0),e.end,e.start,e.end,new w(o,0,0),t.length,!0));let s=0;for(let u=0;us.childCount>0&&s.firstChild.type==n);return o?t?r.node(o.depth-1).type==n?yp(e,t,n,o):bp(e,t,o):!0:!1}}function yp(n,e,t,r){let i=n.tr,o=r.end,s=r.$to.end(r.depth);om;p--)h-=i.child(p).nodeSize,r.delete(h-1,h+1);let o=r.doc.resolve(t.start),s=o.nodeAfter;if(r.mapping.map(t.end)!=t.start+o.nodeAfter.nodeSize)return!1;let l=t.startIndex==0,a=t.endIndex==i.childCount,c=o.node(-1),u=o.index(-1);if(!c.canReplace(u+(l?0:1),u+1,s.content.append(a?x.empty:x.from(i))))return!1;let f=o.pos,d=f+s.nodeSize;return r.step(new J(f-(l?1:0),d+(a?1:0),f+1,d-1,new w((l?x.empty:x.from(i.copy(x.empty))).append(a?x.empty:x.from(i.copy(x.empty))),l?0:1,a?0:1),l?0:1)),e(r.scrollIntoView()),!0}function Cc(n){return function(e,t){let{$from:r,$to:i}=e.selection,o=r.blockRange(i,c=>c.childCount>0&&c.firstChild.type==n);if(!o)return!1;let s=o.startIndex;if(s==0)return!1;let l=o.parent,a=l.child(s-1);if(a.type!=n)return!1;if(t){let c=a.lastChild&&a.lastChild.type==l.type,u=x.from(c?n.create():null),f=new w(x.from(n.create(null,x.from(l.type.create(null,u)))),c?3:1,0),d=o.start,h=o.end;t(e.tr.step(new J(d-(c?3:1),h,d,h,f,1,!0)).scrollIntoView())}return!0}}var xp=Object.defineProperty,Rc=(n,e)=>{for(var t in e)xp(n,t,{get:e[t],enumerable:!0})};function Fr(n){let{state:e,transaction:t}=n,{selection:r}=t,{doc:i}=t,{storedMarks:o}=t;return{...e,apply:e.apply.bind(e),applyTransaction:e.applyTransaction.bind(e),plugins:e.plugins,schema:e.schema,reconfigure:e.reconfigure.bind(e),toJSON:e.toJSON.bind(e),get storedMarks(){return o},get selection(){return r},get doc(){return i},get tr(){return r=t.selection,i=t.doc,o=t.storedMarks,t}}}var zr=class{constructor(n){this.editor=n.editor,this.rawCommands=this.editor.extensionManager.commands,this.customState=n.state}get hasCustomState(){return!!this.customState}get state(){return this.customState||this.editor.state}get commands(){let{rawCommands:n,editor:e,state:t}=this,{view:r}=e,{tr:i}=t,o=this.buildProps(i);return Object.fromEntries(Object.entries(n).map(([s,l])=>[s,(...c)=>{let u=l(...c)(o);return!i.getMeta("preventDispatch")&&!this.hasCustomState&&r.dispatch(i),u}]))}get chain(){return()=>this.createChain()}get can(){return()=>this.createCan()}createChain(n,e=!0){let{rawCommands:t,editor:r,state:i}=this,{view:o}=r,s=[],l=!!n,a=n||i.tr,c=()=>(!l&&e&&!a.getMeta("preventDispatch")&&!this.hasCustomState&&o.dispatch(a),s.every(f=>f===!0)),u={...Object.fromEntries(Object.entries(t).map(([f,d])=>[f,(...p)=>{let m=this.buildProps(a,e),g=d(...p)(m);return s.push(g),u}])),run:c};return u}createCan(n){let{rawCommands:e,state:t}=this,r=!1,i=n||t.tr,o=this.buildProps(i,r);return{...Object.fromEntries(Object.entries(e).map(([l,a])=>[l,(...c)=>a(...c)({...o,dispatch:void 0})])),chain:()=>this.createChain(i,r)}}buildProps(n,e=!0){let{rawCommands:t,editor:r,state:i}=this,{view:o}=r,s={tr:n,editor:r,view:o,state:Fr({state:i,transaction:n}),dispatch:e?()=>{}:void 0,chain:()=>this.createChain(n,e),can:()=>this.createCan(n),get commands(){return Object.fromEntries(Object.entries(t).map(([l,a])=>[l,(...c)=>a(...c)(s)]))}};return s}},kp=class{constructor(){this.callbacks={}}on(n,e){return this.callbacks[n]||(this.callbacks[n]=[]),this.callbacks[n].push(e),this}emit(n,...e){let t=this.callbacks[n];return t&&t.forEach(r=>r.apply(this,e)),this}off(n,e){let t=this.callbacks[n];return t&&(e?this.callbacks[n]=t.filter(r=>r!==e):delete this.callbacks[n]),this}once(n,e){let t=(...r)=>{this.off(n,t),e.apply(this,r)};return this.on(n,t)}removeAllListeners(){this.callbacks={}}};function is(n,e){let t=new qt(n);return e.forEach(r=>{r.steps.forEach(i=>{t.step(i)})}),t}var Pc=n=>{let e=n.childNodes;for(let t=e.length-1;t>=0;t-=1){let r=e[t];r.nodeType===3&&r.nodeValue&&/^(\n\s\s|\n)$/.test(r.nodeValue)?n.removeChild(r):r.nodeType===1&&Pc(r)}return n};function Or(n){if(typeof window>"u")throw new Error("[tiptap error]: there is no window object available, so this function cannot be used");let e=`${n}`,t=new window.DOMParser().parseFromString(e,"text/html").body;return Pc(t)}function Ir(n,e,t){if(n instanceof G||n instanceof x)return n;t={slice:!0,parseOptions:{},...t};let r=typeof n=="object"&&n!==null,i=typeof n=="string";if(r)try{if(Array.isArray(n)&&n.length>0)return x.fromArray(n.map(l=>e.nodeFromJSON(l)));let s=e.nodeFromJSON(n);return t.errorOnInvalidContent&&s.check(),s}catch(o){if(t.errorOnInvalidContent)throw new Error("[tiptap error]: Invalid JSON content",{cause:o});return console.warn("[tiptap warn]: Invalid content.","Passed value:",n,"Error:",o),Ir("",e,t)}if(i){if(t.errorOnInvalidContent){let s=!1,l="",a=new _t({topNode:e.spec.topNode,marks:e.spec.marks,nodes:e.spec.nodes.append({__tiptap__private__unknown__catch__all__node:{content:"inline*",group:"block",parseDOM:[{tag:"*",getAttrs:c=>(s=!0,l=typeof c=="string"?c:c.outerHTML,null)}]}})});if(t.slice?Ie.fromSchema(a).parseSlice(Or(n),t.parseOptions):Ie.fromSchema(a).parse(Or(n),t.parseOptions),t.errorOnInvalidContent&&s)throw new Error("[tiptap error]: Invalid HTML content",{cause:new Error(`Invalid element found: ${l}`)})}let o=Ie.fromSchema(e);return t.slice?o.parseSlice(Or(n),t.parseOptions).content:o.parse(Or(n),t.parseOptions)}return Ir("",e,t)}function ns(n,e,t={},r={}){return Ir(n,e,{slice:!1,parseOptions:t,errorOnInvalidContent:r.errorOnInvalidContent})}function Sp(n){for(let e=0;e{t(i)&&r.push({node:i,pos:o})}),r}function wp(n,e){for(let t=n.depth;t>0;t-=1){let r=n.node(t);if(e(r))return{pos:t>0?n.before(t):0,start:n.start(t),depth:t,node:r}}}function Hr(n){return e=>wp(e.$from,n)}function T(n,e,t){return n.config[e]===void 0&&n.parent?T(n.parent,e,t):typeof n.config[e]=="function"?n.config[e].bind({...t,parent:n.parent?T(n.parent,e,t):null}):n.config[e]}function ss(n){return n.map(e=>{let t={name:e.name,options:e.options,storage:e.storage},r=T(e,"addExtensions",t);return r?[e,...ss(r())]:e}).flat(10)}function ls(n,e){let t=Ue.fromSchema(e).serializeFragment(n),i=document.implementation.createHTMLDocument().createElement("div");return i.appendChild(t),i.innerHTML}function Lc(n){return typeof n=="function"}function H(n,e=void 0,...t){return Lc(n)?e?n.bind(e)(...t):n(...t):n}function Mp(n={}){return Object.keys(n).length===0&&n.constructor===Object}function Rn(n){let e=n.filter(i=>i.type==="extension"),t=n.filter(i=>i.type==="node"),r=n.filter(i=>i.type==="mark");return{baseExtensions:e,nodeExtensions:t,markExtensions:r}}function Bc(n){let e=[],{nodeExtensions:t,markExtensions:r}=Rn(n),i=[...t,...r],o={default:null,validate:void 0,rendered:!0,renderHTML:null,parseHTML:null,keepOnSplit:!0,isRequired:!1};return n.forEach(s=>{let l={name:s.name,options:s.options,storage:s.storage,extensions:i},a=T(s,"addGlobalAttributes",l);if(!a)return;a().forEach(u=>{u.types.forEach(f=>{Object.entries(u.attributes).forEach(([d,h])=>{e.push({type:f,name:d,attribute:{...o,...h}})})})})}),i.forEach(s=>{let l={name:s.name,options:s.options,storage:s.storage},a=T(s,"addAttributes",l);if(!a)return;let c=a();Object.entries(c).forEach(([u,f])=>{let d={...o,...f};typeof d?.default=="function"&&(d.default=d.default()),d?.isRequired&&d?.default===void 0&&delete d.default,e.push({type:s.name,name:u,attribute:d})})}),e}function D(...n){return n.filter(e=>!!e).reduce((e,t)=>{let r={...e};return Object.entries(t).forEach(([i,o])=>{if(!r[i]){r[i]=o;return}if(i==="class"){let l=o?String(o).split(" "):[],a=r[i]?r[i].split(" "):[],c=l.filter(u=>!a.includes(u));r[i]=[...a,...c].join(" ")}else if(i==="style"){let l=o?o.split(";").map(u=>u.trim()).filter(Boolean):[],a=r[i]?r[i].split(";").map(u=>u.trim()).filter(Boolean):[],c=new Map;a.forEach(u=>{let[f,d]=u.split(":").map(h=>h.trim());c.set(f,d)}),l.forEach(u=>{let[f,d]=u.split(":").map(h=>h.trim());c.set(f,d)}),r[i]=Array.from(c.entries()).map(([u,f])=>`${u}: ${f}`).join("; ")}else r[i]=o}),r},{})}function Lr(n,e){return e.filter(t=>t.type===n.type.name).filter(t=>t.attribute.rendered).map(t=>t.attribute.renderHTML?t.attribute.renderHTML(n.attrs)||{}:{[t.name]:n.attrs[t.name]}).reduce((t,r)=>D(t,r),{})}function Cp(n){return typeof n!="string"?n:n.match(/^[+-]?(?:\d*\.)?\d+$/)?Number(n):n==="true"?!0:n==="false"?!1:n}function vc(n,e){return"style"in n?n:{...n,getAttrs:t=>{let r=n.getAttrs?n.getAttrs(t):n.attrs;if(r===!1)return!1;let i=e.reduce((o,s)=>{let l=s.attribute.parseHTML?s.attribute.parseHTML(t):Cp(t.getAttribute(s.name));return l==null?o:{...o,[s.name]:l}},{});return{...r,...i}}}}function Tc(n){return Object.fromEntries(Object.entries(n).filter(([e,t])=>e==="attrs"&&Mp(t)?!1:t!=null))}function vp(n,e){var t;let r=Bc(n),{nodeExtensions:i,markExtensions:o}=Rn(n),s=(t=i.find(c=>T(c,"topNode")))==null?void 0:t.name,l=Object.fromEntries(i.map(c=>{let u=r.filter(y=>y.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},d=n.reduce((y,b)=>{let S=T(b,"extendNodeSchema",f);return{...y,...S?S(c):{}}},{}),h=Tc({...d,content:H(T(c,"content",f)),marks:H(T(c,"marks",f)),group:H(T(c,"group",f)),inline:H(T(c,"inline",f)),atom:H(T(c,"atom",f)),selectable:H(T(c,"selectable",f)),draggable:H(T(c,"draggable",f)),code:H(T(c,"code",f)),whitespace:H(T(c,"whitespace",f)),linebreakReplacement:H(T(c,"linebreakReplacement",f)),defining:H(T(c,"defining",f)),isolating:H(T(c,"isolating",f)),attrs:Object.fromEntries(u.map(y=>{var b,S;return[y.name,{default:(b=y?.attribute)==null?void 0:b.default,validate:(S=y?.attribute)==null?void 0:S.validate}]}))}),p=H(T(c,"parseHTML",f));p&&(h.parseDOM=p.map(y=>vc(y,u)));let m=T(c,"renderHTML",f);m&&(h.toDOM=y=>m({node:y,HTMLAttributes:Lr(y,u)}));let g=T(c,"renderText",f);return g&&(h.toText=g),[c.name,h]})),a=Object.fromEntries(o.map(c=>{let u=r.filter(g=>g.type===c.name),f={name:c.name,options:c.options,storage:c.storage,editor:e},d=n.reduce((g,y)=>{let b=T(y,"extendMarkSchema",f);return{...g,...b?b(c):{}}},{}),h=Tc({...d,inclusive:H(T(c,"inclusive",f)),excludes:H(T(c,"excludes",f)),group:H(T(c,"group",f)),spanning:H(T(c,"spanning",f)),code:H(T(c,"code",f)),attrs:Object.fromEntries(u.map(g=>{var y,b;return[g.name,{default:(y=g?.attribute)==null?void 0:y.default,validate:(b=g?.attribute)==null?void 0:b.validate}]}))}),p=H(T(c,"parseHTML",f));p&&(h.parseDOM=p.map(g=>vc(g,u)));let m=T(c,"renderHTML",f);return m&&(h.toDOM=g=>m({mark:g,HTMLAttributes:Lr(g,u)})),[c.name,h]}));return new _t({topNode:s,nodes:l,marks:a})}function Tp(n){let e=n.filter((t,r)=>n.indexOf(t)!==r);return Array.from(new Set(e))}function as(n){return n.sort((t,r)=>{let i=T(t,"priority")||100,o=T(r,"priority")||100;return i>o?-1:ir.name));return t.length&&console.warn(`[tiptap warn]: Duplicate extension names found: [${t.map(r=>`'${r}'`).join(", ")}]. This can lead to issues.`),e}function zc(n,e,t){let{from:r,to:i}=e,{blockSeparator:o=` -`,textSerializers:s={}}=t||{},l="";return n.nodesBetween(r,i,(a,c,u,f)=>{var d;a.isBlock&&c>r&&(l+=o);let h=s?.[a.type.name];if(h)return u&&(l+=h({node:a,pos:c,parent:u,index:f,range:e})),!1;a.isText&&(l+=(d=a?.text)==null?void 0:d.slice(Math.max(r,c)-c,i-c))}),l}function vp(n,e){let t={from:0,to:n.content.size};return Fc(n,t,e)}function zc(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function tt(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}function Hc(n,e){let t=tt(e,n.schema),{from:r,to:i,empty:o}=n.selection,s=[];o?(n.storedMarks&&s.push(...n.storedMarks),s.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,a=>{s.push(...a.marks)});let l=s.find(a=>a.type.name===t.name);return l?{...l.attrs}:{}}function _(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function Tp(n,e){let t=_(e,n.schema),{from:r,to:i}=n.selection,o=[];n.doc.nodesBetween(r,i,l=>{o.push(l)});let s=o.reverse().find(l=>l.type.name===t.name);return s?{...s.attrs}:{}}function $r(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function cs(n,e){let t=$r(typeof e=="string"?e:e.name,n.schema);return t==="node"?Tp(n,e):t==="mark"?Hc(n,e):{}}function Ep(n,e=JSON.stringify){let t={};return n.filter(r=>{let i=e(r);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function Ap(n){let e=Ep(n);return e.length===1?e:e.filter((t,r)=>!e.filter((o,s)=>s!==r).some(o=>t.oldRange.from>=o.oldRange.from&&t.oldRange.to<=o.oldRange.to&&t.newRange.from>=o.newRange.from&&t.newRange.to<=o.newRange.to))}function us(n){let{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,o)=>{let s=[];if(i.ranges.length)i.forEach((l,a)=>{s.push({from:l,to:a})});else{let{from:l,to:a}=t[o];if(l===void 0||a===void 0)return;s.push({from:l,to:a})}s.forEach(({from:l,to:a})=>{let c=e.slice(o).map(l,-1),u=e.slice(o).map(a),f=e.invert().map(c,-1),d=e.invert().map(u);r.push({oldRange:{from:f,to:d},newRange:{from:c,to:u}})})}),Ap(r)}function fs(n){return Object.prototype.toString.call(n)==="[object RegExp]"}function Br(n,e,t={strict:!0}){let r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:fs(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function $c(n,e,t={}){return n.find(r=>r.type===e&&Br(Object.fromEntries(Object.keys(t).map(i=>[i,r.attrs[i]])),t))}function Tc(n,e,t={}){return!!$c(n,e,t)}function ds(n,e,t){var r;if(!n||!e)return;let i=n.parent.childAfter(n.parentOffset);if((!i.node||!i.node.marks.some(u=>u.type===e))&&(i=n.parent.childBefore(n.parentOffset)),!i.node||!i.node.marks.some(u=>u.type===e)||(t=t||((r=i.node.marks[0])==null?void 0:r.attrs),!$c([...i.node.marks],e,t)))return;let s=i.index,l=n.start()+i.offset,a=s+1,c=l+i.node.nodeSize;for(;s>0&&Tc([...n.parent.child(s-1).marks],e,t);)s-=1,l-=n.parent.child(s).nodeSize;for(;a{let o=t.resolve(n),s=ds(o,i.type);s&&r.push({mark:i,...s})}):t.nodesBetween(n,e,(i,o)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}var Vc=(n,e,t,r=20)=>{let i=n.doc.resolve(t),o=r,s=null;for(;o>0&&s===null;){let l=i.node(o);l?.type.name===e?s=l:o-=1}return[s,o]};function Zo(n,e){return e.nodes[n]||e.marks[n]||null}function Pr(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{let i=n.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}var Op=(n,e=500)=>{let t="",r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,l)=>{var a,c;let u=((c=(a=i.type.spec).toText)==null?void 0:c.call(a,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";t+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,r-o))}),t};function rs(n,e,t={}){let{empty:r,ranges:i}=n.selection,o=e?tt(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Br(f.attrs,t,{strict:!1}));let s=0,l=[];if(i.forEach(({$from:f,$to:d})=>{let h=f.pos,p=d.pos;n.doc.nodesBetween(h,p,(m,g)=>{if(!m.isText&&!m.marks.length)return;let y=Math.max(h,g),b=Math.min(p,g+m.nodeSize),S=b-y;s+=S,l.push(...m.marks.map(C=>({mark:C,from:y,to:b})))})}),s===0)return!1;let a=l.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Br(f.mark.attrs,t,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),c=l.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,d)=>f+d.to-d.from,0);return(a>0?a+c:a)>=s}function Fe(n,e,t={}){let{from:r,to:i,empty:o}=n.selection,s=e?_(e,n.schema):null,l=[];n.doc.nodesBetween(r,i,(f,d)=>{if(f.isText)return;let h=Math.max(r,d),p=Math.min(i,d+f.nodeSize);l.push({node:f,from:h,to:p})});let a=i-r,c=l.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>Br(f.node.attrs,t,{strict:!1}));return o?!!c.length:c.reduce((f,d)=>f+d.to-d.from,0)>=a}function Np(n,e,t={}){if(!e)return Fe(n,null,t)||rs(n,null,t);let r=$r(e,n.schema);return r==="node"?Fe(n,e,t):r==="mark"?rs(n,e,t):!1}var Wc=(n,e)=>{let{$from:t,$to:r,$anchor:i}=n.selection;if(e){let o=Hr(l=>l.type.name===e)(n.selection);if(!o)return!1;let s=n.doc.resolve(o.pos+1);return i.pos+1===s.end()}return!(r.parentOffset{let{$from:e,$to:t}=n.selection;return!(e.parentOffset>0||e.pos!==t.pos)};function Ec(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function Ac(n,e){let{nodeExtensions:t}=Rn(e),r=t.find(s=>s.name===n);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=H(T(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Pn(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var r;if(t){if(n.type.name==="hardBreak")return!0;if(n.isText)return/^\s*$/m.test((r=n.text)!=null?r:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let i=!0;return n.content.forEach(o=>{i!==!1&&(Pn(o,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function Kc(n){return n instanceof v}function _c(n){return n instanceof O}function Pt(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function Uc(n,e=null){if(!e)return null;let t=A.atStart(n),r=A.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;let i=t.from,o=r.to;return e==="all"?O.create(n,Pt(0,i,o),Pt(n.content.size,i,o)):O.create(n,Pt(e,i,o),Pt(e,i,o))}function Dp(n,e,t){let r=n.steps.length-1;if(r{s===0&&(s=u)}),n.setSelection(A.near(n.doc.resolve(s),t))}var Wr=class{constructor(n){this.find=n.find,this.handler=n.handler}},Rp=(n,e)=>{if(fs(e))return e.exec(n);let t=e(n);if(!t)return null;let r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function Nr(n){var e;let{editor:t,from:r,to:i,text:o,rules:s,plugin:l}=n,{view:a}=t;if(a.composing)return!1;let c=a.state.doc.resolve(r);if(c.parent.type.spec.code||(e=c.nodeBefore||c.nodeAfter)!=null&&e.marks.find(d=>d.type.spec.code))return!1;let u=!1,f=Op(c)+o;return s.forEach(d=>{if(u)return;let h=Rp(f,d.find);if(!h)return;let p=a.state.tr,m=Fr({state:a.state,transaction:p}),g={from:r-(h[0].length-o.length),to:i},{commands:y,chain:b,can:S}=new zr({editor:t,state:m});d.handler({state:m,range:g,match:h,commands:y,chain:b,can:S})===null||!p.steps.length||(p.setMeta(l,{transform:p,from:r,to:i,text:o}),a.dispatch(p),u=!0)}),u}function Pp(n){let{editor:e,rules:t}=n,r=new E({state:{init(){return null},apply(i,o,s){let l=i.getMeta(r);if(l)return l;let a=i.getMeta("applyInputRules");return!!a&&setTimeout(()=>{let{text:u}=a;typeof u=="string"?u=u:u=ls(x.from(u),s.schema);let{from:f}=a,d=f+u.length;Nr({editor:e,from:f,to:d,text:u,rules:t,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,l){return Nr({editor:e,from:o,to:s,text:l,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{let{$cursor:o}=i.state.selection;o&&Nr({editor:e,from:o.pos,to:o.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;let{$cursor:s}=i.state.selection;return s?Nr({editor:e,from:s.pos,to:s.pos,text:` -`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function Ip(n){return Object.prototype.toString.call(n).slice(8,-1)}function Dr(n){return Ip(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function Jc(n,e){let t={...n};return Dr(n)&&Dr(e)&&Object.keys(e).forEach(r=>{Dr(e[r])&&Dr(n[r])?t[r]=Jc(n[r],e[r]):t[r]=e[r]}),t}var hs=class{constructor(n={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...n},this.name=this.config.name}get options(){return{...H(T(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...H(T(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(n={}){let e=this.extend({...this.config,addOptions:()=>Jc(this.options,n)});return e.name=this.name,e.parent=this.parent,e}extend(n={}){let e=new this.constructor({...this.config,...n});return e.parent=this,this.child=e,e.name="name"in n?n.name:e.parent.name,e}},te=class qc extends hs{constructor(){super(...arguments),this.type="mark"}static create(e={}){return new qc(e)}static handleExit({editor:e,mark:t}){let{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){let s=i.marks();if(!!!s.find(c=>c?.type.name===t.name))return!1;let a=s.find(c=>c?.type.name===t.name);return a&&r.removeStoredMark(a),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){return super.extend(e)}};function Lp(n){return typeof n=="number"}var Bp=class{constructor(n){this.find=n.find,this.handler=n.handler}},Fp=(n,e,t)=>{if(fs(e))return[...n.matchAll(e)];let r=e(n,t);return r?r.map(i=>{let o=[i.text];return o.index=i.index,o.input=n,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function zp(n){let{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=n,{commands:a,chain:c,can:u}=new zr({editor:e,state:t}),f=[];return t.doc.nodesBetween(r,i,(h,p)=>{if(!h.isTextblock||h.type.spec.code)return;let m=Math.max(r,p),g=Math.min(i,p+h.content.size),y=h.textBetween(m-p,g-p,void 0,"\uFFFC");Fp(y,o.find,s).forEach(S=>{if(S.index===void 0)return;let C=m+S.index+1,M=C+S[0].length,R={from:t.tr.mapping.map(C),to:t.tr.mapping.map(M)},z=o.handler({state:t,range:R,match:S,commands:a,chain:c,can:u,pasteEvent:s,dropEvent:l});f.push(z)})}),f.every(h=>h!==null)}var Rr=null,Hp=n=>{var e;let t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)==null||e.setData("text/html",n),t};function $p(n){let{editor:e,rules:t}=n,r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}let a=({state:u,from:f,to:d,rule:h,pasteEvt:p})=>{let m=u.tr,g=Fr({state:u,transaction:m});if(!(!zp({editor:e,state:g,from:Math.max(f-1,0),to:d.b-1,rule:h,pasteEvent:p,dropEvent:l})||!m.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return t.map(u=>new E({view(f){let d=p=>{var m;r=(m=f.dom.parentElement)!=null&&m.contains(p.target)?f.dom.parentElement:null,r&&(Rr=e)},h=()=>{Rr&&(Rr=null)};return window.addEventListener("dragstart",d),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",d),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(f,d)=>{if(o=r===f.dom.parentElement,l=d,!o){let h=Rr;h&&setTimeout(()=>{let p=h.state.selection;p&&h.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(f,d)=>{var h;let p=(h=d.clipboardData)==null?void 0:h.getData("text/html");return s=d,i=!!p?.includes("data-pm-slice"),!1}}},appendTransaction:(f,d,h)=>{let p=f[0],m=p.getMeta("uiEvent")==="paste"&&!i,g=p.getMeta("uiEvent")==="drop"&&!o,y=p.getMeta("applyPasteRules"),b=!!y;if(!m&&!g&&!b)return;if(b){let{text:M}=y;typeof M=="string"?M=M:M=ls(x.from(M),h.schema);let{from:R}=y,z=R+M.length,V=Hp(M);return a({rule:u,state:h,from:R,to:{b:z},pasteEvt:V})}let S=d.doc.content.findDiffStart(h.doc.content),C=d.doc.content.findDiffEnd(h.doc.content);if(!(!Lp(S)||!C||S===C.b))return a({rule:u,state:h,from:S,to:C,pasteEvt:s})}}))}var jr=class{constructor(n,e){this.splittableMarks=[],this.editor=e,this.extensions=Bc(n),this.schema=Mp(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((n,e)=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Zo(e.name,this.schema)},r=T(e,"addCommands",t);return r?{...n,...r()}:n},{})}get plugins(){let{editor:n}=this,e=as([...this.extensions].reverse()),t=[],r=[],i=e.map(o=>{let s={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:n,type:Zo(o.name,this.schema)},l=[],a=T(o,"addKeyboardShortcuts",s),c={};if(o.type==="mark"&&T(o,"exitable",s)&&(c.ArrowRight=()=>te.handleExit({editor:n,mark:o})),a){let p=Object.fromEntries(Object.entries(a()).map(([m,g])=>[m,()=>g({editor:n})]));c={...c,...p}}let u=lc(c);l.push(u);let f=T(o,"addInputRules",s);Ec(o,n.options.enableInputRules)&&f&&t.push(...f());let d=T(o,"addPasteRules",s);Ec(o,n.options.enablePasteRules)&&d&&r.push(...d());let h=T(o,"addProseMirrorPlugins",s);if(h){let p=h();l.push(...p)}return l}).flat();return[Pp({editor:n,rules:t}),...$p({editor:n,rules:r}),...i]}get attributes(){return Lc(this.extensions)}get nodeViews(){let{editor:n}=this,{nodeExtensions:e}=Rn(this.extensions);return Object.fromEntries(e.filter(t=>!!T(t,"addNodeView")).map(t=>{let r=this.attributes.filter(l=>l.type===t.name),i={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:_(t.name,this.schema)},o=T(t,"addNodeView",i);if(!o)return[];let s=(l,a,c,u,f)=>{let d=Lr(l,r);return o()({node:l,view:a,getPos:c,decorations:u,innerDecorations:f,editor:n,extension:t,HTMLAttributes:d})};return[t.name,s]}))}get markViews(){let{editor:n}=this,{markExtensions:e}=Rn(this.extensions);return Object.fromEntries(e.filter(t=>!!T(t,"addMarkView")).map(t=>{let r=this.attributes.filter(l=>l.type===t.name),i={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:tt(t.name,this.schema)},o=T(t,"addMarkView",i);if(!o)return[];let s=(l,a,c)=>{let u=Lr(l,r);return o()({mark:l,view:a,inline:c,editor:n,extension:t,HTMLAttributes:u})};return[t.name,s]}))}setupExtensions(){let n=this.extensions;this.editor.extensionStorage=Object.fromEntries(n.map(e=>[e.name,e.storage])),n.forEach(e=>{var t;let r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Zo(e.name,this.schema)};e.type==="mark"&&((t=H(T(e,"keepOnSplit",r)))==null||t)&&this.splittableMarks.push(e.name);let i=T(e,"onBeforeCreate",r),o=T(e,"onCreate",r),s=T(e,"onUpdate",r),l=T(e,"onSelectionUpdate",r),a=T(e,"onTransaction",r),c=T(e,"onFocus",r),u=T(e,"onBlur",r),f=T(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),l&&this.editor.on("selectionUpdate",l),a&&this.editor.on("transaction",a),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),f&&this.editor.on("destroy",f)})}};jr.resolve=Bc;jr.sort=as;jr.flatten=ss;var Vp={};Dc(Vp,{ClipboardTextSerializer:()=>Yc,Commands:()=>Zc,Delete:()=>eu,Drop:()=>tu,Editable:()=>nu,FocusEvents:()=>iu,Keymap:()=>ou,Paste:()=>su,Tabindex:()=>lu,focusEventsPluginKey:()=>ru});var F=class Gc extends hs{constructor(){super(...arguments),this.type="extension"}static create(e={}){return new Gc(e)}configure(e){return super.configure(e)}extend(e){return super.extend(e)}},Yc=F.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new E({key:new P("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),l=Math.max(...o.map(u=>u.$to.pos)),a=zc(t);return Fc(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),Xc={};Dc(Xc,{blur:()=>Wp,clearContent:()=>jp,clearNodes:()=>Kp,command:()=>_p,createParagraphNear:()=>Up,cut:()=>Jp,deleteCurrentNode:()=>qp,deleteNode:()=>Gp,deleteRange:()=>Yp,deleteSelection:()=>Xp,enter:()=>Qp,exitCode:()=>Zp,extendMarkRange:()=>em,first:()=>tm,focus:()=>rm,forEach:()=>im,insertContent:()=>om,insertContentAt:()=>lm,joinBackward:()=>um,joinDown:()=>cm,joinForward:()=>fm,joinItemBackward:()=>dm,joinItemForward:()=>hm,joinTextblockBackward:()=>pm,joinTextblockForward:()=>mm,joinUp:()=>am,keyboardShortcut:()=>ym,lift:()=>bm,liftEmptyBlock:()=>xm,liftListItem:()=>km,newlineInCode:()=>Sm,resetAttributes:()=>wm,scrollIntoView:()=>Mm,selectAll:()=>Cm,selectNodeBackward:()=>vm,selectNodeForward:()=>Tm,selectParentNode:()=>Em,selectTextblockEnd:()=>Am,selectTextblockStart:()=>Om,setContent:()=>Nm,setMark:()=>Rm,setMeta:()=>Pm,setNode:()=>Im,setNodeSelection:()=>Lm,setTextSelection:()=>Bm,sinkListItem:()=>Fm,splitBlock:()=>zm,splitListItem:()=>Hm,toggleList:()=>$m,toggleMark:()=>Vm,toggleNode:()=>Wm,toggleWrap:()=>jm,undoInputRule:()=>Km,unsetAllMarks:()=>_m,unsetMark:()=>Um,updateAttributes:()=>Jm,wrapIn:()=>qm,wrapInList:()=>Gm});var Wp=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())==null||t.removeAllRanges())}),!0),jp=(n=!0)=>({commands:e})=>e.setContent("",{emitUpdate:n}),Kp=()=>({state:n,tr:e,dispatch:t})=>{let{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:o,$to:s})=>{n.doc.nodesBetween(o.pos,s.pos,(l,a)=>{if(l.type.isText)return;let{doc:c,mapping:u}=e,f=c.resolve(u.map(a)),d=c.resolve(u.map(a+l.nodeSize)),h=f.blockRange(d);if(!h)return;let p=Ge(h);if(l.type.isTextblock){let{defaultType:m}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(h.start,m)}(p||p===0)&&e.lift(h,p)})}),!0},_p=n=>e=>n(e),Up=()=>({state:n,dispatch:e})=>Jo(n,e),Jp=(n,e)=>({editor:t,tr:r})=>{let{state:i}=t,o=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);let s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new O(r.doc.resolve(s-1))),!0},qp=()=>({tr:n,dispatch:e})=>{let{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;let i=n.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){let l=i.before(o),a=i.after(o);n.delete(l,a).scrollIntoView()}return!0}return!1},Gp=n=>({tr:e,state:t,dispatch:r})=>{let i=_(n,t.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){let a=o.before(s),c=o.after(s);e.delete(a,c).scrollIntoView()}return!0}return!1},Yp=n=>({tr:e,dispatch:t})=>{let{from:r,to:i}=n;return t&&e.delete(r,i),!0},Xp=()=>({state:n,dispatch:e})=>Ar(n,e),Qp=()=>({commands:n})=>n.keyboardShortcut("Enter"),Zp=()=>({state:n,dispatch:e})=>Uo(n,e),em=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=tt(n,r.schema),{doc:s,selection:l}=t,{$from:a,from:c,to:u}=l;if(i){let f=ds(a,o,e);if(f&&f.from<=c&&f.to>=u){let d=O.create(s,f.from,f.to);t.setSelection(d)}}return!0},tm=n=>e=>{let t=typeof n=="function"?n(e):n;for(let r=0;r({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};let s=()=>{(ps()||nm())&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(o&&n===null&&!_c(t.state.selection))return s(),!0;let l=Uc(i.doc,n)||t.state.selection,a=t.state.selection.eq(l);return o&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},im=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),om=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),sm=n=>!("type"in n),lm=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){t={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let l,{selection:a}=o.state;try{l=Ir(e,o.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions},errorOnInvalidContent:(s=t.errorOnInvalidContent)!=null?s:o.options.enableContentCheck})}catch(m){return o.emit("contentError",{editor:o,error:m,disableCollaboration:()=>{"collaboration"in o.storage&&typeof o.storage.collaboration=="object"&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:c,to:u}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},f=!0,d=!0;if((sm(l)?l:[l]).forEach(m=>{m.check(),f=f?m.isText&&m.marks.length===0:!1,d=d?m.isBlock:!1}),c===u&&d){let{parent:m}=r.doc.resolve(c);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(c-=1,u+=1)}let p;if(f){if(Array.isArray(e))p=e.map(m=>m.text||"").join("");else if(e instanceof x){let m="";e.forEach(g=>{g.text&&(m+=g.text)}),p=m}else typeof e=="object"&&e&&e.text?p=e.text:p=e;r.insertText(p,c,u)}else{p=l;let m=a.$from.parentOffset===0,g=a.$from.node().isText||a.$from.node().isTextblock;m&&g&&(c=Math.max(0,c-1)),r.replaceWith(c,u,p)}t.updateSelection&&Dp(r,r.steps.length-1,-1),t.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:p}),t.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:p})}return!0},am=()=>({state:n,dispatch:e})=>pc(n,e),cm=()=>({state:n,dispatch:e})=>mc(n,e),um=()=>({state:n,dispatch:e})=>zo(n,e),fm=()=>({state:n,dispatch:e})=>Vo(n,e),dm=()=>({state:n,dispatch:e,tr:t})=>{try{let r=Mt(n.doc,n.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},hm=()=>({state:n,dispatch:e,tr:t})=>{try{let r=Mt(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},pm=()=>({state:n,dispatch:e})=>uc(n,e),mm=()=>({state:n,dispatch:e})=>fc(n,e);function Qc(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function gm(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t==="Space"&&(t=" ");let r,i,o,s;for(let l=0;l({editor:e,view:t,tr:r,dispatch:i})=>{let o=gm(n).split(/-(?!$)/),s=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{t.someProp("handleKeyDown",c=>c(t,l))});return a?.steps.forEach(c=>{let u=c.map(r.mapping);u&&i&&r.maybeStep(u)}),!0},bm=(n,e={})=>({state:t,dispatch:r})=>{let i=_(n,t.schema);return Fe(t,i,e)?gc(t,r):!1},xm=()=>({state:n,dispatch:e})=>qo(n,e),km=n=>({state:e,dispatch:t})=>{let r=_(n,e.schema);return wc(r)(e,t)},Sm=()=>({state:n,dispatch:e})=>Ko(n,e);function Oc(n,e){let t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}var wm=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,s=null,l=$r(typeof n=="string"?n:n.name,r.schema);return l?(l==="node"&&(o=_(n,r.schema)),l==="mark"&&(s=tt(n,r.schema)),i&&t.selection.ranges.forEach(a=>{r.doc.nodesBetween(a.$from.pos,a.$to.pos,(c,u)=>{o&&o===c.type&&t.setNodeMarkup(u,void 0,Oc(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(f=>{s===f.type&&t.addMark(u,u+c.nodeSize,s.create(Oc(f.attrs,e)))})})}),!0):!1},Mm=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),Cm=()=>({tr:n,dispatch:e})=>{if(e){let t=new fe(n.doc);n.setSelection(t)}return!0},vm=()=>({state:n,dispatch:e})=>Ho(n,e),Tm=()=>({state:n,dispatch:e})=>Wo(n,e),Em=()=>({state:n,dispatch:e})=>yc(n,e),Am=()=>({state:n,dispatch:e})=>Yo(n,e),Om=()=>({state:n,dispatch:e})=>Go(n,e),Nm=(n,{errorOnInvalidContent:e,emitUpdate:t=!0,parseOptions:r={}}={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{let{doc:a}=o;if(r.preserveWhitespace!=="full"){let c=ns(n,i.schema,r,{errorOnInvalidContent:e??i.options.enableContentCheck});return s&&o.replaceWith(0,a.content.size,c).setMeta("preventUpdate",!t),!0}return s&&o.setMeta("preventUpdate",!t),l.insertContentAt({from:0,to:a.content.size},n,{parseOptions:r,errorOnInvalidContent:e??i.options.enableContentCheck})};function Dm(n,e,t){var r;let{selection:i}=e,o=null;if(_c(i)&&(o=i.$cursor),o){let l=(r=n.storedMarks)!=null?r:o.marks();return!!t.isInSet(l)||!l.some(a=>a.type.excludes(t))}let{ranges:s}=i;return s.some(({$from:l,$to:a})=>{let c=l.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(l.pos,a.pos,(u,f,d)=>{if(c)return!1;if(u.isInline){let h=!d||d.type.allowsMarkType(t),p=!!t.isInSet(u.marks)||!u.marks.some(m=>m.type.excludes(t));c=h&&p}return!c}),c})}var Rm=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let{selection:o}=t,{empty:s,ranges:l}=o,a=tt(n,r.schema);if(i)if(s){let c=Hc(r,a);t.addStoredMark(a.create({...c,...e}))}else l.forEach(c=>{let u=c.$from.pos,f=c.$to.pos;r.doc.nodesBetween(u,f,(d,h)=>{let p=Math.max(h,u),m=Math.min(h+d.nodeSize,f);d.marks.find(y=>y.type===a)?d.marks.forEach(y=>{a===y.type&&t.addMark(p,m,a.create({...y.attrs,...e}))}):t.addMark(p,m,a.create(e))})});return Dm(r,t,a)},Pm=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),Im=(n,e={})=>({state:t,dispatch:r,chain:i})=>{let o=_(n,t.schema),s;return t.selection.$anchor.sameParent(t.selection.$head)&&(s=t.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:l})=>Xo(o,{...s,...e})(t)?!0:l.clearNodes()).command(({state:l})=>Xo(o,{...s,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Lm=n=>({tr:e,dispatch:t})=>{if(t){let{doc:r}=e,i=Pt(n,0,r.content.size),o=v.create(r,i);e.setSelection(o)}return!0},Bm=n=>({tr:e,dispatch:t})=>{if(t){let{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,s=O.atStart(r).from,l=O.atEnd(r).to,a=Pt(i,s,l),c=Pt(o,s,l),u=O.create(r,a,c);e.setSelection(u)}return!0},Fm=n=>({state:e,dispatch:t})=>{let r=_(n,e.schema);return Mc(r)(e,t)};function Nc(n,e){let t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){let r=t.filter(i=>e?.includes(i.type.name));n.tr.ensureMarks(r)}}var zm=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{let{selection:o,doc:s}=e,{$from:l,$to:a}=o,c=i.extensionManager.attributes,u=Pr(c,l.node().type.name,l.node().attrs);if(o instanceof v&&o.node.isBlock)return!l.parentOffset||!xe(s,l.pos)?!1:(r&&(n&&Nc(t,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;let f=a.parentOffset===a.parent.content.size,d=l.depth===0?void 0:xp(l.node(-1).contentMatchAt(l.indexAfter(-1))),h=f&&d?[{type:d,attrs:u}]:void 0,p=xe(e.doc,e.mapping.map(l.pos),1,h);if(!h&&!p&&xe(e.doc,e.mapping.map(l.pos),1,d?[{type:d}]:void 0)&&(p=!0,h=d?[{type:d,attrs:u}]:void 0),r){if(p&&(o instanceof O&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,h),d&&!f&&!l.parentOffset&&l.parent.type!==d)){let m=e.mapping.map(l.before()),g=e.doc.resolve(m);l.node(-1).canReplaceWith(g.index(),g.index()+1,d)&&e.setNodeMarkup(e.mapping.map(l.before()),d)}n&&Nc(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return p},Hm=(n,e={})=>({tr:t,state:r,dispatch:i,editor:o})=>{var s;let l=_(n,r.schema),{$from:a,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(c))return!1;let f=a.node(-1);if(f.type!==l)return!1;let d=o.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(i){let y=x.empty,b=a.index(-1)?1:a.index(-2)?2:3;for(let V=a.depth-b;V>=a.depth-3;V-=1)y=x.from(a.node(V).copy(y));let S=a.indexAfter(-1){if(z>-1)return!1;V.isTextblock&&V.content.size===0&&(z=N+1)}),z>-1&&t.setSelection(O.near(t.doc.resolve(z))),t.scrollIntoView()}return!0}let h=c.pos===a.end()?f.contentMatchAt(0).defaultType:null,p={...Pr(d,f.type.name,f.attrs),...e},m={...Pr(d,a.node().type.name,a.node().attrs),...e};t.delete(a.pos,c.pos);let g=h?[{type:l,attrs:p},{type:h,attrs:m}]:[{type:l,attrs:p}];if(!xe(t.doc,a.pos,2))return!1;if(i){let{selection:y,storedMarks:b}=r,{splittableMarks:S}=o.extensionManager,C=b||y.$to.parentOffset&&y.$from.marks();if(t.split(a.pos,2,g).scrollIntoView(),!C||!i)return!0;let M=C.filter(R=>S.includes(R.type.name));t.ensureMarks(M)}return!0},es=(n,e)=>{let t=Hr(s=>s.type===e)(n.selection);if(!t)return!0;let r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;let i=n.doc.nodeAt(r);return t.node.type===i?.type&&Se(n.doc,t.pos)&&n.join(t.pos),!0},ts=(n,e)=>{let t=Hr(s=>s.type===e)(n.selection);if(!t)return!0;let r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;let i=n.doc.nodeAt(r);return t.node.type===i?.type&&Se(n.doc,r)&&n.join(r),!0},$m=(n,e,t,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:a,commands:c,can:u})=>{let{extensions:f,splittableMarks:d}=i.extensionManager,h=_(n,s.schema),p=_(e,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:b}=m,S=y.blockRange(b),C=g||m.$to.parentOffset&&m.$from.marks();if(!S)return!1;let M=Hr(R=>Ac(R.type.name,f))(m);if(S.depth>=1&&M&&S.depth-M.depth<=1){if(M.node.type===h)return c.liftListItem(p);if(Ac(M.node.type.name,f)&&h.validContent(M.node.content)&&l)return a().command(()=>(o.setNodeMarkup(M.pos,h),!0)).command(()=>es(o,h)).command(()=>ts(o,h)).run()}return!t||!C||!l?a().command(()=>u().wrapInList(h,r)?!0:c.clearNodes()).wrapInList(h,r).command(()=>es(o,h)).command(()=>ts(o,h)).run():a().command(()=>{let R=u().wrapInList(h,r),z=C.filter(V=>d.includes(V.type.name));return o.ensureMarks(z),R?!0:c.clearNodes()}).wrapInList(h,r).command(()=>es(o,h)).command(()=>ts(o,h)).run()},Vm=(n,e={},t={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=t,s=tt(n,r.schema);return rs(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},Wm=(n,e,t={})=>({state:r,commands:i})=>{let o=_(n,r.schema),s=_(e,r.schema),l=Fe(r,o,t),a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),l?i.setNode(s,a):i.setNode(o,{...a,...t})},jm=(n,e={})=>({state:t,commands:r})=>{let i=_(n,t.schema);return Fe(t,i,e)?r.lift(i):r.wrapIn(i,e)},Km=()=>({state:n,dispatch:e})=>{let t=n.plugins;for(let r=0;r=0;a-=1)s.step(l.steps[a].invert(l.docs[a]));if(o.text){let a=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,n.schema.text(o.text,a))}else s.delete(o.from,o.to)}return!0}}return!1},_m=()=>({tr:n,dispatch:e})=>{let{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(o=>{n.removeMark(o.$from.pos,o.$to.pos)}),!0},Um=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=e,{selection:l}=t,a=tt(n,r.schema),{$from:c,empty:u,ranges:f}=l;if(!i)return!0;if(u&&s){let{from:d,to:h}=l,p=(o=c.marks().find(g=>g.type===a))==null?void 0:o.attrs,m=ds(c,a,p);m&&(d=m.from,h=m.to),t.removeMark(d,h,a)}else f.forEach(d=>{t.removeMark(d.$from.pos,d.$to.pos,a)});return t.removeStoredMark(a),!0},Jm=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,s=null,l=$r(typeof n=="string"?n:n.name,r.schema);return l?(l==="node"&&(o=_(n,r.schema)),l==="mark"&&(s=tt(n,r.schema)),i&&t.selection.ranges.forEach(a=>{let c=a.$from.pos,u=a.$to.pos,f,d,h,p;t.selection.empty?r.doc.nodesBetween(c,u,(m,g)=>{o&&o===m.type&&(h=Math.max(g,c),p=Math.min(g+m.nodeSize,u),f=g,d=m)}):r.doc.nodesBetween(c,u,(m,g)=>{g=c&&g<=u&&(o&&o===m.type&&t.setNodeMarkup(g,void 0,{...m.attrs,...e}),s&&m.marks.length&&m.marks.forEach(y=>{if(s===y.type){let b=Math.max(g,c),S=Math.min(g+m.nodeSize,u);t.addMark(b,S,s.create({...y.attrs,...e}))}}))}),d&&(f!==void 0&&t.setNodeMarkup(f,void 0,{...d.attrs,...e}),s&&d.marks.length&&d.marks.forEach(m=>{s===m.type&&t.addMark(h,p,s.create({...m.attrs,...e}))}))}),!0):!1},qm=(n,e={})=>({state:t,dispatch:r})=>{let i=_(n,t.schema);return kc(i,e)(t,r)},Gm=(n,e={})=>({state:t,dispatch:r})=>{let i=_(n,t.schema);return Sc(i,e)(t,r)},Zc=F.create({name:"commands",addCommands(){return{...Xc}}}),eu=F.create({name:"delete",onUpdate({transaction:n,appendedTransactions:e}){var t,r,i;let o=()=>{var s,l,a,c;if((c=(a=(l=(s=this.editor.options.coreExtensionOptions)==null?void 0:s.delete)==null?void 0:l.filterTransaction)==null?void 0:a.call(l,n))!=null?c:n.getMeta("y-sync$"))return;let u=is(n.before,[n,...e]);us(u).forEach(h=>{u.mapping.mapResult(h.oldRange.from).deletedAfter&&u.mapping.mapResult(h.oldRange.to).deletedBefore&&u.before.nodesBetween(h.oldRange.from,h.oldRange.to,(p,m)=>{let g=m+p.nodeSize-2,y=h.oldRange.from<=m&&g<=h.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:m,to:g,newFrom:u.mapping.map(m),newTo:u.mapping.map(g),deletedRange:h.oldRange,newRange:h.newRange,partial:!y,editor:this.editor,transaction:n,combinedTransform:u})})});let d=u.mapping;u.steps.forEach((h,p)=>{var m,g;if(h instanceof qe){let y=d.slice(p).map(h.from,-1),b=d.slice(p).map(h.to),S=d.invert().map(y,-1),C=d.invert().map(b),M=(m=u.doc.nodeAt(y-1))==null?void 0:m.marks.some(z=>z.eq(h.mark)),R=(g=u.doc.nodeAt(b))==null?void 0:g.marks.some(z=>z.eq(h.mark));this.editor.emit("delete",{type:"mark",mark:h.mark,from:h.from,to:h.to,deletedRange:{from:S,to:C},newRange:{from:y,to:b},partial:!!(R||M),editor:this.editor,transaction:n,combinedTransform:u})}})};(i=(r=(t=this.editor.options.coreExtensionOptions)==null?void 0:t.delete)==null?void 0:r.async)==null||i?setTimeout(o,0):o()}}),tu=F.create({name:"drop",addProseMirrorPlugins(){return[new E({key:new P("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),nu=F.create({name:"editable",addProseMirrorPlugins(){return[new E({key:new P("editable"),props:{editable:()=>this.editor.options.editable}})]}}),ru=new P("focusEvents"),iu=F.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:n}=this;return[new E({key:ru,props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;let r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;let r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),ou=F.create({name:"keymap",addKeyboardShortcuts(){let n=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{let{selection:a,doc:c}=l,{empty:u,$anchor:f}=a,{pos:d,parent:h}=f,p=f.parent.isTextblock&&d>0?l.doc.resolve(d-1):f,m=p.parent.type.spec.isolating,g=f.pos-f.parentOffset,y=m&&p.parent.childCount===1?g===f.pos:A.atStart(c).from===d;return!u||!h.type.isTextblock||h.textContent.length||!y||y&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return ps()||Qc()?o:i},addProseMirrorPlugins(){return[new E({key:new P("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(m=>m.getMeta("composition")))return;let r=n.some(m=>m.docChanged)&&!e.doc.eq(t.doc),i=n.some(m=>m.getMeta("preventClearDocument"));if(!r||i)return;let{empty:o,from:s,to:l}=e.selection,a=A.atStart(e.doc).from,c=A.atEnd(e.doc).to;if(o||!(s===a&&l===c)||!Pn(t.doc))return;let d=t.tr,h=Fr({state:t,transaction:d}),{commands:p}=new zr({editor:this.editor,state:h});if(p.clearNodes(),!!d.steps.length)return d}})]}}),su=F.create({name:"paste",addProseMirrorPlugins(){return[new E({key:new P("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),lu=F.create({name:"tabindex",addProseMirrorPlugins(){return[new E({key:new P("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Ym=class sn{constructor(e,t,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=t,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:t,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;let e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new sn(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new sn(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new sn(e,this.editor)}get children(){let e=[];return this.node.content.forEach((t,r)=>{let i=t.isBlock&&!t.isTextblock,o=t.isAtom&&!t.isText,s=this.pos+r+(o?0:1),l=this.resolvedPos.doc.resolve(s);if(!i&&l.depth<=this.depth)return;let a=new sn(l,this.editor,i,i?t:null);i&&(a.actualDepth=this.depth+1),e.push(new sn(l,this.editor,i,i?t:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(t).length>0){let o=i.node.attrs,s=Object.keys(t);for(let l=0;l{r&&i.length>0||(s.node.type.name===e&&o.every(a=>t[a]===s.node.attrs[a])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,t,r))))}),i}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},Xm=`.ProseMirror { +`,textSerializers:s={}}=t||{},l="";return n.nodesBetween(r,i,(a,c,u,f)=>{var d;a.isBlock&&c>r&&(l+=o);let h=s?.[a.type.name];if(h)return u&&(l+=h({node:a,pos:c,parent:u,index:f,range:e})),!1;a.isText&&(l+=(d=a?.text)==null?void 0:d.slice(Math.max(r,c)-c,i-c))}),l}function Ep(n,e){let t={from:0,to:n.content.size};return zc(n,t,e)}function Hc(n){return Object.fromEntries(Object.entries(n.nodes).filter(([,e])=>e.spec.toText).map(([e,t])=>[e,t.spec.toText]))}function tt(n,e){if(typeof n=="string"){if(!e.marks[n])throw Error(`There is no mark type named '${n}'. Maybe you forgot to add the extension?`);return e.marks[n]}return n}function $c(n,e){let t=tt(e,n.schema),{from:r,to:i,empty:o}=n.selection,s=[];o?(n.storedMarks&&s.push(...n.storedMarks),s.push(...n.selection.$head.marks())):n.doc.nodesBetween(r,i,a=>{s.push(...a.marks)});let l=s.find(a=>a.type.name===t.name);return l?{...l.attrs}:{}}function _(n,e){if(typeof n=="string"){if(!e.nodes[n])throw Error(`There is no node type named '${n}'. Maybe you forgot to add the extension?`);return e.nodes[n]}return n}function Ap(n,e){let t=_(e,n.schema),{from:r,to:i}=n.selection,o=[];n.doc.nodesBetween(r,i,l=>{o.push(l)});let s=o.reverse().find(l=>l.type.name===t.name);return s?{...s.attrs}:{}}function $r(n,e){return e.nodes[n]?"node":e.marks[n]?"mark":null}function cs(n,e){let t=$r(typeof e=="string"?e:e.name,n.schema);return t==="node"?Ap(n,e):t==="mark"?$c(n,e):{}}function Op(n,e=JSON.stringify){let t={};return n.filter(r=>{let i=e(r);return Object.prototype.hasOwnProperty.call(t,i)?!1:t[i]=!0})}function Np(n){let e=Op(n);return e.length===1?e:e.filter((t,r)=>!e.filter((o,s)=>s!==r).some(o=>t.oldRange.from>=o.oldRange.from&&t.oldRange.to<=o.oldRange.to&&t.newRange.from>=o.newRange.from&&t.newRange.to<=o.newRange.to))}function us(n){let{mapping:e,steps:t}=n,r=[];return e.maps.forEach((i,o)=>{let s=[];if(i.ranges.length)i.forEach((l,a)=>{s.push({from:l,to:a})});else{let{from:l,to:a}=t[o];if(l===void 0||a===void 0)return;s.push({from:l,to:a})}s.forEach(({from:l,to:a})=>{let c=e.slice(o).map(l,-1),u=e.slice(o).map(a),f=e.invert().map(c,-1),d=e.invert().map(u);r.push({oldRange:{from:f,to:d},newRange:{from:c,to:u}})})}),Np(r)}function fs(n){return Object.prototype.toString.call(n)==="[object RegExp]"}function Br(n,e,t={strict:!0}){let r=Object.keys(e);return r.length?r.every(i=>t.strict?e[i]===n[i]:fs(e[i])?e[i].test(n[i]):e[i]===n[i]):!0}function Vc(n,e,t={}){return n.find(r=>r.type===e&&Br(Object.fromEntries(Object.keys(t).map(i=>[i,r.attrs[i]])),t))}function Ec(n,e,t={}){return!!Vc(n,e,t)}function ds(n,e,t){var r;if(!n||!e)return;let i=n.parent.childAfter(n.parentOffset);if((!i.node||!i.node.marks.some(u=>u.type===e))&&(i=n.parent.childBefore(n.parentOffset)),!i.node||!i.node.marks.some(u=>u.type===e)||(t=t||((r=i.node.marks[0])==null?void 0:r.attrs),!Vc([...i.node.marks],e,t)))return;let s=i.index,l=n.start()+i.offset,a=s+1,c=l+i.node.nodeSize;for(;s>0&&Ec([...n.parent.child(s-1).marks],e,t);)s-=1,l-=n.parent.child(s).nodeSize;for(;a{let o=t.resolve(n),s=ds(o,i.type);s&&r.push({mark:i,...s})}):t.nodesBetween(n,e,(i,o)=>{!i||i?.nodeSize===void 0||r.push(...i.marks.map(s=>({from:o,to:o+i.nodeSize,mark:s})))}),r}var Wc=(n,e,t,r=20)=>{let i=n.doc.resolve(t),o=r,s=null;for(;o>0&&s===null;){let l=i.node(o);l?.type.name===e?s=l:o-=1}return[s,o]};function Zo(n,e){return e.nodes[n]||e.marks[n]||null}function Pr(n,e,t){return Object.fromEntries(Object.entries(t).filter(([r])=>{let i=n.find(o=>o.type===e&&o.name===r);return i?i.attribute.keepOnSplit:!1}))}var Dp=(n,e=500)=>{let t="",r=n.parentOffset;return n.parent.nodesBetween(Math.max(0,r-e),r,(i,o,s,l)=>{var a,c;let u=((c=(a=i.type.spec).toText)==null?void 0:c.call(a,{node:i,pos:o,parent:s,index:l}))||i.textContent||"%leaf%";t+=i.isAtom&&!i.isText?u:u.slice(0,Math.max(0,r-o))}),t};function rs(n,e,t={}){let{empty:r,ranges:i}=n.selection,o=e?tt(e,n.schema):null;if(r)return!!(n.storedMarks||n.selection.$from.marks()).filter(f=>o?o.name===f.type.name:!0).find(f=>Br(f.attrs,t,{strict:!1}));let s=0,l=[];if(i.forEach(({$from:f,$to:d})=>{let h=f.pos,p=d.pos;n.doc.nodesBetween(h,p,(m,g)=>{if(!m.isText&&!m.marks.length)return;let y=Math.max(h,g),b=Math.min(p,g+m.nodeSize),S=b-y;s+=S,l.push(...m.marks.map(C=>({mark:C,from:y,to:b})))})}),s===0)return!1;let a=l.filter(f=>o?o.name===f.mark.type.name:!0).filter(f=>Br(f.mark.attrs,t,{strict:!1})).reduce((f,d)=>f+d.to-d.from,0),c=l.filter(f=>o?f.mark.type!==o&&f.mark.type.excludes(o):!0).reduce((f,d)=>f+d.to-d.from,0);return(a>0?a+c:a)>=s}function Fe(n,e,t={}){let{from:r,to:i,empty:o}=n.selection,s=e?_(e,n.schema):null,l=[];n.doc.nodesBetween(r,i,(f,d)=>{if(f.isText)return;let h=Math.max(r,d),p=Math.min(i,d+f.nodeSize);l.push({node:f,from:h,to:p})});let a=i-r,c=l.filter(f=>s?s.name===f.node.type.name:!0).filter(f=>Br(f.node.attrs,t,{strict:!1}));return o?!!c.length:c.reduce((f,d)=>f+d.to-d.from,0)>=a}function Rp(n,e,t={}){if(!e)return Fe(n,null,t)||rs(n,null,t);let r=$r(e,n.schema);return r==="node"?Fe(n,e,t):r==="mark"?rs(n,e,t):!1}var jc=(n,e)=>{let{$from:t,$to:r,$anchor:i}=n.selection;if(e){let o=Hr(l=>l.type.name===e)(n.selection);if(!o)return!1;let s=n.doc.resolve(o.pos+1);return i.pos+1===s.end()}return!(r.parentOffset{let{$from:e,$to:t}=n.selection;return!(e.parentOffset>0||e.pos!==t.pos)};function Ac(n,e){return Array.isArray(e)?e.some(t=>(typeof t=="string"?t:t.name)===n.name):e}function Oc(n,e){let{nodeExtensions:t}=Rn(e),r=t.find(s=>s.name===n);if(!r)return!1;let i={name:r.name,options:r.options,storage:r.storage},o=H(T(r,"group",i));return typeof o!="string"?!1:o.split(" ").includes("list")}function Pn(n,{checkChildren:e=!0,ignoreWhitespace:t=!1}={}){var r;if(t){if(n.type.name==="hardBreak")return!0;if(n.isText)return/^\s*$/m.test((r=n.text)!=null?r:"")}if(n.isText)return!n.text;if(n.isAtom||n.isLeaf)return!1;if(n.content.childCount===0)return!0;if(e){let i=!0;return n.content.forEach(o=>{i!==!1&&(Pn(o,{ignoreWhitespace:t,checkChildren:e})||(i=!1))}),i}return!1}function _c(n){return n instanceof v}function Uc(n){return n instanceof O}function Pt(n=0,e=0,t=0){return Math.min(Math.max(n,e),t)}function Jc(n,e=null){if(!e)return null;let t=A.atStart(n),r=A.atEnd(n);if(e==="start"||e===!0)return t;if(e==="end")return r;let i=t.from,o=r.to;return e==="all"?O.create(n,Pt(0,i,o),Pt(n.content.size,i,o)):O.create(n,Pt(e,i,o),Pt(e,i,o))}function Pp(n,e,t){let r=n.steps.length-1;if(r{s===0&&(s=u)}),n.setSelection(A.near(n.doc.resolve(s),t))}var Wr=class{constructor(n){this.find=n.find,this.handler=n.handler}},Ip=(n,e)=>{if(fs(e))return e.exec(n);let t=e(n);if(!t)return null;let r=[t.text];return r.index=t.index,r.input=n,r.data=t.data,t.replaceWith&&(t.text.includes(t.replaceWith)||console.warn('[tiptap warn]: "inputRuleMatch.replaceWith" must be part of "inputRuleMatch.text".'),r.push(t.replaceWith)),r};function Nr(n){var e;let{editor:t,from:r,to:i,text:o,rules:s,plugin:l}=n,{view:a}=t;if(a.composing)return!1;let c=a.state.doc.resolve(r);if(c.parent.type.spec.code||(e=c.nodeBefore||c.nodeAfter)!=null&&e.marks.find(d=>d.type.spec.code))return!1;let u=!1,f=Dp(c)+o;return s.forEach(d=>{if(u)return;let h=Ip(f,d.find);if(!h)return;let p=a.state.tr,m=Fr({state:a.state,transaction:p}),g={from:r-(h[0].length-o.length),to:i},{commands:y,chain:b,can:S}=new zr({editor:t,state:m});d.handler({state:m,range:g,match:h,commands:y,chain:b,can:S})===null||!p.steps.length||(p.setMeta(l,{transform:p,from:r,to:i,text:o}),a.dispatch(p),u=!0)}),u}function Lp(n){let{editor:e,rules:t}=n,r=new E({state:{init(){return null},apply(i,o,s){let l=i.getMeta(r);if(l)return l;let a=i.getMeta("applyInputRules");return!!a&&setTimeout(()=>{let{text:u}=a;typeof u=="string"?u=u:u=ls(x.from(u),s.schema);let{from:f}=a,d=f+u.length;Nr({editor:e,from:f,to:d,text:u,rules:t,plugin:r})}),i.selectionSet||i.docChanged?null:o}},props:{handleTextInput(i,o,s,l){return Nr({editor:e,from:o,to:s,text:l,rules:t,plugin:r})},handleDOMEvents:{compositionend:i=>(setTimeout(()=>{let{$cursor:o}=i.state.selection;o&&Nr({editor:e,from:o.pos,to:o.pos,text:"",rules:t,plugin:r})}),!1)},handleKeyDown(i,o){if(o.key!=="Enter")return!1;let{$cursor:s}=i.state.selection;return s?Nr({editor:e,from:s.pos,to:s.pos,text:` +`,rules:t,plugin:r}):!1}},isInputRules:!0});return r}function Bp(n){return Object.prototype.toString.call(n).slice(8,-1)}function Dr(n){return Bp(n)!=="Object"?!1:n.constructor===Object&&Object.getPrototypeOf(n)===Object.prototype}function qc(n,e){let t={...n};return Dr(n)&&Dr(e)&&Object.keys(e).forEach(r=>{Dr(e[r])&&Dr(n[r])?t[r]=qc(n[r],e[r]):t[r]=e[r]}),t}var hs=class{constructor(n={}){this.type="extendable",this.parent=null,this.child=null,this.name="",this.config={name:this.name},this.config={...this.config,...n},this.name=this.config.name}get options(){return{...H(T(this,"addOptions",{name:this.name}))||{}}}get storage(){return{...H(T(this,"addStorage",{name:this.name,options:this.options}))||{}}}configure(n={}){let e=this.extend({...this.config,addOptions:()=>qc(this.options,n)});return e.name=this.name,e.parent=this.parent,e}extend(n={}){let e=new this.constructor({...this.config,...n});return e.parent=this,this.child=e,e.name="name"in n?n.name:e.parent.name,e}},te=class Gc extends hs{constructor(){super(...arguments),this.type="mark"}static create(e={}){return new Gc(e)}static handleExit({editor:e,mark:t}){let{tr:r}=e.state,i=e.state.selection.$from;if(i.pos===i.end()){let s=i.marks();if(!!!s.find(c=>c?.type.name===t.name))return!1;let a=s.find(c=>c?.type.name===t.name);return a&&r.removeStoredMark(a),r.insertText(" ",i.pos),e.view.dispatch(r),!0}return!1}configure(e){return super.configure(e)}extend(e){return super.extend(e)}};function Fp(n){return typeof n=="number"}var zp=class{constructor(n){this.find=n.find,this.handler=n.handler}},Hp=(n,e,t)=>{if(fs(e))return[...n.matchAll(e)];let r=e(n,t);return r?r.map(i=>{let o=[i.text];return o.index=i.index,o.input=n,o.data=i.data,i.replaceWith&&(i.text.includes(i.replaceWith)||console.warn('[tiptap warn]: "pasteRuleMatch.replaceWith" must be part of "pasteRuleMatch.text".'),o.push(i.replaceWith)),o}):[]};function $p(n){let{editor:e,state:t,from:r,to:i,rule:o,pasteEvent:s,dropEvent:l}=n,{commands:a,chain:c,can:u}=new zr({editor:e,state:t}),f=[];return t.doc.nodesBetween(r,i,(h,p)=>{if(!h.isTextblock||h.type.spec.code)return;let m=Math.max(r,p),g=Math.min(i,p+h.content.size),y=h.textBetween(m-p,g-p,void 0,"\uFFFC");Hp(y,o.find,s).forEach(S=>{if(S.index===void 0)return;let C=m+S.index+1,M=C+S[0].length,R={from:t.tr.mapping.map(C),to:t.tr.mapping.map(M)},z=o.handler({state:t,range:R,match:S,commands:a,chain:c,can:u,pasteEvent:s,dropEvent:l});f.push(z)})}),f.every(h=>h!==null)}var Rr=null,Vp=n=>{var e;let t=new ClipboardEvent("paste",{clipboardData:new DataTransfer});return(e=t.clipboardData)==null||e.setData("text/html",n),t};function Wp(n){let{editor:e,rules:t}=n,r=null,i=!1,o=!1,s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,l;try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}let a=({state:u,from:f,to:d,rule:h,pasteEvt:p})=>{let m=u.tr,g=Fr({state:u,transaction:m});if(!(!$p({editor:e,state:g,from:Math.max(f-1,0),to:d.b-1,rule:h,pasteEvent:p,dropEvent:l})||!m.steps.length)){try{l=typeof DragEvent<"u"?new DragEvent("drop"):null}catch{l=null}return s=typeof ClipboardEvent<"u"?new ClipboardEvent("paste"):null,m}};return t.map(u=>new E({view(f){let d=p=>{var m;r=(m=f.dom.parentElement)!=null&&m.contains(p.target)?f.dom.parentElement:null,r&&(Rr=e)},h=()=>{Rr&&(Rr=null)};return window.addEventListener("dragstart",d),window.addEventListener("dragend",h),{destroy(){window.removeEventListener("dragstart",d),window.removeEventListener("dragend",h)}}},props:{handleDOMEvents:{drop:(f,d)=>{if(o=r===f.dom.parentElement,l=d,!o){let h=Rr;h&&setTimeout(()=>{let p=h.state.selection;p&&h.commands.deleteRange({from:p.from,to:p.to})},10)}return!1},paste:(f,d)=>{var h;let p=(h=d.clipboardData)==null?void 0:h.getData("text/html");return s=d,i=!!p?.includes("data-pm-slice"),!1}}},appendTransaction:(f,d,h)=>{let p=f[0],m=p.getMeta("uiEvent")==="paste"&&!i,g=p.getMeta("uiEvent")==="drop"&&!o,y=p.getMeta("applyPasteRules"),b=!!y;if(!m&&!g&&!b)return;if(b){let{text:M}=y;typeof M=="string"?M=M:M=ls(x.from(M),h.schema);let{from:R}=y,z=R+M.length,V=Vp(M);return a({rule:u,state:h,from:R,to:{b:z},pasteEvt:V})}let S=d.doc.content.findDiffStart(h.doc.content),C=d.doc.content.findDiffEnd(h.doc.content);if(!(!Fp(S)||!C||S===C.b))return a({rule:u,state:h,from:S,to:C,pasteEvt:s})}}))}var jr=class{constructor(n,e){this.splittableMarks=[],this.editor=e,this.extensions=Fc(n),this.schema=vp(this.extensions,e),this.setupExtensions()}get commands(){return this.extensions.reduce((n,e)=>{let t={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Zo(e.name,this.schema)},r=T(e,"addCommands",t);return r?{...n,...r()}:n},{})}get plugins(){let{editor:n}=this,e=as([...this.extensions].reverse()),t=[],r=[],i=e.map(o=>{let s={name:o.name,options:o.options,storage:this.editor.extensionStorage[o.name],editor:n,type:Zo(o.name,this.schema)},l=[],a=T(o,"addKeyboardShortcuts",s),c={};if(o.type==="mark"&&T(o,"exitable",s)&&(c.ArrowRight=()=>te.handleExit({editor:n,mark:o})),a){let p=Object.fromEntries(Object.entries(a()).map(([m,g])=>[m,()=>g({editor:n})]));c={...c,...p}}let u=ac(c);l.push(u);let f=T(o,"addInputRules",s);Ac(o,n.options.enableInputRules)&&f&&t.push(...f());let d=T(o,"addPasteRules",s);Ac(o,n.options.enablePasteRules)&&d&&r.push(...d());let h=T(o,"addProseMirrorPlugins",s);if(h){let p=h();l.push(...p)}return l}).flat();return[Lp({editor:n,rules:t}),...Wp({editor:n,rules:r}),...i]}get attributes(){return Bc(this.extensions)}get nodeViews(){let{editor:n}=this,{nodeExtensions:e}=Rn(this.extensions);return Object.fromEntries(e.filter(t=>!!T(t,"addNodeView")).map(t=>{let r=this.attributes.filter(l=>l.type===t.name),i={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:_(t.name,this.schema)},o=T(t,"addNodeView",i);if(!o)return[];let s=(l,a,c,u,f)=>{let d=Lr(l,r);return o()({node:l,view:a,getPos:c,decorations:u,innerDecorations:f,editor:n,extension:t,HTMLAttributes:d})};return[t.name,s]}))}get markViews(){let{editor:n}=this,{markExtensions:e}=Rn(this.extensions);return Object.fromEntries(e.filter(t=>!!T(t,"addMarkView")).map(t=>{let r=this.attributes.filter(l=>l.type===t.name),i={name:t.name,options:t.options,storage:this.editor.extensionStorage[t.name],editor:n,type:tt(t.name,this.schema)},o=T(t,"addMarkView",i);if(!o)return[];let s=(l,a,c)=>{let u=Lr(l,r);return o()({mark:l,view:a,inline:c,editor:n,extension:t,HTMLAttributes:u})};return[t.name,s]}))}setupExtensions(){let n=this.extensions;this.editor.extensionStorage=Object.fromEntries(n.map(e=>[e.name,e.storage])),n.forEach(e=>{var t;let r={name:e.name,options:e.options,storage:this.editor.extensionStorage[e.name],editor:this.editor,type:Zo(e.name,this.schema)};e.type==="mark"&&((t=H(T(e,"keepOnSplit",r)))==null||t)&&this.splittableMarks.push(e.name);let i=T(e,"onBeforeCreate",r),o=T(e,"onCreate",r),s=T(e,"onUpdate",r),l=T(e,"onSelectionUpdate",r),a=T(e,"onTransaction",r),c=T(e,"onFocus",r),u=T(e,"onBlur",r),f=T(e,"onDestroy",r);i&&this.editor.on("beforeCreate",i),o&&this.editor.on("create",o),s&&this.editor.on("update",s),l&&this.editor.on("selectionUpdate",l),a&&this.editor.on("transaction",a),c&&this.editor.on("focus",c),u&&this.editor.on("blur",u),f&&this.editor.on("destroy",f)})}};jr.resolve=Fc;jr.sort=as;jr.flatten=ss;var jp={};Rc(jp,{ClipboardTextSerializer:()=>Xc,Commands:()=>eu,Delete:()=>tu,Drop:()=>nu,Editable:()=>ru,FocusEvents:()=>ou,Keymap:()=>su,Paste:()=>lu,Tabindex:()=>au,focusEventsPluginKey:()=>iu});var F=class Yc extends hs{constructor(){super(...arguments),this.type="extension"}static create(e={}){return new Yc(e)}configure(e){return super.configure(e)}extend(e){return super.extend(e)}},Xc=F.create({name:"clipboardTextSerializer",addOptions(){return{blockSeparator:void 0}},addProseMirrorPlugins(){return[new E({key:new P("clipboardTextSerializer"),props:{clipboardTextSerializer:()=>{let{editor:n}=this,{state:e,schema:t}=n,{doc:r,selection:i}=e,{ranges:o}=i,s=Math.min(...o.map(u=>u.$from.pos)),l=Math.max(...o.map(u=>u.$to.pos)),a=Hc(t);return zc(r,{from:s,to:l},{...this.options.blockSeparator!==void 0?{blockSeparator:this.options.blockSeparator}:{},textSerializers:a})}}})]}}),Qc={};Rc(Qc,{blur:()=>Kp,clearContent:()=>_p,clearNodes:()=>Up,command:()=>Jp,createParagraphNear:()=>qp,cut:()=>Gp,deleteCurrentNode:()=>Yp,deleteNode:()=>Xp,deleteRange:()=>Qp,deleteSelection:()=>Zp,enter:()=>em,exitCode:()=>tm,extendMarkRange:()=>nm,first:()=>rm,focus:()=>om,forEach:()=>sm,insertContent:()=>lm,insertContentAt:()=>cm,joinBackward:()=>dm,joinDown:()=>fm,joinForward:()=>hm,joinItemBackward:()=>pm,joinItemForward:()=>mm,joinTextblockBackward:()=>gm,joinTextblockForward:()=>ym,joinUp:()=>um,keyboardShortcut:()=>xm,lift:()=>km,liftEmptyBlock:()=>Sm,liftListItem:()=>wm,newlineInCode:()=>Mm,resetAttributes:()=>Cm,scrollIntoView:()=>vm,selectAll:()=>Tm,selectNodeBackward:()=>Em,selectNodeForward:()=>Am,selectParentNode:()=>Om,selectTextblockEnd:()=>Nm,selectTextblockStart:()=>Dm,setContent:()=>Rm,setMark:()=>Im,setMeta:()=>Lm,setNode:()=>Bm,setNodeSelection:()=>Fm,setTextSelection:()=>zm,sinkListItem:()=>Hm,splitBlock:()=>$m,splitListItem:()=>Vm,toggleList:()=>Wm,toggleMark:()=>jm,toggleNode:()=>Km,toggleWrap:()=>_m,undoInputRule:()=>Um,unsetAllMarks:()=>Jm,unsetMark:()=>qm,updateAttributes:()=>Gm,wrapIn:()=>Ym,wrapInList:()=>Xm});var Kp=()=>({editor:n,view:e})=>(requestAnimationFrame(()=>{var t;n.isDestroyed||(e.dom.blur(),(t=window?.getSelection())==null||t.removeAllRanges())}),!0),_p=(n=!0)=>({commands:e})=>e.setContent("",{emitUpdate:n}),Up=()=>({state:n,tr:e,dispatch:t})=>{let{selection:r}=e,{ranges:i}=r;return t&&i.forEach(({$from:o,$to:s})=>{n.doc.nodesBetween(o.pos,s.pos,(l,a)=>{if(l.type.isText)return;let{doc:c,mapping:u}=e,f=c.resolve(u.map(a)),d=c.resolve(u.map(a+l.nodeSize)),h=f.blockRange(d);if(!h)return;let p=Ge(h);if(l.type.isTextblock){let{defaultType:m}=f.parent.contentMatchAt(f.index());e.setNodeMarkup(h.start,m)}(p||p===0)&&e.lift(h,p)})}),!0},Jp=n=>e=>n(e),qp=()=>({state:n,dispatch:e})=>Jo(n,e),Gp=(n,e)=>({editor:t,tr:r})=>{let{state:i}=t,o=i.doc.slice(n.from,n.to);r.deleteRange(n.from,n.to);let s=r.mapping.map(e);return r.insert(s,o.content),r.setSelection(new O(r.doc.resolve(s-1))),!0},Yp=()=>({tr:n,dispatch:e})=>{let{selection:t}=n,r=t.$anchor.node();if(r.content.size>0)return!1;let i=n.selection.$anchor;for(let o=i.depth;o>0;o-=1)if(i.node(o).type===r.type){if(e){let l=i.before(o),a=i.after(o);n.delete(l,a).scrollIntoView()}return!0}return!1},Xp=n=>({tr:e,state:t,dispatch:r})=>{let i=_(n,t.schema),o=e.selection.$anchor;for(let s=o.depth;s>0;s-=1)if(o.node(s).type===i){if(r){let a=o.before(s),c=o.after(s);e.delete(a,c).scrollIntoView()}return!0}return!1},Qp=n=>({tr:e,dispatch:t})=>{let{from:r,to:i}=n;return t&&e.delete(r,i),!0},Zp=()=>({state:n,dispatch:e})=>Ar(n,e),em=()=>({commands:n})=>n.keyboardShortcut("Enter"),tm=()=>({state:n,dispatch:e})=>Uo(n,e),nm=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=tt(n,r.schema),{doc:s,selection:l}=t,{$from:a,from:c,to:u}=l;if(i){let f=ds(a,o,e);if(f&&f.from<=c&&f.to>=u){let d=O.create(s,f.from,f.to);t.setSelection(d)}}return!0},rm=n=>e=>{let t=typeof n=="function"?n(e):n;for(let r=0;r({editor:t,view:r,tr:i,dispatch:o})=>{e={scrollIntoView:!0,...e};let s=()=>{(ps()||im())&&r.dom.focus(),requestAnimationFrame(()=>{t.isDestroyed||(r.focus(),e?.scrollIntoView&&t.commands.scrollIntoView())})};if(r.hasFocus()&&n===null||n===!1)return!0;if(o&&n===null&&!Uc(t.state.selection))return s(),!0;let l=Jc(i.doc,n)||t.state.selection,a=t.state.selection.eq(l);return o&&(a||i.setSelection(l),a&&i.storedMarks&&i.setStoredMarks(i.storedMarks),s()),!0},sm=(n,e)=>t=>n.every((r,i)=>e(r,{...t,index:i})),lm=(n,e)=>({tr:t,commands:r})=>r.insertContentAt({from:t.selection.from,to:t.selection.to},n,e),am=n=>!("type"in n),cm=(n,e,t)=>({tr:r,dispatch:i,editor:o})=>{var s;if(i){t={parseOptions:o.options.parseOptions,updateSelection:!0,applyInputRules:!1,applyPasteRules:!1,...t};let l,{selection:a}=o.state;try{l=Ir(e,o.schema,{parseOptions:{preserveWhitespace:"full",...t.parseOptions},errorOnInvalidContent:(s=t.errorOnInvalidContent)!=null?s:o.options.enableContentCheck})}catch(m){return o.emit("contentError",{editor:o,error:m,disableCollaboration:()=>{"collaboration"in o.storage&&typeof o.storage.collaboration=="object"&&o.storage.collaboration&&(o.storage.collaboration.isDisabled=!0)}}),!1}let{from:c,to:u}=typeof n=="number"?{from:n,to:n}:{from:n.from,to:n.to},f=!0,d=!0;if((am(l)?l:[l]).forEach(m=>{m.check(),f=f?m.isText&&m.marks.length===0:!1,d=d?m.isBlock:!1}),c===u&&d){let{parent:m}=r.doc.resolve(c);m.isTextblock&&!m.type.spec.code&&!m.childCount&&(c-=1,u+=1)}let p;if(f){if(Array.isArray(e))p=e.map(m=>m.text||"").join("");else if(e instanceof x){let m="";e.forEach(g=>{g.text&&(m+=g.text)}),p=m}else typeof e=="object"&&e&&e.text?p=e.text:p=e;r.insertText(p,c,u)}else{p=l;let m=a.$from.parentOffset===0,g=a.$from.node().isText||a.$from.node().isTextblock;m&&g&&(c=Math.max(0,c-1)),r.replaceWith(c,u,p)}t.updateSelection&&Pp(r,r.steps.length-1,-1),t.applyInputRules&&r.setMeta("applyInputRules",{from:c,text:p}),t.applyPasteRules&&r.setMeta("applyPasteRules",{from:c,text:p})}return!0},um=()=>({state:n,dispatch:e})=>mc(n,e),fm=()=>({state:n,dispatch:e})=>gc(n,e),dm=()=>({state:n,dispatch:e})=>zo(n,e),hm=()=>({state:n,dispatch:e})=>Vo(n,e),pm=()=>({state:n,dispatch:e,tr:t})=>{try{let r=Mt(n.doc,n.selection.$from.pos,-1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},mm=()=>({state:n,dispatch:e,tr:t})=>{try{let r=Mt(n.doc,n.selection.$from.pos,1);return r==null?!1:(t.join(r,2),e&&e(t),!0)}catch{return!1}},gm=()=>({state:n,dispatch:e})=>fc(n,e),ym=()=>({state:n,dispatch:e})=>dc(n,e);function Zc(){return typeof navigator<"u"?/Mac/.test(navigator.platform):!1}function bm(n){let e=n.split(/-(?!$)/),t=e[e.length-1];t==="Space"&&(t=" ");let r,i,o,s;for(let l=0;l({editor:e,view:t,tr:r,dispatch:i})=>{let o=bm(n).split(/-(?!$)/),s=o.find(c=>!["Alt","Ctrl","Meta","Shift"].includes(c)),l=new KeyboardEvent("keydown",{key:s==="Space"?" ":s,altKey:o.includes("Alt"),ctrlKey:o.includes("Ctrl"),metaKey:o.includes("Meta"),shiftKey:o.includes("Shift"),bubbles:!0,cancelable:!0}),a=e.captureTransaction(()=>{t.someProp("handleKeyDown",c=>c(t,l))});return a?.steps.forEach(c=>{let u=c.map(r.mapping);u&&i&&r.maybeStep(u)}),!0},km=(n,e={})=>({state:t,dispatch:r})=>{let i=_(n,t.schema);return Fe(t,i,e)?yc(t,r):!1},Sm=()=>({state:n,dispatch:e})=>qo(n,e),wm=n=>({state:e,dispatch:t})=>{let r=_(n,e.schema);return Mc(r)(e,t)},Mm=()=>({state:n,dispatch:e})=>Ko(n,e);function Nc(n,e){let t=typeof e=="string"?[e]:e;return Object.keys(n).reduce((r,i)=>(t.includes(i)||(r[i]=n[i]),r),{})}var Cm=(n,e)=>({tr:t,state:r,dispatch:i})=>{let o=null,s=null,l=$r(typeof n=="string"?n:n.name,r.schema);return l?(l==="node"&&(o=_(n,r.schema)),l==="mark"&&(s=tt(n,r.schema)),i&&t.selection.ranges.forEach(a=>{r.doc.nodesBetween(a.$from.pos,a.$to.pos,(c,u)=>{o&&o===c.type&&t.setNodeMarkup(u,void 0,Nc(c.attrs,e)),s&&c.marks.length&&c.marks.forEach(f=>{s===f.type&&t.addMark(u,u+c.nodeSize,s.create(Nc(f.attrs,e)))})})}),!0):!1},vm=()=>({tr:n,dispatch:e})=>(e&&n.scrollIntoView(),!0),Tm=()=>({tr:n,dispatch:e})=>{if(e){let t=new fe(n.doc);n.setSelection(t)}return!0},Em=()=>({state:n,dispatch:e})=>Ho(n,e),Am=()=>({state:n,dispatch:e})=>Wo(n,e),Om=()=>({state:n,dispatch:e})=>bc(n,e),Nm=()=>({state:n,dispatch:e})=>Yo(n,e),Dm=()=>({state:n,dispatch:e})=>Go(n,e),Rm=(n,{errorOnInvalidContent:e,emitUpdate:t=!0,parseOptions:r={}}={})=>({editor:i,tr:o,dispatch:s,commands:l})=>{let{doc:a}=o;if(r.preserveWhitespace!=="full"){let c=ns(n,i.schema,r,{errorOnInvalidContent:e??i.options.enableContentCheck});return s&&o.replaceWith(0,a.content.size,c).setMeta("preventUpdate",!t),!0}return s&&o.setMeta("preventUpdate",!t),l.insertContentAt({from:0,to:a.content.size},n,{parseOptions:r,errorOnInvalidContent:e??i.options.enableContentCheck})};function Pm(n,e,t){var r;let{selection:i}=e,o=null;if(Uc(i)&&(o=i.$cursor),o){let l=(r=n.storedMarks)!=null?r:o.marks();return!!t.isInSet(l)||!l.some(a=>a.type.excludes(t))}let{ranges:s}=i;return s.some(({$from:l,$to:a})=>{let c=l.depth===0?n.doc.inlineContent&&n.doc.type.allowsMarkType(t):!1;return n.doc.nodesBetween(l.pos,a.pos,(u,f,d)=>{if(c)return!1;if(u.isInline){let h=!d||d.type.allowsMarkType(t),p=!!t.isInSet(u.marks)||!u.marks.some(m=>m.type.excludes(t));c=h&&p}return!c}),c})}var Im=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let{selection:o}=t,{empty:s,ranges:l}=o,a=tt(n,r.schema);if(i)if(s){let c=$c(r,a);t.addStoredMark(a.create({...c,...e}))}else l.forEach(c=>{let u=c.$from.pos,f=c.$to.pos;r.doc.nodesBetween(u,f,(d,h)=>{let p=Math.max(h,u),m=Math.min(h+d.nodeSize,f);d.marks.find(y=>y.type===a)?d.marks.forEach(y=>{a===y.type&&t.addMark(p,m,a.create({...y.attrs,...e}))}):t.addMark(p,m,a.create(e))})});return Pm(r,t,a)},Lm=(n,e)=>({tr:t})=>(t.setMeta(n,e),!0),Bm=(n,e={})=>({state:t,dispatch:r,chain:i})=>{let o=_(n,t.schema),s;return t.selection.$anchor.sameParent(t.selection.$head)&&(s=t.selection.$anchor.parent.attrs),o.isTextblock?i().command(({commands:l})=>Xo(o,{...s,...e})(t)?!0:l.clearNodes()).command(({state:l})=>Xo(o,{...s,...e})(l,r)).run():(console.warn('[tiptap warn]: Currently "setNode()" only supports text block nodes.'),!1)},Fm=n=>({tr:e,dispatch:t})=>{if(t){let{doc:r}=e,i=Pt(n,0,r.content.size),o=v.create(r,i);e.setSelection(o)}return!0},zm=n=>({tr:e,dispatch:t})=>{if(t){let{doc:r}=e,{from:i,to:o}=typeof n=="number"?{from:n,to:n}:n,s=O.atStart(r).from,l=O.atEnd(r).to,a=Pt(i,s,l),c=Pt(o,s,l),u=O.create(r,a,c);e.setSelection(u)}return!0},Hm=n=>({state:e,dispatch:t})=>{let r=_(n,e.schema);return Cc(r)(e,t)};function Dc(n,e){let t=n.storedMarks||n.selection.$to.parentOffset&&n.selection.$from.marks();if(t){let r=t.filter(i=>e?.includes(i.type.name));n.tr.ensureMarks(r)}}var $m=({keepMarks:n=!0}={})=>({tr:e,state:t,dispatch:r,editor:i})=>{let{selection:o,doc:s}=e,{$from:l,$to:a}=o,c=i.extensionManager.attributes,u=Pr(c,l.node().type.name,l.node().attrs);if(o instanceof v&&o.node.isBlock)return!l.parentOffset||!xe(s,l.pos)?!1:(r&&(n&&Dc(t,i.extensionManager.splittableMarks),e.split(l.pos).scrollIntoView()),!0);if(!l.parent.isBlock)return!1;let f=a.parentOffset===a.parent.content.size,d=l.depth===0?void 0:Sp(l.node(-1).contentMatchAt(l.indexAfter(-1))),h=f&&d?[{type:d,attrs:u}]:void 0,p=xe(e.doc,e.mapping.map(l.pos),1,h);if(!h&&!p&&xe(e.doc,e.mapping.map(l.pos),1,d?[{type:d}]:void 0)&&(p=!0,h=d?[{type:d,attrs:u}]:void 0),r){if(p&&(o instanceof O&&e.deleteSelection(),e.split(e.mapping.map(l.pos),1,h),d&&!f&&!l.parentOffset&&l.parent.type!==d)){let m=e.mapping.map(l.before()),g=e.doc.resolve(m);l.node(-1).canReplaceWith(g.index(),g.index()+1,d)&&e.setNodeMarkup(e.mapping.map(l.before()),d)}n&&Dc(t,i.extensionManager.splittableMarks),e.scrollIntoView()}return p},Vm=(n,e={})=>({tr:t,state:r,dispatch:i,editor:o})=>{var s;let l=_(n,r.schema),{$from:a,$to:c}=r.selection,u=r.selection.node;if(u&&u.isBlock||a.depth<2||!a.sameParent(c))return!1;let f=a.node(-1);if(f.type!==l)return!1;let d=o.extensionManager.attributes;if(a.parent.content.size===0&&a.node(-1).childCount===a.indexAfter(-1)){if(a.depth===2||a.node(-3).type!==l||a.index(-2)!==a.node(-2).childCount-1)return!1;if(i){let y=x.empty,b=a.index(-1)?1:a.index(-2)?2:3;for(let V=a.depth-b;V>=a.depth-3;V-=1)y=x.from(a.node(V).copy(y));let S=a.indexAfter(-1){if(z>-1)return!1;V.isTextblock&&V.content.size===0&&(z=N+1)}),z>-1&&t.setSelection(O.near(t.doc.resolve(z))),t.scrollIntoView()}return!0}let h=c.pos===a.end()?f.contentMatchAt(0).defaultType:null,p={...Pr(d,f.type.name,f.attrs),...e},m={...Pr(d,a.node().type.name,a.node().attrs),...e};t.delete(a.pos,c.pos);let g=h?[{type:l,attrs:p},{type:h,attrs:m}]:[{type:l,attrs:p}];if(!xe(t.doc,a.pos,2))return!1;if(i){let{selection:y,storedMarks:b}=r,{splittableMarks:S}=o.extensionManager,C=b||y.$to.parentOffset&&y.$from.marks();if(t.split(a.pos,2,g).scrollIntoView(),!C||!i)return!0;let M=C.filter(R=>S.includes(R.type.name));t.ensureMarks(M)}return!0},es=(n,e)=>{let t=Hr(s=>s.type===e)(n.selection);if(!t)return!0;let r=n.doc.resolve(Math.max(0,t.pos-1)).before(t.depth);if(r===void 0)return!0;let i=n.doc.nodeAt(r);return t.node.type===i?.type&&Se(n.doc,t.pos)&&n.join(t.pos),!0},ts=(n,e)=>{let t=Hr(s=>s.type===e)(n.selection);if(!t)return!0;let r=n.doc.resolve(t.start).after(t.depth);if(r===void 0)return!0;let i=n.doc.nodeAt(r);return t.node.type===i?.type&&Se(n.doc,r)&&n.join(r),!0},Wm=(n,e,t,r={})=>({editor:i,tr:o,state:s,dispatch:l,chain:a,commands:c,can:u})=>{let{extensions:f,splittableMarks:d}=i.extensionManager,h=_(n,s.schema),p=_(e,s.schema),{selection:m,storedMarks:g}=s,{$from:y,$to:b}=m,S=y.blockRange(b),C=g||m.$to.parentOffset&&m.$from.marks();if(!S)return!1;let M=Hr(R=>Oc(R.type.name,f))(m);if(S.depth>=1&&M&&S.depth-M.depth<=1){if(M.node.type===h)return c.liftListItem(p);if(Oc(M.node.type.name,f)&&h.validContent(M.node.content)&&l)return a().command(()=>(o.setNodeMarkup(M.pos,h),!0)).command(()=>es(o,h)).command(()=>ts(o,h)).run()}return!t||!C||!l?a().command(()=>u().wrapInList(h,r)?!0:c.clearNodes()).wrapInList(h,r).command(()=>es(o,h)).command(()=>ts(o,h)).run():a().command(()=>{let R=u().wrapInList(h,r),z=C.filter(V=>d.includes(V.type.name));return o.ensureMarks(z),R?!0:c.clearNodes()}).wrapInList(h,r).command(()=>es(o,h)).command(()=>ts(o,h)).run()},jm=(n,e={},t={})=>({state:r,commands:i})=>{let{extendEmptyMarkRange:o=!1}=t,s=tt(n,r.schema);return rs(r,s,e)?i.unsetMark(s,{extendEmptyMarkRange:o}):i.setMark(s,e)},Km=(n,e,t={})=>({state:r,commands:i})=>{let o=_(n,r.schema),s=_(e,r.schema),l=Fe(r,o,t),a;return r.selection.$anchor.sameParent(r.selection.$head)&&(a=r.selection.$anchor.parent.attrs),l?i.setNode(s,a):i.setNode(o,{...a,...t})},_m=(n,e={})=>({state:t,commands:r})=>{let i=_(n,t.schema);return Fe(t,i,e)?r.lift(i):r.wrapIn(i,e)},Um=()=>({state:n,dispatch:e})=>{let t=n.plugins;for(let r=0;r=0;a-=1)s.step(l.steps[a].invert(l.docs[a]));if(o.text){let a=s.doc.resolve(o.from).marks();s.replaceWith(o.from,o.to,n.schema.text(o.text,a))}else s.delete(o.from,o.to)}return!0}}return!1},Jm=()=>({tr:n,dispatch:e})=>{let{selection:t}=n,{empty:r,ranges:i}=t;return r||e&&i.forEach(o=>{n.removeMark(o.$from.pos,o.$to.pos)}),!0},qm=(n,e={})=>({tr:t,state:r,dispatch:i})=>{var o;let{extendEmptyMarkRange:s=!1}=e,{selection:l}=t,a=tt(n,r.schema),{$from:c,empty:u,ranges:f}=l;if(!i)return!0;if(u&&s){let{from:d,to:h}=l,p=(o=c.marks().find(g=>g.type===a))==null?void 0:o.attrs,m=ds(c,a,p);m&&(d=m.from,h=m.to),t.removeMark(d,h,a)}else f.forEach(d=>{t.removeMark(d.$from.pos,d.$to.pos,a)});return t.removeStoredMark(a),!0},Gm=(n,e={})=>({tr:t,state:r,dispatch:i})=>{let o=null,s=null,l=$r(typeof n=="string"?n:n.name,r.schema);return l?(l==="node"&&(o=_(n,r.schema)),l==="mark"&&(s=tt(n,r.schema)),i&&t.selection.ranges.forEach(a=>{let c=a.$from.pos,u=a.$to.pos,f,d,h,p;t.selection.empty?r.doc.nodesBetween(c,u,(m,g)=>{o&&o===m.type&&(h=Math.max(g,c),p=Math.min(g+m.nodeSize,u),f=g,d=m)}):r.doc.nodesBetween(c,u,(m,g)=>{g=c&&g<=u&&(o&&o===m.type&&t.setNodeMarkup(g,void 0,{...m.attrs,...e}),s&&m.marks.length&&m.marks.forEach(y=>{if(s===y.type){let b=Math.max(g,c),S=Math.min(g+m.nodeSize,u);t.addMark(b,S,s.create({...y.attrs,...e}))}}))}),d&&(f!==void 0&&t.setNodeMarkup(f,void 0,{...d.attrs,...e}),s&&d.marks.length&&d.marks.forEach(m=>{s===m.type&&t.addMark(h,p,s.create({...m.attrs,...e}))}))}),!0):!1},Ym=(n,e={})=>({state:t,dispatch:r})=>{let i=_(n,t.schema);return Sc(i,e)(t,r)},Xm=(n,e={})=>({state:t,dispatch:r})=>{let i=_(n,t.schema);return wc(i,e)(t,r)},eu=F.create({name:"commands",addCommands(){return{...Qc}}}),tu=F.create({name:"delete",onUpdate({transaction:n,appendedTransactions:e}){var t,r,i;let o=()=>{var s,l,a,c;if((c=(a=(l=(s=this.editor.options.coreExtensionOptions)==null?void 0:s.delete)==null?void 0:l.filterTransaction)==null?void 0:a.call(l,n))!=null?c:n.getMeta("y-sync$"))return;let u=is(n.before,[n,...e]);us(u).forEach(h=>{u.mapping.mapResult(h.oldRange.from).deletedAfter&&u.mapping.mapResult(h.oldRange.to).deletedBefore&&u.before.nodesBetween(h.oldRange.from,h.oldRange.to,(p,m)=>{let g=m+p.nodeSize-2,y=h.oldRange.from<=m&&g<=h.oldRange.to;this.editor.emit("delete",{type:"node",node:p,from:m,to:g,newFrom:u.mapping.map(m),newTo:u.mapping.map(g),deletedRange:h.oldRange,newRange:h.newRange,partial:!y,editor:this.editor,transaction:n,combinedTransform:u})})});let d=u.mapping;u.steps.forEach((h,p)=>{var m,g;if(h instanceof qe){let y=d.slice(p).map(h.from,-1),b=d.slice(p).map(h.to),S=d.invert().map(y,-1),C=d.invert().map(b),M=(m=u.doc.nodeAt(y-1))==null?void 0:m.marks.some(z=>z.eq(h.mark)),R=(g=u.doc.nodeAt(b))==null?void 0:g.marks.some(z=>z.eq(h.mark));this.editor.emit("delete",{type:"mark",mark:h.mark,from:h.from,to:h.to,deletedRange:{from:S,to:C},newRange:{from:y,to:b},partial:!!(R||M),editor:this.editor,transaction:n,combinedTransform:u})}})};(i=(r=(t=this.editor.options.coreExtensionOptions)==null?void 0:t.delete)==null?void 0:r.async)==null||i?setTimeout(o,0):o()}}),nu=F.create({name:"drop",addProseMirrorPlugins(){return[new E({key:new P("tiptapDrop"),props:{handleDrop:(n,e,t,r)=>{this.editor.emit("drop",{editor:this.editor,event:e,slice:t,moved:r})}}})]}}),ru=F.create({name:"editable",addProseMirrorPlugins(){return[new E({key:new P("editable"),props:{editable:()=>this.editor.options.editable}})]}}),iu=new P("focusEvents"),ou=F.create({name:"focusEvents",addProseMirrorPlugins(){let{editor:n}=this;return[new E({key:iu,props:{handleDOMEvents:{focus:(e,t)=>{n.isFocused=!0;let r=n.state.tr.setMeta("focus",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1},blur:(e,t)=>{n.isFocused=!1;let r=n.state.tr.setMeta("blur",{event:t}).setMeta("addToHistory",!1);return e.dispatch(r),!1}}}})]}}),su=F.create({name:"keymap",addKeyboardShortcuts(){let n=()=>this.editor.commands.first(({commands:s})=>[()=>s.undoInputRule(),()=>s.command(({tr:l})=>{let{selection:a,doc:c}=l,{empty:u,$anchor:f}=a,{pos:d,parent:h}=f,p=f.parent.isTextblock&&d>0?l.doc.resolve(d-1):f,m=p.parent.type.spec.isolating,g=f.pos-f.parentOffset,y=m&&p.parent.childCount===1?g===f.pos:A.atStart(c).from===d;return!u||!h.type.isTextblock||h.textContent.length||!y||y&&f.parent.type.name==="paragraph"?!1:s.clearNodes()}),()=>s.deleteSelection(),()=>s.joinBackward(),()=>s.selectNodeBackward()]),e=()=>this.editor.commands.first(({commands:s})=>[()=>s.deleteSelection(),()=>s.deleteCurrentNode(),()=>s.joinForward(),()=>s.selectNodeForward()]),r={Enter:()=>this.editor.commands.first(({commands:s})=>[()=>s.newlineInCode(),()=>s.createParagraphNear(),()=>s.liftEmptyBlock(),()=>s.splitBlock()]),"Mod-Enter":()=>this.editor.commands.exitCode(),Backspace:n,"Mod-Backspace":n,"Shift-Backspace":n,Delete:e,"Mod-Delete":e,"Mod-a":()=>this.editor.commands.selectAll()},i={...r},o={...r,"Ctrl-h":n,"Alt-Backspace":n,"Ctrl-d":e,"Ctrl-Alt-Backspace":e,"Alt-Delete":e,"Alt-d":e,"Ctrl-a":()=>this.editor.commands.selectTextblockStart(),"Ctrl-e":()=>this.editor.commands.selectTextblockEnd()};return ps()||Zc()?o:i},addProseMirrorPlugins(){return[new E({key:new P("clearDocument"),appendTransaction:(n,e,t)=>{if(n.some(m=>m.getMeta("composition")))return;let r=n.some(m=>m.docChanged)&&!e.doc.eq(t.doc),i=n.some(m=>m.getMeta("preventClearDocument"));if(!r||i)return;let{empty:o,from:s,to:l}=e.selection,a=A.atStart(e.doc).from,c=A.atEnd(e.doc).to;if(o||!(s===a&&l===c)||!Pn(t.doc))return;let d=t.tr,h=Fr({state:t,transaction:d}),{commands:p}=new zr({editor:this.editor,state:h});if(p.clearNodes(),!!d.steps.length)return d}})]}}),lu=F.create({name:"paste",addProseMirrorPlugins(){return[new E({key:new P("tiptapPaste"),props:{handlePaste:(n,e,t)=>{this.editor.emit("paste",{editor:this.editor,event:e,slice:t})}}})]}}),au=F.create({name:"tabindex",addProseMirrorPlugins(){return[new E({key:new P("tabindex"),props:{attributes:()=>this.editor.isEditable?{tabindex:"0"}:{}}})]}}),Qm=class sn{constructor(e,t,r=!1,i=null){this.currentNode=null,this.actualDepth=null,this.isBlock=r,this.resolvedPos=e,this.editor=t,this.currentNode=i}get name(){return this.node.type.name}get node(){return this.currentNode||this.resolvedPos.node()}get element(){return this.editor.view.domAtPos(this.pos).node}get depth(){var e;return(e=this.actualDepth)!=null?e:this.resolvedPos.depth}get pos(){return this.resolvedPos.pos}get content(){return this.node.content}set content(e){let t=this.from,r=this.to;if(this.isBlock){if(this.content.size===0){console.error(`You can\u2019t set content on a block node. Tried to set content on ${this.name} at ${this.pos}`);return}t=this.from+1,r=this.to-1}this.editor.commands.insertContentAt({from:t,to:r},e)}get attributes(){return this.node.attrs}get textContent(){return this.node.textContent}get size(){return this.node.nodeSize}get from(){return this.isBlock?this.pos:this.resolvedPos.start(this.resolvedPos.depth)}get range(){return{from:this.from,to:this.to}}get to(){return this.isBlock?this.pos+this.size:this.resolvedPos.end(this.resolvedPos.depth)+(this.node.isText?0:1)}get parent(){if(this.depth===0)return null;let e=this.resolvedPos.start(this.resolvedPos.depth-1),t=this.resolvedPos.doc.resolve(e);return new sn(t,this.editor)}get before(){let e=this.resolvedPos.doc.resolve(this.from-(this.isBlock?1:2));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.from-3)),new sn(e,this.editor)}get after(){let e=this.resolvedPos.doc.resolve(this.to+(this.isBlock?2:1));return e.depth!==this.depth&&(e=this.resolvedPos.doc.resolve(this.to+3)),new sn(e,this.editor)}get children(){let e=[];return this.node.content.forEach((t,r)=>{let i=t.isBlock&&!t.isTextblock,o=t.isAtom&&!t.isText,s=this.pos+r+(o?0:1),l=this.resolvedPos.doc.resolve(s);if(!i&&l.depth<=this.depth)return;let a=new sn(l,this.editor,i,i?t:null);i&&(a.actualDepth=this.depth+1),e.push(new sn(l,this.editor,i,i?t:null))}),e}get firstChild(){return this.children[0]||null}get lastChild(){let e=this.children;return e[e.length-1]||null}closest(e,t={}){let r=null,i=this.parent;for(;i&&!r;){if(i.node.type.name===e)if(Object.keys(t).length>0){let o=i.node.attrs,s=Object.keys(t);for(let l=0;l{r&&i.length>0||(s.node.type.name===e&&o.every(a=>t[a]===s.node.attrs[a])&&i.push(s),!(r&&i.length>0)&&(i=i.concat(s.querySelectorAll(e,t,r))))}),i}setAttribute(e){let{tr:t}=this.editor.state;t.setNodeMarkup(this.from,void 0,{...this.node.attrs,...e}),this.editor.view.dispatch(t)}},Zm=`.ProseMirror { position: relative; } @@ -80,13 +80,13 @@ img.ProseMirror-separator { .ProseMirror-focused .ProseMirror-gapcursor { display: block; -}`;function Qm(n,e,t){let r=document.querySelector(`style[data-tiptap-style${t?`-${t}`:""}]`);if(r!==null)return r;let i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute(`data-tiptap-style${t?`-${t}`:""}`,""),i.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(i),i}var au=class extends bp{constructor(n={}){super(),this.css=null,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(n),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:i,moved:o})=>this.options.onDrop(r,i,o)),this.on("paste",({event:r,slice:i})=>this.options.onPaste(r,i)),this.on("delete",this.options.onDelete);let e=this.createDoc(),t=Uc(e,this.options.autofocus);this.editorState=dr.create({doc:e,schema:this.schema,selection:t||void 0}),this.options.element&&this.mount(this.options.element)}mount(n){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(n),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){var n;if(this.editorView){let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}this.editorView=null,this.isInitialized=!1,(n=this.css)==null||n.remove(),this.css=null}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=Qm(Xm,this.options.injectNonce))}setOptions(n={}){this.options={...this.options,...n},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(n,e=!0){this.setOptions({editable:n}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:n=>{this.editorState=n},dispatch:n=>{this.editorState=this.state.apply(n)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(n,e)=>{if(e==="state")return this.editorState;if(e in n)return Reflect.get(n,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(n,e){let t=Ic(e)?e(n,[...this.state.plugins]):[...this.state.plugins,n],r=this.state.reconfigure({plugins:t});return this.view.updateState(r),r}unregisterPlugin(n){if(this.isDestroyed)return;let e=this.state.plugins,t=e;if([].concat(n).forEach(i=>{let o=typeof i=="string"?`${i}$`:i.key;t=t.filter(s=>!s.key.startsWith(o))}),e.length===t.length)return;let r=this.state.reconfigure({plugins:t});return this.view.updateState(r),r}createExtensionManager(){var n,e;let r=[...this.options.enableCoreExtensions?[nu,Yc.configure({blockSeparator:(e=(n=this.options.coreExtensionOptions)==null?void 0:n.clipboardTextSerializer)==null?void 0:e.blockSeparator}),Zc,iu,ou,lu,tu,su,eu].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i?.type));this.extensionManager=new jr(r,this)}createCommandManager(){this.commandManager=new zr({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let n;try{n=ns(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(t=>t.name!=="collaboration"),this.createExtensionManager()}}),n=ns(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return n}createView(n){var e;this.editorView=new Mr(n,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)==null?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState});let t=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(t),this.createNodeViews(),this.prependClass(),this.injectCSS();let r=this.view.dom;r.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(n){this.isCapturingTransaction=!0,n(),this.isCapturingTransaction=!1;let e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(n){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=n;return}n.steps.forEach(c=>{var u;return(u=this.capturedTransaction)==null?void 0:u.step(c)});return}let{state:e,transactions:t}=this.state.applyTransaction(n),r=!this.state.selection.eq(e.selection),i=t.includes(n),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:n,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:n,appendedTransactions:t.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:n});let s=t.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),l=s?.getMeta("focus"),a=s?.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:s}),a&&this.emit("blur",{editor:this,event:a.event,transaction:s}),!(n.getMeta("preventUpdate")||!t.some(c=>c.docChanged)||o.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:n,appendedTransactions:t.slice(1)})}getAttributes(n){return cs(this.state,n)}isActive(n,e){let t=typeof n=="string"?n:null,r=typeof n=="string"?e:n;return Np(this.state,t,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ls(this.state.doc.content,this.schema)}getText(n){let{blockSeparator:e=` +}`;function eg(n,e,t){let r=document.querySelector(`style[data-tiptap-style${t?`-${t}`:""}]`);if(r!==null)return r;let i=document.createElement("style");return e&&i.setAttribute("nonce",e),i.setAttribute(`data-tiptap-style${t?`-${t}`:""}`,""),i.innerHTML=n,document.getElementsByTagName("head")[0].appendChild(i),i}var cu=class extends kp{constructor(n={}){super(),this.css=null,this.editorView=null,this.isFocused=!1,this.isInitialized=!1,this.extensionStorage={},this.instanceId=Math.random().toString(36).slice(2,9),this.options={element:typeof document<"u"?document.createElement("div"):null,content:"",injectCSS:!0,injectNonce:void 0,extensions:[],autofocus:!1,editable:!0,editorProps:{},parseOptions:{},coreExtensionOptions:{},enableInputRules:!0,enablePasteRules:!0,enableCoreExtensions:!0,enableContentCheck:!1,onBeforeCreate:()=>null,onCreate:()=>null,onUpdate:()=>null,onSelectionUpdate:()=>null,onTransaction:()=>null,onFocus:()=>null,onBlur:()=>null,onDestroy:()=>null,onContentError:({error:r})=>{throw r},onPaste:()=>null,onDrop:()=>null,onDelete:()=>null},this.isCapturingTransaction=!1,this.capturedTransaction=null,this.setOptions(n),this.createExtensionManager(),this.createCommandManager(),this.createSchema(),this.on("beforeCreate",this.options.onBeforeCreate),this.emit("beforeCreate",{editor:this}),this.on("contentError",this.options.onContentError),this.on("create",this.options.onCreate),this.on("update",this.options.onUpdate),this.on("selectionUpdate",this.options.onSelectionUpdate),this.on("transaction",this.options.onTransaction),this.on("focus",this.options.onFocus),this.on("blur",this.options.onBlur),this.on("destroy",this.options.onDestroy),this.on("drop",({event:r,slice:i,moved:o})=>this.options.onDrop(r,i,o)),this.on("paste",({event:r,slice:i})=>this.options.onPaste(r,i)),this.on("delete",this.options.onDelete);let e=this.createDoc(),t=Jc(e,this.options.autofocus);this.editorState=dr.create({doc:e,schema:this.schema,selection:t||void 0}),this.options.element&&this.mount(this.options.element)}mount(n){if(typeof document>"u")throw new Error("[tiptap error]: The editor cannot be mounted because there is no 'document' defined in this environment.");this.createView(n),window.setTimeout(()=>{this.isDestroyed||(this.commands.focus(this.options.autofocus),this.emit("create",{editor:this}),this.isInitialized=!0)},0)}unmount(){var n;if(this.editorView){let e=this.editorView.dom;e?.editor&&delete e.editor,this.editorView.destroy()}this.editorView=null,this.isInitialized=!1,(n=this.css)==null||n.remove(),this.css=null}get storage(){return this.extensionStorage}get commands(){return this.commandManager.commands}chain(){return this.commandManager.chain()}can(){return this.commandManager.can()}injectCSS(){this.options.injectCSS&&typeof document<"u"&&(this.css=eg(Zm,this.options.injectNonce))}setOptions(n={}){this.options={...this.options,...n},!(!this.editorView||!this.state||this.isDestroyed)&&(this.options.editorProps&&this.view.setProps(this.options.editorProps),this.view.updateState(this.state))}setEditable(n,e=!0){this.setOptions({editable:n}),e&&this.emit("update",{editor:this,transaction:this.state.tr,appendedTransactions:[]})}get isEditable(){return this.options.editable&&this.view&&this.view.editable}get view(){return this.editorView?this.editorView:new Proxy({state:this.editorState,updateState:n=>{this.editorState=n},dispatch:n=>{this.editorState=this.state.apply(n)},composing:!1,dragging:null,editable:!0,isDestroyed:!1},{get:(n,e)=>{if(e==="state")return this.editorState;if(e in n)return Reflect.get(n,e);throw new Error(`[tiptap error]: The editor view is not available. Cannot access view['${e}']. The editor may not be mounted yet.`)}})}get state(){return this.editorView&&(this.editorState=this.view.state),this.editorState}registerPlugin(n,e){let t=Lc(e)?e(n,[...this.state.plugins]):[...this.state.plugins,n],r=this.state.reconfigure({plugins:t});return this.view.updateState(r),r}unregisterPlugin(n){if(this.isDestroyed)return;let e=this.state.plugins,t=e;if([].concat(n).forEach(i=>{let o=typeof i=="string"?`${i}$`:i.key;t=t.filter(s=>!s.key.startsWith(o))}),e.length===t.length)return;let r=this.state.reconfigure({plugins:t});return this.view.updateState(r),r}createExtensionManager(){var n,e;let r=[...this.options.enableCoreExtensions?[ru,Xc.configure({blockSeparator:(e=(n=this.options.coreExtensionOptions)==null?void 0:n.clipboardTextSerializer)==null?void 0:e.blockSeparator}),eu,ou,su,au,nu,lu,tu].filter(i=>typeof this.options.enableCoreExtensions=="object"?this.options.enableCoreExtensions[i.name]!==!1:!0):[],...this.options.extensions].filter(i=>["extension","node","mark"].includes(i?.type));this.extensionManager=new jr(r,this)}createCommandManager(){this.commandManager=new zr({editor:this})}createSchema(){this.schema=this.extensionManager.schema}createDoc(){let n;try{n=ns(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:this.options.enableContentCheck})}catch(e){if(!(e instanceof Error)||!["[tiptap error]: Invalid JSON content","[tiptap error]: Invalid HTML content"].includes(e.message))throw e;this.emit("contentError",{editor:this,error:e,disableCollaboration:()=>{"collaboration"in this.storage&&typeof this.storage.collaboration=="object"&&this.storage.collaboration&&(this.storage.collaboration.isDisabled=!0),this.options.extensions=this.options.extensions.filter(t=>t.name!=="collaboration"),this.createExtensionManager()}}),n=ns(this.options.content,this.schema,this.options.parseOptions,{errorOnInvalidContent:!1})}return n}createView(n){var e;this.editorView=new Mr(n,{...this.options.editorProps,attributes:{role:"textbox",...(e=this.options.editorProps)==null?void 0:e.attributes},dispatchTransaction:this.dispatchTransaction.bind(this),state:this.editorState});let t=this.state.reconfigure({plugins:this.extensionManager.plugins});this.view.updateState(t),this.createNodeViews(),this.prependClass(),this.injectCSS();let r=this.view.dom;r.editor=this}createNodeViews(){this.view.isDestroyed||this.view.setProps({markViews:this.extensionManager.markViews,nodeViews:this.extensionManager.nodeViews})}prependClass(){this.view.dom.className=`tiptap ${this.view.dom.className}`}captureTransaction(n){this.isCapturingTransaction=!0,n(),this.isCapturingTransaction=!1;let e=this.capturedTransaction;return this.capturedTransaction=null,e}dispatchTransaction(n){if(this.view.isDestroyed)return;if(this.isCapturingTransaction){if(!this.capturedTransaction){this.capturedTransaction=n;return}n.steps.forEach(c=>{var u;return(u=this.capturedTransaction)==null?void 0:u.step(c)});return}let{state:e,transactions:t}=this.state.applyTransaction(n),r=!this.state.selection.eq(e.selection),i=t.includes(n),o=this.state;if(this.emit("beforeTransaction",{editor:this,transaction:n,nextState:e}),!i)return;this.view.updateState(e),this.emit("transaction",{editor:this,transaction:n,appendedTransactions:t.slice(1)}),r&&this.emit("selectionUpdate",{editor:this,transaction:n});let s=t.findLast(c=>c.getMeta("focus")||c.getMeta("blur")),l=s?.getMeta("focus"),a=s?.getMeta("blur");l&&this.emit("focus",{editor:this,event:l.event,transaction:s}),a&&this.emit("blur",{editor:this,event:a.event,transaction:s}),!(n.getMeta("preventUpdate")||!t.some(c=>c.docChanged)||o.doc.eq(e.doc))&&this.emit("update",{editor:this,transaction:n,appendedTransactions:t.slice(1)})}getAttributes(n){return cs(this.state,n)}isActive(n,e){let t=typeof n=="string"?n:null,r=typeof n=="string"?e:n;return Rp(this.state,t,r)}getJSON(){return this.state.doc.toJSON()}getHTML(){return ls(this.state.doc.content,this.schema)}getText(n){let{blockSeparator:e=` -`,textSerializers:t={}}=n||{};return vp(this.state.doc,{blockSeparator:e,textSerializers:{...zc(this.schema),...t}})}get isEmpty(){return Pn(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var n,e;return(e=(n=this.editorView)==null?void 0:n.isDestroyed)!=null?e:!0}$node(n,e){var t;return((t=this.$doc)==null?void 0:t.querySelector(n,e))||null}$nodes(n,e){var t;return((t=this.$doc)==null?void 0:t.querySelectorAll(n,e))||null}$pos(n){let e=this.state.doc.resolve(n);return new Ym(e,this)}get $doc(){return this.$pos(0)}};function ze(n){return new Wr({find:n.find,handler:({state:e,range:t,match:r})=>{let i=H(n.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:o}=e,s=r[r.length-1],l=r[0];if(s){let a=l.search(/\S/),c=t.from+l.indexOf(s),u=c+s.length;if(Vr(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(m=>m===n.type&&m!==h.mark.type)).filter(h=>h.to>c).length)return null;ut.from&&o.delete(t.from+a,c);let d=t.from+a+s.length;o.addMark(t.from+a,d,n.type.create(i||{})),o.removeStoredMark(n.type)}}})}function cu(n){return new Wr({find:n.find,handler:({state:e,range:t,match:r})=>{let i=H(n.getAttributes,void 0,r)||{},{tr:o}=e,s=t.from,l=t.to,a=n.type.create(i);if(r[1]){let c=r[0].lastIndexOf(r[1]),u=s+c;u>l?u=l:l=u+r[1].length;let f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(u,l,a)}else if(r[0]){let c=n.type.isInline?s:s-1;o.insert(c,n.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l))}o.scrollIntoView()}})}function In(n){return new Wr({find:n.find,handler:({state:e,range:t,match:r})=>{let i=e.doc.resolve(t.from),o=H(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,o)}})}function He(n){return new Wr({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{let o=H(n.getAttributes,void 0,r)||{},s=e.tr.delete(t.from,t.to),a=s.doc.resolve(t.from).blockRange(),c=a&&Gt(a,n.type,o);if(!c)return null;if(s.wrap(a,c),n.keepMarks&&n.editor){let{selection:f,storedMarks:d}=e,{splittableMarks:h}=n.editor.extensionManager,p=d||f.$to.parentOffset&&f.$from.marks();if(p){let m=p.filter(g=>h.includes(g.type.name));s.ensureMarks(m)}}if(n.keepAttributes){let f=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}let u=s.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&Se(s.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&s.join(t.from-1)}})}function uu(n){return n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var $=class fu extends hs{constructor(){super(...arguments),this.type="node"}static create(e={}){return new fu(e)}configure(e){return super.configure(e)}extend(e){return super.extend(e)}};function ve(n){return new Bp({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{let o=H(n.getAttributes,void 0,r,i);if(o===!1||o===null)return null;let{tr:s}=e,l=r[r.length-1],a=r[0],c=t.to;if(l){let u=a.search(/\S/),f=t.from+a.indexOf(l),d=f+l.length;if(Vr(t.from,t.to,e.doc).filter(p=>p.mark.type.excluded.find(g=>g===n.type&&g!==p.mark.type)).filter(p=>p.to>f).length)return null;dt.from&&s.delete(t.from+u,f),c=t.from+u+l.length,s.addMark(t.from+u,c,n.type.create(o||{})),s.removeStoredMark(n.type)}}})}function du(n={}){return new E({view(e){return new ms(e,n)}})}var ms=class{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r,i=this.editorView.dom,o=i.getBoundingClientRect(),s=o.width/i.offsetWidth,l=o.height/i.offsetHeight;if(t){let f=e.nodeBefore,d=e.nodeAfter;if(f||d){let h=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(h){let p=h.getBoundingClientRect(),m=f?p.bottom:p.top;f&&d&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*l;r={left:p.left,right:p.right,top:m-g,bottom:m+g}}}}if(!r){let f=this.editorView.coordsAtPos(this.cursorPos),d=this.width/2*s;r={left:f.left-d,right:f.left+d,top:f.top,bottom:f.bottom}}let a=this.editorView.dom.offsetParent;this.element||(this.element=a.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let c,u;if(!a||a==document.body&&getComputedStyle(a).position=="static")c=-pageXOffset,u=-pageYOffset;else{let f=a.getBoundingClientRect(),d=f.width/a.offsetWidth,h=f.height/a.offsetHeight;c=f.left-a.scrollLeft*d,u=f.top-a.scrollTop*h}this.element.style.left=(r.left-c)/s+"px",this.element.style.top=(r.top-u)/l+"px",this.element.style.width=(r.right-r.left)/s+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!o){let s=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=ar(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}};var ue=class n extends A{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return n.valid(r)?new n(r):A.near(r)}content(){return w.empty}eq(e){return e instanceof n&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new n(e.resolve(t.pos))}getBookmark(){return new gs(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!Zm(e)||!eg(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&n.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let l=e.node(s);if(t>0?e.indexAfter(s)0){o=l.child(t>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=t;let a=e.doc.resolve(i);if(n.valid(a))return a}for(;;){let s=t>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!v.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*t),r=!1;continue e}break}o=s,i+=t;let l=e.doc.resolve(i);if(n.valid(l))return l}return null}}};ue.prototype.visible=!1;ue.findFrom=ue.findGapCursorFrom;A.jsonID("gapcursor",ue);var gs=class n{constructor(e){this.pos=e}map(e){return new n(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return ue.valid(t)?new ue(t):A.near(t)}};function Zm(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function eg(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function hu(){return new E({props:{decorations:ig,createSelectionBetween(n,e,t){return e.pos==t.pos&&ue.valid(t)?new ue(t):null},handleClick:ng,handleKeyDown:tg,handleDOMEvents:{beforeinput:rg}}})}var tg=Bo({ArrowLeft:Kr("horiz",-1),ArrowRight:Kr("horiz",1),ArrowUp:Kr("vert",-1),ArrowDown:Kr("vert",1)});function Kr(n,e){let t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,l=e>0?s.$to:s.$from,a=s.empty;if(s instanceof O){if(!o.endOfTextblock(t)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=ue.findGapCursorFrom(l,e,a);return c?(i&&i(r.tr.setSelection(new ue(c))),!0):!1}}function ng(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!ue.valid(r))return!1;let i=n.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&v.isSelectable(n.state.doc.nodeAt(i.inside))?!1:(n.dispatch(n.state.tr.setSelection(new ue(r))),!0)}function rg(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof ue))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let i=x.empty;for(let s=r.length-1;s>=0;s--)i=x.from(r[s].createAndFill(null,i));let o=n.state.tr.replace(t.pos,t.pos,new w(i,0,0));return o.setSelection(O.near(o.doc.resolve(t.pos+1))),n.dispatch(o),!1}function ig(n){if(!(n.selection instanceof ue))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",K.create(n.doc,[X.widget(n.selection.head,e,{key:"gapcursor"})])}var _r=200,ne=function(){};ne.prototype.append=function(e){return e.length?(e=ne.from(e),!this.length&&e||e.length<_r&&this.leafAppend(e)||this.length<_r&&e.leafPrepend(this)||this.appendInner(e)):this};ne.prototype.prepend=function(e){return e.length?ne.from(e).append(this):this};ne.prototype.appendInner=function(e){return new og(this,e)};ne.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?ne.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};ne.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};ne.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)};ne.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},t,r),i};ne.from=function(e){return e instanceof ne?e:e&&e.length?new pu(e):ne.empty};var pu=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var a=o;a=s;a--)if(i(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=_r)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=_r)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(ne);ne.empty=new pu([]);var og=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return rl&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(ne),ys=ne;var sg=500,Lt=class n{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,a,c=[],u=[];return this.items.forEach((f,d)=>{if(!f.step){i||(i=this.remapping(r,d+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new $e(f.map));let h=f.step.map(i.slice(o)),p;h&&s.maybeStep(h).doc&&(p=s.mapping.maps[s.mapping.maps.length-1],c.push(new $e(p,void 0,void 0,c.length+u.length))),o--,p&&i.appendMap(p,o)}else s.maybeStep(f.step);if(f.selection)return l=i?f.selection.map(i.slice(o)):f.selection,a=new n(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:s,selection:l}}addTransform(e,t,r,i){let o=[],s=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let u=0;uag&&(l=lg(l,c),s-=c),new n(l.append(o),s)}remapping(e,t){let r=new xn;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,t),r}addMaps(e){return this.eventCount==0?this:new n(this.items.append(e.map(t=>new $e(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(d=>{d.selection&&l--},i);let a=t;this.items.forEach(d=>{let h=o.getMirror(--a);if(h==null)return;s=Math.min(s,h);let p=o.maps[h];if(d.step){let m=e.steps[h].invert(e.docs[h]),g=d.selection&&d.selection.map(o.slice(a+1,h));g&&l++,r.push(new $e(p,m,g))}else r.push(new $e(p))},i);let c=[];for(let d=t;dsg&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let a=s.step.map(t.slice(r)),c=a&&a.getMap();if(r--,c&&t.appendMap(c,r),a){let u=s.selection&&s.selection.map(t.slice(r));u&&o++;let f=new $e(c.invert(),a,u),d,h=i.length-1;(d=i.length&&i[h].merge(f))?i[h]=d:i.push(f)}}else s.map&&r--},this.items.length,0),new n(ys.from(i.reverse()),o)}};Lt.empty=new Lt(ys.empty,0);function lg(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}var $e=class n{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new n(t.getMap().invert(),t,this.selection)}}},Ve=class{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}},ag=20;function cg(n,e,t,r){let i=t.getMeta(It),o;if(i)return i.historyState;t.getMeta(dg)&&(n=new Ve(n.done,n.undone,null,0,-1));let s=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(s&&s.getMeta(It))return s.getMeta(It).redo?new Ve(n.done.addTransform(t,void 0,r,Ur(e)),n.undone,mu(t.mapping.maps),n.prevTime,n.prevComposition):new Ve(n.done,n.undone.addTransform(t,void 0,r,Ur(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=n.prevTime==0||!s&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!ug(t,n.prevRanges)),c=s?bs(n.prevRanges,t.mapping):mu(t.mapping.maps);return new Ve(n.done.addTransform(t,a?e.selection.getBookmark():void 0,r,Ur(e)),Lt.empty,c,t.time,l??n.prevComposition)}else return(o=t.getMeta("rebased"))?new Ve(n.done.rebased(t,o),n.undone.rebased(t,o),bs(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new Ve(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),bs(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function ug(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(t=!0)}),t}function mu(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,i,o,s)=>e.push(o,s));return e}function bs(n,e){if(!n)return null;let t=[];for(let r=0;r{let i=It.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let o=fg(i,t,n);o&&r(e?o.scrollIntoView():o)}return!0}}var ks=Jr(!1,!0),Ss=Jr(!0,!0),cx=Jr(!1,!1),ux=Jr(!0,!1);var gx=F.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{let e=n?.node||this.editor.state.doc;if((n?.mode||this.options.mode)==="textSize"){let r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=n=>{let e=n?.node||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new E({key:new P("characterCount"),appendTransaction:(e,t,r)=>{if(n)return;let i=this.options.limit;if(i==null||i===0){n=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let s=o-i,l=0,a=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let c=r.tr.deleteRange(l,a);return n=!0,c}n=!0},filterTransaction:(e,t)=>{let r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;let i=this.storage.characters({node:t.doc}),o=this.storage.characters({node:e.doc});if(o<=r||i>r&&o>r&&o<=i)return!0;if(i>r&&o>r&&o>i||!e.getMeta("paste"))return!1;let l=e.selection.$head.pos,a=o-r,c=l-a,u=l;return e.deleteRange(c,u),!(this.storage.characters({node:e.doc})>r)}})]}}),xx=F.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[du(this.options)]}}),Mx=F.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new E({key:new P("focus"),props:{decorations:({doc:n,selection:e})=>{let{isEditable:t,isFocused:r}=this.editor,{anchor:i}=e,o=[];if(!t||!r)return K.create(n,[]);let s=0;this.options.mode==="deepest"&&n.descendants((a,c)=>{if(a.isText)return;if(!(i>=c&&i<=c+a.nodeSize-1))return!1;s+=1});let l=0;return n.descendants((a,c)=>{if(a.isText||!(i>=c&&i<=c+a.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&s-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";o.push(X.node(c,c+a.nodeSize,{class:this.options.className}))}),K.create(n,o)}}})]}}),Tx=F.create({name:"gapCursor",addProseMirrorPlugins(){return[hu()]},extendNodeSchema(n){var e;let t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=H(T(n,"allowGapCursor",t)))!=null?e:null}}}),Nx=F.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new E({key:new P("placeholder"),props:{decorations:({doc:n,selection:e})=>{let t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!t)return null;let o=this.editor.isEmpty;return n.descendants((s,l)=>{let a=r>=l&&r<=l+s.nodeSize,c=!s.isLeaf&&Pn(s);if((a||!this.options.showOnlyCurrent)&&c){let u=[this.options.emptyNodeClass];o&&u.push(this.options.emptyEditorClass);let f=X.node(l,l+s.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:l,hasAnchor:a}):this.options.placeholder});i.push(f)}return this.options.includeChildren}),K.create(n,i)}}})]}}),Ix=F.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){let{editor:n,options:e}=this;return[new E({key:new P("selection"),props:{decorations(t){return t.selection.empty||n.isFocused||!n.isEditable||Kc(t.selection)?null:K.create(t.doc,[X.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});function bu({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||e?.type===n}var Fx=F.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:[]}},addProseMirrorPlugins(){let n=new P(this.name),e=Object.entries(this.editor.schema.nodes).map(([,t])=>t).filter(t=>(this.options.notAfter||[]).concat(this.options.node).includes(t.name));return[new E({key:n,appendTransaction:(t,r,i)=>{let{doc:o,tr:s,schema:l}=i,a=n.getState(i),c=o.content.size,u=l.nodes[this.options.node];if(a)return s.insert(c,u.create())},state:{init:(t,r)=>{let i=r.tr.doc.lastChild;return!bu({node:i,types:e})},apply:(t,r)=>{if(!t.docChanged)return r;let i=t.doc.lastChild;return!bu({node:i,types:e})}}})]}}),xu=F.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>ks(n,e),redo:()=>({state:n,dispatch:e})=>Ss(n,e)}},addProseMirrorPlugins(){return[yu(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});var ln=(n,e)=>{if(n==="slot")return 0;if(n instanceof Function)return n(e);let{children:t,...r}=e??{};if(n==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[n,r,t]};var hg=/^\s*>\s$/,pg=$.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return ln("blockquote",{...D(this.options.HTMLAttributes,n),children:ln("slot",{})})},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[He({find:hg,type:this.type})]}}),ku=pg;var mg=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,gg=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,yg=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,bg=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,xg=te.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:n=>n.type.name===this.name},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return ln("strong",{...D(this.options.HTMLAttributes,n),children:ln("slot",{})})},addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[ze({find:mg,type:this.type}),ze({find:yg,type:this.type})]},addPasteRules(){return[ve({find:gg,type:this.type}),ve({find:bg,type:this.type})]}}),Su=xg;var kg=/(^|[^`])`([^`]+)`(?!`)/,Sg=/(^|[^`])`([^`]+)`(?!`)/g,wg=te.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",D(this.options.HTMLAttributes,n),0]},addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[ze({find:kg,type:this.type})]},addPasteRules(){return[ve({find:Sg,type:this.type})]}}),wu=wg;var Mg=/^```([a-z]+)?[\s\n]$/,Cg=/^~~~([a-z]+)?[\s\n]$/,vg=$.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:n=>{var e;let{languageClassPrefix:t}=this.options,o=[...((e=n.firstElementChild)==null?void 0:e.classList)||[]].filter(s=>s.startsWith(t)).map(s=>s.replace(t,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",D(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:e}=n,{selection:t}=e,{$from:r,empty:i}=t;if(!i||r.parent.type!==this.type)return!1;let o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` +`,textSerializers:t={}}=n||{};return Ep(this.state.doc,{blockSeparator:e,textSerializers:{...Hc(this.schema),...t}})}get isEmpty(){return Pn(this.state.doc)}destroy(){this.emit("destroy"),this.unmount(),this.removeAllListeners()}get isDestroyed(){var n,e;return(e=(n=this.editorView)==null?void 0:n.isDestroyed)!=null?e:!0}$node(n,e){var t;return((t=this.$doc)==null?void 0:t.querySelector(n,e))||null}$nodes(n,e){var t;return((t=this.$doc)==null?void 0:t.querySelectorAll(n,e))||null}$pos(n){let e=this.state.doc.resolve(n);return new Qm(e,this)}get $doc(){return this.$pos(0)}};function ze(n){return new Wr({find:n.find,handler:({state:e,range:t,match:r})=>{let i=H(n.getAttributes,void 0,r);if(i===!1||i===null)return null;let{tr:o}=e,s=r[r.length-1],l=r[0];if(s){let a=l.search(/\S/),c=t.from+l.indexOf(s),u=c+s.length;if(Vr(t.from,t.to,e.doc).filter(h=>h.mark.type.excluded.find(m=>m===n.type&&m!==h.mark.type)).filter(h=>h.to>c).length)return null;ut.from&&o.delete(t.from+a,c);let d=t.from+a+s.length;o.addMark(t.from+a,d,n.type.create(i||{})),o.removeStoredMark(n.type)}}})}function uu(n){return new Wr({find:n.find,handler:({state:e,range:t,match:r})=>{let i=H(n.getAttributes,void 0,r)||{},{tr:o}=e,s=t.from,l=t.to,a=n.type.create(i);if(r[1]){let c=r[0].lastIndexOf(r[1]),u=s+c;u>l?u=l:l=u+r[1].length;let f=r[0][r[0].length-1];o.insertText(f,s+r[0].length-1),o.replaceWith(u,l,a)}else if(r[0]){let c=n.type.isInline?s:s-1;o.insert(c,n.type.create(i)).delete(o.mapping.map(s),o.mapping.map(l))}o.scrollIntoView()}})}function In(n){return new Wr({find:n.find,handler:({state:e,range:t,match:r})=>{let i=e.doc.resolve(t.from),o=H(n.getAttributes,void 0,r)||{};if(!i.node(-1).canReplaceWith(i.index(-1),i.indexAfter(-1),n.type))return null;e.tr.delete(t.from,t.to).setBlockType(t.from,t.from,n.type,o)}})}function He(n){return new Wr({find:n.find,handler:({state:e,range:t,match:r,chain:i})=>{let o=H(n.getAttributes,void 0,r)||{},s=e.tr.delete(t.from,t.to),a=s.doc.resolve(t.from).blockRange(),c=a&&Gt(a,n.type,o);if(!c)return null;if(s.wrap(a,c),n.keepMarks&&n.editor){let{selection:f,storedMarks:d}=e,{splittableMarks:h}=n.editor.extensionManager,p=d||f.$to.parentOffset&&f.$from.marks();if(p){let m=p.filter(g=>h.includes(g.type.name));s.ensureMarks(m)}}if(n.keepAttributes){let f=n.type.name==="bulletList"||n.type.name==="orderedList"?"listItem":"taskList";i().updateAttributes(f,o).run()}let u=s.doc.resolve(t.from-1).nodeBefore;u&&u.type===n.type&&Se(s.doc,t.from-1)&&(!n.joinPredicate||n.joinPredicate(r,u))&&s.join(t.from-1)}})}function fu(n){return n.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}var $=class du extends hs{constructor(){super(...arguments),this.type="node"}static create(e={}){return new du(e)}configure(e){return super.configure(e)}extend(e){return super.extend(e)}};function ve(n){return new zp({find:n.find,handler:({state:e,range:t,match:r,pasteEvent:i})=>{let o=H(n.getAttributes,void 0,r,i);if(o===!1||o===null)return null;let{tr:s}=e,l=r[r.length-1],a=r[0],c=t.to;if(l){let u=a.search(/\S/),f=t.from+a.indexOf(l),d=f+l.length;if(Vr(t.from,t.to,e.doc).filter(p=>p.mark.type.excluded.find(g=>g===n.type&&g!==p.mark.type)).filter(p=>p.to>f).length)return null;dt.from&&s.delete(t.from+u,f),c=t.from+u+l.length,s.addMark(t.from+u,c,n.type.create(o||{})),s.removeStoredMark(n.type)}}})}function hu(n={}){return new E({view(e){return new ms(e,n)}})}var ms=class{constructor(e,t){var r;this.editorView=e,this.cursorPos=null,this.element=null,this.timeout=-1,this.width=(r=t.width)!==null&&r!==void 0?r:1,this.color=t.color===!1?void 0:t.color||"black",this.class=t.class,this.handlers=["dragover","dragend","drop","dragleave"].map(i=>{let o=s=>{this[i](s)};return e.dom.addEventListener(i,o),{name:i,handler:o}})}destroy(){this.handlers.forEach(({name:e,handler:t})=>this.editorView.dom.removeEventListener(e,t))}update(e,t){this.cursorPos!=null&&t.doc!=e.state.doc&&(this.cursorPos>e.state.doc.content.size?this.setCursor(null):this.updateOverlay())}setCursor(e){e!=this.cursorPos&&(this.cursorPos=e,e==null?(this.element.parentNode.removeChild(this.element),this.element=null):this.updateOverlay())}updateOverlay(){let e=this.editorView.state.doc.resolve(this.cursorPos),t=!e.parent.inlineContent,r,i=this.editorView.dom,o=i.getBoundingClientRect(),s=o.width/i.offsetWidth,l=o.height/i.offsetHeight;if(t){let f=e.nodeBefore,d=e.nodeAfter;if(f||d){let h=this.editorView.nodeDOM(this.cursorPos-(f?f.nodeSize:0));if(h){let p=h.getBoundingClientRect(),m=f?p.bottom:p.top;f&&d&&(m=(m+this.editorView.nodeDOM(this.cursorPos).getBoundingClientRect().top)/2);let g=this.width/2*l;r={left:p.left,right:p.right,top:m-g,bottom:m+g}}}}if(!r){let f=this.editorView.coordsAtPos(this.cursorPos),d=this.width/2*s;r={left:f.left-d,right:f.left+d,top:f.top,bottom:f.bottom}}let a=this.editorView.dom.offsetParent;this.element||(this.element=a.appendChild(document.createElement("div")),this.class&&(this.element.className=this.class),this.element.style.cssText="position: absolute; z-index: 50; pointer-events: none;",this.color&&(this.element.style.backgroundColor=this.color)),this.element.classList.toggle("prosemirror-dropcursor-block",t),this.element.classList.toggle("prosemirror-dropcursor-inline",!t);let c,u;if(!a||a==document.body&&getComputedStyle(a).position=="static")c=-pageXOffset,u=-pageYOffset;else{let f=a.getBoundingClientRect(),d=f.width/a.offsetWidth,h=f.height/a.offsetHeight;c=f.left-a.scrollLeft*d,u=f.top-a.scrollTop*h}this.element.style.left=(r.left-c)/s+"px",this.element.style.top=(r.top-u)/l+"px",this.element.style.width=(r.right-r.left)/s+"px",this.element.style.height=(r.bottom-r.top)/l+"px"}scheduleRemoval(e){clearTimeout(this.timeout),this.timeout=setTimeout(()=>this.setCursor(null),e)}dragover(e){if(!this.editorView.editable)return;let t=this.editorView.posAtCoords({left:e.clientX,top:e.clientY}),r=t&&t.inside>=0&&this.editorView.state.doc.nodeAt(t.inside),i=r&&r.type.spec.disableDropCursor,o=typeof i=="function"?i(this.editorView,t,e):i;if(t&&!o){let s=t.pos;if(this.editorView.dragging&&this.editorView.dragging.slice){let l=ar(this.editorView.state.doc,s,this.editorView.dragging.slice);l!=null&&(s=l)}this.setCursor(s),this.scheduleRemoval(5e3)}}dragend(){this.scheduleRemoval(20)}drop(){this.scheduleRemoval(20)}dragleave(e){this.editorView.dom.contains(e.relatedTarget)||this.setCursor(null)}};var ue=class n extends A{constructor(e){super(e,e)}map(e,t){let r=e.resolve(t.map(this.head));return n.valid(r)?new n(r):A.near(r)}content(){return w.empty}eq(e){return e instanceof n&&e.head==this.head}toJSON(){return{type:"gapcursor",pos:this.head}}static fromJSON(e,t){if(typeof t.pos!="number")throw new RangeError("Invalid input for GapCursor.fromJSON");return new n(e.resolve(t.pos))}getBookmark(){return new gs(this.anchor)}static valid(e){let t=e.parent;if(t.isTextblock||!tg(e)||!ng(e))return!1;let r=t.type.spec.allowGapCursor;if(r!=null)return r;let i=t.contentMatchAt(e.index()).defaultType;return i&&i.isTextblock}static findGapCursorFrom(e,t,r=!1){e:for(;;){if(!r&&n.valid(e))return e;let i=e.pos,o=null;for(let s=e.depth;;s--){let l=e.node(s);if(t>0?e.indexAfter(s)0){o=l.child(t>0?e.indexAfter(s):e.index(s)-1);break}else if(s==0)return null;i+=t;let a=e.doc.resolve(i);if(n.valid(a))return a}for(;;){let s=t>0?o.firstChild:o.lastChild;if(!s){if(o.isAtom&&!o.isText&&!v.isSelectable(o)){e=e.doc.resolve(i+o.nodeSize*t),r=!1;continue e}break}o=s,i+=t;let l=e.doc.resolve(i);if(n.valid(l))return l}return null}}};ue.prototype.visible=!1;ue.findFrom=ue.findGapCursorFrom;A.jsonID("gapcursor",ue);var gs=class n{constructor(e){this.pos=e}map(e){return new n(e.map(this.pos))}resolve(e){let t=e.resolve(this.pos);return ue.valid(t)?new ue(t):A.near(t)}};function tg(n){for(let e=n.depth;e>=0;e--){let t=n.index(e),r=n.node(e);if(t==0){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t-1);;i=i.lastChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function ng(n){for(let e=n.depth;e>=0;e--){let t=n.indexAfter(e),r=n.node(e);if(t==r.childCount){if(r.type.spec.isolating)return!0;continue}for(let i=r.child(t);;i=i.firstChild){if(i.childCount==0&&!i.inlineContent||i.isAtom||i.type.spec.isolating)return!0;if(i.inlineContent)return!1}}return!0}function pu(){return new E({props:{decorations:sg,createSelectionBetween(n,e,t){return e.pos==t.pos&&ue.valid(t)?new ue(t):null},handleClick:ig,handleKeyDown:rg,handleDOMEvents:{beforeinput:og}}})}var rg=Bo({ArrowLeft:Kr("horiz",-1),ArrowRight:Kr("horiz",1),ArrowUp:Kr("vert",-1),ArrowDown:Kr("vert",1)});function Kr(n,e){let t=n=="vert"?e>0?"down":"up":e>0?"right":"left";return function(r,i,o){let s=r.selection,l=e>0?s.$to:s.$from,a=s.empty;if(s instanceof O){if(!o.endOfTextblock(t)||l.depth==0)return!1;a=!1,l=r.doc.resolve(e>0?l.after():l.before())}let c=ue.findGapCursorFrom(l,e,a);return c?(i&&i(r.tr.setSelection(new ue(c))),!0):!1}}function ig(n,e,t){if(!n||!n.editable)return!1;let r=n.state.doc.resolve(e);if(!ue.valid(r))return!1;let i=n.posAtCoords({left:t.clientX,top:t.clientY});return i&&i.inside>-1&&v.isSelectable(n.state.doc.nodeAt(i.inside))?!1:(n.dispatch(n.state.tr.setSelection(new ue(r))),!0)}function og(n,e){if(e.inputType!="insertCompositionText"||!(n.state.selection instanceof ue))return!1;let{$from:t}=n.state.selection,r=t.parent.contentMatchAt(t.index()).findWrapping(n.state.schema.nodes.text);if(!r)return!1;let i=x.empty;for(let s=r.length-1;s>=0;s--)i=x.from(r[s].createAndFill(null,i));let o=n.state.tr.replace(t.pos,t.pos,new w(i,0,0));return o.setSelection(O.near(o.doc.resolve(t.pos+1))),n.dispatch(o),!1}function sg(n){if(!(n.selection instanceof ue))return null;let e=document.createElement("div");return e.className="ProseMirror-gapcursor",K.create(n.doc,[X.widget(n.selection.head,e,{key:"gapcursor"})])}var _r=200,ne=function(){};ne.prototype.append=function(e){return e.length?(e=ne.from(e),!this.length&&e||e.length<_r&&this.leafAppend(e)||this.length<_r&&e.leafPrepend(this)||this.appendInner(e)):this};ne.prototype.prepend=function(e){return e.length?ne.from(e).append(this):this};ne.prototype.appendInner=function(e){return new lg(this,e)};ne.prototype.slice=function(e,t){return e===void 0&&(e=0),t===void 0&&(t=this.length),e>=t?ne.empty:this.sliceInner(Math.max(0,e),Math.min(this.length,t))};ne.prototype.get=function(e){if(!(e<0||e>=this.length))return this.getInner(e)};ne.prototype.forEach=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length),t<=r?this.forEachInner(e,t,r,0):this.forEachInvertedInner(e,t,r,0)};ne.prototype.map=function(e,t,r){t===void 0&&(t=0),r===void 0&&(r=this.length);var i=[];return this.forEach(function(o,s){return i.push(e(o,s))},t,r),i};ne.from=function(e){return e instanceof ne?e:e&&e.length?new mu(e):ne.empty};var mu=function(n){function e(r){n.call(this),this.values=r}n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e;var t={length:{configurable:!0},depth:{configurable:!0}};return e.prototype.flatten=function(){return this.values},e.prototype.sliceInner=function(i,o){return i==0&&o==this.length?this:new e(this.values.slice(i,o))},e.prototype.getInner=function(i){return this.values[i]},e.prototype.forEachInner=function(i,o,s,l){for(var a=o;a=s;a--)if(i(this.values[a],l+a)===!1)return!1},e.prototype.leafAppend=function(i){if(this.length+i.length<=_r)return new e(this.values.concat(i.flatten()))},e.prototype.leafPrepend=function(i){if(this.length+i.length<=_r)return new e(i.flatten().concat(this.values))},t.length.get=function(){return this.values.length},t.depth.get=function(){return 0},Object.defineProperties(e.prototype,t),e}(ne);ne.empty=new mu([]);var lg=function(n){function e(t,r){n.call(this),this.left=t,this.right=r,this.length=t.length+r.length,this.depth=Math.max(t.depth,r.depth)+1}return n&&(e.__proto__=n),e.prototype=Object.create(n&&n.prototype),e.prototype.constructor=e,e.prototype.flatten=function(){return this.left.flatten().concat(this.right.flatten())},e.prototype.getInner=function(r){return rl&&this.right.forEachInner(r,Math.max(i-l,0),Math.min(this.length,o)-l,s+l)===!1)return!1},e.prototype.forEachInvertedInner=function(r,i,o,s){var l=this.left.length;if(i>l&&this.right.forEachInvertedInner(r,i-l,Math.max(o,l)-l,s+l)===!1||o=o?this.right.slice(r-o,i-o):this.left.slice(r,o).append(this.right.slice(0,i-o))},e.prototype.leafAppend=function(r){var i=this.right.leafAppend(r);if(i)return new e(this.left,i)},e.prototype.leafPrepend=function(r){var i=this.left.leafPrepend(r);if(i)return new e(i,this.right)},e.prototype.appendInner=function(r){return this.left.depth>=Math.max(this.right.depth,r.depth)+1?new e(this.left,new e(this.right,r)):new e(this,r)},e}(ne),ys=ne;var ag=500,Lt=class n{constructor(e,t){this.items=e,this.eventCount=t}popEvent(e,t){if(this.eventCount==0)return null;let r=this.items.length;for(;;r--)if(this.items.get(r-1).selection){--r;break}let i,o;t&&(i=this.remapping(r,this.items.length),o=i.maps.length);let s=e.tr,l,a,c=[],u=[];return this.items.forEach((f,d)=>{if(!f.step){i||(i=this.remapping(r,d+1),o=i.maps.length),o--,u.push(f);return}if(i){u.push(new $e(f.map));let h=f.step.map(i.slice(o)),p;h&&s.maybeStep(h).doc&&(p=s.mapping.maps[s.mapping.maps.length-1],c.push(new $e(p,void 0,void 0,c.length+u.length))),o--,p&&i.appendMap(p,o)}else s.maybeStep(f.step);if(f.selection)return l=i?f.selection.map(i.slice(o)):f.selection,a=new n(this.items.slice(0,r).append(u.reverse().concat(c)),this.eventCount-1),!1},this.items.length,0),{remaining:a,transform:s,selection:l}}addTransform(e,t,r,i){let o=[],s=this.eventCount,l=this.items,a=!i&&l.length?l.get(l.length-1):null;for(let u=0;uug&&(l=cg(l,c),s-=c),new n(l.append(o),s)}remapping(e,t){let r=new xn;return this.items.forEach((i,o)=>{let s=i.mirrorOffset!=null&&o-i.mirrorOffset>=e?r.maps.length-i.mirrorOffset:void 0;r.appendMap(i.map,s)},e,t),r}addMaps(e){return this.eventCount==0?this:new n(this.items.append(e.map(t=>new $e(t))),this.eventCount)}rebased(e,t){if(!this.eventCount)return this;let r=[],i=Math.max(0,this.items.length-t),o=e.mapping,s=e.steps.length,l=this.eventCount;this.items.forEach(d=>{d.selection&&l--},i);let a=t;this.items.forEach(d=>{let h=o.getMirror(--a);if(h==null)return;s=Math.min(s,h);let p=o.maps[h];if(d.step){let m=e.steps[h].invert(e.docs[h]),g=d.selection&&d.selection.map(o.slice(a+1,h));g&&l++,r.push(new $e(p,m,g))}else r.push(new $e(p))},i);let c=[];for(let d=t;dag&&(f=f.compress(this.items.length-r.length)),f}emptyItemCount(){let e=0;return this.items.forEach(t=>{t.step||e++}),e}compress(e=this.items.length){let t=this.remapping(0,e),r=t.maps.length,i=[],o=0;return this.items.forEach((s,l)=>{if(l>=e)i.push(s),s.selection&&o++;else if(s.step){let a=s.step.map(t.slice(r)),c=a&&a.getMap();if(r--,c&&t.appendMap(c,r),a){let u=s.selection&&s.selection.map(t.slice(r));u&&o++;let f=new $e(c.invert(),a,u),d,h=i.length-1;(d=i.length&&i[h].merge(f))?i[h]=d:i.push(f)}}else s.map&&r--},this.items.length,0),new n(ys.from(i.reverse()),o)}};Lt.empty=new Lt(ys.empty,0);function cg(n,e){let t;return n.forEach((r,i)=>{if(r.selection&&e--==0)return t=i,!1}),n.slice(t)}var $e=class n{constructor(e,t,r,i){this.map=e,this.step=t,this.selection=r,this.mirrorOffset=i}merge(e){if(this.step&&e.step&&!e.selection){let t=e.step.merge(this.step);if(t)return new n(t.getMap().invert(),t,this.selection)}}},Ve=class{constructor(e,t,r,i,o){this.done=e,this.undone=t,this.prevRanges=r,this.prevTime=i,this.prevComposition=o}},ug=20;function fg(n,e,t,r){let i=t.getMeta(It),o;if(i)return i.historyState;t.getMeta(pg)&&(n=new Ve(n.done,n.undone,null,0,-1));let s=t.getMeta("appendedTransaction");if(t.steps.length==0)return n;if(s&&s.getMeta(It))return s.getMeta(It).redo?new Ve(n.done.addTransform(t,void 0,r,Ur(e)),n.undone,gu(t.mapping.maps),n.prevTime,n.prevComposition):new Ve(n.done,n.undone.addTransform(t,void 0,r,Ur(e)),null,n.prevTime,n.prevComposition);if(t.getMeta("addToHistory")!==!1&&!(s&&s.getMeta("addToHistory")===!1)){let l=t.getMeta("composition"),a=n.prevTime==0||!s&&n.prevComposition!=l&&(n.prevTime<(t.time||0)-r.newGroupDelay||!dg(t,n.prevRanges)),c=s?bs(n.prevRanges,t.mapping):gu(t.mapping.maps);return new Ve(n.done.addTransform(t,a?e.selection.getBookmark():void 0,r,Ur(e)),Lt.empty,c,t.time,l??n.prevComposition)}else return(o=t.getMeta("rebased"))?new Ve(n.done.rebased(t,o),n.undone.rebased(t,o),bs(n.prevRanges,t.mapping),n.prevTime,n.prevComposition):new Ve(n.done.addMaps(t.mapping.maps),n.undone.addMaps(t.mapping.maps),bs(n.prevRanges,t.mapping),n.prevTime,n.prevComposition)}function dg(n,e){if(!e)return!1;if(!n.docChanged)return!0;let t=!1;return n.mapping.maps[0].forEach((r,i)=>{for(let o=0;o=e[o]&&(t=!0)}),t}function gu(n){let e=[];for(let t=n.length-1;t>=0&&e.length==0;t--)n[t].forEach((r,i,o,s)=>e.push(o,s));return e}function bs(n,e){if(!n)return null;let t=[];for(let r=0;r{let i=It.getState(t);if(!i||(n?i.undone:i.done).eventCount==0)return!1;if(r){let o=hg(i,t,n);o&&r(e?o.scrollIntoView():o)}return!0}}var ks=Jr(!1,!0),Ss=Jr(!0,!0),fx=Jr(!1,!1),dx=Jr(!0,!1);var bx=F.create({name:"characterCount",addOptions(){return{limit:null,mode:"textSize",textCounter:n=>n.length,wordCounter:n=>n.split(" ").filter(e=>e!=="").length}},addStorage(){return{characters:()=>0,words:()=>0}},onBeforeCreate(){this.storage.characters=n=>{let e=n?.node||this.editor.state.doc;if((n?.mode||this.options.mode)==="textSize"){let r=e.textBetween(0,e.content.size,void 0," ");return this.options.textCounter(r)}return e.nodeSize},this.storage.words=n=>{let e=n?.node||this.editor.state.doc,t=e.textBetween(0,e.content.size," "," ");return this.options.wordCounter(t)}},addProseMirrorPlugins(){let n=!1;return[new E({key:new P("characterCount"),appendTransaction:(e,t,r)=>{if(n)return;let i=this.options.limit;if(i==null||i===0){n=!0;return}let o=this.storage.characters({node:r.doc});if(o>i){let s=o-i,l=0,a=s;console.warn(`[CharacterCount] Initial content exceeded limit of ${i} characters. Content was automatically trimmed.`);let c=r.tr.deleteRange(l,a);return n=!0,c}n=!0},filterTransaction:(e,t)=>{let r=this.options.limit;if(!e.docChanged||r===0||r===null||r===void 0)return!0;let i=this.storage.characters({node:t.doc}),o=this.storage.characters({node:e.doc});if(o<=r||i>r&&o>r&&o<=i)return!0;if(i>r&&o>r&&o>i||!e.getMeta("paste"))return!1;let l=e.selection.$head.pos,a=o-r,c=l-a,u=l;return e.deleteRange(c,u),!(this.storage.characters({node:e.doc})>r)}})]}}),ws=F.create({name:"dropCursor",addOptions(){return{color:"currentColor",width:1,class:void 0}},addProseMirrorPlugins(){return[hu(this.options)]}}),Cx=F.create({name:"focus",addOptions(){return{className:"has-focus",mode:"all"}},addProseMirrorPlugins(){return[new E({key:new P("focus"),props:{decorations:({doc:n,selection:e})=>{let{isEditable:t,isFocused:r}=this.editor,{anchor:i}=e,o=[];if(!t||!r)return K.create(n,[]);let s=0;this.options.mode==="deepest"&&n.descendants((a,c)=>{if(a.isText)return;if(!(i>=c&&i<=c+a.nodeSize-1))return!1;s+=1});let l=0;return n.descendants((a,c)=>{if(a.isText||!(i>=c&&i<=c+a.nodeSize-1))return!1;if(l+=1,this.options.mode==="deepest"&&s-l>0||this.options.mode==="shallowest"&&l>1)return this.options.mode==="deepest";o.push(X.node(c,c+a.nodeSize,{class:this.options.className}))}),K.create(n,o)}}})]}}),Ex=F.create({name:"gapCursor",addProseMirrorPlugins(){return[pu()]},extendNodeSchema(n){var e;let t={name:n.name,options:n.options,storage:n.storage};return{allowGapCursor:(e=H(T(n,"allowGapCursor",t)))!=null?e:null}}}),Dx=F.create({name:"placeholder",addOptions(){return{emptyEditorClass:"is-editor-empty",emptyNodeClass:"is-empty",placeholder:"Write something \u2026",showOnlyWhenEditable:!0,showOnlyCurrent:!0,includeChildren:!1}},addProseMirrorPlugins(){return[new E({key:new P("placeholder"),props:{decorations:({doc:n,selection:e})=>{let t=this.editor.isEditable||!this.options.showOnlyWhenEditable,{anchor:r}=e,i=[];if(!t)return null;let o=this.editor.isEmpty;return n.descendants((s,l)=>{let a=r>=l&&r<=l+s.nodeSize,c=!s.isLeaf&&Pn(s);if((a||!this.options.showOnlyCurrent)&&c){let u=[this.options.emptyNodeClass];o&&u.push(this.options.emptyEditorClass);let f=X.node(l,l+s.nodeSize,{class:u.join(" "),"data-placeholder":typeof this.options.placeholder=="function"?this.options.placeholder({editor:this.editor,node:s,pos:l,hasAnchor:a}):this.options.placeholder});i.push(f)}return this.options.includeChildren}),K.create(n,i)}}})]}}),Lx=F.create({name:"selection",addOptions(){return{className:"selection"}},addProseMirrorPlugins(){let{editor:n,options:e}=this;return[new E({key:new P("selection"),props:{decorations(t){return t.selection.empty||n.isFocused||!n.isEditable||_c(t.selection)?null:K.create(t.doc,[X.inline(t.selection.from,t.selection.to,{class:e.className})])}}})]}});function xu({types:n,node:e}){return e&&Array.isArray(n)&&n.includes(e.type)||e?.type===n}var zx=F.create({name:"trailingNode",addOptions(){return{node:"paragraph",notAfter:[]}},addProseMirrorPlugins(){let n=new P(this.name),e=Object.entries(this.editor.schema.nodes).map(([,t])=>t).filter(t=>(this.options.notAfter||[]).concat(this.options.node).includes(t.name));return[new E({key:n,appendTransaction:(t,r,i)=>{let{doc:o,tr:s,schema:l}=i,a=n.getState(i),c=o.content.size,u=l.nodes[this.options.node];if(a)return s.insert(c,u.create())},state:{init:(t,r)=>{let i=r.tr.doc.lastChild;return!xu({node:i,types:e})},apply:(t,r)=>{if(!t.docChanged)return r;let i=t.doc.lastChild;return!xu({node:i,types:e})}}})]}}),ku=F.create({name:"undoRedo",addOptions(){return{depth:100,newGroupDelay:500}},addCommands(){return{undo:()=>({state:n,dispatch:e})=>ks(n,e),redo:()=>({state:n,dispatch:e})=>Ss(n,e)}},addProseMirrorPlugins(){return[bu(this.options)]},addKeyboardShortcuts(){return{"Mod-z":()=>this.editor.commands.undo(),"Shift-Mod-z":()=>this.editor.commands.redo(),"Mod-y":()=>this.editor.commands.redo(),"Mod-\u044F":()=>this.editor.commands.undo(),"Shift-Mod-\u044F":()=>this.editor.commands.redo()}}});var ln=(n,e)=>{if(n==="slot")return 0;if(n instanceof Function)return n(e);let{children:t,...r}=e??{};if(n==="svg")throw new Error("SVG elements are not supported in the JSX syntax, use the array syntax instead");return[n,r,t]};var mg=/^\s*>\s$/,gg=$.create({name:"blockquote",addOptions(){return{HTMLAttributes:{}}},content:"block+",group:"block",defining:!0,parseHTML(){return[{tag:"blockquote"}]},renderHTML({HTMLAttributes:n}){return ln("blockquote",{...D(this.options.HTMLAttributes,n),children:ln("slot",{})})},addCommands(){return{setBlockquote:()=>({commands:n})=>n.wrapIn(this.name),toggleBlockquote:()=>({commands:n})=>n.toggleWrap(this.name),unsetBlockquote:()=>({commands:n})=>n.lift(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-b":()=>this.editor.commands.toggleBlockquote()}},addInputRules(){return[He({find:mg,type:this.type})]}}),Su=gg;var yg=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))$/,bg=/(?:^|\s)(\*\*(?!\s+\*\*)((?:[^*]+))\*\*(?!\s+\*\*))/g,xg=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))$/,kg=/(?:^|\s)(__(?!\s+__)((?:[^_]+))__(?!\s+__))/g,Sg=te.create({name:"bold",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"strong"},{tag:"b",getAttrs:n=>n.style.fontWeight!=="normal"&&null},{style:"font-weight=400",clearMark:n=>n.type.name===this.name},{style:"font-weight",getAttrs:n=>/^(bold(er)?|[5-9]\d{2,})$/.test(n)&&null}]},renderHTML({HTMLAttributes:n}){return ln("strong",{...D(this.options.HTMLAttributes,n),children:ln("slot",{})})},addCommands(){return{setBold:()=>({commands:n})=>n.setMark(this.name),toggleBold:()=>({commands:n})=>n.toggleMark(this.name),unsetBold:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-b":()=>this.editor.commands.toggleBold(),"Mod-B":()=>this.editor.commands.toggleBold()}},addInputRules(){return[ze({find:yg,type:this.type}),ze({find:xg,type:this.type})]},addPasteRules(){return[ve({find:bg,type:this.type}),ve({find:kg,type:this.type})]}}),wu=Sg;var wg=/(^|[^`])`([^`]+)`(?!`)/,Mg=/(^|[^`])`([^`]+)`(?!`)/g,Cg=te.create({name:"code",addOptions(){return{HTMLAttributes:{}}},excludes:"_",code:!0,exitable:!0,parseHTML(){return[{tag:"code"}]},renderHTML({HTMLAttributes:n}){return["code",D(this.options.HTMLAttributes,n),0]},addCommands(){return{setCode:()=>({commands:n})=>n.setMark(this.name),toggleCode:()=>({commands:n})=>n.toggleMark(this.name),unsetCode:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-e":()=>this.editor.commands.toggleCode()}},addInputRules(){return[ze({find:wg,type:this.type})]},addPasteRules(){return[ve({find:Mg,type:this.type})]}}),Mu=Cg;var vg=/^```([a-z]+)?[\s\n]$/,Tg=/^~~~([a-z]+)?[\s\n]$/,Eg=$.create({name:"codeBlock",addOptions(){return{languageClassPrefix:"language-",exitOnTripleEnter:!0,exitOnArrowDown:!0,defaultLanguage:null,HTMLAttributes:{}}},content:"text*",marks:"",group:"block",code:!0,defining:!0,addAttributes(){return{language:{default:this.options.defaultLanguage,parseHTML:n=>{var e;let{languageClassPrefix:t}=this.options,o=[...((e=n.firstElementChild)==null?void 0:e.classList)||[]].filter(s=>s.startsWith(t)).map(s=>s.replace(t,""))[0];return o||null},rendered:!1}}},parseHTML(){return[{tag:"pre",preserveWhitespace:"full"}]},renderHTML({node:n,HTMLAttributes:e}){return["pre",D(this.options.HTMLAttributes,e),["code",{class:n.attrs.language?this.options.languageClassPrefix+n.attrs.language:null},0]]},addCommands(){return{setCodeBlock:n=>({commands:e})=>e.setNode(this.name,n),toggleCodeBlock:n=>({commands:e})=>e.toggleNode(this.name,"paragraph",n)}},addKeyboardShortcuts(){return{"Mod-Alt-c":()=>this.editor.commands.toggleCodeBlock(),Backspace:()=>{let{empty:n,$anchor:e}=this.editor.state.selection,t=e.pos===1;return!n||e.parent.type.name!==this.name?!1:t||!e.parent.textContent.length?this.editor.commands.clearNodes():!1},Enter:({editor:n})=>{if(!this.options.exitOnTripleEnter)return!1;let{state:e}=n,{selection:t}=e,{$from:r,empty:i}=t;if(!i||r.parent.type!==this.type)return!1;let o=r.parentOffset===r.parent.nodeSize-2,s=r.parent.textContent.endsWith(` -`);return!o||!s?!1:n.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;let{state:e}=n,{selection:t,doc:r}=e,{$from:i,empty:o}=t;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;let l=i.after();return l===void 0?!1:r.nodeAt(l)?n.commands.command(({tr:c})=>(c.setSelection(A.near(r.resolve(l))),!0)):n.commands.exitCode()}}},addInputRules(){return[In({find:Mg,type:this.type,getAttributes:n=>({language:n[1]})}),In({find:Cg,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new E({key:new P("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;let t=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i?.mode;if(!t||!o)return!1;let{tr:s,schema:l}=n.state,a=l.text(t.replace(/\r\n?/g,` -`));return s.replaceSelectionWith(this.type.create({language:o},a)),s.selection.$from.parent.type!==this.type&&s.setSelection(O.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),n.dispatch(s),!0}}})]}}),Mu=vg;var Cu=$.create({name:"customBlock",priority:101,group:"block",atom:!0,defining:!0,draggable:!0,selectable:!0,isolating:!0,allowGapCursor:!0,inline:!1,addOptions:function(){return{HTMLAttributes:{},renderText({node:n}){return`<<${n.attrs.label??n.attrs.id}>>`},renderHTML({options:n,node:e}){return["div",D(this.HTMLAttributes,n.HTMLAttributes),`${e.attrs.label??e.attrs.id}`]}}},addAttributes:function(){return{id:{default:null,parseHTML:n=>n.getAttribute("data-id"),renderHTML:n=>n.id?{"data-id":n.id}:{}},label:{default:null,parseHTML:n=>n.getAttribute("data-label"),renderHTML:n=>n.label?{"data-label":n.label}:{}}}},parseHTML:function(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML:function({node:n,HTMLAttributes:e}){let t={...this.options};t.HTMLAttributes=D({"data-type":this.name},this.options.HTMLAttributes,e);let r=this.options.renderHTML({options:t,node:n});return typeof r=="string"?["div",D({"data-type":this.name},this.options.HTMLAttributes,e),r]:r},renderText:function({node:n}){let e={options:this.options,node:n};return this.options.renderText(e)},addKeyboardShortcuts:function(){return{Backspace:()=>this.editor.commands.command(({tr:n,state:e})=>{let t=!1,{selection:r}=e,{empty:i,anchor:o}=r;if(!i)return!1;let s=new G,l=0;return e.doc.nodesBetween(o-1,o,(a,c)=>{if(a.type.name===this.name)return t=!0,s=a,l=c,!1}),t})}},addProseMirrorPlugins:function(){return[new E({props:{handleDrop(n,e){if(!e||(e.preventDefault(),!e.dataTransfer.getData("customBlock")))return!1;let t=e.dataTransfer.getData("customBlock");return n.dispatch(n.state.tr.insert(n.posAtCoords({left:e.clientX,top:e.clientY}).pos,n.state.schema.nodes.customBlock.create({id:t}))),!1}}})]}});var Tg=$.create({name:"doc",topNode:!0,content:"block+"}),vu=Tg;var Eg=$.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,D(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>In({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),Tu=Eg;var Ag=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Og=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Ng=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Dg=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Rg=te.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",D(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ze({find:Ag,type:this.type}),ze({find:Ng,type:this.type})]},addPasteRules(){return[ve({find:Og,type:this.type}),ve({find:Dg,type:this.type})]}}),Eu=Rg;var Pg=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Ig=$.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:n}){return["img",D(this.options.HTMLAttributes,n)]},addCommands(){return{setImage:n=>({commands:e})=>e.insertContent({type:this.name,attrs:n})}},addInputRules(){return[cu({find:Pg,type:this.type,getAttributes:n=>{let[,,e,t,r]=n;return{src:t,alt:e,title:r}}})]}}),Au=Ig;var Ou=Au.extend({addAttributes(){return{...this.parent?.(),"data-id":{default:null}}}});var Lg="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",Bg="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",cn=(n,e)=>{for(let t in e)n[t]=e[t];return n},As="numeric",Os="ascii",Ns="alpha",Fn="asciinumeric",Bn="alphanumeric",Ds="domain",Bu="emoji",Fg="scheme",zg="slashscheme",ws="whitespace";function Hg(n,e){return n in e||(e[n]=[]),e[n]}function Bt(n,e,t){e[As]&&(e[Fn]=!0,e[Bn]=!0),e[Os]&&(e[Fn]=!0,e[Ns]=!0),e[Fn]&&(e[Bn]=!0),e[Ns]&&(e[Bn]=!0),e[Bn]&&(e[Ds]=!0),e[Bu]&&(e[Ds]=!0);for(let r in e){let i=Hg(r,t);i.indexOf(n)<0&&i.push(n)}}function $g(n,e){let t={};for(let r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function ye(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}ye.groups={};ye.prototype={accepts(){return!!this.t},go(n){let e=this,t=e.j[n];if(t)return t;for(let r=0;rn.ta(e,t,r,i),U=(n,e,t,r,i)=>n.tr(e,t,r,i),Nu=(n,e,t,r,i)=>n.ts(e,t,r,i),k=(n,e,t,r,i)=>n.tt(e,t,r,i),it="WORD",Rs="UWORD",Fu="ASCIINUMERICAL",zu="ALPHANUMERICAL",jn="LOCALHOST",Ps="TLD",Is="UTLD",Xr="SCHEME",an="SLASH_SCHEME",Bs="NUM",Ls="WS",Fs="NL",zn="OPENBRACE",Hn="CLOSEBRACE",Qr="OPENBRACKET",Zr="CLOSEBRACKET",ei="OPENPAREN",ti="CLOSEPAREN",ni="OPENANGLEBRACKET",ri="CLOSEANGLEBRACKET",ii="FULLWIDTHLEFTPAREN",oi="FULLWIDTHRIGHTPAREN",si="LEFTCORNERBRACKET",li="RIGHTCORNERBRACKET",ai="LEFTWHITECORNERBRACKET",ci="RIGHTWHITECORNERBRACKET",ui="FULLWIDTHLESSTHAN",fi="FULLWIDTHGREATERTHAN",di="AMPERSAND",hi="APOSTROPHE",pi="ASTERISK",mt="AT",mi="BACKSLASH",gi="BACKTICK",yi="CARET",gt="COLON",zs="COMMA",bi="DOLLAR",We="DOT",xi="EQUALS",Hs="EXCLAMATION",Ee="HYPHEN",$n="PERCENT",ki="PIPE",Si="PLUS",wi="POUND",Vn="QUERY",$s="QUOTE",Hu="FULLWIDTHMIDDLEDOT",Vs="SEMI",je="SLASH",Wn="TILDE",Mi="UNDERSCORE",$u="EMOJI",Ci="SYM",Vu=Object.freeze({__proto__:null,ALPHANUMERICAL:zu,AMPERSAND:di,APOSTROPHE:hi,ASCIINUMERICAL:Fu,ASTERISK:pi,AT:mt,BACKSLASH:mi,BACKTICK:gi,CARET:yi,CLOSEANGLEBRACKET:ri,CLOSEBRACE:Hn,CLOSEBRACKET:Zr,CLOSEPAREN:ti,COLON:gt,COMMA:zs,DOLLAR:bi,DOT:We,EMOJI:$u,EQUALS:xi,EXCLAMATION:Hs,FULLWIDTHGREATERTHAN:fi,FULLWIDTHLEFTPAREN:ii,FULLWIDTHLESSTHAN:ui,FULLWIDTHMIDDLEDOT:Hu,FULLWIDTHRIGHTPAREN:oi,HYPHEN:Ee,LEFTCORNERBRACKET:si,LEFTWHITECORNERBRACKET:ai,LOCALHOST:jn,NL:Fs,NUM:Bs,OPENANGLEBRACKET:ni,OPENBRACE:zn,OPENBRACKET:Qr,OPENPAREN:ei,PERCENT:$n,PIPE:ki,PLUS:Si,POUND:wi,QUERY:Vn,QUOTE:$s,RIGHTCORNERBRACKET:li,RIGHTWHITECORNERBRACKET:ci,SCHEME:Xr,SEMI:Vs,SLASH:je,SLASH_SCHEME:an,SYM:Ci,TILDE:Wn,TLD:Ps,UNDERSCORE:Mi,UTLD:Is,UWORD:Rs,WORD:it,WS:Ls}),nt=/[a-z]/,Ln=/\p{L}/u,Ms=/\p{Emoji}/u;var rt=/\d/,Cs=/\s/;var Du="\r",vs=` -`,Vg="\uFE0F",Wg="\u200D",Ts="\uFFFC",qr=null,Gr=null;function jg(n=[]){let e={};ye.groups=e;let t=new ye;qr==null&&(qr=Ru(Lg)),Gr==null&&(Gr=Ru(Bg)),k(t,"'",hi),k(t,"{",zn),k(t,"}",Hn),k(t,"[",Qr),k(t,"]",Zr),k(t,"(",ei),k(t,")",ti),k(t,"<",ni),k(t,">",ri),k(t,"\uFF08",ii),k(t,"\uFF09",oi),k(t,"\u300C",si),k(t,"\u300D",li),k(t,"\u300E",ai),k(t,"\u300F",ci),k(t,"\uFF1C",ui),k(t,"\uFF1E",fi),k(t,"&",di),k(t,"*",pi),k(t,"@",mt),k(t,"`",gi),k(t,"^",yi),k(t,":",gt),k(t,",",zs),k(t,"$",bi),k(t,".",We),k(t,"=",xi),k(t,"!",Hs),k(t,"-",Ee),k(t,"%",$n),k(t,"|",ki),k(t,"+",Si),k(t,"#",wi),k(t,"?",Vn),k(t,'"',$s),k(t,"/",je),k(t,";",Vs),k(t,"~",Wn),k(t,"_",Mi),k(t,"\\",mi),k(t,"\u30FB",Hu);let r=U(t,rt,Bs,{[As]:!0});U(r,rt,r);let i=U(r,nt,Fu,{[Fn]:!0}),o=U(r,Ln,zu,{[Bn]:!0}),s=U(t,nt,it,{[Os]:!0});U(s,rt,i),U(s,nt,s),U(i,rt,i),U(i,nt,i);let l=U(t,Ln,Rs,{[Ns]:!0});U(l,nt),U(l,rt,o),U(l,Ln,l),U(o,rt,o),U(o,nt),U(o,Ln,o);let a=k(t,vs,Fs,{[ws]:!0}),c=k(t,Du,Ls,{[ws]:!0}),u=U(t,Cs,Ls,{[ws]:!0});k(t,Ts,u),k(c,vs,a),k(c,Ts,u),U(c,Cs,u),k(u,Du),k(u,vs),U(u,Cs,u),k(u,Ts,u);let f=U(t,Ms,$u,{[Bu]:!0});k(f,"#"),U(f,Ms,f),k(f,Vg,f);let d=k(f,Wg);k(d,"#"),U(d,Ms,f);let h=[[nt,s],[rt,i]],p=[[nt,null],[Ln,l],[rt,o]];for(let m=0;mm[0]>g[0]?1:-1);for(let m=0;m=0?b[Ds]=!0:nt.test(g)?rt.test(g)?b[Fn]=!0:b[Os]=!0:b[As]=!0,Nu(t,g,g,b)}return Nu(t,"localhost",jn,{ascii:!0}),t.jd=new ye(Ci),{start:t,tokens:cn({groups:e},Vu)}}function Wu(n,e){let t=Kg(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=t.length,i=[],o=0,s=0;for(;s=0&&(f+=t[s].length,d++),c+=t[s].length,o+=t[s].length,s++;o-=f,s-=d,c-=f,i.push({t:u.t,v:e.slice(o-c,o),s:o-c,e:o})}return i}function Kg(n){let e=[],t=n.length,r=0;for(;r56319||r+1===t||(o=n.charCodeAt(r+1))<56320||o>57343?n[r]:n.slice(r,r+2);e.push(s),r+=s.length}return e}function pt(n,e,t,r,i){let o,s=e.length;for(let l=0;l=0;)o++;if(o>0){e.push(t.join(""));for(let s=parseInt(n.substring(r,r+o),10);s>0;s--)t.pop();r+=o}else t.push(n[r]),r++}return e}var Kn={defaultProtocol:"http",events:null,format:Pu,formatHref:Pu,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function Ws(n,e=null){let t=cn({},Kn);n&&(t=cn(t,n instanceof Ws?n.o:n));let r=t.ignoreTags,i=[];for(let o=0;ot?r.substring(0,t)+"\u2026":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=Kn.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){let e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),i=n.get("tagName",t,e),o=this.toFormattedString(n),s={},l=n.get("className",t,e),a=n.get("target",t,e),c=n.get("rel",t,e),u=n.getObj("attributes",t,e),f=n.getObj("events",t,e);return s.href=r,l&&(s.class=l),a&&(s.target=a),c&&(s.rel=c),u&&cn(s,u),{tagName:i,attributes:s,content:o,eventListeners:f}}};function vi(n,e){class t extends ju{constructor(i,o){super(i,o),this.t=n}}for(let r in e)t.prototype[r]=e[r];return t.t=n,t}var Iu=vi("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Lu=vi("text"),_g=vi("nl"),Yr=vi("url",{isLink:!0,toHref(n=Kn.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){let n=this.tk;return n.length>=2&&n[0].t!==jn&&n[1].t===gt}});var Te=n=>new ye(n);function Ug({groups:n}){let e=n.domain.concat([di,pi,mt,mi,gi,yi,bi,xi,Ee,Bs,$n,ki,Si,wi,je,Ci,Wn,Mi]),t=[hi,gt,zs,We,Hs,$n,Vn,$s,Vs,ni,ri,zn,Hn,Zr,Qr,ei,ti,ii,oi,si,li,ai,ci,ui,fi],r=[di,hi,pi,mi,gi,yi,bi,xi,Ee,zn,Hn,$n,ki,Si,wi,Vn,je,Ci,Wn,Mi],i=Te(),o=k(i,Wn);L(o,r,o),L(o,n.domain,o);let s=Te(),l=Te(),a=Te();L(i,n.domain,s),L(i,n.scheme,l),L(i,n.slashscheme,a),L(s,r,o),L(s,n.domain,s);let c=k(s,mt);k(o,mt,c),k(l,mt,c),k(a,mt,c);let u=k(o,We);L(u,r,o),L(u,n.domain,o);let f=Te();L(c,n.domain,f),L(f,n.domain,f);let d=k(f,We);L(d,n.domain,f);let h=Te(Iu);L(d,n.tld,h),L(d,n.utld,h),k(c,jn,h);let p=k(f,Ee);k(p,Ee,p),L(p,n.domain,f),L(h,n.domain,f),k(h,We,d),k(h,Ee,p);let m=k(h,gt);L(m,n.numeric,Iu);let g=k(s,Ee),y=k(s,We);k(g,Ee,g),L(g,n.domain,s),L(y,r,o),L(y,n.domain,s);let b=Te(Yr);L(y,n.tld,b),L(y,n.utld,b),L(b,n.domain,s),L(b,r,o),k(b,We,y),k(b,Ee,g),k(b,mt,c);let S=k(b,gt),C=Te(Yr);L(S,n.numeric,C);let M=Te(Yr),R=Te();L(M,e,M),L(M,t,R),L(R,e,M),L(R,t,R),k(b,je,M),k(C,je,M);let z=k(l,gt),V=k(a,gt),N=k(V,je),I=k(N,je);L(l,n.domain,s),k(l,We,y),k(l,Ee,g),L(a,n.domain,s),k(a,We,y),k(a,Ee,g),L(z,n.domain,M),k(z,je,M),k(z,Vn,M),L(I,n.domain,M),L(I,e,M),k(I,je,M);let j=[[zn,Hn],[Qr,Zr],[ei,ti],[ni,ri],[ii,oi],[si,li],[ai,ci],[ui,fi]];for(let me=0;me=0&&d++,i++,u++;if(d<0)i-=u,i0&&(o.push(Es(Lu,e,s)),s=[]),i-=d,u-=d;let h=f.t,p=t.slice(i-u,i);o.push(Es(h,e,p))}}return s.length>0&&o.push(Es(Lu,e,s)),o}function Es(n,e,t){let r=t[0].s,i=t[t.length-1].e,o=e.slice(r,i);return new n(o,t)}var qg=typeof console<"u"&&console&&console.warn||(()=>{}),Gg="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",W={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Ku(){return ye.groups={},W.scanner=null,W.parser=null,W.tokenQueue=[],W.pluginQueue=[],W.customSchemes=[],W.initialized=!1,W}function js(n,e=!1){if(W.initialized&&qg(`linkifyjs: already initialized - will not register custom scheme "${n}" ${Gg}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format. +`);return!o||!s?!1:n.chain().command(({tr:l})=>(l.delete(r.pos-2,r.pos),!0)).exitCode().run()},ArrowDown:({editor:n})=>{if(!this.options.exitOnArrowDown)return!1;let{state:e}=n,{selection:t,doc:r}=e,{$from:i,empty:o}=t;if(!o||i.parent.type!==this.type||!(i.parentOffset===i.parent.nodeSize-2))return!1;let l=i.after();return l===void 0?!1:r.nodeAt(l)?n.commands.command(({tr:c})=>(c.setSelection(A.near(r.resolve(l))),!0)):n.commands.exitCode()}}},addInputRules(){return[In({find:vg,type:this.type,getAttributes:n=>({language:n[1]})}),In({find:Tg,type:this.type,getAttributes:n=>({language:n[1]})})]},addProseMirrorPlugins(){return[new E({key:new P("codeBlockVSCodeHandler"),props:{handlePaste:(n,e)=>{if(!e.clipboardData||this.editor.isActive(this.type.name))return!1;let t=e.clipboardData.getData("text/plain"),r=e.clipboardData.getData("vscode-editor-data"),i=r?JSON.parse(r):void 0,o=i?.mode;if(!t||!o)return!1;let{tr:s,schema:l}=n.state,a=l.text(t.replace(/\r\n?/g,` +`));return s.replaceSelectionWith(this.type.create({language:o},a)),s.selection.$from.parent.type!==this.type&&s.setSelection(O.near(s.doc.resolve(Math.max(0,s.selection.from-2)))),s.setMeta("paste",!0),n.dispatch(s),!0}}})]}}),Cu=Eg;var vu=$.create({name:"customBlock",priority:101,group:"block",atom:!0,defining:!0,draggable:!0,selectable:!0,isolating:!0,allowGapCursor:!0,inline:!1,addOptions:function(){return{HTMLAttributes:{},renderText({node:n}){return`<<${n.attrs.label??n.attrs.id}>>`},renderHTML({options:n,node:e}){return["div",D(this.HTMLAttributes,n.HTMLAttributes),`${e.attrs.label??e.attrs.id}`]}}},addAttributes:function(){return{id:{default:null,parseHTML:n=>n.getAttribute("data-id"),renderHTML:n=>n.id?{"data-id":n.id}:{}},label:{default:null,parseHTML:n=>n.getAttribute("data-label"),renderHTML:n=>n.label?{"data-label":n.label}:{}}}},parseHTML:function(){return[{tag:`div[data-type="${this.name}"]`}]},renderHTML:function({node:n,HTMLAttributes:e}){let t={...this.options};t.HTMLAttributes=D({"data-type":this.name},this.options.HTMLAttributes,e);let r=this.options.renderHTML({options:t,node:n});return typeof r=="string"?["div",D({"data-type":this.name},this.options.HTMLAttributes,e),r]:r},renderText:function({node:n}){let e={options:this.options,node:n};return this.options.renderText(e)},addKeyboardShortcuts:function(){return{Backspace:()=>this.editor.commands.command(({tr:n,state:e})=>{let t=!1,{selection:r}=e,{empty:i,anchor:o}=r;if(!i)return!1;let s=new G,l=0;return e.doc.nodesBetween(o-1,o,(a,c)=>{if(a.type.name===this.name)return t=!0,s=a,l=c,!1}),t})}},addProseMirrorPlugins:function(){return[new E({props:{handleDrop(n,e){if(!e||(e.preventDefault(),!e.dataTransfer.getData("customBlock")))return!1;let t=e.dataTransfer.getData("customBlock");return n.dispatch(n.state.tr.insert(n.posAtCoords({left:e.clientX,top:e.clientY}).pos,n.state.schema.nodes.customBlock.create({id:t}))),!1}}})]}});var Ag=$.create({name:"doc",topNode:!0,content:"block+"}),Tu=Ag;var Eu=ws;var Og=$.create({name:"heading",addOptions(){return{levels:[1,2,3,4,5,6],HTMLAttributes:{}}},content:"inline*",group:"block",defining:!0,addAttributes(){return{level:{default:1,rendered:!1}}},parseHTML(){return this.options.levels.map(n=>({tag:`h${n}`,attrs:{level:n}}))},renderHTML({node:n,HTMLAttributes:e}){return[`h${this.options.levels.includes(n.attrs.level)?n.attrs.level:this.options.levels[0]}`,D(this.options.HTMLAttributes,e),0]},addCommands(){return{setHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.setNode(this.name,n):!1,toggleHeading:n=>({commands:e})=>this.options.levels.includes(n.level)?e.toggleNode(this.name,"paragraph",n):!1}},addKeyboardShortcuts(){return this.options.levels.reduce((n,e)=>({...n,[`Mod-Alt-${e}`]:()=>this.editor.commands.toggleHeading({level:e})}),{})},addInputRules(){return this.options.levels.map(n=>In({find:new RegExp(`^(#{${Math.min(...this.options.levels)},${n}})\\s$`),type:this.type,getAttributes:{level:n}}))}}),Au=Og;var Ng=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))$/,Dg=/(?:^|\s)(\*(?!\s+\*)((?:[^*]+))\*(?!\s+\*))/g,Rg=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))$/,Pg=/(?:^|\s)(_(?!\s+_)((?:[^_]+))_(?!\s+_))/g,Ig=te.create({name:"italic",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"em"},{tag:"i",getAttrs:n=>n.style.fontStyle!=="normal"&&null},{style:"font-style=normal",clearMark:n=>n.type.name===this.name},{style:"font-style=italic"}]},renderHTML({HTMLAttributes:n}){return["em",D(this.options.HTMLAttributes,n),0]},addCommands(){return{setItalic:()=>({commands:n})=>n.setMark(this.name),toggleItalic:()=>({commands:n})=>n.toggleMark(this.name),unsetItalic:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-i":()=>this.editor.commands.toggleItalic(),"Mod-I":()=>this.editor.commands.toggleItalic()}},addInputRules(){return[ze({find:Ng,type:this.type}),ze({find:Rg,type:this.type})]},addPasteRules(){return[ve({find:Dg,type:this.type}),ve({find:Pg,type:this.type})]}}),Ou=Ig;var Lg=/(?:^|\s)(!\[(.+|:?)]\((\S+)(?:(?:\s+)["'](\S+)["'])?\))$/,Bg=$.create({name:"image",addOptions(){return{inline:!1,allowBase64:!1,HTMLAttributes:{}}},inline(){return this.options.inline},group(){return this.options.inline?"inline":"block"},draggable:!0,addAttributes(){return{src:{default:null},alt:{default:null},title:{default:null},width:{default:null},height:{default:null}}},parseHTML(){return[{tag:this.options.allowBase64?"img[src]":'img[src]:not([src^="data:"])'}]},renderHTML({HTMLAttributes:n}){return["img",D(this.options.HTMLAttributes,n)]},addCommands(){return{setImage:n=>({commands:e})=>e.insertContent({type:this.name,attrs:n})}},addInputRules(){return[uu({find:Lg,type:this.type,getAttributes:n=>{let[,,e,t,r]=n;return{src:t,alt:e,title:r}}})]}}),Nu=Bg;var Du=Nu.extend({addAttributes(){return{...this.parent?.(),"data-id":{default:null}}}});var Fg="aaa1rp3bb0ott3vie4c1le2ogado5udhabi7c0ademy5centure6ountant0s9o1tor4d0s1ult4e0g1ro2tna4f0l1rica5g0akhan5ency5i0g1rbus3force5tel5kdn3l0ibaba4pay4lfinanz6state5y2sace3tom5m0azon4ericanexpress7family11x2fam3ica3sterdam8nalytics7droid5quan4z2o0l2partments8p0le4q0uarelle8r0ab1mco4chi3my2pa2t0e3s0da2ia2sociates9t0hleta5torney7u0ction5di0ble3o3spost5thor3o0s4w0s2x0a2z0ure5ba0by2idu3namex4d1k2r0celona5laycard4s5efoot5gains6seball5ketball8uhaus5yern5b0c1t1va3cg1n2d1e0ats2uty4er2rlin4st0buy5t2f1g1h0arti5i0ble3d1ke2ng0o3o1z2j1lack0friday9ockbuster8g1omberg7ue3m0s1w2n0pparibas9o0ats3ehringer8fa2m1nd2o0k0ing5sch2tik2on4t1utique6x2r0adesco6idgestone9oadway5ker3ther5ussels7s1t1uild0ers6siness6y1zz3v1w1y1z0h3ca0b1fe2l0l1vinklein9m0era3p2non3petown5ital0one8r0avan4ds2e0er0s4s2sa1e1h1ino4t0ering5holic7ba1n1re3c1d1enter4o1rn3f0a1d2g1h0anel2nel4rity4se2t2eap3intai5ristmas6ome4urch5i0priani6rcle4sco3tadel4i0c2y3k1l0aims4eaning6ick2nic1que6othing5ud3ub0med6m1n1o0ach3des3ffee4llege4ogne5m0mbank4unity6pany2re3uter5sec4ndos3struction8ulting7tact3ractors9oking4l1p2rsica5untry4pon0s4rses6pa2r0edit0card4union9icket5own3s1uise0s6u0isinella9v1w1x1y0mru3ou3z2dad1nce3ta1e1ing3sun4y2clk3ds2e0al0er2s3gree4livery5l1oitte5ta3mocrat6ntal2ist5si0gn4v2hl2iamonds6et2gital5rect0ory7scount3ver5h2y2j1k1m1np2o0cs1tor4g1mains5t1wnload7rive4tv2ubai3nlop4pont4rban5vag2r2z2earth3t2c0o2deka3u0cation8e1g1mail3erck5nergy4gineer0ing9terprises10pson4quipment8r0icsson6ni3s0q1tate5t1u0rovision8s2vents5xchange6pert3osed4ress5traspace10fage2il1rwinds6th3mily4n0s2rm0ers5shion4t3edex3edback6rrari3ero6i0delity5o2lm2nal1nce1ial7re0stone6mdale6sh0ing5t0ness6j1k1lickr3ghts4r2orist4wers5y2m1o0o0d1tball6rd1ex2sale4um3undation8x2r0ee1senius7l1ogans4ntier7tr2ujitsu5n0d2rniture7tbol5yi3ga0l0lery3o1up4me0s3p1rden4y2b0iz3d0n2e0a1nt0ing5orge5f1g0ee3h1i0ft0s3ves2ing5l0ass3e1obal2o4m0ail3bh2o1x2n1odaddy5ld0point6f2o0dyear5g0le4p1t1v2p1q1r0ainger5phics5tis4een3ipe3ocery4up4s1t1u0cci3ge2ide2tars5ru3w1y2hair2mburg5ngout5us3bo2dfc0bank7ealth0care8lp1sinki6re1mes5iphop4samitsu7tachi5v2k0t2m1n1ockey4ldings5iday5medepot5goods5s0ense7nda3rse3spital5t0ing5t0els3mail5use3w2r1sbc3t1u0ghes5yatt3undai7ibm2cbc2e1u2d1e0ee3fm2kano4l1m0amat4db2mo0bilien9n0c1dustries8finiti5o2g1k1stitute6urance4e4t0ernational10uit4vestments10o1piranga7q1r0ish4s0maili5t0anbul7t0au2v3jaguar4va3cb2e0ep2tzt3welry6io2ll2m0p2nj2o0bs1urg4t1y2p0morgan6rs3uegos4niper7kaufen5ddi3e0rryhotels6properties14fh2g1h1i0a1ds2m1ndle4tchen5wi3m1n1oeln3matsu5sher5p0mg2n2r0d1ed3uokgroup8w1y0oto4z2la0caixa5mborghini8er3nd0rover6xess5salle5t0ino3robe5w0yer5b1c1ds2ease3clerc5frak4gal2o2xus4gbt3i0dl2fe0insurance9style7ghting6ke2lly3mited4o2ncoln4k2ve1ing5k1lc1p2oan0s3cker3us3l1ndon4tte1o3ve3pl0financial11r1s1t0d0a3u0ndbeck6xe1ury5v1y2ma0drid4if1son4keup4n0agement7go3p1rket0ing3s4riott5shalls7ttel5ba2c0kinsey7d1e0d0ia3et2lbourne7me1orial6n0u2rckmsd7g1h1iami3crosoft7l1ni1t2t0subishi9k1l0b1s2m0a2n1o0bi0le4da2e1i1m1nash3ey2ster5rmon3tgage6scow4to0rcycles9v0ie4p1q1r1s0d2t0n1r2u0seum3ic4v1w1x1y1z2na0b1goya4me2vy3ba2c1e0c1t0bank4flix4work5ustar5w0s2xt0direct7us4f0l2g0o2hk2i0co2ke1on3nja3ssan1y5l1o0kia3rton4w0ruz3tv4p1r0a1w2tt2u1yc2z2obi1server7ffice5kinawa6layan0group9lo3m0ega4ne1g1l0ine5oo2pen3racle3nge4g0anic5igins6saka4tsuka4t2vh3pa0ge2nasonic7ris2s1tners4s1y3y2ccw3e0t2f0izer5g1h0armacy6d1ilips5one2to0graphy6s4ysio5ics1tet2ures6d1n0g1k2oneer5zza4k1l0ace2y0station9umbing5s3m1n0c2ohl2ker3litie5rn2st3r0america6xi3ess3ime3o0d0uctions8f1gressive8mo2perties3y5tection8u0dential9s1t1ub2w0c2y2qa1pon3uebec3st5racing4dio4e0ad1lestate6tor2y4cipes5d0stone5umbrella9hab3ise0n3t2liance6n0t0als5pair3ort3ublican8st0aurant8view0s5xroth6ich0ardli6oh3l1o1p2o0cks3deo3gers4om3s0vp3u0gby3hr2n2w0e2yukyu6sa0arland6fe0ty4kura4le1on3msclub4ung5ndvik0coromant12ofi4p1rl2s1ve2xo3b0i1s2c0b1haeffler7midt4olarships8ol3ule3warz5ience5ot3d1e0arch3t2cure1ity6ek2lect4ner3rvices6ven3w1x0y3fr2g1h0angrila6rp3ell3ia1ksha5oes2p0ping5uji3w3i0lk2na1gles5te3j1k0i0n2y0pe4l0ing4m0art3ile4n0cf3o0ccer3ial4ftbank4ware6hu2lar2utions7ng1y2y2pa0ce3ort2t3r0l2s1t0ada2ples4r1tebank4farm7c0group6ockholm6rage3e3ream4udio2y3yle4u0cks3pplies3y2ort5rf1gery5zuki5v1watch4iss4x1y0dney4stems6z2tab1ipei4lk2obao4rget4tamotors6r2too4x0i3c0i2d0k2eam2ch0nology8l1masek5nnis4va3f1g1h0d1eater2re6iaa2ckets5enda4ps2res2ol4j0maxx4x2k0maxx5l1m0all4n1o0day3kyo3ols3p1ray3shiba5tal3urs3wn2yota3s3r0ade1ing4ining5vel0ers0insurance16ust3v2t1ube2i1nes3shu4v0s2w1z2ua1bank3s2g1k1nicom3versity8o2ol2ps2s1y1z2va0cations7na1guard7c1e0gas3ntures6risign5m\xF6gensberater2ung14sicherung10t2g1i0ajes4deo3g1king4llas4n1p1rgin4sa1ion4va1o3laanderen9n1odka3lvo3te1ing3o2yage5u2wales2mart4ter4ng0gou5tch0es6eather0channel12bcam3er2site5d0ding5ibo2r3f1hoswho6ien2ki2lliamhill9n0dows4e1ners6me2olterskluwer11odside6rk0s2ld3w2s1tc1f3xbox3erox4ihuan4n2xx2yz3yachts4hoo3maxun5ndex5e1odobashi7ga2kohama6u0tube6t1un3za0ppos4ra3ero3ip2m1one3uerich6w2",zg="\u03B5\u03BB1\u03C52\u0431\u04331\u0435\u043B3\u0434\u0435\u0442\u04384\u0435\u044E2\u043A\u0430\u0442\u043E\u043B\u0438\u043A6\u043E\u043C3\u043C\u043A\u04342\u043E\u043D1\u0441\u043A\u0432\u04306\u043E\u043D\u043B\u0430\u0439\u043D5\u0440\u04333\u0440\u0443\u04412\u04442\u0441\u0430\u0439\u04423\u0440\u04313\u0443\u043A\u04403\u049B\u0430\u04373\u0570\u0561\u05753\u05D9\u05E9\u05E8\u05D0\u05DC5\u05E7\u05D5\u05DD3\u0627\u0628\u0648\u0638\u0628\u064A5\u0631\u0627\u0645\u0643\u06485\u0644\u0627\u0631\u062F\u06464\u0628\u062D\u0631\u064A\u06465\u062C\u0632\u0627\u0626\u06315\u0633\u0639\u0648\u062F\u064A\u06296\u0639\u0644\u064A\u0627\u06465\u0645\u063A\u0631\u06285\u0645\u0627\u0631\u0627\u062A5\u06CC\u0631\u0627\u06465\u0628\u0627\u0631\u062A2\u0632\u0627\u06314\u064A\u062A\u06433\u06BE\u0627\u0631\u062A5\u062A\u0648\u0646\u06334\u0633\u0648\u062F\u0627\u06463\u0631\u064A\u06295\u0634\u0628\u0643\u06294\u0639\u0631\u0627\u06422\u06282\u0645\u0627\u06464\u0641\u0644\u0633\u0637\u064A\u06466\u0642\u0637\u06313\u0643\u0627\u062B\u0648\u0644\u064A\u06436\u0648\u06453\u0645\u0635\u06312\u0644\u064A\u0633\u064A\u06275\u0648\u0631\u064A\u062A\u0627\u0646\u064A\u06277\u0642\u06394\u0647\u0645\u0631\u0627\u06475\u067E\u0627\u06A9\u0633\u062A\u0627\u06467\u0680\u0627\u0631\u062A4\u0915\u0949\u092E3\u0928\u0947\u091F3\u092D\u093E\u0930\u09240\u092E\u094D3\u094B\u09245\u0938\u0902\u0917\u0920\u09285\u09AC\u09BE\u0982\u09B2\u09BE5\u09AD\u09BE\u09B0\u09A42\u09F0\u09A44\u0A2D\u0A3E\u0A30\u0A244\u0AAD\u0ABE\u0AB0\u0AA44\u0B2D\u0B3E\u0B30\u0B244\u0B87\u0BA8\u0BCD\u0BA4\u0BBF\u0BAF\u0BBE6\u0BB2\u0B99\u0BCD\u0B95\u0BC86\u0B9A\u0BBF\u0B99\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0BC2\u0BB0\u0BCD11\u0C2D\u0C3E\u0C30\u0C24\u0C4D5\u0CAD\u0CBE\u0CB0\u0CA44\u0D2D\u0D3E\u0D30\u0D24\u0D025\u0DBD\u0D82\u0D9A\u0DCF4\u0E04\u0E2D\u0E213\u0E44\u0E17\u0E223\u0EA5\u0EB2\u0EA73\u10D2\u10D42\u307F\u3093\u306A3\u30A2\u30DE\u30BE\u30F34\u30AF\u30E9\u30A6\u30C94\u30B0\u30FC\u30B0\u30EB4\u30B3\u30E02\u30B9\u30C8\u30A23\u30BB\u30FC\u30EB3\u30D5\u30A1\u30C3\u30B7\u30E7\u30F36\u30DD\u30A4\u30F3\u30C84\u4E16\u754C2\u4E2D\u4FE11\u56FD1\u570B1\u6587\u7F513\u4E9A\u9A6C\u900A3\u4F01\u4E1A2\u4F5B\u5C712\u4FE1\u606F2\u5065\u5EB72\u516B\u53662\u516C\u53F81\u76CA2\u53F0\u6E7E1\u70632\u5546\u57CE1\u5E971\u68072\u5609\u91CC0\u5927\u9152\u5E975\u5728\u7EBF2\u5927\u62FF2\u5929\u4E3B\u65593\u5A31\u4E502\u5BB6\u96FB2\u5E7F\u4E1C2\u5FAE\u535A2\u6148\u55842\u6211\u7231\u4F603\u624B\u673A2\u62DB\u80582\u653F\u52A11\u5E9C2\u65B0\u52A0\u57612\u95FB2\u65F6\u5C1A2\u66F8\u7C4D2\u673A\u67842\u6DE1\u9A6C\u95213\u6E38\u620F2\u6FB3\u95802\u70B9\u770B2\u79FB\u52A82\u7EC4\u7EC7\u673A\u67844\u7F51\u57401\u5E971\u7AD91\u7EDC2\u8054\u901A2\u8C37\u6B4C2\u8D2D\u72692\u901A\u8CA92\u96C6\u56E22\u96FB\u8A0A\u76C8\u79D14\u98DE\u5229\u6D663\u98DF\u54C12\u9910\u53852\u9999\u683C\u91CC\u62C93\u6E2F2\uB2F7\uB1371\uCEF42\uC0BC\uC1312\uD55C\uAD6D2",cn=(n,e)=>{for(let t in e)n[t]=e[t];return n},Os="numeric",Ns="ascii",Ds="alpha",Fn="asciinumeric",Bn="alphanumeric",Rs="domain",zu="emoji",Hg="scheme",$g="slashscheme",Ms="whitespace";function Vg(n,e){return n in e||(e[n]=[]),e[n]}function Bt(n,e,t){e[Os]&&(e[Fn]=!0,e[Bn]=!0),e[Ns]&&(e[Fn]=!0,e[Ds]=!0),e[Fn]&&(e[Bn]=!0),e[Ds]&&(e[Bn]=!0),e[Bn]&&(e[Rs]=!0),e[zu]&&(e[Rs]=!0);for(let r in e){let i=Vg(r,t);i.indexOf(n)<0&&i.push(n)}}function Wg(n,e){let t={};for(let r in e)e[r].indexOf(n)>=0&&(t[r]=!0);return t}function ye(n=null){this.j={},this.jr=[],this.jd=null,this.t=n}ye.groups={};ye.prototype={accepts(){return!!this.t},go(n){let e=this,t=e.j[n];if(t)return t;for(let r=0;rn.ta(e,t,r,i),U=(n,e,t,r,i)=>n.tr(e,t,r,i),Ru=(n,e,t,r,i)=>n.ts(e,t,r,i),k=(n,e,t,r,i)=>n.tt(e,t,r,i),it="WORD",Ps="UWORD",Hu="ASCIINUMERICAL",$u="ALPHANUMERICAL",jn="LOCALHOST",Is="TLD",Ls="UTLD",Xr="SCHEME",an="SLASH_SCHEME",Fs="NUM",Bs="WS",zs="NL",zn="OPENBRACE",Hn="CLOSEBRACE",Qr="OPENBRACKET",Zr="CLOSEBRACKET",ei="OPENPAREN",ti="CLOSEPAREN",ni="OPENANGLEBRACKET",ri="CLOSEANGLEBRACKET",ii="FULLWIDTHLEFTPAREN",oi="FULLWIDTHRIGHTPAREN",si="LEFTCORNERBRACKET",li="RIGHTCORNERBRACKET",ai="LEFTWHITECORNERBRACKET",ci="RIGHTWHITECORNERBRACKET",ui="FULLWIDTHLESSTHAN",fi="FULLWIDTHGREATERTHAN",di="AMPERSAND",hi="APOSTROPHE",pi="ASTERISK",mt="AT",mi="BACKSLASH",gi="BACKTICK",yi="CARET",gt="COLON",Hs="COMMA",bi="DOLLAR",We="DOT",xi="EQUALS",$s="EXCLAMATION",Ee="HYPHEN",$n="PERCENT",ki="PIPE",Si="PLUS",wi="POUND",Vn="QUERY",Vs="QUOTE",Vu="FULLWIDTHMIDDLEDOT",Ws="SEMI",je="SLASH",Wn="TILDE",Mi="UNDERSCORE",Wu="EMOJI",Ci="SYM",ju=Object.freeze({__proto__:null,ALPHANUMERICAL:$u,AMPERSAND:di,APOSTROPHE:hi,ASCIINUMERICAL:Hu,ASTERISK:pi,AT:mt,BACKSLASH:mi,BACKTICK:gi,CARET:yi,CLOSEANGLEBRACKET:ri,CLOSEBRACE:Hn,CLOSEBRACKET:Zr,CLOSEPAREN:ti,COLON:gt,COMMA:Hs,DOLLAR:bi,DOT:We,EMOJI:Wu,EQUALS:xi,EXCLAMATION:$s,FULLWIDTHGREATERTHAN:fi,FULLWIDTHLEFTPAREN:ii,FULLWIDTHLESSTHAN:ui,FULLWIDTHMIDDLEDOT:Vu,FULLWIDTHRIGHTPAREN:oi,HYPHEN:Ee,LEFTCORNERBRACKET:si,LEFTWHITECORNERBRACKET:ai,LOCALHOST:jn,NL:zs,NUM:Fs,OPENANGLEBRACKET:ni,OPENBRACE:zn,OPENBRACKET:Qr,OPENPAREN:ei,PERCENT:$n,PIPE:ki,PLUS:Si,POUND:wi,QUERY:Vn,QUOTE:Vs,RIGHTCORNERBRACKET:li,RIGHTWHITECORNERBRACKET:ci,SCHEME:Xr,SEMI:Ws,SLASH:je,SLASH_SCHEME:an,SYM:Ci,TILDE:Wn,TLD:Is,UNDERSCORE:Mi,UTLD:Ls,UWORD:Ps,WORD:it,WS:Bs}),nt=/[a-z]/,Ln=/\p{L}/u,Cs=/\p{Emoji}/u;var rt=/\d/,vs=/\s/;var Pu="\r",Ts=` +`,jg="\uFE0F",Kg="\u200D",Es="\uFFFC",qr=null,Gr=null;function _g(n=[]){let e={};ye.groups=e;let t=new ye;qr==null&&(qr=Iu(Fg)),Gr==null&&(Gr=Iu(zg)),k(t,"'",hi),k(t,"{",zn),k(t,"}",Hn),k(t,"[",Qr),k(t,"]",Zr),k(t,"(",ei),k(t,")",ti),k(t,"<",ni),k(t,">",ri),k(t,"\uFF08",ii),k(t,"\uFF09",oi),k(t,"\u300C",si),k(t,"\u300D",li),k(t,"\u300E",ai),k(t,"\u300F",ci),k(t,"\uFF1C",ui),k(t,"\uFF1E",fi),k(t,"&",di),k(t,"*",pi),k(t,"@",mt),k(t,"`",gi),k(t,"^",yi),k(t,":",gt),k(t,",",Hs),k(t,"$",bi),k(t,".",We),k(t,"=",xi),k(t,"!",$s),k(t,"-",Ee),k(t,"%",$n),k(t,"|",ki),k(t,"+",Si),k(t,"#",wi),k(t,"?",Vn),k(t,'"',Vs),k(t,"/",je),k(t,";",Ws),k(t,"~",Wn),k(t,"_",Mi),k(t,"\\",mi),k(t,"\u30FB",Vu);let r=U(t,rt,Fs,{[Os]:!0});U(r,rt,r);let i=U(r,nt,Hu,{[Fn]:!0}),o=U(r,Ln,$u,{[Bn]:!0}),s=U(t,nt,it,{[Ns]:!0});U(s,rt,i),U(s,nt,s),U(i,rt,i),U(i,nt,i);let l=U(t,Ln,Ps,{[Ds]:!0});U(l,nt),U(l,rt,o),U(l,Ln,l),U(o,rt,o),U(o,nt),U(o,Ln,o);let a=k(t,Ts,zs,{[Ms]:!0}),c=k(t,Pu,Bs,{[Ms]:!0}),u=U(t,vs,Bs,{[Ms]:!0});k(t,Es,u),k(c,Ts,a),k(c,Es,u),U(c,vs,u),k(u,Pu),k(u,Ts),U(u,vs,u),k(u,Es,u);let f=U(t,Cs,Wu,{[zu]:!0});k(f,"#"),U(f,Cs,f),k(f,jg,f);let d=k(f,Kg);k(d,"#"),U(d,Cs,f);let h=[[nt,s],[rt,i]],p=[[nt,null],[Ln,l],[rt,o]];for(let m=0;mm[0]>g[0]?1:-1);for(let m=0;m=0?b[Rs]=!0:nt.test(g)?rt.test(g)?b[Fn]=!0:b[Ns]=!0:b[Os]=!0,Ru(t,g,g,b)}return Ru(t,"localhost",jn,{ascii:!0}),t.jd=new ye(Ci),{start:t,tokens:cn({groups:e},ju)}}function Ku(n,e){let t=Ug(e.replace(/[A-Z]/g,l=>l.toLowerCase())),r=t.length,i=[],o=0,s=0;for(;s=0&&(f+=t[s].length,d++),c+=t[s].length,o+=t[s].length,s++;o-=f,s-=d,c-=f,i.push({t:u.t,v:e.slice(o-c,o),s:o-c,e:o})}return i}function Ug(n){let e=[],t=n.length,r=0;for(;r56319||r+1===t||(o=n.charCodeAt(r+1))<56320||o>57343?n[r]:n.slice(r,r+2);e.push(s),r+=s.length}return e}function pt(n,e,t,r,i){let o,s=e.length;for(let l=0;l=0;)o++;if(o>0){e.push(t.join(""));for(let s=parseInt(n.substring(r,r+o),10);s>0;s--)t.pop();r+=o}else t.push(n[r]),r++}return e}var Kn={defaultProtocol:"http",events:null,format:Lu,formatHref:Lu,nl2br:!1,tagName:"a",target:null,rel:null,validate:!0,truncate:1/0,className:null,attributes:null,ignoreTags:[],render:null};function js(n,e=null){let t=cn({},Kn);n&&(t=cn(t,n instanceof js?n.o:n));let r=t.ignoreTags,i=[];for(let o=0;ot?r.substring(0,t)+"\u2026":r},toFormattedHref(n){return n.get("formatHref",this.toHref(n.get("defaultProtocol")),this)},startIndex(){return this.tk[0].s},endIndex(){return this.tk[this.tk.length-1].e},toObject(n=Kn.defaultProtocol){return{type:this.t,value:this.toString(),isLink:this.isLink,href:this.toHref(n),start:this.startIndex(),end:this.endIndex()}},toFormattedObject(n){return{type:this.t,value:this.toFormattedString(n),isLink:this.isLink,href:this.toFormattedHref(n),start:this.startIndex(),end:this.endIndex()}},validate(n){return n.get("validate",this.toString(),this)},render(n){let e=this,t=this.toHref(n.get("defaultProtocol")),r=n.get("formatHref",t,this),i=n.get("tagName",t,e),o=this.toFormattedString(n),s={},l=n.get("className",t,e),a=n.get("target",t,e),c=n.get("rel",t,e),u=n.getObj("attributes",t,e),f=n.getObj("events",t,e);return s.href=r,l&&(s.class=l),a&&(s.target=a),c&&(s.rel=c),u&&cn(s,u),{tagName:i,attributes:s,content:o,eventListeners:f}}};function vi(n,e){class t extends _u{constructor(i,o){super(i,o),this.t=n}}for(let r in e)t.prototype[r]=e[r];return t.t=n,t}var Bu=vi("email",{isLink:!0,toHref(){return"mailto:"+this.toString()}}),Fu=vi("text"),Jg=vi("nl"),Yr=vi("url",{isLink:!0,toHref(n=Kn.defaultProtocol){return this.hasProtocol()?this.v:`${n}://${this.v}`},hasProtocol(){let n=this.tk;return n.length>=2&&n[0].t!==jn&&n[1].t===gt}});var Te=n=>new ye(n);function qg({groups:n}){let e=n.domain.concat([di,pi,mt,mi,gi,yi,bi,xi,Ee,Fs,$n,ki,Si,wi,je,Ci,Wn,Mi]),t=[hi,gt,Hs,We,$s,$n,Vn,Vs,Ws,ni,ri,zn,Hn,Zr,Qr,ei,ti,ii,oi,si,li,ai,ci,ui,fi],r=[di,hi,pi,mi,gi,yi,bi,xi,Ee,zn,Hn,$n,ki,Si,wi,Vn,je,Ci,Wn,Mi],i=Te(),o=k(i,Wn);L(o,r,o),L(o,n.domain,o);let s=Te(),l=Te(),a=Te();L(i,n.domain,s),L(i,n.scheme,l),L(i,n.slashscheme,a),L(s,r,o),L(s,n.domain,s);let c=k(s,mt);k(o,mt,c),k(l,mt,c),k(a,mt,c);let u=k(o,We);L(u,r,o),L(u,n.domain,o);let f=Te();L(c,n.domain,f),L(f,n.domain,f);let d=k(f,We);L(d,n.domain,f);let h=Te(Bu);L(d,n.tld,h),L(d,n.utld,h),k(c,jn,h);let p=k(f,Ee);k(p,Ee,p),L(p,n.domain,f),L(h,n.domain,f),k(h,We,d),k(h,Ee,p);let m=k(h,gt);L(m,n.numeric,Bu);let g=k(s,Ee),y=k(s,We);k(g,Ee,g),L(g,n.domain,s),L(y,r,o),L(y,n.domain,s);let b=Te(Yr);L(y,n.tld,b),L(y,n.utld,b),L(b,n.domain,s),L(b,r,o),k(b,We,y),k(b,Ee,g),k(b,mt,c);let S=k(b,gt),C=Te(Yr);L(S,n.numeric,C);let M=Te(Yr),R=Te();L(M,e,M),L(M,t,R),L(R,e,M),L(R,t,R),k(b,je,M),k(C,je,M);let z=k(l,gt),V=k(a,gt),N=k(V,je),I=k(N,je);L(l,n.domain,s),k(l,We,y),k(l,Ee,g),L(a,n.domain,s),k(a,We,y),k(a,Ee,g),L(z,n.domain,M),k(z,je,M),k(z,Vn,M),L(I,n.domain,M),L(I,e,M),k(I,je,M);let j=[[zn,Hn],[Qr,Zr],[ei,ti],[ni,ri],[ii,oi],[si,li],[ai,ci],[ui,fi]];for(let me=0;me=0&&d++,i++,u++;if(d<0)i-=u,i0&&(o.push(As(Fu,e,s)),s=[]),i-=d,u-=d;let h=f.t,p=t.slice(i-u,i);o.push(As(h,e,p))}}return s.length>0&&o.push(As(Fu,e,s)),o}function As(n,e,t){let r=t[0].s,i=t[t.length-1].e,o=e.slice(r,i);return new n(o,t)}var Yg=typeof console<"u"&&console&&console.warn||(()=>{}),Xg="until manual call of linkify.init(). Register all schemes and plugins before invoking linkify the first time.",W={scanner:null,parser:null,tokenQueue:[],pluginQueue:[],customSchemes:[],initialized:!1};function Uu(){return ye.groups={},W.scanner=null,W.parser=null,W.tokenQueue=[],W.pluginQueue=[],W.customSchemes=[],W.initialized=!1,W}function Ks(n,e=!1){if(W.initialized&&Yg(`linkifyjs: already initialized - will not register custom scheme "${n}" ${Xg}`),!/^[0-9a-z]+(-[0-9a-z]+)*$/.test(n))throw new Error(`linkifyjs: incorrect scheme format. 1. Must only contain digits, lowercase ASCII letters or "-" 2. Cannot start or end with "-" -3. "-" cannot repeat`);W.customSchemes.push([n,e])}function Yg(){W.scanner=jg(W.customSchemes);for(let n=0;n{let i=e.some(c=>c.docChanged)&&!t.doc.eq(r.doc),o=e.some(c=>c.getMeta("preventAutolink"));if(!i||o)return;let{tr:s}=r,l=is(t.doc,[...e]);if(us(l).forEach(({newRange:c})=>{let u=Pc(r.doc,c,h=>h.isTextblock),f,d;if(u.length>1?(f=u[0],d=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(f=u[0],d=r.doc.textBetween(f.pos,c.to,void 0," ")),f&&d){let h=d.split(" ").filter(y=>y!=="");if(h.length<=0)return!1;let p=h[h.length-1],m=f.pos+d.lastIndexOf(p);if(!p)return!1;let g=Ti(p).map(y=>y.toObject(n.defaultProtocol));if(!Xg(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:m+y.start+1,to:m+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>n.validate(y.value)).filter(y=>n.shouldAutoLink(y.value)).forEach(y=>{Vr(y.from,y.to,r.doc).some(b=>b.mark.type===n.type)||s.addMark(y.from,y.to,n.type.create({href:y.href}))})}}),!!s.steps.length)return s}})}function Zg(n){return new E({key:new P("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||!e.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{let u=r.target,f=[];for(;u.nodeName!=="DIV";)f.push(u),u=u.parentNode;s=f.find(d=>d.nodeName==="A")}if(!s)return!1;let l=cs(e.state,n.type.name),a=(i=s?.href)!=null?i:l.href,c=(o=s?.target)!=null?o:l.target;return s&&a?(window.open(a,c),!0):!1}}})}function ey(n){return new E({key:new P("handlePasteLink"),props:{handlePaste:(e,t,r)=>{let{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let l="";r.content.forEach(c=>{l+=c.textContent});let a=Ei(l,{defaultProtocol:n.defaultProtocol}).find(c=>c.isLink&&c.value===l);return!l||!a?!1:n.editor.commands.setMark(n.type,{href:a.href})}}})}var ty=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Ft(n,e){let t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{let i=typeof r=="string"?r:r.scheme;i&&t.push(i)}),!n||n.replace(ty,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var ny=te.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){js(n);return}js(n.scheme,n.optionalSlashes)})},onDestroy(){Ku()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!Ft(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>!!n}},addAttributes(){return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{let e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!Ft(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!Ft(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",D(this.options.HTMLAttributes,n),0]:["a",D(this.options.HTMLAttributes,{...n,href:""}),0]},addCommands(){return{setLink:n=>({chain:e})=>{let{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!Ft(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{let{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!Ft(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ve({find:n=>{let e=[];if(n){let{protocols:t,defaultProtocol:r}=this.options,i=Ei(n).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!Ft(s,t),protocols:t,defaultProtocol:r}));i.length&&i.forEach(o=>e.push({text:o.value,data:{href:o.href},index:o.start}))}return e},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){let n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(Qg({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!Ft(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&n.push(Zg({type:this.type})),this.options.linkOnPaste&&n.push(ey({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),n}}),_u=ny;var ry=Object.defineProperty,iy=(n,e)=>{for(var t in e)ry(n,t,{get:e[t],enumerable:!0})},oy="listItem",Uu="textStyle",Ju=/^\s*([-+*])\s$/,Us=$.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",D(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(oy,this.editor.getAttributes(Uu)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=He({find:Ju,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=He({find:Ju,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(Uu),editor:this.editor})),[n]}}),Js=$.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",D(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),sy={};iy(sy,{findListItemPos:()=>_n,getNextListDepth:()=>qs,handleBackspace:()=>Ks,handleDelete:()=>_s,hasListBefore:()=>Yu,hasListItemAfter:()=>ly,hasListItemBefore:()=>Xu,listItemHasSubList:()=>Qu,nextListIsDeeper:()=>Zu,nextListIsHigher:()=>ef});var _n=(n,e)=>{let{$from:t}=e.selection,r=_(n,e.schema),i=null,o=t.depth,s=t.pos,l=null;for(;o>0&&l===null;)i=t.node(o),i.type===r?l=o:(o-=1,s-=1);return l===null?null:{$pos:e.doc.resolve(s),depth:l}},qs=(n,e)=>{let t=_n(n,e);if(!t)return!1;let[,r]=Vc(e,n,t.$pos.pos+4);return r},Yu=(n,e,t)=>{let{$anchor:r}=n.selection,i=Math.max(0,r.pos-2),o=n.doc.resolve(i).node();return!(!o||!t.includes(o.type.name))},Xu=(n,e)=>{var t;let{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-2);return!(i.index()===0||((t=i.nodeBefore)==null?void 0:t.type.name)!==n)},Qu=(n,e,t)=>{if(!t)return!1;let r=_(n,e.schema),i=!1;return t.descendants(o=>{o.type===r&&(i=!0)}),i},Ks=(n,e,t)=>{if(n.commands.undoInputRule())return!0;if(n.state.selection.from!==n.state.selection.to)return!1;if(!Fe(n.state,e)&&Yu(n.state,e,t)){let{$anchor:l}=n.state.selection,a=n.state.doc.resolve(l.before()-1),c=[];a.node().descendants((d,h)=>{d.type.name===e&&c.push({node:d,pos:h})});let u=c.at(-1);if(!u)return!1;let f=n.state.doc.resolve(a.start()+u.pos+1);return n.chain().cut({from:l.start()-1,to:l.end()+1},f.end()).joinForward().run()}if(!Fe(n.state,e)||!jc(n.state))return!1;let r=_n(e,n.state);if(!r)return!1;let o=n.state.doc.resolve(r.$pos.pos-2).node(r.depth),s=Qu(e,n.state,o);return Xu(e,n.state)&&!s?n.commands.joinItemBackward():n.chain().liftListItem(e).run()},Zu=(n,e)=>{let t=qs(n,e),r=_n(n,e);return!r||!t?!1:t>r.depth},ef=(n,e)=>{let t=qs(n,e),r=_n(n,e);return!r||!t?!1:t{if(!Fe(n.state,e)||!Wc(n.state,e))return!1;let{selection:t}=n.state,{$from:r,$to:i}=t;return!t.empty&&r.sameParent(i)?!1:Zu(e,n.state)?n.chain().focus(n.state.selection.from+4).lift(e).joinBackward().run():ef(e,n.state)?n.chain().joinForward().joinBackward().run():n.commands.joinItemForward()},ly=(n,e)=>{var t;let{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-r.parentOffset-2);return!(i.index()===i.parent.childCount-1||((t=i.nodeAfter)==null?void 0:t.type.name)!==n)},ay=F.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&_s(n,t)&&(e=!0)}),e},"Mod-Delete":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&_s(n,t)&&(e=!0)}),e},Backspace:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:r})=>{n.state.schema.nodes[t]!==void 0&&Ks(n,t,r)&&(e=!0)}),e},"Mod-Backspace":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:r})=>{n.state.schema.nodes[t]!==void 0&&Ks(n,t,r)&&(e=!0)}),e}}}}),cy="listItem",qu="textStyle",Gu=/^(\d+)\.\s$/,Gs=$.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:null,parseHTML:n=>n.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){let{start:e,...t}=n;return e===1?["ol",D(this.options.HTMLAttributes,t),0]:["ol",D(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(cy,this.editor.getAttributes(qu)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=He({find:Gu,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=He({find:Gu,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(qu)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),uy=/^\s*(\[([( |x])?\])\s$/,fy=$.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList"}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{let e=n.getAttribute("data-checked");return e===""||e==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:n,HTMLAttributes:e}){return["li",D(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){let n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:e,getPos:t,editor:r})=>{let i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div");return o.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",c=>c.preventDefault()),l.addEventListener("change",c=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}let{checked:u}=c.target;r.isEditable&&typeof t=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{let d=t();if(typeof d!="number")return!1;let h=f.doc.nodeAt(d);return f.setNodeMarkup(d,void 0,{...h?.attrs,checked:u}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,u)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([c,u])=>{i.setAttribute(c,u)}),i.dataset.checked=n.attrs.checked,l.checked=n.attrs.checked,o.append(l,s),i.append(o,a),Object.entries(e).forEach(([c,u])=>{i.setAttribute(c,u)}),{dom:i,contentDOM:a,update:c=>c.type!==this.type?!1:(i.dataset.checked=c.attrs.checked,l.checked=c.attrs.checked,!0)}}},addInputRules(){return[He({find:uy,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),dy=$.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",D(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),Fk=F.create({name:"listKit",addExtensions(){let n=[];return this.options.bulletList!==!1&&n.push(Us.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(Js.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(ay.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(Gs.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(fy.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(dy.configure(this.options.taskList)),n}});var tf=["image/png","image/jpeg","image/gif","image/webp"],Ai=(n,e,t={})=>{n.dom.closest("form")?.dispatchEvent(new CustomEvent(e,{composed:!0,cancelable:!0,detail:t}))},hy=({editor:n,key:e,statePath:t,uploadingMessage:r,$wire:i})=>{let o=s=>i().callSchemaComponentMethod(e,"getUploadedFileAttachmentTemporaryUrl",{attachment:s});return new E({key:new P("localFiles"),props:{handleDrop(s,l){if(!l.dataTransfer?.files.length)return!1;let a=Array.from(l.dataTransfer.files).filter(u=>tf.includes(u.type));if(!a.length)return!1;Ai(s,"form-processing-started",{message:r}),l.preventDefault(),l.stopPropagation();let c=s.posAtCoords({left:l.clientX,top:l.clientY});return a.forEach((u,f)=>{n.setEditable(!1),s.dom.dispatchEvent(new CustomEvent("rich-editor-uploading-file",{bubbles:!0,detail:{key:e,livewireId:i().id}}));let d=new FileReader;d.readAsDataURL(u),d.onload=()=>{n.chain().insertContentAt(c?.pos??0,{type:"image",attrs:{class:"fi-loading",src:d.result}}).run()};let h=("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,p=>(p^crypto.getRandomValues(new Uint8Array(1))[0]&15>>p/4).toString(16));i().upload(`componentFileAttachments.${t}.${h}`,u,()=>{o(h).then(p=>{p&&(n.chain().updateAttributes("image",{class:null,"data-id":h,src:p}).run(),n.setEditable(!0),s.dom.dispatchEvent(new CustomEvent("rich-editor-uploaded-file",{bubbles:!0,detail:{key:e,livewireId:i().id}})),f===a.length-1&&Ai(s,"form-processing-finished"))})})}),!0},handlePaste(s,l){if(!l.clipboardData?.files.length)return!1;let a=Array.from(l.clipboardData.files).filter(c=>tf.includes(c.type));return a.length?(l.preventDefault(),l.stopPropagation(),Ai(s,"form-processing-started",{message:r}),a.forEach((c,u)=>{n.setEditable(!1),s.dom.dispatchEvent(new CustomEvent("rich-editor-uploading-file",{bubbles:!0,detail:{key:e,livewireId:i().id}}));let f=new FileReader;f.readAsDataURL(c),f.onload=()=>{n.chain().insertContentAt(n.state.selection.anchor,{type:"image",attrs:{class:"fi-loading",src:f.result}}).run()};let d=("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,h=>(h^crypto.getRandomValues(new Uint8Array(1))[0]&15>>h/4).toString(16));i().upload(`componentFileAttachments.${t}.${d}`,c,()=>{o(d).then(h=>{h&&(n.chain().updateAttributes("image",{class:null,"data-id":d,src:h}).run(),n.setEditable(!0),s.dom.dispatchEvent(new CustomEvent("rich-editor-uploaded-file",{bubbles:!0,detail:{key:e,livewireId:i().id}})),u===a.length-1&&Ai(s,"form-processing-finished"))})})}),!0):!1}}})},nf=F.create({name:"localFiles",addOptions(){return{key:null,statePath:null,uploadingMessage:null,$wire:null}},addProseMirrorPlugins(){return[hy({editor:this.editor,...this.options})]}});function py(n){var e;let{char:t,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:l}=n,a=r&&!i,c=uu(t),u=new RegExp(`\\s${c}$`),f=s?"^":"",d=i?"":c,h=a?new RegExp(`${f}${c}.*?(?=\\s${d}|$)`,"gm"):new RegExp(`${f}(?:^)?${c}[^\\s${d}]*`,"gm"),p=((e=l.nodeBefore)==null?void 0:e.isText)&&l.nodeBefore.text;if(!p)return null;let m=l.pos-p.length,g=Array.from(p.matchAll(h)).pop();if(!g||g.input===void 0||g.index===void 0)return null;let y=g.input.slice(Math.max(0,g.index-1),g.index),b=new RegExp(`^[${o?.join("")}\0]?$`).test(y);if(o!==null&&!b)return null;let S=m+g.index,C=S+g[0].length;return a&&u.test(p.slice(C-1,C+1))&&(g[0]+=" ",C+=1),S=l.pos?{range:{from:S,to:C},query:g[0].slice(t.length),text:g[0]}:null}var my=new P("suggestion");function gy({pluginKey:n=my,editor:e,char:t="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:o=[" "],startOfLine:s=!1,decorationTag:l="span",decorationClass:a="suggestion",command:c=()=>null,items:u=()=>[],render:f=()=>({}),allow:d=()=>!0,findSuggestionMatch:h=py}){let p,m=f?.(),g=new E({key:n,view(){return{update:async(y,b)=>{var S,C,M,R,z,V,N;let I=(S=this.key)==null?void 0:S.getState(b),j=(C=this.key)==null?void 0:C.getState(y.state),me=I.active&&j.active&&I.range.from!==j.range.from,st=!I.active&&j.active,_e=I.active&&!j.active,re=!st&&!_e&&I.query!==j.query,ie=st||me&&re,oe=re||me,ke=_e||me&&re;if(!ie&&!oe&&!ke)return;let Q=ke&&!ie?I:j,Ne=y.dom.querySelector(`[data-decoration-id="${Q.decorationId}"]`);p={editor:e,range:Q.range,query:Q.query,text:Q.text,items:[],command:jt=>c({editor:e,range:Q.range,props:jt}),decorationNode:Ne,clientRect:Ne?()=>{var jt;let{decorationId:Hf}=(jt=this.key)==null?void 0:jt.getState(e.state),rl=y.dom.querySelector(`[data-decoration-id="${Hf}"]`);return rl?.getBoundingClientRect()||null}:null},ie&&((M=m?.onBeforeStart)==null||M.call(m,p)),oe&&((R=m?.onBeforeUpdate)==null||R.call(m,p)),(oe||ie)&&(p.items=await u({editor:e,query:Q.query})),ke&&((z=m?.onExit)==null||z.call(m,p)),oe&&((V=m?.onUpdate)==null||V.call(m,p)),ie&&((N=m?.onStart)==null||N.call(m,p))},destroy:()=>{var y;p&&((y=m?.onExit)==null||y.call(m,p))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(y,b,S,C){let{isEditable:M}=e,{composing:R}=e.view,{selection:z}=y,{empty:V,from:N}=z,I={...b};if(I.composing=R,M&&(V||e.view.composing)){(Nb.range.to)&&!R&&!b.composing&&(I.active=!1);let j=h({char:t,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:z.$from}),me=`id_${Math.floor(Math.random()*4294967295)}`;j&&d({editor:e,state:C,range:j.range,isActive:b.active})?(I.active=!0,I.decorationId=b.decorationId?b.decorationId:me,I.range=j.range,I.query=j.query,I.text=j.text):I.active=!1}else I.active=!1;return I.active||(I.decorationId=null,I.range={from:0,to:0},I.query=null,I.text=null),I}},props:{handleKeyDown(y,b){var S;let{active:C,range:M}=g.getState(y.state);return C&&((S=m?.onKeyDown)==null?void 0:S.call(m,{view:y,event:b,range:M}))||!1},decorations(y){let{active:b,range:S,decorationId:C}=g.getState(y);return b?K.create(y.doc,[X.inline(S.from,S.to,{nodeName:l,class:a,"data-decoration-id":C})]):null}}});return g}var rf=gy;var yy=function({editor:n,overrideSuggestionOptions:e,extensionName:t}){let r=new P;return{editor:n,char:"{{",pluginKey:r,command:({editor:i,range:o,props:s})=>{i.view.state.selection.$to.nodeAfter?.text?.startsWith(" ")&&(o.to+=1),i.chain().focus().insertContentAt(o,[{type:t,attrs:{...s}},{type:"text",text:" "}]).run(),i.view.dom.ownerDocument.defaultView?.getSelection()?.collapseToEnd()},allow:({state:i,range:o})=>{let s=i.doc.resolve(o.from),l=i.schema.nodes[t];return!!s.parent.type.contentMatch.matchType(l)},...e}},of=$.create({name:"mergeTag",priority:101,addStorage:function(){return{suggestions:[],getSuggestionFromChar:()=>null}},addOptions:function(){return{HTMLAttributes:{},renderText({node:n}){return`{{ ${n.attrs.label??n.attrs.id} }}`},deleteTriggerWithBackspace:!1,renderHTML({options:n,node:e}){return["span",D(this.HTMLAttributes,n.HTMLAttributes),`${e.attrs.label??e.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:function(){return{id:{default:null,parseHTML:n=>n.getAttribute("data-id"),renderHTML:n=>n.id?{"data-id":n.id}:{}},label:{default:null,parseHTML:n=>n.getAttribute("data-label"),renderHTML:n=>n.label?{"data-label":n.label}:{}}}},parseHTML:function(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML:function({node:n,HTMLAttributes:e}){let t=this.editor?.extensionStorage?.[this.name]?.getSuggestionFromChar("{{"),r={...this.options};r.HTMLAttributes=D({"data-type":this.name},this.options.HTMLAttributes,e);let i=this.options.renderHTML({options:r,node:n,suggestion:t});return typeof i=="string"?["span",D({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},renderText:function({node:n}){let e={options:this.options,node:n,suggestion:this.editor?.extensionStorage?.[this.name]?.getSuggestionFromChar("{{")};return this.options.renderText(e)},addKeyboardShortcuts:function(){return{Backspace:()=>this.editor.commands.command(({tr:n,state:e})=>{let t=!1,{selection:r}=e,{empty:i,anchor:o}=r;if(!i)return!1;let s=new G,l=0;return e.doc.nodesBetween(o-1,o,(a,c)=>{if(a.type.name===this.name)return t=!0,s=a,l=c,!1}),t&&n.insertText(this.options.deleteTriggerWithBackspace?"":"{{",l,l+s.nodeSize),t})}},addProseMirrorPlugins:function(){return[...this.storage.suggestions.map(rf),new E({props:{handleDrop(n,e){if(!e||(e.preventDefault(),!e.dataTransfer.getData("mergeTag")))return!1;let t=e.dataTransfer.getData("mergeTag");return n.dispatch(n.state.tr.insert(n.posAtCoords({left:e.clientX,top:e.clientY}).pos,n.state.schema.nodes.mergeTag.create({id:t}))),!1}}})]},onBeforeCreate:function(){this.storage.suggestions=(this.options.suggestions.length?this.options.suggestions:[this.options.suggestion]).map(n=>yy({editor:this.editor,overrideSuggestionOptions:n,extensionName:this.name})),this.storage.getSuggestionFromChar=n=>{let e=this.storage.suggestions.find(t=>t.char===n);return e||(this.storage.suggestions.length?this.storage.suggestions[0]:null)}}});var by=$.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",D(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),sf=by;var xy=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,ky=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,Sy=te.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",D(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ze({find:xy,type:this.type})]},addPasteRules(){return[ve({find:ky,type:this.type})]}}),lf=Sy;var wy=te.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(n){return n!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:n}){return["sub",D(this.options.HTMLAttributes,n),0]},addCommands(){return{setSubscript:()=>({commands:n})=>n.setMark(this.name),toggleSubscript:()=>({commands:n})=>n.toggleMark(this.name),unsetSubscript:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),af=wy;var My=te.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(n){return n!=="super"?!1:null}}]},renderHTML({HTMLAttributes:n}){return["sup",D(this.options.HTMLAttributes,n),0]},addCommands(){return{setSuperscript:()=>({commands:n})=>n.setMark(this.name),toggleSuperscript:()=>({commands:n})=>n.toggleMark(this.name),unsetSuperscript:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),cf=My;var Cy=$.create({name:"text",group:"inline"}),uf=Cy;var vy=te.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",D(this.options.HTMLAttributes,n),0]},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),ff=vy;var Jn=Math.min,yt=Math.max,qn=Math.round;var Re=n=>({x:n,y:n}),Ty={left:"right",right:"left",bottom:"top",top:"bottom"},Ey={start:"end",end:"start"};function Ys(n,e,t){return yt(n,Jn(e,t))}function Ni(n,e){return typeof n=="function"?n(e):n}function zt(n){return n.split("-")[0]}function Di(n){return n.split("-")[1]}function Xs(n){return n==="x"?"y":"x"}function Qs(n){return n==="y"?"height":"width"}function Ht(n){return["top","bottom"].includes(zt(n))?"y":"x"}function Zs(n){return Xs(Ht(n))}function df(n,e,t){t===void 0&&(t=!1);let r=Di(n),i=Zs(n),o=Qs(i),s=i==="x"?r===(t?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Un(s)),[s,Un(s)]}function hf(n){let e=Un(n);return[Oi(n),e,Oi(e)]}function Oi(n){return n.replace(/start|end/g,e=>Ey[e])}function Ay(n,e,t){let r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(n){case"top":case"bottom":return t?e?i:r:e?r:i;case"left":case"right":return e?o:s;default:return[]}}function pf(n,e,t,r){let i=Di(n),o=Ay(zt(n),t==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(Oi)))),o}function Un(n){return n.replace(/left|right|bottom|top/g,e=>Ty[e])}function Oy(n){return{top:0,right:0,bottom:0,left:0,...n}}function mf(n){return typeof n!="number"?Oy(n):{top:n,right:n,bottom:n,left:n}}function $t(n){let{x:e,y:t,width:r,height:i}=n;return{width:r,height:i,top:t,left:e,right:e+r,bottom:t+i,x:e,y:t}}function gf(n,e,t){let{reference:r,floating:i}=n,o=Ht(e),s=Zs(e),l=Qs(s),a=zt(e),c=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,d=r[l]/2-i[l]/2,h;switch(a){case"top":h={x:u,y:r.y-i.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-i.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Di(e)){case"start":h[s]-=d*(t&&c?-1:1);break;case"end":h[s]+=d*(t&&c?-1:1);break}return h}var yf=async(n,e,t)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=t,l=o.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(e)),c=await s.getElementRects({reference:n,floating:e,strategy:i}),{x:u,y:f}=gf(c,r,a),d=r,h={},p=0;for(let m=0;mre<=0)){var j,me;let re=(((j=o.flip)==null?void 0:j.index)||0)+1,ie=z[re];if(ie){var st;let ke=f==="alignment"?b!==Ht(ie):!1,Q=((st=I[0])==null?void 0:st.overflows[0])>0;if(!ke||Q)return{data:{index:re,overflows:I},reset:{placement:ie}}}let oe=(me=I.filter(ke=>ke.overflows[0]<=0).sort((ke,Q)=>ke.overflows[1]-Q.overflows[1])[0])==null?void 0:me.placement;if(!oe)switch(h){case"bestFit":{var _e;let ke=(_e=I.filter(Q=>{if(R){let Ne=Ht(Q.placement);return Ne===b||Ne==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(Ne=>Ne>0).reduce((Ne,jt)=>Ne+jt,0)]).sort((Q,Ne)=>Q[1]-Ne[1])[0])==null?void 0:_e[0];ke&&(oe=ke);break}case"initialPlacement":oe=l;break}if(i!==oe)return{reset:{placement:oe}}}return{}}}};var xf=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){let{x:t,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:g=>{let{x:y,y:b}=g;return{x:y,y:b}}},...a}=Ni(n,e),c={x:t,y:r},u=await el(e,a),f=Ht(zt(i)),d=Xs(f),h=c[d],p=c[f];if(o){let g=d==="y"?"top":"left",y=d==="y"?"bottom":"right",b=h+u[g],S=h-u[y];h=Ys(b,h,S)}if(s){let g=f==="y"?"top":"left",y=f==="y"?"bottom":"right",b=p+u[g],S=p-u[y];p=Ys(b,p,S)}let m=l.fn({...e,[d]:h,[f]:p});return{...m,data:{x:m.x-t,y:m.y-r,enabled:{[d]:o,[f]:s}}}}}};function Pi(){return typeof window<"u"}function Vt(n){return Sf(n)?(n.nodeName||"").toLowerCase():"#document"}function be(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function Ke(n){var e;return(e=(Sf(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function Sf(n){return Pi()?n instanceof Node||n instanceof be(n).Node:!1}function Ae(n){return Pi()?n instanceof Element||n instanceof be(n).Element:!1}function Pe(n){return Pi()?n instanceof HTMLElement||n instanceof be(n).HTMLElement:!1}function kf(n){return!Pi()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof be(n).ShadowRoot}function un(n){let{overflow:e,overflowX:t,overflowY:r,display:i}=Oe(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!["inline","contents"].includes(i)}function wf(n){return["table","td","th"].includes(Vt(n))}function Gn(n){return[":popover-open",":modal"].some(e=>{try{return n.matches(e)}catch{return!1}})}function Ii(n){let e=Li(),t=Ae(n)?Oe(n):n;return["transform","translate","scale","rotate","perspective"].some(r=>t[r]?t[r]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(t.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(t.contain||"").includes(r))}function Mf(n){let e=ot(n);for(;Pe(e)&&!Wt(e);){if(Ii(e))return e;if(Gn(e))return null;e=ot(e)}return null}function Li(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Wt(n){return["html","body","#document"].includes(Vt(n))}function Oe(n){return be(n).getComputedStyle(n)}function Yn(n){return Ae(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function ot(n){if(Vt(n)==="html")return n;let e=n.assignedSlot||n.parentNode||kf(n)&&n.host||Ke(n);return kf(e)?e.host:e}function Cf(n){let e=ot(n);return Wt(e)?n.ownerDocument?n.ownerDocument.body:n.body:Pe(e)&&un(e)?e:Cf(e)}function Ri(n,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);let i=Cf(n),o=i===((r=n.ownerDocument)==null?void 0:r.body),s=be(i);if(o){let l=Bi(s);return e.concat(s,s.visualViewport||[],un(i)?i:[],l&&t?Ri(l):[])}return e.concat(i,Ri(i,[],t))}function Bi(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Ef(n){let e=Oe(n),t=parseFloat(e.width)||0,r=parseFloat(e.height)||0,i=Pe(n),o=i?n.offsetWidth:t,s=i?n.offsetHeight:r,l=qn(t)!==o||qn(r)!==s;return l&&(t=o,r=s),{width:t,height:r,$:l}}function Af(n){return Ae(n)?n:n.contextElement}function fn(n){let e=Af(n);if(!Pe(e))return Re(1);let t=e.getBoundingClientRect(),{width:r,height:i,$:o}=Ef(e),s=(o?qn(t.width):t.width)/r,l=(o?qn(t.height):t.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}var Ny=Re(0);function Of(n){let e=be(n);return!Li()||!e.visualViewport?Ny:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Dy(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==be(n)?!1:e}function Xn(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=!1);let i=n.getBoundingClientRect(),o=Af(n),s=Re(1);e&&(r?Ae(r)&&(s=fn(r)):s=fn(n));let l=Dy(o,t,r)?Of(o):Re(0),a=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){let d=be(o),h=r&&Ae(r)?be(r):r,p=d,m=Bi(p);for(;m&&r&&h!==p;){let g=fn(m),y=m.getBoundingClientRect(),b=Oe(m),S=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*g.x,C=y.top+(m.clientTop+parseFloat(b.paddingTop))*g.y;a*=g.x,c*=g.y,u*=g.x,f*=g.y,a+=S,c+=C,p=be(m),m=Bi(p)}}return $t({width:u,height:f,x:a,y:c})}function nl(n,e){let t=Yn(n).scrollLeft;return e?e.left+t:Xn(Ke(n)).left+t}function Nf(n,e,t){t===void 0&&(t=!1);let r=n.getBoundingClientRect(),i=r.left+e.scrollLeft-(t?0:nl(n,r)),o=r.top+e.scrollTop;return{x:i,y:o}}function Ry(n){let{elements:e,rect:t,offsetParent:r,strategy:i}=n,o=i==="fixed",s=Ke(r),l=e?Gn(e.floating):!1;if(r===s||l&&o)return t;let a={scrollLeft:0,scrollTop:0},c=Re(1),u=Re(0),f=Pe(r);if((f||!f&&!o)&&((Vt(r)!=="body"||un(s))&&(a=Yn(r)),Pe(r))){let h=Xn(r);c=fn(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}let d=s&&!f&&!o?Nf(s,a,!0):Re(0);return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-a.scrollLeft*c.x+u.x+d.x,y:t.y*c.y-a.scrollTop*c.y+u.y+d.y}}function Py(n){return Array.from(n.getClientRects())}function Iy(n){let e=Ke(n),t=Yn(n),r=n.ownerDocument.body,i=yt(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=yt(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),s=-t.scrollLeft+nl(n),l=-t.scrollTop;return Oe(r).direction==="rtl"&&(s+=yt(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:l}}function Ly(n,e){let t=be(n),r=Ke(n),i=t.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,a=0;if(i){o=i.width,s=i.height;let c=Li();(!c||c&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}return{width:o,height:s,x:l,y:a}}function By(n,e){let t=Xn(n,!0,e==="fixed"),r=t.top+n.clientTop,i=t.left+n.clientLeft,o=Pe(n)?fn(n):Re(1),s=n.clientWidth*o.x,l=n.clientHeight*o.y,a=i*o.x,c=r*o.y;return{width:s,height:l,x:a,y:c}}function vf(n,e,t){let r;if(e==="viewport")r=Ly(n,t);else if(e==="document")r=Iy(Ke(n));else if(Ae(e))r=By(e,t);else{let i=Of(n);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return $t(r)}function Df(n,e){let t=ot(n);return t===e||!Ae(t)||Wt(t)?!1:Oe(t).position==="fixed"||Df(t,e)}function Fy(n,e){let t=e.get(n);if(t)return t;let r=Ri(n,[],!1).filter(l=>Ae(l)&&Vt(l)!=="body"),i=null,o=Oe(n).position==="fixed",s=o?ot(n):n;for(;Ae(s)&&!Wt(s);){let l=Oe(s),a=Ii(s);!a&&l.position==="fixed"&&(i=null),(o?!a&&!i:!a&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||un(s)&&!a&&Df(n,s))?r=r.filter(u=>u!==s):i=l,s=ot(s)}return e.set(n,r),r}function zy(n){let{element:e,boundary:t,rootBoundary:r,strategy:i}=n,s=[...t==="clippingAncestors"?Gn(e)?[]:Fy(e,this._c):[].concat(t),r],l=s[0],a=s.reduce((c,u)=>{let f=vf(e,u,i);return c.top=yt(f.top,c.top),c.right=Jn(f.right,c.right),c.bottom=Jn(f.bottom,c.bottom),c.left=yt(f.left,c.left),c},vf(e,l,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Hy(n){let{width:e,height:t}=Ef(n);return{width:e,height:t}}function $y(n,e,t){let r=Pe(e),i=Ke(e),o=t==="fixed",s=Xn(n,!0,o,e),l={scrollLeft:0,scrollTop:0},a=Re(0);function c(){a.x=nl(i)}if(r||!r&&!o)if((Vt(e)!=="body"||un(i))&&(l=Yn(e)),r){let h=Xn(e,!0,o,e);a.x=h.x+e.clientLeft,a.y=h.y+e.clientTop}else i&&c();o&&!r&&i&&c();let u=i&&!r&&!o?Nf(i,l):Re(0),f=s.left+l.scrollLeft-a.x-u.x,d=s.top+l.scrollTop-a.y-u.y;return{x:f,y:d,width:s.width,height:s.height}}function tl(n){return Oe(n).position==="static"}function Tf(n,e){if(!Pe(n)||Oe(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return Ke(n)===t&&(t=t.ownerDocument.body),t}function Rf(n,e){let t=be(n);if(Gn(n))return t;if(!Pe(n)){let i=ot(n);for(;i&&!Wt(i);){if(Ae(i)&&!tl(i))return i;i=ot(i)}return t}let r=Tf(n,e);for(;r&&wf(r)&&tl(r);)r=Tf(r,e);return r&&Wt(r)&&tl(r)&&!Ii(r)?t:r||Mf(n)||t}var Vy=async function(n){let e=this.getOffsetParent||Rf,t=this.getDimensions,r=await t(n.floating);return{reference:$y(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Wy(n){return Oe(n).direction==="rtl"}var jy={convertOffsetParentRelativeRectToViewportRelativeRect:Ry,getDocumentElement:Ke,getClippingRect:zy,getOffsetParent:Rf,getElementRects:Vy,getClientRects:Py,getDimensions:Hy,getScale:fn,isElement:Ae,isRTL:Wy};var Pf=xf,If=bf;var Lf=(n,e,t)=>{let r=new Map,i={platform:jy,...t},o={...i.platform,_c:r};return yf(n,e,{...i,platform:o})};var Bf=(n,e)=>{Lf({getBoundingClientRect:()=>{let{from:r,to:i}=n.state.selection,o=n.view.coordsAtPos(r),s=n.view.coordsAtPos(i);return{top:Math.min(o.top,s.top),bottom:Math.max(o.bottom,s.bottom),left:Math.min(o.left,s.left),right:Math.max(o.right,s.right),width:Math.abs(s.right-o.left),height:Math.abs(s.bottom-o.top),x:Math.min(o.left,s.left),y:Math.min(o.top,s.top)}}},e,{placement:"bottom-start",strategy:"absolute",middleware:[Pf(),If()]}).then(({x:r,y:i,strategy:o})=>{e.style.width="max-content",e.style.position=o,e.style.left=`${r}px`,e.style.top=`${i}px`})},Ff=({mergeTags:n,noMergeTagSearchResultsMessage:e})=>({items:({query:t})=>n.filter(r=>r.toLowerCase().replace(/\s/g,"").includes(t.toLowerCase())),render:()=>{let t,r=0,i=null,o=()=>{let f=document.createElement("div");return f.className="fi-dropdown-panel fi-dropdown-list",f},s=()=>{if(!t||!i)return;let f=i.items||[];if(t.innerHTML="",f.length)f.forEach((d,h)=>{let p=document.createElement("button");p.className=h===r?"fi-dropdown-list-item fi-dropdown-list-item-label fi-selected":"fi-dropdown-list-item fi-dropdown-list-item-label",p.textContent=d,p.type="button",p.addEventListener("click",()=>l(h)),t.appendChild(p)});else{let d=document.createElement("div");d.className="fi-dropdown-header",d.textContent=e,t.appendChild(d)}},l=f=>{if(!i)return;let h=(i.items||[])[f];h&&i.command({id:h})},a=()=>{if(!i)return;let f=i.items||[];f.length!==0&&(r=(r+f.length-1)%f.length,s())},c=()=>{if(!i)return;let f=i.items||[];f.length!==0&&(r=(r+1)%f.length,s())},u=()=>{l(r)};return{onStart:f=>{i=f,r=0,t=o(),t.style.position="absolute",s(),document.body.appendChild(t),f.clientRect&&Bf(f.editor,t)},onUpdate:f=>{i=f,r=0,s(),f.clientRect&&Bf(f.editor,t)},onKeyDown:f=>f.event.key==="Escape"?(t&&t.parentNode&&t.parentNode.removeChild(t),!0):f.event.key==="ArrowUp"?(a(),!0):f.event.key==="ArrowDown"?(c(),!0):f.event.key==="Enter"?(u(),!0):!1,onExit:()=>{t&&t.parentNode&&t.parentNode.removeChild(t)}}}});var zf=async({customExtensionUrls:n,key:e,mergeTags:t,noMergeTagSearchResultsMessage:r,statePath:i,uploadingFileMessage:o,$wire:s})=>[ku,Su,Us,wu,Mu,Cu,vu,Tu,Eu,Ou,_u.configure({autolink:!0,openOnClick:!1}),Js,nf.configure({key:e,statePath:i,uploadingMessage:o,$wire:()=>s}),...t.length?[of.configure({deleteTriggerWithBackspace:!0,suggestion:Ff({mergeTags:t,noMergeTagSearchResultsMessage:r})})]:[],Gs,sf,lf,af,cf,uf,ff,xu,...(await Promise.all(n.map(async l=>(new RegExp("^(?:[a-z+]+:)?//","i").test(l)||(l=new URL(l,document.baseURI).href),(await import(l)).default)))).flat()];function Ky({activePanel:n,extensions:e,key:t,isLiveDebounced:r,isLiveOnBlur:i,liveDebounce:o,livewireId:s,mergeTags:l,noMergeTagSearchResultsMessage:a,state:c,statePath:u,uploadingFileMessage:f}){let d;return{state:c,activePanel:n,editorSelection:{type:"text",anchor:1,head:1},isUploadingFile:!1,shouldUpdateState:!0,editorUpdatedAt:Date.now(),init:async function(){d=new au({element:this.$refs.editor,extensions:await zf({customExtensionUrls:e,key:t,mergeTags:l,noMergeTagSearchResultsMessage:a,statePath:u,uploadingFileMessage:f,$wire:this.$wire}),content:this.state}),d.on("create",()=>{this.editorUpdatedAt=Date.now()}),d.on("update",Alpine.debounce(({editor:h})=>{this.editorUpdatedAt=Date.now(),this.state=h.getJSON(),this.shouldUpdateState=!1,r&&this.$wire.commit()},o??300)),d.on("selectionUpdate",({transaction:h})=>{this.editorUpdatedAt=Date.now(),this.editorSelection=h.selection.toJSON()}),i&&d.on("blur",()=>this.$wire.commit()),this.$watch("state",()=>{if(!this.shouldUpdateState){this.shouldUpdateState=!0;return}d.commands.setContent(this.state)}),window.addEventListener("run-rich-editor-commands",h=>{h.detail.livewireId===s&&h.detail.key===t&&this.runEditorCommands(h.detail)}),window.addEventListener("rich-editor-uploading-file",h=>{h.detail.livewireId===s&&h.detail.key===t&&(this.isUploadingFile=!0,h.stopPropagation())}),window.addEventListener("rich-editor-uploaded-file",h=>{h.detail.livewireId===s&&h.detail.key===t&&(this.isUploadingFile=!1,h.stopPropagation())}),window.dispatchEvent(new CustomEvent(`schema-component-${s}-${t}-loaded`))},getEditor:function(){return d},$getEditor:function(){return this.getEditor()},setEditorSelection:function(h){h&&(this.editorSelection=h,d.chain().command(({tr:p})=>(p.setSelection(A.fromJSON(d.state.doc,this.editorSelection)),!0)).run())},runEditorCommands:function({commands:h,editorSelection:p}){this.setEditorSelection(p);let m=d.chain();h.forEach(g=>m=m[g.name](...g.arguments??[])),m.run()},togglePanel:function(h=null){if(this.isPanelActive(h)){this.activePanel=null;return}this.activePanel=h},isPanelActive:function(h=null){return h===null?this.activePanel!==null:this.activePanel===h},insertCustomBlock:function(h){d.chain().focus().insertContent([{type:"customBlock",attrs:{id:h}},{type:"text",text:" "}]).run()},insertMergeTag:function(h){d.chain().focus().insertContent([{type:"mergeTag",attrs:{id:h}},{type:"text",text:" "}]).run()}}}export{Ky as default}; +3. "-" cannot repeat`);W.customSchemes.push([n,e])}function Qg(){W.scanner=_g(W.customSchemes);for(let n=0;n{let i=e.some(c=>c.docChanged)&&!t.doc.eq(r.doc),o=e.some(c=>c.getMeta("preventAutolink"));if(!i||o)return;let{tr:s}=r,l=is(t.doc,[...e]);if(us(l).forEach(({newRange:c})=>{let u=Ic(r.doc,c,h=>h.isTextblock),f,d;if(u.length>1?(f=u[0],d=r.doc.textBetween(f.pos,f.pos+f.node.nodeSize,void 0," ")):u.length&&r.doc.textBetween(c.from,c.to," "," ").endsWith(" ")&&(f=u[0],d=r.doc.textBetween(f.pos,c.to,void 0," ")),f&&d){let h=d.split(" ").filter(y=>y!=="");if(h.length<=0)return!1;let p=h[h.length-1],m=f.pos+d.lastIndexOf(p);if(!p)return!1;let g=Ti(p).map(y=>y.toObject(n.defaultProtocol));if(!Zg(g))return!1;g.filter(y=>y.isLink).map(y=>({...y,from:m+y.start+1,to:m+y.end+1})).filter(y=>r.schema.marks.code?!r.doc.rangeHasMark(y.from,y.to,r.schema.marks.code):!0).filter(y=>n.validate(y.value)).filter(y=>n.shouldAutoLink(y.value)).forEach(y=>{Vr(y.from,y.to,r.doc).some(b=>b.mark.type===n.type)||s.addMark(y.from,y.to,n.type.create({href:y.href}))})}}),!!s.steps.length)return s}})}function ty(n){return new E({key:new P("handleClickLink"),props:{handleClick:(e,t,r)=>{var i,o;if(r.button!==0||!e.editable)return!1;let s=null;if(r.target instanceof HTMLAnchorElement)s=r.target;else{let u=r.target,f=[];for(;u.nodeName!=="DIV";)f.push(u),u=u.parentNode;s=f.find(d=>d.nodeName==="A")}if(!s)return!1;let l=cs(e.state,n.type.name),a=(i=s?.href)!=null?i:l.href,c=(o=s?.target)!=null?o:l.target;return s&&a?(window.open(a,c),!0):!1}}})}function ny(n){return new E({key:new P("handlePasteLink"),props:{handlePaste:(e,t,r)=>{let{state:i}=e,{selection:o}=i,{empty:s}=o;if(s)return!1;let l="";r.content.forEach(c=>{l+=c.textContent});let a=Ei(l,{defaultProtocol:n.defaultProtocol}).find(c=>c.isLink&&c.value===l);return!l||!a?!1:n.editor.commands.setMark(n.type,{href:a.href})}}})}var ry=/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g;function Ft(n,e){let t=["http","https","ftp","ftps","mailto","tel","callto","sms","cid","xmpp"];return e&&e.forEach(r=>{let i=typeof r=="string"?r:r.scheme;i&&t.push(i)}),!n||n.replace(ry,"").match(new RegExp(`^(?:(?:${t.join("|")}):|[^a-z]|[a-z0-9+.-]+(?:[^a-z+.-:]|$))`,"i"))}var iy=te.create({name:"link",priority:1e3,keepOnSplit:!1,exitable:!0,onCreate(){this.options.validate&&!this.options.shouldAutoLink&&(this.options.shouldAutoLink=this.options.validate,console.warn("The `validate` option is deprecated. Rename to the `shouldAutoLink` option instead.")),this.options.protocols.forEach(n=>{if(typeof n=="string"){Ks(n);return}Ks(n.scheme,n.optionalSlashes)})},onDestroy(){Uu()},inclusive(){return this.options.autolink},addOptions(){return{openOnClick:!0,linkOnPaste:!0,autolink:!0,protocols:[],defaultProtocol:"http",HTMLAttributes:{target:"_blank",rel:"noopener noreferrer nofollow",class:null},isAllowedUri:(n,e)=>!!Ft(n,e.protocols),validate:n=>!!n,shouldAutoLink:n=>!!n}},addAttributes(){return{href:{default:null,parseHTML(n){return n.getAttribute("href")}},target:{default:this.options.HTMLAttributes.target},rel:{default:this.options.HTMLAttributes.rel},class:{default:this.options.HTMLAttributes.class}}},parseHTML(){return[{tag:"a[href]",getAttrs:n=>{let e=n.getAttribute("href");return!e||!this.options.isAllowedUri(e,{defaultValidate:t=>!!Ft(t,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?!1:null}}]},renderHTML({HTMLAttributes:n}){return this.options.isAllowedUri(n.href,{defaultValidate:e=>!!Ft(e,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?["a",D(this.options.HTMLAttributes,n),0]:["a",D(this.options.HTMLAttributes,{...n,href:""}),0]},addCommands(){return{setLink:n=>({chain:e})=>{let{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!Ft(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().setMark(this.name,n).setMeta("preventAutolink",!0).run():!1},toggleLink:n=>({chain:e})=>{let{href:t}=n;return this.options.isAllowedUri(t,{defaultValidate:r=>!!Ft(r,this.options.protocols),protocols:this.options.protocols,defaultProtocol:this.options.defaultProtocol})?e().toggleMark(this.name,n,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run():!1},unsetLink:()=>({chain:n})=>n().unsetMark(this.name,{extendEmptyMarkRange:!0}).setMeta("preventAutolink",!0).run()}},addPasteRules(){return[ve({find:n=>{let e=[];if(n){let{protocols:t,defaultProtocol:r}=this.options,i=Ei(n).filter(o=>o.isLink&&this.options.isAllowedUri(o.value,{defaultValidate:s=>!!Ft(s,t),protocols:t,defaultProtocol:r}));i.length&&i.forEach(o=>e.push({text:o.value,data:{href:o.href},index:o.start}))}return e},type:this.type,getAttributes:n=>{var e;return{href:(e=n.data)==null?void 0:e.href}}})]},addProseMirrorPlugins(){let n=[],{protocols:e,defaultProtocol:t}=this.options;return this.options.autolink&&n.push(ey({type:this.type,defaultProtocol:this.options.defaultProtocol,validate:r=>this.options.isAllowedUri(r,{defaultValidate:i=>!!Ft(i,e),protocols:e,defaultProtocol:t}),shouldAutoLink:this.options.shouldAutoLink})),this.options.openOnClick===!0&&n.push(ty({type:this.type})),this.options.linkOnPaste&&n.push(ny({editor:this.editor,defaultProtocol:this.options.defaultProtocol,type:this.type})),n}}),Ju=iy;var oy=Object.defineProperty,sy=(n,e)=>{for(var t in e)oy(n,t,{get:e[t],enumerable:!0})},ly="listItem",qu="textStyle",Gu=/^\s*([-+*])\s$/,Js=$.create({name:"bulletList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:"ul"}]},renderHTML({HTMLAttributes:n}){return["ul",D(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleBulletList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(ly,this.editor.getAttributes(qu)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-8":()=>this.editor.commands.toggleBulletList()}},addInputRules(){let n=He({find:Gu,type:this.type});return(this.options.keepMarks||this.options.keepAttributes)&&(n=He({find:Gu,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:()=>this.editor.getAttributes(qu),editor:this.editor})),[n]}}),qs=$.create({name:"listItem",addOptions(){return{HTMLAttributes:{},bulletListTypeName:"bulletList",orderedListTypeName:"orderedList"}},content:"paragraph block*",defining:!0,parseHTML(){return[{tag:"li"}]},renderHTML({HTMLAttributes:n}){return["li",D(this.options.HTMLAttributes,n),0]},addKeyboardShortcuts(){return{Enter:()=>this.editor.commands.splitListItem(this.name),Tab:()=>this.editor.commands.sinkListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)}}}),ay={};sy(ay,{findListItemPos:()=>_n,getNextListDepth:()=>Gs,handleBackspace:()=>_s,handleDelete:()=>Us,hasListBefore:()=>Qu,hasListItemAfter:()=>cy,hasListItemBefore:()=>Zu,listItemHasSubList:()=>ef,nextListIsDeeper:()=>tf,nextListIsHigher:()=>nf});var _n=(n,e)=>{let{$from:t}=e.selection,r=_(n,e.schema),i=null,o=t.depth,s=t.pos,l=null;for(;o>0&&l===null;)i=t.node(o),i.type===r?l=o:(o-=1,s-=1);return l===null?null:{$pos:e.doc.resolve(s),depth:l}},Gs=(n,e)=>{let t=_n(n,e);if(!t)return!1;let[,r]=Wc(e,n,t.$pos.pos+4);return r},Qu=(n,e,t)=>{let{$anchor:r}=n.selection,i=Math.max(0,r.pos-2),o=n.doc.resolve(i).node();return!(!o||!t.includes(o.type.name))},Zu=(n,e)=>{var t;let{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-2);return!(i.index()===0||((t=i.nodeBefore)==null?void 0:t.type.name)!==n)},ef=(n,e,t)=>{if(!t)return!1;let r=_(n,e.schema),i=!1;return t.descendants(o=>{o.type===r&&(i=!0)}),i},_s=(n,e,t)=>{if(n.commands.undoInputRule())return!0;if(n.state.selection.from!==n.state.selection.to)return!1;if(!Fe(n.state,e)&&Qu(n.state,e,t)){let{$anchor:l}=n.state.selection,a=n.state.doc.resolve(l.before()-1),c=[];a.node().descendants((d,h)=>{d.type.name===e&&c.push({node:d,pos:h})});let u=c.at(-1);if(!u)return!1;let f=n.state.doc.resolve(a.start()+u.pos+1);return n.chain().cut({from:l.start()-1,to:l.end()+1},f.end()).joinForward().run()}if(!Fe(n.state,e)||!Kc(n.state))return!1;let r=_n(e,n.state);if(!r)return!1;let o=n.state.doc.resolve(r.$pos.pos-2).node(r.depth),s=ef(e,n.state,o);return Zu(e,n.state)&&!s?n.commands.joinItemBackward():n.chain().liftListItem(e).run()},tf=(n,e)=>{let t=Gs(n,e),r=_n(n,e);return!r||!t?!1:t>r.depth},nf=(n,e)=>{let t=Gs(n,e),r=_n(n,e);return!r||!t?!1:t{if(!Fe(n.state,e)||!jc(n.state,e))return!1;let{selection:t}=n.state,{$from:r,$to:i}=t;return!t.empty&&r.sameParent(i)?!1:tf(e,n.state)?n.chain().focus(n.state.selection.from+4).lift(e).joinBackward().run():nf(e,n.state)?n.chain().joinForward().joinBackward().run():n.commands.joinItemForward()},cy=(n,e)=>{var t;let{$anchor:r}=e.selection,i=e.doc.resolve(r.pos-r.parentOffset-2);return!(i.index()===i.parent.childCount-1||((t=i.nodeAfter)==null?void 0:t.type.name)!==n)},uy=F.create({name:"listKeymap",addOptions(){return{listTypes:[{itemName:"listItem",wrapperNames:["bulletList","orderedList"]},{itemName:"taskItem",wrapperNames:["taskList"]}]}},addKeyboardShortcuts(){return{Delete:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&Us(n,t)&&(e=!0)}),e},"Mod-Delete":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t})=>{n.state.schema.nodes[t]!==void 0&&Us(n,t)&&(e=!0)}),e},Backspace:({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:r})=>{n.state.schema.nodes[t]!==void 0&&_s(n,t,r)&&(e=!0)}),e},"Mod-Backspace":({editor:n})=>{let e=!1;return this.options.listTypes.forEach(({itemName:t,wrapperNames:r})=>{n.state.schema.nodes[t]!==void 0&&_s(n,t,r)&&(e=!0)}),e}}}}),fy="listItem",Yu="textStyle",Xu=/^(\d+)\.\s$/,Ys=$.create({name:"orderedList",addOptions(){return{itemTypeName:"listItem",HTMLAttributes:{},keepMarks:!1,keepAttributes:!1}},group:"block list",content(){return`${this.options.itemTypeName}+`},addAttributes(){return{start:{default:1,parseHTML:n=>n.hasAttribute("start")?parseInt(n.getAttribute("start")||"",10):1},type:{default:null,parseHTML:n=>n.getAttribute("type")}}},parseHTML(){return[{tag:"ol"}]},renderHTML({HTMLAttributes:n}){let{start:e,...t}=n;return e===1?["ol",D(this.options.HTMLAttributes,t),0]:["ol",D(this.options.HTMLAttributes,n),0]},addCommands(){return{toggleOrderedList:()=>({commands:n,chain:e})=>this.options.keepAttributes?e().toggleList(this.name,this.options.itemTypeName,this.options.keepMarks).updateAttributes(fy,this.editor.getAttributes(Yu)).run():n.toggleList(this.name,this.options.itemTypeName,this.options.keepMarks)}},addKeyboardShortcuts(){return{"Mod-Shift-7":()=>this.editor.commands.toggleOrderedList()}},addInputRules(){let n=He({find:Xu,type:this.type,getAttributes:e=>({start:+e[1]}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1]});return(this.options.keepMarks||this.options.keepAttributes)&&(n=He({find:Xu,type:this.type,keepMarks:this.options.keepMarks,keepAttributes:this.options.keepAttributes,getAttributes:e=>({start:+e[1],...this.editor.getAttributes(Yu)}),joinPredicate:(e,t)=>t.childCount+t.attrs.start===+e[1],editor:this.editor})),[n]}}),dy=/^\s*(\[([( |x])?\])\s$/,hy=$.create({name:"taskItem",addOptions(){return{nested:!1,HTMLAttributes:{},taskListTypeName:"taskList"}},content(){return this.options.nested?"paragraph block*":"paragraph+"},defining:!0,addAttributes(){return{checked:{default:!1,keepOnSplit:!1,parseHTML:n=>{let e=n.getAttribute("data-checked");return e===""||e==="true"},renderHTML:n=>({"data-checked":n.checked})}}},parseHTML(){return[{tag:`li[data-type="${this.name}"]`,priority:51}]},renderHTML({node:n,HTMLAttributes:e}){return["li",D(this.options.HTMLAttributes,e,{"data-type":this.name}),["label",["input",{type:"checkbox",checked:n.attrs.checked?"checked":null}],["span"]],["div",0]]},addKeyboardShortcuts(){let n={Enter:()=>this.editor.commands.splitListItem(this.name),"Shift-Tab":()=>this.editor.commands.liftListItem(this.name)};return this.options.nested?{...n,Tab:()=>this.editor.commands.sinkListItem(this.name)}:n},addNodeView(){return({node:n,HTMLAttributes:e,getPos:t,editor:r})=>{let i=document.createElement("li"),o=document.createElement("label"),s=document.createElement("span"),l=document.createElement("input"),a=document.createElement("div");return o.contentEditable="false",l.type="checkbox",l.addEventListener("mousedown",c=>c.preventDefault()),l.addEventListener("change",c=>{if(!r.isEditable&&!this.options.onReadOnlyChecked){l.checked=!l.checked;return}let{checked:u}=c.target;r.isEditable&&typeof t=="function"&&r.chain().focus(void 0,{scrollIntoView:!1}).command(({tr:f})=>{let d=t();if(typeof d!="number")return!1;let h=f.doc.nodeAt(d);return f.setNodeMarkup(d,void 0,{...h?.attrs,checked:u}),!0}).run(),!r.isEditable&&this.options.onReadOnlyChecked&&(this.options.onReadOnlyChecked(n,u)||(l.checked=!l.checked))}),Object.entries(this.options.HTMLAttributes).forEach(([c,u])=>{i.setAttribute(c,u)}),i.dataset.checked=n.attrs.checked,l.checked=n.attrs.checked,o.append(l,s),i.append(o,a),Object.entries(e).forEach(([c,u])=>{i.setAttribute(c,u)}),{dom:i,contentDOM:a,update:c=>c.type!==this.type?!1:(i.dataset.checked=c.attrs.checked,l.checked=c.attrs.checked,!0)}}},addInputRules(){return[He({find:dy,type:this.type,getAttributes:n=>({checked:n[n.length-1]==="x"})})]}}),py=$.create({name:"taskList",addOptions(){return{itemTypeName:"taskItem",HTMLAttributes:{}}},group:"block list",content(){return`${this.options.itemTypeName}+`},parseHTML(){return[{tag:`ul[data-type="${this.name}"]`,priority:51}]},renderHTML({HTMLAttributes:n}){return["ul",D(this.options.HTMLAttributes,n,{"data-type":this.name}),0]},addCommands(){return{toggleTaskList:()=>({commands:n})=>n.toggleList(this.name,this.options.itemTypeName)}},addKeyboardShortcuts(){return{"Mod-Shift-9":()=>this.editor.commands.toggleTaskList()}}}),Vk=F.create({name:"listKit",addExtensions(){let n=[];return this.options.bulletList!==!1&&n.push(Js.configure(this.options.bulletList)),this.options.listItem!==!1&&n.push(qs.configure(this.options.listItem)),this.options.listKeymap!==!1&&n.push(uy.configure(this.options.listKeymap)),this.options.orderedList!==!1&&n.push(Ys.configure(this.options.orderedList)),this.options.taskItem!==!1&&n.push(hy.configure(this.options.taskItem)),this.options.taskList!==!1&&n.push(py.configure(this.options.taskList)),n}});var rf=["image/png","image/jpeg","image/gif","image/webp"],Ai=(n,e,t={})=>{n.dom.closest("form")?.dispatchEvent(new CustomEvent(e,{composed:!0,cancelable:!0,detail:t}))},my=({editor:n,key:e,statePath:t,uploadingMessage:r,$wire:i})=>{let o=s=>i().callSchemaComponentMethod(e,"getUploadedFileAttachmentTemporaryUrl",{attachment:s});return new E({key:new P("localFiles"),props:{handleDrop(s,l){if(!l.dataTransfer?.files.length)return!1;let a=Array.from(l.dataTransfer.files).filter(u=>rf.includes(u.type));if(!a.length)return!1;Ai(s,"form-processing-started",{message:r}),l.preventDefault(),l.stopPropagation();let c=s.posAtCoords({left:l.clientX,top:l.clientY});return a.forEach((u,f)=>{n.setEditable(!1),s.dom.dispatchEvent(new CustomEvent("rich-editor-uploading-file",{bubbles:!0,detail:{key:e,livewireId:i().id}}));let d=new FileReader;d.readAsDataURL(u),d.onload=()=>{n.chain().insertContentAt(c?.pos??0,{type:"image",attrs:{class:"fi-loading",src:d.result}}).run()};let h=("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,p=>(p^crypto.getRandomValues(new Uint8Array(1))[0]&15>>p/4).toString(16));i().upload(`componentFileAttachments.${t}.${h}`,u,()=>{o(h).then(p=>{p&&(n.chain().updateAttributes("image",{class:null,"data-id":h,src:p}).run(),n.setEditable(!0),s.dom.dispatchEvent(new CustomEvent("rich-editor-uploaded-file",{bubbles:!0,detail:{key:e,livewireId:i().id}})),f===a.length-1&&Ai(s,"form-processing-finished"))})})}),!0},handlePaste(s,l){if(!l.clipboardData?.files.length)return!1;let a=Array.from(l.clipboardData.files).filter(c=>rf.includes(c.type));return a.length?(l.preventDefault(),l.stopPropagation(),Ai(s,"form-processing-started",{message:r}),a.forEach((c,u)=>{n.setEditable(!1),s.dom.dispatchEvent(new CustomEvent("rich-editor-uploading-file",{bubbles:!0,detail:{key:e,livewireId:i().id}}));let f=new FileReader;f.readAsDataURL(c),f.onload=()=>{n.chain().insertContentAt(n.state.selection.anchor,{type:"image",attrs:{class:"fi-loading",src:f.result}}).run()};let d=("10000000-1000-4000-8000"+-1e11).replace(/[018]/g,h=>(h^crypto.getRandomValues(new Uint8Array(1))[0]&15>>h/4).toString(16));i().upload(`componentFileAttachments.${t}.${d}`,c,()=>{o(d).then(h=>{h&&(n.chain().updateAttributes("image",{class:null,"data-id":d,src:h}).run(),n.setEditable(!0),s.dom.dispatchEvent(new CustomEvent("rich-editor-uploaded-file",{bubbles:!0,detail:{key:e,livewireId:i().id}})),u===a.length-1&&Ai(s,"form-processing-finished"))})})}),!0):!1}}})},of=F.create({name:"localFiles",addOptions(){return{key:null,statePath:null,uploadingMessage:null,$wire:null}},addProseMirrorPlugins(){return[my({editor:this.editor,...this.options})]}});function gy(n){var e;let{char:t,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:l}=n,a=r&&!i,c=fu(t),u=new RegExp(`\\s${c}$`),f=s?"^":"",d=i?"":c,h=a?new RegExp(`${f}${c}.*?(?=\\s${d}|$)`,"gm"):new RegExp(`${f}(?:^)?${c}[^\\s${d}]*`,"gm"),p=((e=l.nodeBefore)==null?void 0:e.isText)&&l.nodeBefore.text;if(!p)return null;let m=l.pos-p.length,g=Array.from(p.matchAll(h)).pop();if(!g||g.input===void 0||g.index===void 0)return null;let y=g.input.slice(Math.max(0,g.index-1),g.index),b=new RegExp(`^[${o?.join("")}\0]?$`).test(y);if(o!==null&&!b)return null;let S=m+g.index,C=S+g[0].length;return a&&u.test(p.slice(C-1,C+1))&&(g[0]+=" ",C+=1),S=l.pos?{range:{from:S,to:C},query:g[0].slice(t.length),text:g[0]}:null}var yy=new P("suggestion");function by({pluginKey:n=yy,editor:e,char:t="@",allowSpaces:r=!1,allowToIncludeChar:i=!1,allowedPrefixes:o=[" "],startOfLine:s=!1,decorationTag:l="span",decorationClass:a="suggestion",command:c=()=>null,items:u=()=>[],render:f=()=>({}),allow:d=()=>!0,findSuggestionMatch:h=gy}){let p,m=f?.(),g=new E({key:n,view(){return{update:async(y,b)=>{var S,C,M,R,z,V,N;let I=(S=this.key)==null?void 0:S.getState(b),j=(C=this.key)==null?void 0:C.getState(y.state),me=I.active&&j.active&&I.range.from!==j.range.from,st=!I.active&&j.active,_e=I.active&&!j.active,re=!st&&!_e&&I.query!==j.query,ie=st||me&&re,oe=re||me,ke=_e||me&&re;if(!ie&&!oe&&!ke)return;let Q=ke&&!ie?I:j,Ne=y.dom.querySelector(`[data-decoration-id="${Q.decorationId}"]`);p={editor:e,range:Q.range,query:Q.query,text:Q.text,items:[],command:jt=>c({editor:e,range:Q.range,props:jt}),decorationNode:Ne,clientRect:Ne?()=>{var jt;let{decorationId:Vf}=(jt=this.key)==null?void 0:jt.getState(e.state),il=y.dom.querySelector(`[data-decoration-id="${Vf}"]`);return il?.getBoundingClientRect()||null}:null},ie&&((M=m?.onBeforeStart)==null||M.call(m,p)),oe&&((R=m?.onBeforeUpdate)==null||R.call(m,p)),(oe||ie)&&(p.items=await u({editor:e,query:Q.query})),ke&&((z=m?.onExit)==null||z.call(m,p)),oe&&((V=m?.onUpdate)==null||V.call(m,p)),ie&&((N=m?.onStart)==null||N.call(m,p))},destroy:()=>{var y;p&&((y=m?.onExit)==null||y.call(m,p))}}},state:{init(){return{active:!1,range:{from:0,to:0},query:null,text:null,composing:!1}},apply(y,b,S,C){let{isEditable:M}=e,{composing:R}=e.view,{selection:z}=y,{empty:V,from:N}=z,I={...b};if(I.composing=R,M&&(V||e.view.composing)){(Nb.range.to)&&!R&&!b.composing&&(I.active=!1);let j=h({char:t,allowSpaces:r,allowToIncludeChar:i,allowedPrefixes:o,startOfLine:s,$position:z.$from}),me=`id_${Math.floor(Math.random()*4294967295)}`;j&&d({editor:e,state:C,range:j.range,isActive:b.active})?(I.active=!0,I.decorationId=b.decorationId?b.decorationId:me,I.range=j.range,I.query=j.query,I.text=j.text):I.active=!1}else I.active=!1;return I.active||(I.decorationId=null,I.range={from:0,to:0},I.query=null,I.text=null),I}},props:{handleKeyDown(y,b){var S;let{active:C,range:M}=g.getState(y.state);return C&&((S=m?.onKeyDown)==null?void 0:S.call(m,{view:y,event:b,range:M}))||!1},decorations(y){let{active:b,range:S,decorationId:C}=g.getState(y);return b?K.create(y.doc,[X.inline(S.from,S.to,{nodeName:l,class:a,"data-decoration-id":C})]):null}}});return g}var sf=by;var xy=function({editor:n,overrideSuggestionOptions:e,extensionName:t}){let r=new P;return{editor:n,char:"{{",pluginKey:r,command:({editor:i,range:o,props:s})=>{i.view.state.selection.$to.nodeAfter?.text?.startsWith(" ")&&(o.to+=1),i.chain().focus().insertContentAt(o,[{type:t,attrs:{...s}},{type:"text",text:" "}]).run(),i.view.dom.ownerDocument.defaultView?.getSelection()?.collapseToEnd()},allow:({state:i,range:o})=>{let s=i.doc.resolve(o.from),l=i.schema.nodes[t];return!!s.parent.type.contentMatch.matchType(l)},...e}},lf=$.create({name:"mergeTag",priority:101,addStorage:function(){return{suggestions:[],getSuggestionFromChar:()=>null}},addOptions:function(){return{HTMLAttributes:{},renderText({node:n}){return`{{ ${n.attrs.label??n.attrs.id} }}`},deleteTriggerWithBackspace:!1,renderHTML({options:n,node:e}){return["span",D(this.HTMLAttributes,n.HTMLAttributes),`${e.attrs.label??e.attrs.id}`]},suggestions:[],suggestion:{}}},group:"inline",inline:!0,selectable:!1,atom:!0,addAttributes:function(){return{id:{default:null,parseHTML:n=>n.getAttribute("data-id"),renderHTML:n=>n.id?{"data-id":n.id}:{}},label:{default:null,parseHTML:n=>n.getAttribute("data-label"),renderHTML:n=>n.label?{"data-label":n.label}:{}}}},parseHTML:function(){return[{tag:`span[data-type="${this.name}"]`}]},renderHTML:function({node:n,HTMLAttributes:e}){let t=this.editor?.extensionStorage?.[this.name]?.getSuggestionFromChar("{{"),r={...this.options};r.HTMLAttributes=D({"data-type":this.name},this.options.HTMLAttributes,e);let i=this.options.renderHTML({options:r,node:n,suggestion:t});return typeof i=="string"?["span",D({"data-type":this.name},this.options.HTMLAttributes,e),i]:i},renderText:function({node:n}){let e={options:this.options,node:n,suggestion:this.editor?.extensionStorage?.[this.name]?.getSuggestionFromChar("{{")};return this.options.renderText(e)},addKeyboardShortcuts:function(){return{Backspace:()=>this.editor.commands.command(({tr:n,state:e})=>{let t=!1,{selection:r}=e,{empty:i,anchor:o}=r;if(!i)return!1;let s=new G,l=0;return e.doc.nodesBetween(o-1,o,(a,c)=>{if(a.type.name===this.name)return t=!0,s=a,l=c,!1}),t&&n.insertText(this.options.deleteTriggerWithBackspace?"":"{{",l,l+s.nodeSize),t})}},addProseMirrorPlugins:function(){return[...this.storage.suggestions.map(sf),new E({props:{handleDrop(n,e){if(!e||(e.preventDefault(),!e.dataTransfer.getData("mergeTag")))return!1;let t=e.dataTransfer.getData("mergeTag");return n.dispatch(n.state.tr.insert(n.posAtCoords({left:e.clientX,top:e.clientY}).pos,n.state.schema.nodes.mergeTag.create({id:t}))),!1}}})]},onBeforeCreate:function(){this.storage.suggestions=(this.options.suggestions.length?this.options.suggestions:[this.options.suggestion]).map(n=>xy({editor:this.editor,overrideSuggestionOptions:n,extensionName:this.name})),this.storage.getSuggestionFromChar=n=>{let e=this.storage.suggestions.find(t=>t.char===n);return e||(this.storage.suggestions.length?this.storage.suggestions[0]:null)}}});var ky=$.create({name:"paragraph",priority:1e3,addOptions(){return{HTMLAttributes:{}}},group:"block",content:"inline*",parseHTML(){return[{tag:"p"}]},renderHTML({HTMLAttributes:n}){return["p",D(this.options.HTMLAttributes,n),0]},addCommands(){return{setParagraph:()=>({commands:n})=>n.setNode(this.name)}},addKeyboardShortcuts(){return{"Mod-Alt-0":()=>this.editor.commands.setParagraph()}}}),af=ky;var Sy=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))$/,wy=/(?:^|\s)(~~(?!\s+~~)((?:[^~]+))~~(?!\s+~~))/g,My=te.create({name:"strike",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"s"},{tag:"del"},{tag:"strike"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("line-through")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["s",D(this.options.HTMLAttributes,n),0]},addCommands(){return{setStrike:()=>({commands:n})=>n.setMark(this.name),toggleStrike:()=>({commands:n})=>n.toggleMark(this.name),unsetStrike:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-Shift-s":()=>this.editor.commands.toggleStrike()}},addInputRules(){return[ze({find:Sy,type:this.type})]},addPasteRules(){return[ve({find:wy,type:this.type})]}}),cf=My;var Cy=te.create({name:"subscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sub"},{style:"vertical-align",getAttrs(n){return n!=="sub"?!1:null}}]},renderHTML({HTMLAttributes:n}){return["sub",D(this.options.HTMLAttributes,n),0]},addCommands(){return{setSubscript:()=>({commands:n})=>n.setMark(this.name),toggleSubscript:()=>({commands:n})=>n.toggleMark(this.name),unsetSubscript:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-,":()=>this.editor.commands.toggleSubscript()}}}),uf=Cy;var vy=te.create({name:"superscript",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"sup"},{style:"vertical-align",getAttrs(n){return n!=="super"?!1:null}}]},renderHTML({HTMLAttributes:n}){return["sup",D(this.options.HTMLAttributes,n),0]},addCommands(){return{setSuperscript:()=>({commands:n})=>n.setMark(this.name),toggleSuperscript:()=>({commands:n})=>n.toggleMark(this.name),unsetSuperscript:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-.":()=>this.editor.commands.toggleSuperscript()}}}),ff=vy;var Ty=$.create({name:"text",group:"inline"}),df=Ty;var Ey=te.create({name:"underline",addOptions(){return{HTMLAttributes:{}}},parseHTML(){return[{tag:"u"},{style:"text-decoration",consuming:!1,getAttrs:n=>n.includes("underline")?{}:!1}]},renderHTML({HTMLAttributes:n}){return["u",D(this.options.HTMLAttributes,n),0]},addCommands(){return{setUnderline:()=>({commands:n})=>n.setMark(this.name),toggleUnderline:()=>({commands:n})=>n.toggleMark(this.name),unsetUnderline:()=>({commands:n})=>n.unsetMark(this.name)}},addKeyboardShortcuts(){return{"Mod-u":()=>this.editor.commands.toggleUnderline(),"Mod-U":()=>this.editor.commands.toggleUnderline()}}}),hf=Ey;var Jn=Math.min,yt=Math.max,qn=Math.round;var Re=n=>({x:n,y:n}),Ay={left:"right",right:"left",bottom:"top",top:"bottom"},Oy={start:"end",end:"start"};function Xs(n,e,t){return yt(n,Jn(e,t))}function Ni(n,e){return typeof n=="function"?n(e):n}function zt(n){return n.split("-")[0]}function Di(n){return n.split("-")[1]}function Qs(n){return n==="x"?"y":"x"}function Zs(n){return n==="y"?"height":"width"}function Ht(n){return["top","bottom"].includes(zt(n))?"y":"x"}function el(n){return Qs(Ht(n))}function pf(n,e,t){t===void 0&&(t=!1);let r=Di(n),i=el(n),o=Zs(i),s=i==="x"?r===(t?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[o]>e.floating[o]&&(s=Un(s)),[s,Un(s)]}function mf(n){let e=Un(n);return[Oi(n),e,Oi(e)]}function Oi(n){return n.replace(/start|end/g,e=>Oy[e])}function Ny(n,e,t){let r=["left","right"],i=["right","left"],o=["top","bottom"],s=["bottom","top"];switch(n){case"top":case"bottom":return t?e?i:r:e?r:i;case"left":case"right":return e?o:s;default:return[]}}function gf(n,e,t,r){let i=Di(n),o=Ny(zt(n),t==="start",r);return i&&(o=o.map(s=>s+"-"+i),e&&(o=o.concat(o.map(Oi)))),o}function Un(n){return n.replace(/left|right|bottom|top/g,e=>Ay[e])}function Dy(n){return{top:0,right:0,bottom:0,left:0,...n}}function yf(n){return typeof n!="number"?Dy(n):{top:n,right:n,bottom:n,left:n}}function $t(n){let{x:e,y:t,width:r,height:i}=n;return{width:r,height:i,top:t,left:e,right:e+r,bottom:t+i,x:e,y:t}}function bf(n,e,t){let{reference:r,floating:i}=n,o=Ht(e),s=el(e),l=Zs(s),a=zt(e),c=o==="y",u=r.x+r.width/2-i.width/2,f=r.y+r.height/2-i.height/2,d=r[l]/2-i[l]/2,h;switch(a){case"top":h={x:u,y:r.y-i.height};break;case"bottom":h={x:u,y:r.y+r.height};break;case"right":h={x:r.x+r.width,y:f};break;case"left":h={x:r.x-i.width,y:f};break;default:h={x:r.x,y:r.y}}switch(Di(e)){case"start":h[s]-=d*(t&&c?-1:1);break;case"end":h[s]+=d*(t&&c?-1:1);break}return h}var xf=async(n,e,t)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:s}=t,l=o.filter(Boolean),a=await(s.isRTL==null?void 0:s.isRTL(e)),c=await s.getElementRects({reference:n,floating:e,strategy:i}),{x:u,y:f}=bf(c,r,a),d=r,h={},p=0;for(let m=0;mre<=0)){var j,me;let re=(((j=o.flip)==null?void 0:j.index)||0)+1,ie=z[re];if(ie){var st;let ke=f==="alignment"?b!==Ht(ie):!1,Q=((st=I[0])==null?void 0:st.overflows[0])>0;if(!ke||Q)return{data:{index:re,overflows:I},reset:{placement:ie}}}let oe=(me=I.filter(ke=>ke.overflows[0]<=0).sort((ke,Q)=>ke.overflows[1]-Q.overflows[1])[0])==null?void 0:me.placement;if(!oe)switch(h){case"bestFit":{var _e;let ke=(_e=I.filter(Q=>{if(R){let Ne=Ht(Q.placement);return Ne===b||Ne==="y"}return!0}).map(Q=>[Q.placement,Q.overflows.filter(Ne=>Ne>0).reduce((Ne,jt)=>Ne+jt,0)]).sort((Q,Ne)=>Q[1]-Ne[1])[0])==null?void 0:_e[0];ke&&(oe=ke);break}case"initialPlacement":oe=l;break}if(i!==oe)return{reset:{placement:oe}}}return{}}}};var Sf=function(n){return n===void 0&&(n={}),{name:"shift",options:n,async fn(e){let{x:t,y:r,placement:i}=e,{mainAxis:o=!0,crossAxis:s=!1,limiter:l={fn:g=>{let{x:y,y:b}=g;return{x:y,y:b}}},...a}=Ni(n,e),c={x:t,y:r},u=await tl(e,a),f=Ht(zt(i)),d=Qs(f),h=c[d],p=c[f];if(o){let g=d==="y"?"top":"left",y=d==="y"?"bottom":"right",b=h+u[g],S=h-u[y];h=Xs(b,h,S)}if(s){let g=f==="y"?"top":"left",y=f==="y"?"bottom":"right",b=p+u[g],S=p-u[y];p=Xs(b,p,S)}let m=l.fn({...e,[d]:h,[f]:p});return{...m,data:{x:m.x-t,y:m.y-r,enabled:{[d]:o,[f]:s}}}}}};function Pi(){return typeof window<"u"}function Vt(n){return Mf(n)?(n.nodeName||"").toLowerCase():"#document"}function be(n){var e;return(n==null||(e=n.ownerDocument)==null?void 0:e.defaultView)||window}function Ke(n){var e;return(e=(Mf(n)?n.ownerDocument:n.document)||window.document)==null?void 0:e.documentElement}function Mf(n){return Pi()?n instanceof Node||n instanceof be(n).Node:!1}function Ae(n){return Pi()?n instanceof Element||n instanceof be(n).Element:!1}function Pe(n){return Pi()?n instanceof HTMLElement||n instanceof be(n).HTMLElement:!1}function wf(n){return!Pi()||typeof ShadowRoot>"u"?!1:n instanceof ShadowRoot||n instanceof be(n).ShadowRoot}function un(n){let{overflow:e,overflowX:t,overflowY:r,display:i}=Oe(n);return/auto|scroll|overlay|hidden|clip/.test(e+r+t)&&!["inline","contents"].includes(i)}function Cf(n){return["table","td","th"].includes(Vt(n))}function Gn(n){return[":popover-open",":modal"].some(e=>{try{return n.matches(e)}catch{return!1}})}function Ii(n){let e=Li(),t=Ae(n)?Oe(n):n;return["transform","translate","scale","rotate","perspective"].some(r=>t[r]?t[r]!=="none":!1)||(t.containerType?t.containerType!=="normal":!1)||!e&&(t.backdropFilter?t.backdropFilter!=="none":!1)||!e&&(t.filter?t.filter!=="none":!1)||["transform","translate","scale","rotate","perspective","filter"].some(r=>(t.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(t.contain||"").includes(r))}function vf(n){let e=ot(n);for(;Pe(e)&&!Wt(e);){if(Ii(e))return e;if(Gn(e))return null;e=ot(e)}return null}function Li(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Wt(n){return["html","body","#document"].includes(Vt(n))}function Oe(n){return be(n).getComputedStyle(n)}function Yn(n){return Ae(n)?{scrollLeft:n.scrollLeft,scrollTop:n.scrollTop}:{scrollLeft:n.scrollX,scrollTop:n.scrollY}}function ot(n){if(Vt(n)==="html")return n;let e=n.assignedSlot||n.parentNode||wf(n)&&n.host||Ke(n);return wf(e)?e.host:e}function Tf(n){let e=ot(n);return Wt(e)?n.ownerDocument?n.ownerDocument.body:n.body:Pe(e)&&un(e)?e:Tf(e)}function Ri(n,e,t){var r;e===void 0&&(e=[]),t===void 0&&(t=!0);let i=Tf(n),o=i===((r=n.ownerDocument)==null?void 0:r.body),s=be(i);if(o){let l=Bi(s);return e.concat(s,s.visualViewport||[],un(i)?i:[],l&&t?Ri(l):[])}return e.concat(i,Ri(i,[],t))}function Bi(n){return n.parent&&Object.getPrototypeOf(n.parent)?n.frameElement:null}function Of(n){let e=Oe(n),t=parseFloat(e.width)||0,r=parseFloat(e.height)||0,i=Pe(n),o=i?n.offsetWidth:t,s=i?n.offsetHeight:r,l=qn(t)!==o||qn(r)!==s;return l&&(t=o,r=s),{width:t,height:r,$:l}}function Nf(n){return Ae(n)?n:n.contextElement}function fn(n){let e=Nf(n);if(!Pe(e))return Re(1);let t=e.getBoundingClientRect(),{width:r,height:i,$:o}=Of(e),s=(o?qn(t.width):t.width)/r,l=(o?qn(t.height):t.height)/i;return(!s||!Number.isFinite(s))&&(s=1),(!l||!Number.isFinite(l))&&(l=1),{x:s,y:l}}var Ry=Re(0);function Df(n){let e=be(n);return!Li()||!e.visualViewport?Ry:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function Py(n,e,t){return e===void 0&&(e=!1),!t||e&&t!==be(n)?!1:e}function Xn(n,e,t,r){e===void 0&&(e=!1),t===void 0&&(t=!1);let i=n.getBoundingClientRect(),o=Nf(n),s=Re(1);e&&(r?Ae(r)&&(s=fn(r)):s=fn(n));let l=Py(o,t,r)?Df(o):Re(0),a=(i.left+l.x)/s.x,c=(i.top+l.y)/s.y,u=i.width/s.x,f=i.height/s.y;if(o){let d=be(o),h=r&&Ae(r)?be(r):r,p=d,m=Bi(p);for(;m&&r&&h!==p;){let g=fn(m),y=m.getBoundingClientRect(),b=Oe(m),S=y.left+(m.clientLeft+parseFloat(b.paddingLeft))*g.x,C=y.top+(m.clientTop+parseFloat(b.paddingTop))*g.y;a*=g.x,c*=g.y,u*=g.x,f*=g.y,a+=S,c+=C,p=be(m),m=Bi(p)}}return $t({width:u,height:f,x:a,y:c})}function rl(n,e){let t=Yn(n).scrollLeft;return e?e.left+t:Xn(Ke(n)).left+t}function Rf(n,e,t){t===void 0&&(t=!1);let r=n.getBoundingClientRect(),i=r.left+e.scrollLeft-(t?0:rl(n,r)),o=r.top+e.scrollTop;return{x:i,y:o}}function Iy(n){let{elements:e,rect:t,offsetParent:r,strategy:i}=n,o=i==="fixed",s=Ke(r),l=e?Gn(e.floating):!1;if(r===s||l&&o)return t;let a={scrollLeft:0,scrollTop:0},c=Re(1),u=Re(0),f=Pe(r);if((f||!f&&!o)&&((Vt(r)!=="body"||un(s))&&(a=Yn(r)),Pe(r))){let h=Xn(r);c=fn(r),u.x=h.x+r.clientLeft,u.y=h.y+r.clientTop}let d=s&&!f&&!o?Rf(s,a,!0):Re(0);return{width:t.width*c.x,height:t.height*c.y,x:t.x*c.x-a.scrollLeft*c.x+u.x+d.x,y:t.y*c.y-a.scrollTop*c.y+u.y+d.y}}function Ly(n){return Array.from(n.getClientRects())}function By(n){let e=Ke(n),t=Yn(n),r=n.ownerDocument.body,i=yt(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),o=yt(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight),s=-t.scrollLeft+rl(n),l=-t.scrollTop;return Oe(r).direction==="rtl"&&(s+=yt(e.clientWidth,r.clientWidth)-i),{width:i,height:o,x:s,y:l}}function Fy(n,e){let t=be(n),r=Ke(n),i=t.visualViewport,o=r.clientWidth,s=r.clientHeight,l=0,a=0;if(i){o=i.width,s=i.height;let c=Li();(!c||c&&e==="fixed")&&(l=i.offsetLeft,a=i.offsetTop)}return{width:o,height:s,x:l,y:a}}function zy(n,e){let t=Xn(n,!0,e==="fixed"),r=t.top+n.clientTop,i=t.left+n.clientLeft,o=Pe(n)?fn(n):Re(1),s=n.clientWidth*o.x,l=n.clientHeight*o.y,a=i*o.x,c=r*o.y;return{width:s,height:l,x:a,y:c}}function Ef(n,e,t){let r;if(e==="viewport")r=Fy(n,t);else if(e==="document")r=By(Ke(n));else if(Ae(e))r=zy(e,t);else{let i=Df(n);r={x:e.x-i.x,y:e.y-i.y,width:e.width,height:e.height}}return $t(r)}function Pf(n,e){let t=ot(n);return t===e||!Ae(t)||Wt(t)?!1:Oe(t).position==="fixed"||Pf(t,e)}function Hy(n,e){let t=e.get(n);if(t)return t;let r=Ri(n,[],!1).filter(l=>Ae(l)&&Vt(l)!=="body"),i=null,o=Oe(n).position==="fixed",s=o?ot(n):n;for(;Ae(s)&&!Wt(s);){let l=Oe(s),a=Ii(s);!a&&l.position==="fixed"&&(i=null),(o?!a&&!i:!a&&l.position==="static"&&!!i&&["absolute","fixed"].includes(i.position)||un(s)&&!a&&Pf(n,s))?r=r.filter(u=>u!==s):i=l,s=ot(s)}return e.set(n,r),r}function $y(n){let{element:e,boundary:t,rootBoundary:r,strategy:i}=n,s=[...t==="clippingAncestors"?Gn(e)?[]:Hy(e,this._c):[].concat(t),r],l=s[0],a=s.reduce((c,u)=>{let f=Ef(e,u,i);return c.top=yt(f.top,c.top),c.right=Jn(f.right,c.right),c.bottom=Jn(f.bottom,c.bottom),c.left=yt(f.left,c.left),c},Ef(e,l,i));return{width:a.right-a.left,height:a.bottom-a.top,x:a.left,y:a.top}}function Vy(n){let{width:e,height:t}=Of(n);return{width:e,height:t}}function Wy(n,e,t){let r=Pe(e),i=Ke(e),o=t==="fixed",s=Xn(n,!0,o,e),l={scrollLeft:0,scrollTop:0},a=Re(0);function c(){a.x=rl(i)}if(r||!r&&!o)if((Vt(e)!=="body"||un(i))&&(l=Yn(e)),r){let h=Xn(e,!0,o,e);a.x=h.x+e.clientLeft,a.y=h.y+e.clientTop}else i&&c();o&&!r&&i&&c();let u=i&&!r&&!o?Rf(i,l):Re(0),f=s.left+l.scrollLeft-a.x-u.x,d=s.top+l.scrollTop-a.y-u.y;return{x:f,y:d,width:s.width,height:s.height}}function nl(n){return Oe(n).position==="static"}function Af(n,e){if(!Pe(n)||Oe(n).position==="fixed")return null;if(e)return e(n);let t=n.offsetParent;return Ke(n)===t&&(t=t.ownerDocument.body),t}function If(n,e){let t=be(n);if(Gn(n))return t;if(!Pe(n)){let i=ot(n);for(;i&&!Wt(i);){if(Ae(i)&&!nl(i))return i;i=ot(i)}return t}let r=Af(n,e);for(;r&&Cf(r)&&nl(r);)r=Af(r,e);return r&&Wt(r)&&nl(r)&&!Ii(r)?t:r||vf(n)||t}var jy=async function(n){let e=this.getOffsetParent||If,t=this.getDimensions,r=await t(n.floating);return{reference:Wy(n.reference,await e(n.floating),n.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Ky(n){return Oe(n).direction==="rtl"}var _y={convertOffsetParentRelativeRectToViewportRelativeRect:Iy,getDocumentElement:Ke,getClippingRect:$y,getOffsetParent:If,getElementRects:jy,getClientRects:Ly,getDimensions:Vy,getScale:fn,isElement:Ae,isRTL:Ky};var Lf=Sf,Bf=kf;var Ff=(n,e,t)=>{let r=new Map,i={platform:_y,...t},o={...i.platform,_c:r};return xf(n,e,{...i,platform:o})};var zf=(n,e)=>{Ff({getBoundingClientRect:()=>{let{from:r,to:i}=n.state.selection,o=n.view.coordsAtPos(r),s=n.view.coordsAtPos(i);return{top:Math.min(o.top,s.top),bottom:Math.max(o.bottom,s.bottom),left:Math.min(o.left,s.left),right:Math.max(o.right,s.right),width:Math.abs(s.right-o.left),height:Math.abs(s.bottom-o.top),x:Math.min(o.left,s.left),y:Math.min(o.top,s.top)}}},e,{placement:"bottom-start",strategy:"absolute",middleware:[Lf(),Bf()]}).then(({x:r,y:i,strategy:o})=>{e.style.width="max-content",e.style.position=o,e.style.left=`${r}px`,e.style.top=`${i}px`})},Hf=({mergeTags:n,noMergeTagSearchResultsMessage:e})=>({items:({query:t})=>n.filter(r=>r.toLowerCase().replace(/\s/g,"").includes(t.toLowerCase())),render:()=>{let t,r=0,i=null,o=()=>{let f=document.createElement("div");return f.className="fi-dropdown-panel fi-dropdown-list",f},s=()=>{if(!t||!i)return;let f=i.items||[];if(t.innerHTML="",f.length)f.forEach((d,h)=>{let p=document.createElement("button");p.className=h===r?"fi-dropdown-list-item fi-dropdown-list-item-label fi-selected":"fi-dropdown-list-item fi-dropdown-list-item-label",p.textContent=d,p.type="button",p.addEventListener("click",()=>l(h)),t.appendChild(p)});else{let d=document.createElement("div");d.className="fi-dropdown-header",d.textContent=e,t.appendChild(d)}},l=f=>{if(!i)return;let h=(i.items||[])[f];h&&i.command({id:h})},a=()=>{if(!i)return;let f=i.items||[];f.length!==0&&(r=(r+f.length-1)%f.length,s())},c=()=>{if(!i)return;let f=i.items||[];f.length!==0&&(r=(r+1)%f.length,s())},u=()=>{l(r)};return{onStart:f=>{i=f,r=0,t=o(),t.style.position="absolute",s(),document.body.appendChild(t),f.clientRect&&zf(f.editor,t)},onUpdate:f=>{i=f,r=0,s(),f.clientRect&&zf(f.editor,t)},onKeyDown:f=>f.event.key==="Escape"?(t&&t.parentNode&&t.parentNode.removeChild(t),!0):f.event.key==="ArrowUp"?(a(),!0):f.event.key==="ArrowDown"?(c(),!0):f.event.key==="Enter"?(u(),!0):!1,onExit:()=>{t&&t.parentNode&&t.parentNode.removeChild(t)}}}});var $f=async({customExtensionUrls:n,key:e,mergeTags:t,noMergeTagSearchResultsMessage:r,statePath:i,uploadingFileMessage:o,$wire:s})=>[Su,wu,Js,Mu,Cu,vu,Tu,Eu,Au,Ou,Du,Ju.configure({autolink:!0,openOnClick:!1}),qs,of.configure({key:e,statePath:i,uploadingMessage:o,$wire:()=>s}),...t.length?[lf.configure({deleteTriggerWithBackspace:!0,suggestion:Hf({mergeTags:t,noMergeTagSearchResultsMessage:r})})]:[],Ys,af,cf,uf,ff,df,hf,ku,...(await Promise.all(n.map(async l=>(new RegExp("^(?:[a-z+]+:)?//","i").test(l)||(l=new URL(l,document.baseURI).href),(await import(l)).default)))).flat()];function Uy({activePanel:n,extensions:e,key:t,isLiveDebounced:r,isLiveOnBlur:i,liveDebounce:o,livewireId:s,mergeTags:l,noMergeTagSearchResultsMessage:a,state:c,statePath:u,uploadingFileMessage:f}){let d;return{state:c,activePanel:n,editorSelection:{type:"text",anchor:1,head:1},isUploadingFile:!1,shouldUpdateState:!0,editorUpdatedAt:Date.now(),init:async function(){d=new cu({element:this.$refs.editor,extensions:await $f({customExtensionUrls:e,key:t,mergeTags:l,noMergeTagSearchResultsMessage:a,statePath:u,uploadingFileMessage:f,$wire:this.$wire}),content:this.state}),d.on("create",()=>{this.editorUpdatedAt=Date.now()}),d.on("update",Alpine.debounce(({editor:h})=>{this.editorUpdatedAt=Date.now(),this.state=h.getJSON(),this.shouldUpdateState=!1,r&&this.$wire.commit()},o??300)),d.on("selectionUpdate",({transaction:h})=>{this.editorUpdatedAt=Date.now(),this.editorSelection=h.selection.toJSON()}),i&&d.on("blur",()=>this.$wire.commit()),this.$watch("state",()=>{if(!this.shouldUpdateState){this.shouldUpdateState=!0;return}d.commands.setContent(this.state)}),window.addEventListener("run-rich-editor-commands",h=>{h.detail.livewireId===s&&h.detail.key===t&&this.runEditorCommands(h.detail)}),window.addEventListener("rich-editor-uploading-file",h=>{h.detail.livewireId===s&&h.detail.key===t&&(this.isUploadingFile=!0,h.stopPropagation())}),window.addEventListener("rich-editor-uploaded-file",h=>{h.detail.livewireId===s&&h.detail.key===t&&(this.isUploadingFile=!1,h.stopPropagation())}),window.dispatchEvent(new CustomEvent(`schema-component-${s}-${t}-loaded`))},getEditor:function(){return d},$getEditor:function(){return this.getEditor()},setEditorSelection:function(h){h&&(this.editorSelection=h,d.chain().command(({tr:p})=>(p.setSelection(A.fromJSON(d.state.doc,this.editorSelection)),!0)).run())},runEditorCommands:function({commands:h,editorSelection:p}){this.setEditorSelection(p);let m=d.chain();h.forEach(g=>m=m[g.name](...g.arguments??[])),m.run()},togglePanel:function(h=null){if(this.isPanelActive(h)){this.activePanel=null;return}this.activePanel=h},isPanelActive:function(h=null){return h===null?this.activePanel!==null:this.activePanel===h},insertCustomBlock:function(h){d.chain().focus().insertContent([{type:"customBlock",attrs:{id:h}},{type:"text",text:" "}]).run()},insertMergeTag:function(h){d.chain().focus().insertContent([{type:"mergeTag",attrs:{id:h}},{type:"text",text:" "}]).run()}}}export{Uy as default}; diff --git a/packages/forms/resources/js/components/rich-editor/extensions.js b/packages/forms/resources/js/components/rich-editor/extensions.js index f0e4265372..54c5fa3f11 100644 --- a/packages/forms/resources/js/components/rich-editor/extensions.js +++ b/packages/forms/resources/js/components/rich-editor/extensions.js @@ -5,6 +5,7 @@ import Code from '@tiptap/extension-code' import CodeBlock from '@tiptap/extension-code-block' import CustomBlock from './extension-custom-block.js' import Document from '@tiptap/extension-document' +import Dropcursor from '@tiptap/extension-dropcursor' import Heading from '@tiptap/extension-heading' import Italic from '@tiptap/extension-italic' import Image from './extension-image.js' @@ -37,6 +38,7 @@ export default async ({ CodeBlock, CustomBlock, Document, + Dropcursor, Heading, Italic, Image,