zigbee2mqtt-frontend 0.7.4 → 0.7.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (116) hide show
  1. package/CHANGELOG.md +37 -0
  2. package/README.md +5 -2
  3. package/dist/assets/{Availability-83a15f1c.js → Availability-f0b23599.js} +1 -1
  4. package/dist/assets/Availability-f0b23599.js.br +0 -0
  5. package/dist/assets/CodeEditor-db28b75a.js +26 -0
  6. package/dist/assets/CodeEditor-db28b75a.js.br +0 -0
  7. package/dist/assets/ConnectedDevicePage-904482a0.js +1 -0
  8. package/dist/assets/ConnectedDevicePage-904482a0.js.br +0 -0
  9. package/dist/assets/ConnectedMap-ad767e1b.js +1 -0
  10. package/dist/assets/ConnectedMap-ad767e1b.js.br +0 -0
  11. package/dist/assets/Dashboard-d3d4628c.js +1 -0
  12. package/dist/assets/Dashboard-d3d4628c.js.br +0 -0
  13. package/dist/assets/{DashboardDevice-e545a4b6.js → DashboardDevice-395e073f.js} +1 -1
  14. package/dist/assets/DashboardDevice-395e073f.js.br +0 -0
  15. package/dist/assets/DashboardFeatureWrapper-155f3706.js +1 -0
  16. package/dist/assets/DashboardFeatureWrapper-155f3706.js.br +0 -0
  17. package/dist/assets/DeviceImage-a061f5db.js +1 -0
  18. package/dist/assets/DeviceImage-a061f5db.js.br +0 -0
  19. package/dist/assets/{GroupPage-188b4717.js → GroupPage-c483fae1.js} +1 -1
  20. package/dist/assets/GroupPage-c483fae1.js.br +0 -0
  21. package/dist/assets/{ReactTableCom-eddba77e.js → ReactTableCom-6781cab1.js} +1 -1
  22. package/dist/assets/ReactTableCom-6781cab1.js.br +0 -0
  23. package/dist/assets/{RecallRemove-720e6aa0.js → RecallRemove-0cbfef09.js} +1 -1
  24. package/dist/assets/RecallRemove-0cbfef09.js.br +0 -0
  25. package/dist/assets/_baseSet-0d6ca43e.js +1 -0
  26. package/dist/assets/_getAllKeysIn-56690519.js +1 -0
  27. package/dist/assets/{bootstrap-5.esm-672cb437.js → bootstrap-5.esm-d9fb6ca4.js} +1 -1
  28. package/dist/assets/bootstrap-5.esm-d9fb6ca4.js.br +0 -0
  29. package/dist/assets/extends-98964cd2.js +1 -0
  30. package/dist/assets/fa-brands-400-bc844b5b.ttf +0 -0
  31. package/dist/assets/fa-brands-400-c411f119.woff2 +0 -0
  32. package/dist/assets/fa-regular-400-64f9fb62.ttf +0 -0
  33. package/dist/assets/fa-regular-400-c732f106.woff2 +0 -0
  34. package/dist/assets/fa-solid-900-1f0189e0.woff2 +0 -0
  35. package/dist/assets/fa-solid-900-31f099c1.ttf +0 -0
  36. package/dist/assets/fa-v4compatibility-2aca24b3.woff2 +0 -0
  37. package/dist/assets/fa-v4compatibility-a6274a12.ttf +0 -0
  38. package/dist/assets/{index-50bf6a26.js → index-09c76387.js} +1 -1
  39. package/dist/assets/index-0f5e7faa.css +5 -0
  40. package/dist/assets/index-0f5e7faa.css.br +0 -0
  41. package/dist/assets/{index-74e84a13.js → index-1213f99f.js} +68 -72
  42. package/dist/assets/index-1213f99f.js.br +0 -0
  43. package/dist/assets/{index-92365285.js → index-16cc7fdf.js} +2 -2
  44. package/dist/assets/index-16cc7fdf.js.br +0 -0
  45. package/dist/assets/index-172e5c4f.js +1 -0
  46. package/dist/assets/index-172e5c4f.js.br +0 -0
  47. package/dist/assets/{index-9b935b93.js → index-89eed468.js} +1 -1
  48. package/dist/assets/index-89eed468.js.br +0 -0
  49. package/dist/assets/{index-538efde1.js → index-a7046605.js} +1 -1
  50. package/dist/assets/index-a7046605.js.br +0 -0
  51. package/dist/assets/index-abe21901.js +1 -0
  52. package/dist/assets/index-abe21901.js.br +0 -0
  53. package/dist/assets/{index-66c36aa3.js → index-ba82a8b0.js} +1 -1
  54. package/dist/assets/index-ba82a8b0.js.br +0 -0
  55. package/dist/assets/{index-10a7b6c0.js → index-d1461a4f.js} +1 -1
  56. package/dist/assets/index-d1461a4f.js.br +0 -0
  57. package/dist/assets/{index-a7d7205c.js → index-e42bdf4a.js} +1 -1
  58. package/dist/assets/index-e42bdf4a.js.br +0 -0
  59. package/dist/assets/{intersection-d034f8dc.js → intersection-88030dad.js} +1 -1
  60. package/dist/assets/intersection-88030dad.js.br +0 -0
  61. package/dist/assets/{isEqual-0d569b85.js → isEqual-0dd0f6d1.js} +1 -1
  62. package/dist/assets/jszip.min-232abc42.js +12 -0
  63. package/dist/assets/jszip.min-232abc42.js.br +0 -0
  64. package/dist/assets/{persist-31c6944f.js → persist-8cc120f5.js} +1 -1
  65. package/dist/assets/persist-8cc120f5.js.br +0 -0
  66. package/dist/assets/{rjsf-translation-fields-e31e8ac9.js → rjsf-translation-fields-3efc16a1.js} +1 -1
  67. package/dist/assets/{spinner-7012eee3.js → spinner-0a4b53d7.js} +1 -1
  68. package/dist/assets/{vendor-links-98886cc7.js → vendor-links-e591f1c0.js} +1 -1
  69. package/dist/assets/vendor-links-e591f1c0.js.br +0 -0
  70. package/dist/index.html +2 -2
  71. package/dist/index.html.br +0 -0
  72. package/package.json +7 -7
  73. package/dist/assets/Availability-83a15f1c.js.br +0 -0
  74. package/dist/assets/CodeEditor-b52a9395.js +0 -25
  75. package/dist/assets/CodeEditor-b52a9395.js.br +0 -0
  76. package/dist/assets/ConnectedDevicePage-792280da.js +0 -1
  77. package/dist/assets/ConnectedDevicePage-792280da.js.br +0 -0
  78. package/dist/assets/ConnectedMap-fc5a7764.js +0 -1
  79. package/dist/assets/ConnectedMap-fc5a7764.js.br +0 -0
  80. package/dist/assets/Dashboard-ba2b8e3b.js +0 -1
  81. package/dist/assets/Dashboard-ba2b8e3b.js.br +0 -0
  82. package/dist/assets/DashboardDevice-e545a4b6.js.br +0 -0
  83. package/dist/assets/DashboardFeatureWrapper-30f9acc7.js +0 -1
  84. package/dist/assets/DashboardFeatureWrapper-30f9acc7.js.br +0 -0
  85. package/dist/assets/DeviceImage-3b9ace8e.js +0 -1
  86. package/dist/assets/DeviceImage-3b9ace8e.js.br +0 -0
  87. package/dist/assets/GroupPage-188b4717.js.br +0 -0
  88. package/dist/assets/ReactTableCom-eddba77e.js.br +0 -0
  89. package/dist/assets/RecallRemove-720e6aa0.js.br +0 -0
  90. package/dist/assets/_baseSet-09a572ba.js +0 -1
  91. package/dist/assets/_getAllKeysIn-6dcbbf30.js +0 -1
  92. package/dist/assets/bootstrap-5.esm-672cb437.js.br +0 -0
  93. package/dist/assets/fa-brands-400-003f1154.ttf +0 -0
  94. package/dist/assets/fa-brands-400-faae6fc0.woff2 +0 -0
  95. package/dist/assets/fa-regular-400-7d81a1a7.ttf +0 -0
  96. package/dist/assets/fa-regular-400-9169d8be.woff2 +0 -0
  97. package/dist/assets/fa-solid-900-886c8611.woff2 +0 -0
  98. package/dist/assets/fa-solid-900-cea79b34.ttf +0 -0
  99. package/dist/assets/fa-v4compatibility-335fd7d9.woff2 +0 -0
  100. package/dist/assets/fa-v4compatibility-455e8e72.ttf +0 -0
  101. package/dist/assets/index-10a7b6c0.js.br +0 -0
  102. package/dist/assets/index-3a8e477d.js +0 -1
  103. package/dist/assets/index-3a8e477d.js.br +0 -0
  104. package/dist/assets/index-4b06423c.js +0 -1
  105. package/dist/assets/index-4b06423c.js.br +0 -0
  106. package/dist/assets/index-538efde1.js.br +0 -0
  107. package/dist/assets/index-654e4a69.css +0 -5
  108. package/dist/assets/index-654e4a69.css.br +0 -0
  109. package/dist/assets/index-66c36aa3.js.br +0 -0
  110. package/dist/assets/index-74e84a13.js.br +0 -0
  111. package/dist/assets/index-92365285.js.br +0 -0
  112. package/dist/assets/index-9b935b93.js.br +0 -0
  113. package/dist/assets/index-a7d7205c.js.br +0 -0
  114. package/dist/assets/intersection-d034f8dc.js.br +0 -0
  115. package/dist/assets/persist-31c6944f.js.br +0 -0
  116. package/dist/assets/vendor-links-98886cc7.js.br +0 -0
@@ -0,0 +1,26 @@
1
+ import{r as Jt,aR as yO,j as Yu,aS as wO}from"./index-1213f99f.js";import{_ as Xu}from"./extends-98964cd2.js";class q{lineAt(t){if(t<0||t>this.length)throw new RangeError(`Invalid position ${t} in document of length ${this.length}`);return this.lineInner(t,!1,1,0)}line(t){if(t<1||t>this.lines)throw new RangeError(`Invalid line number ${t} in ${this.lines}-line document`);return this.lineInner(t,!0,1,0)}replace(t,e,i){[t,e]=Hi(this,t,e);let n=[];return this.decompose(0,t,n,2),i.length&&i.decompose(0,i.length,n,3),this.decompose(e,this.length,n,1),Qe.from(n,this.length-(e-t)+i.length)}append(t){return this.replace(this.length,this.length,t)}slice(t,e=this.length){[t,e]=Hi(this,t,e);let i=[];return this.decompose(t,e,i,0),Qe.from(i,e-t)}eq(t){if(t==this)return!0;if(t.length!=this.length||t.lines!=this.lines)return!1;let e=this.scanIdentical(t,1),i=this.length-this.scanIdentical(t,-1),n=new En(this),r=new En(t);for(let o=e,l=e;;){if(n.next(o),r.next(o),o=0,n.lineBreak!=r.lineBreak||n.done!=r.done||n.value!=r.value)return!1;if(l+=n.value.length,n.done||l>=i)return!0}}iter(t=1){return new En(this,t)}iterRange(t,e=this.length){return new Lu(this,t,e)}iterLines(t,e){let i;if(t==null)i=this.iter();else{e==null&&(e=this.lines+1);let n=this.line(t).from;i=this.iterRange(n,Math.max(n,e==this.lines+1?this.length:e<=1?0:this.line(e-1).to))}return new ju(i)}toString(){return this.sliceString(0)}toJSON(){let t=[];return this.flatten(t),t}constructor(){}static of(t){if(t.length==0)throw new RangeError("A document must have at least one line");return t.length==1&&!t[0]?q.empty:t.length<=32?new pt(t):Qe.from(pt.split(t,[]))}}class pt extends q{constructor(t,e=SO(t)){super(),this.text=t,this.length=e}get lines(){return this.text.length}get children(){return null}lineInner(t,e,i,n){for(let r=0;;r++){let o=this.text[r],l=n+o.length;if((e?i:l)>=t)return new xO(n,l,i,o);n=l+1,i++}}decompose(t,e,i,n){let r=t<=0&&e>=this.length?this:new pt(Lh(this.text,t,e),Math.min(e,this.length)-Math.max(0,t));if(n&1){let o=i.pop(),l=Gs(r.text,o.text.slice(),0,r.length);if(l.length<=32)i.push(new pt(l,o.length+r.length));else{let a=l.length>>1;i.push(new pt(l.slice(0,a)),new pt(l.slice(a)))}}else i.push(r)}replace(t,e,i){if(!(i instanceof pt))return super.replace(t,e,i);[t,e]=Hi(this,t,e);let n=Gs(this.text,Gs(i.text,Lh(this.text,0,t)),e),r=this.length+i.length-(e-t);return n.length<=32?new pt(n,r):Qe.from(pt.split(n,[]),r)}sliceString(t,e=this.length,i=`
2
+ `){[t,e]=Hi(this,t,e);let n="";for(let r=0,o=0;r<=e&&o<this.text.length;o++){let l=this.text[o],a=r+l.length;r>t&&o&&(n+=i),t<a&&e>r&&(n+=l.slice(Math.max(0,t-r),e-r)),r=a+1}return n}flatten(t){for(let e of this.text)t.push(e)}scanIdentical(){return 0}static split(t,e){let i=[],n=-1;for(let r of t)i.push(r),n+=r.length+1,i.length==32&&(e.push(new pt(i,n)),i=[],n=-1);return n>-1&&e.push(new pt(i,n)),e}}class Qe extends q{constructor(t,e){super(),this.children=t,this.length=e,this.lines=0;for(let i of t)this.lines+=i.lines}lineInner(t,e,i,n){for(let r=0;;r++){let o=this.children[r],l=n+o.length,a=i+o.lines-1;if((e?a:l)>=t)return o.lineInner(t,e,i,n);n=l+1,i=a+1}}decompose(t,e,i,n){for(let r=0,o=0;o<=e&&r<this.children.length;r++){let l=this.children[r],a=o+l.length;if(t<=a&&e>=o){let h=n&((o<=t?1:0)|(a>=e?2:0));o>=t&&a<=e&&!h?i.push(l):l.decompose(t-o,e-o,i,h)}o=a+1}}replace(t,e,i){if([t,e]=Hi(this,t,e),i.lines<this.lines)for(let n=0,r=0;n<this.children.length;n++){let o=this.children[n],l=r+o.length;if(t>=r&&e<=l){let a=o.replace(t-r,e-r,i),h=this.lines-o.lines+a.lines;if(a.lines<h>>5-1&&a.lines>h>>5+1){let c=this.children.slice();return c[n]=a,new Qe(c,this.length-(e-t)+i.length)}return super.replace(r,l,a)}r=l+1}return super.replace(t,e,i)}sliceString(t,e=this.length,i=`
3
+ `){[t,e]=Hi(this,t,e);let n="";for(let r=0,o=0;r<this.children.length&&o<=e;r++){let l=this.children[r],a=o+l.length;o>t&&r&&(n+=i),t<a&&e>o&&(n+=l.sliceString(t-o,e-o,i)),o=a+1}return n}flatten(t){for(let e of this.children)e.flatten(t)}scanIdentical(t,e){if(!(t instanceof Qe))return 0;let i=0,[n,r,o,l]=e>0?[0,0,this.children.length,t.children.length]:[this.children.length-1,t.children.length-1,-1,-1];for(;;n+=e,r+=e){if(n==o||r==l)return i;let a=this.children[n],h=t.children[r];if(a!=h)return i+a.scanIdentical(h,e);i+=a.length+1}}static from(t,e=t.reduce((i,n)=>i+n.length+1,-1)){let i=0;for(let d of t)i+=d.lines;if(i<32){let d=[];for(let p of t)p.flatten(d);return new pt(d,e)}let n=Math.max(32,i>>5),r=n<<1,o=n>>1,l=[],a=0,h=-1,c=[];function f(d){let p;if(d.lines>r&&d instanceof Qe)for(let g of d.children)f(g);else d.lines>o&&(a>o||!a)?(u(),l.push(d)):d instanceof pt&&a&&(p=c[c.length-1])instanceof pt&&d.lines+p.lines<=32?(a+=d.lines,h+=d.length+1,c[c.length-1]=new pt(p.text.concat(d.text),p.length+1+d.length)):(a+d.lines>n&&u(),a+=d.lines,h+=d.length+1,c.push(d))}function u(){a!=0&&(l.push(c.length==1?c[0]:Qe.from(c,h)),h=-1,a=c.length=0)}for(let d of t)f(d);return u(),l.length==1?l[0]:new Qe(l,e)}}q.empty=new pt([""],0);function SO(s){let t=-1;for(let e of s)t+=e.length+1;return t}function Gs(s,t,e=0,i=1e9){for(let n=0,r=0,o=!0;r<s.length&&n<=i;r++){let l=s[r],a=n+l.length;a>=e&&(a>i&&(l=l.slice(0,i-n)),n<e&&(l=l.slice(e-n)),o?(t[t.length-1]+=l,o=!1):t.push(l)),n=a+1}return t}function Lh(s,t,e){return Gs(s,[""],t,e)}class En{constructor(t,e=1){this.dir=e,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[t],this.offsets=[e>0?1:(t instanceof pt?t.text.length:t.children.length)<<1]}nextInner(t,e){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,n=this.nodes[i],r=this.offsets[i],o=r>>1,l=n instanceof pt?n.text.length:n.children.length;if(o==(e>0?l:0)){if(i==0)return this.done=!0,this.value="",this;e>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((r&1)==(e>0?0:1)){if(this.offsets[i]+=e,t==0)return this.lineBreak=!0,this.value=`
4
+ `,this;t--}else if(n instanceof pt){let a=n.text[o+(e<0?-1:0)];if(this.offsets[i]+=e,a.length>Math.max(0,t))return this.value=t==0?a:e>0?a.slice(t):a.slice(0,a.length-t),this;t-=a.length}else{let a=n.children[o+(e<0?-1:0)];t>a.length?(t-=a.length,this.offsets[i]+=e):(e<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(e>0?1:(a instanceof pt?a.text.length:a.children.length)<<1))}}}next(t=0){return t<0&&(this.nextInner(-t,-this.dir),t=this.value.length),this.nextInner(t,this.dir)}}class Lu{constructor(t,e,i){this.value="",this.done=!1,this.cursor=new En(t,e>i?-1:1),this.pos=e>i?t.length:0,this.from=Math.min(e,i),this.to=Math.max(e,i)}nextInner(t,e){if(e<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;t+=Math.max(0,e<0?this.pos-this.to:this.from-this.pos);let i=e<0?this.pos-this.from:this.to-this.pos;t>i&&(t=i),i-=t;let{value:n}=this.cursor.next(t);return this.pos+=(n.length+t)*e,this.value=n.length<=i?n:e<0?n.slice(n.length-i):n.slice(0,i),this.done=!this.value,this}next(t=0){return t<0?t=Math.max(t,this.from-this.pos):t>0&&(t=Math.min(t,this.to-this.pos)),this.nextInner(t,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class ju{constructor(t){this.inner=t,this.afterBreak=!0,this.value="",this.done=!1}next(t=0){let{done:e,lineBreak:i,value:n}=this.inner.next(t);return e&&this.afterBreak?(this.value="",this.afterBreak=!1):e?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=n,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(q.prototype[Symbol.iterator]=function(){return this.iter()},En.prototype[Symbol.iterator]=Lu.prototype[Symbol.iterator]=ju.prototype[Symbol.iterator]=function(){return this});class xO{constructor(t,e,i,n){this.from=t,this.to=e,this.number=i,this.text=n}get length(){return this.to-this.from}}function Hi(s,t,e){return t=Math.max(0,Math.min(s.length,t)),[t,Math.max(t,Math.min(s.length,e))]}let Li="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(s=>s?parseInt(s,36):1);for(let s=1;s<Li.length;s++)Li[s]+=Li[s-1];function kO(s){for(let t=1;t<Li.length;t+=2)if(Li[t]>s)return Li[t-1]<=s;return!1}function jh(s){return s>=127462&&s<=127487}const Vh=8205;function ct(s,t,e=!0,i=!0){return(e?Vu:vO)(s,t,i)}function Vu(s,t,e){if(t==s.length)return t;t&&Nu(s.charCodeAt(t))&&Iu(s.charCodeAt(t-1))&&t--;let i=xt(s,t);for(t+=Gt(i);t<s.length;){let n=xt(s,t);if(i==Vh||n==Vh||e&&kO(n))t+=Gt(n),i=n;else if(jh(n)){let r=0,o=t-2;for(;o>=0&&jh(xt(s,o));)r++,o-=2;if(r%2==0)break;t+=2}else break}return t}function vO(s,t,e){for(;t>0;){let i=Vu(s,t-2,e);if(i<t)return i;t--}return 0}function Nu(s){return s>=56320&&s<57344}function Iu(s){return s>=55296&&s<56320}function xt(s,t){let e=s.charCodeAt(t);if(!Iu(e)||t+1==s.length)return e;let i=s.charCodeAt(t+1);return Nu(i)?(e-55296<<10)+(i-56320)+65536:e}function qa(s){return s<=65535?String.fromCharCode(s):(s-=65536,String.fromCharCode((s>>10)+55296,(s&1023)+56320))}function Gt(s){return s<65536?1:2}const rl=/\r\n?|\n/;var ut=function(s){return s[s.Simple=0]="Simple",s[s.TrackDel=1]="TrackDel",s[s.TrackBefore=2]="TrackBefore",s[s.TrackAfter=3]="TrackAfter",s}(ut||(ut={}));class Me{constructor(t){this.sections=t}get length(){let t=0;for(let e=0;e<this.sections.length;e+=2)t+=this.sections[e];return t}get newLength(){let t=0;for(let e=0;e<this.sections.length;e+=2){let i=this.sections[e+1];t+=i<0?this.sections[e]:i}return t}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(t){for(let e=0,i=0,n=0;e<this.sections.length;){let r=this.sections[e++],o=this.sections[e++];o<0?(t(i,n,r),n+=r):n+=o,i+=r}}iterChangedRanges(t,e=!1){ol(this,t,e)}get invertedDesc(){let t=[];for(let e=0;e<this.sections.length;){let i=this.sections[e++],n=this.sections[e++];n<0?t.push(i,n):t.push(n,i)}return new Me(t)}composeDesc(t){return this.empty?t:t.empty?this:qu(this,t)}mapDesc(t,e=!1){return t.empty?this:ll(this,t,e)}mapPos(t,e=-1,i=ut.Simple){let n=0,r=0;for(let o=0;o<this.sections.length;){let l=this.sections[o++],a=this.sections[o++],h=n+l;if(a<0){if(h>t)return r+(t-n);r+=l}else{if(i!=ut.Simple&&h>=t&&(i==ut.TrackDel&&n<t&&h>t||i==ut.TrackBefore&&n<t||i==ut.TrackAfter&&h>t))return null;if(h>t||h==t&&e<0&&!l)return t==n||e<0?r:r+a;r+=a}n=h}if(t>n)throw new RangeError(`Position ${t} is out of range for changeset of length ${n}`);return r}touchesRange(t,e=t){for(let i=0,n=0;i<this.sections.length&&n<=e;){let r=this.sections[i++],o=this.sections[i++],l=n+r;if(o>=0&&n<=e&&l>=t)return n<t&&l>e?"cover":!0;n=l}return!1}toString(){let t="";for(let e=0;e<this.sections.length;){let i=this.sections[e++],n=this.sections[e++];t+=(t?" ":"")+i+(n>=0?":"+n:"")}return t}toJSON(){return this.sections}static fromJSON(t){if(!Array.isArray(t)||t.length%2||t.some(e=>typeof e!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Me(t)}static create(t){return new Me(t)}}class gt extends Me{constructor(t,e){super(t),this.inserted=e}apply(t){if(this.length!=t.length)throw new RangeError("Applying change set to a document with the wrong length");return ol(this,(e,i,n,r,o)=>t=t.replace(n,n+(i-e),o),!1),t}mapDesc(t,e=!1){return ll(this,t,e,!0)}invert(t){let e=this.sections.slice(),i=[];for(let n=0,r=0;n<e.length;n+=2){let o=e[n],l=e[n+1];if(l>=0){e[n]=l,e[n+1]=o;let a=n>>1;for(;i.length<a;)i.push(q.empty);i.push(o?t.slice(r,r+o):q.empty)}r+=o}return new gt(e,i)}compose(t){return this.empty?t:t.empty?this:qu(this,t,!0)}map(t,e=!1){return t.empty?this:ll(this,t,e,!0)}iterChanges(t,e=!1){ol(this,t,e)}get desc(){return Me.create(this.sections)}filter(t){let e=[],i=[],n=[],r=new Vn(this);t:for(let o=0,l=0;;){let a=o==t.length?1e9:t[o++];for(;l<a||l==a&&r.len==0;){if(r.done)break t;let c=Math.min(r.len,a-l);Ct(n,c,-1);let f=r.ins==-1?-1:r.off==0?r.ins:0;Ct(e,c,f),f>0&&si(i,e,r.text),r.forward(c),l+=c}let h=t[o++];for(;l<h;){if(r.done)break t;let c=Math.min(r.len,h-l);Ct(e,c,-1),Ct(n,c,r.ins==-1?-1:r.off==0?r.ins:0),r.forward(c),l+=c}}return{changes:new gt(e,i),filtered:Me.create(n)}}toJSON(){let t=[];for(let e=0;e<this.sections.length;e+=2){let i=this.sections[e],n=this.sections[e+1];n<0?t.push(i):n==0?t.push([i]):t.push([i].concat(this.inserted[e>>1].toJSON()))}return t}static of(t,e,i){let n=[],r=[],o=0,l=null;function a(c=!1){if(!c&&!n.length)return;o<e&&Ct(n,e-o,-1);let f=new gt(n,r);l=l?l.compose(f.map(l)):f,n=[],r=[],o=0}function h(c){if(Array.isArray(c))for(let f of c)h(f);else if(c instanceof gt){if(c.length!=e)throw new RangeError(`Mismatched change set length (got ${c.length}, expected ${e})`);a(),l=l?l.compose(c.map(l)):c}else{let{from:f,to:u=f,insert:d}=c;if(f>u||f<0||u>e)throw new RangeError(`Invalid change range ${f} to ${u} (in doc of length ${e})`);let p=d?typeof d=="string"?q.of(d.split(i||rl)):d:q.empty,g=p.length;if(f==u&&g==0)return;f<o&&a(),f>o&&Ct(n,f-o,-1),Ct(n,u-f,g),si(r,n,p),o=u}}return h(t),a(!l),l}static empty(t){return new gt(t?[t,-1]:[],[])}static fromJSON(t){if(!Array.isArray(t))throw new RangeError("Invalid JSON representation of ChangeSet");let e=[],i=[];for(let n=0;n<t.length;n++){let r=t[n];if(typeof r=="number")e.push(r,-1);else{if(!Array.isArray(r)||typeof r[0]!="number"||r.some((o,l)=>l&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(r.length==1)e.push(r[0],0);else{for(;i.length<n;)i.push(q.empty);i[n]=q.of(r.slice(1)),e.push(r[0],i[n].length)}}}return new gt(e,i)}static createSet(t,e){return new gt(t,e)}}function Ct(s,t,e,i=!1){if(t==0&&e<=0)return;let n=s.length-2;n>=0&&e<=0&&e==s[n+1]?s[n]+=t:t==0&&s[n]==0?s[n+1]+=e:i?(s[n]+=t,s[n+1]+=e):s.push(t,e)}function si(s,t,e){if(e.length==0)return;let i=t.length-2>>1;if(i<s.length)s[s.length-1]=s[s.length-1].append(e);else{for(;s.length<i;)s.push(q.empty);s.push(e)}}function ol(s,t,e){let i=s.inserted;for(let n=0,r=0,o=0;o<s.sections.length;){let l=s.sections[o++],a=s.sections[o++];if(a<0)n+=l,r+=l;else{let h=n,c=r,f=q.empty;for(;h+=l,c+=a,a&&i&&(f=f.append(i[o-2>>1])),!(e||o==s.sections.length||s.sections[o+1]<0);)l=s.sections[o++],a=s.sections[o++];t(n,h,r,c,f),n=h,r=c}}}function ll(s,t,e,i=!1){let n=[],r=i?[]:null,o=new Vn(s),l=new Vn(t);for(let a=-1;;)if(o.ins==-1&&l.ins==-1){let h=Math.min(o.len,l.len);Ct(n,h,-1),o.forward(h),l.forward(h)}else if(l.ins>=0&&(o.ins<0||a==o.i||o.off==0&&(l.len<o.len||l.len==o.len&&!e))){let h=l.len;for(Ct(n,l.ins,-1);h;){let c=Math.min(o.len,h);o.ins>=0&&a<o.i&&o.len<=c&&(Ct(n,0,o.ins),r&&si(r,n,o.text),a=o.i),o.forward(c),h-=c}l.next()}else if(o.ins>=0){let h=0,c=o.len;for(;c;)if(l.ins==-1){let f=Math.min(c,l.len);h+=f,c-=f,l.forward(f)}else if(l.ins==0&&l.len<c)c-=l.len,l.next();else break;Ct(n,h,a<o.i?o.ins:0),r&&a<o.i&&si(r,n,o.text),a=o.i,o.forward(o.len-c)}else{if(o.done&&l.done)return r?gt.createSet(n,r):Me.create(n);throw new Error("Mismatched change set lengths")}}function qu(s,t,e=!1){let i=[],n=e?[]:null,r=new Vn(s),o=new Vn(t);for(let l=!1;;){if(r.done&&o.done)return n?gt.createSet(i,n):Me.create(i);if(r.ins==0)Ct(i,r.len,0,l),r.next();else if(o.len==0&&!o.done)Ct(i,0,o.ins,l),n&&si(n,i,o.text),o.next();else{if(r.done||o.done)throw new Error("Mismatched change set lengths");{let a=Math.min(r.len2,o.len),h=i.length;if(r.ins==-1){let c=o.ins==-1?-1:o.off?0:o.ins;Ct(i,a,c,l),n&&c&&si(n,i,o.text)}else o.ins==-1?(Ct(i,r.off?0:r.len,a,l),n&&si(n,i,r.textBit(a))):(Ct(i,r.off?0:r.len,o.off?0:o.ins,l),n&&!o.off&&si(n,i,o.text));l=(r.ins>a||o.ins>=0&&o.len>a)&&(l||i.length>h),r.forward2(a),o.forward(a)}}}}class Vn{constructor(t){this.set=t,this.i=0,this.next()}next(){let{sections:t}=this.set;this.i<t.length?(this.len=t[this.i++],this.ins=t[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:t}=this.set,e=this.i-2>>1;return e>=t.length?q.empty:t[e]}textBit(t){let{inserted:e}=this.set,i=this.i-2>>1;return i>=e.length&&!t?q.empty:e[i].slice(this.off,t==null?void 0:this.off+t)}forward(t){t==this.len?this.next():(this.len-=t,this.off+=t)}forward2(t){this.ins==-1?this.forward(t):t==this.ins?this.next():(this.ins-=t,this.off+=t)}}class wi{constructor(t,e,i){this.from=t,this.to=e,this.flags=i}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 t=this.flags&7;return t==7?null:t}get goalColumn(){let t=this.flags>>6;return t==16777215?void 0:t}map(t,e=-1){let i,n;return this.empty?i=n=t.mapPos(this.from,e):(i=t.mapPos(this.from,1),n=t.mapPos(this.to,-1)),i==this.from&&n==this.to?this:new wi(i,n,this.flags)}extend(t,e=t){if(t<=this.anchor&&e>=this.anchor)return S.range(t,e);let i=Math.abs(t-this.anchor)>Math.abs(e-this.anchor)?t:e;return S.range(this.anchor,i)}eq(t,e=!1){return this.anchor==t.anchor&&this.head==t.head&&(!e||!this.empty||this.assoc==t.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(t){if(!t||typeof t.anchor!="number"||typeof t.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return S.range(t.anchor,t.head)}static create(t,e,i){return new wi(t,e,i)}}class S{constructor(t,e){this.ranges=t,this.mainIndex=e}map(t,e=-1){return t.empty?this:S.create(this.ranges.map(i=>i.map(t,e)),this.mainIndex)}eq(t,e=!1){if(this.ranges.length!=t.ranges.length||this.mainIndex!=t.mainIndex)return!1;for(let i=0;i<this.ranges.length;i++)if(!this.ranges[i].eq(t.ranges[i],e))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new S([this.main],0)}addRange(t,e=!0){return S.create([t].concat(this.ranges),e?0:this.mainIndex+1)}replaceRange(t,e=this.mainIndex){let i=this.ranges.slice();return i[e]=t,S.create(i,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(t=>t.toJSON()),main:this.mainIndex}}static fromJSON(t){if(!t||!Array.isArray(t.ranges)||typeof t.main!="number"||t.main>=t.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new S(t.ranges.map(e=>wi.fromJSON(e)),t.main)}static single(t,e=t){return new S([S.range(t,e)],0)}static create(t,e=0){if(t.length==0)throw new RangeError("A selection needs at least one range");for(let i=0,n=0;n<t.length;n++){let r=t[n];if(r.empty?r.from<=i:r.from<i)return S.normalized(t.slice(),e);i=r.to}return new S(t,e)}static cursor(t,e=0,i,n){return wi.create(t,t,(e==0?0:e<0?8:16)|(i==null?7:Math.min(6,i))|(n??16777215)<<6)}static range(t,e,i,n){let r=(i??16777215)<<6|(n==null?7:Math.min(6,n));return e<t?wi.create(e,t,48|r):wi.create(t,e,(e>t?8:0)|r)}static normalized(t,e=0){let i=t[e];t.sort((n,r)=>n.from-r.from),e=t.indexOf(i);for(let n=1;n<t.length;n++){let r=t[n],o=t[n-1];if(r.empty?r.from<=o.to:r.from<o.to){let l=o.from,a=Math.max(r.to,o.to);n<=e&&e--,t.splice(--n,2,r.anchor>r.head?S.range(a,l):S.range(l,a))}}return new S(t,e)}}function zu(s,t){for(let e of s.ranges)if(e.to>t)throw new RangeError("Selection points outside of document")}let za=0;class P{constructor(t,e,i,n,r){this.combine=t,this.compareInput=e,this.compare=i,this.isStatic=n,this.id=za++,this.default=t([]),this.extensions=typeof r=="function"?r(this):r}get reader(){return this}static define(t={}){return new P(t.combine||(e=>e),t.compareInput||((e,i)=>e===i),t.compare||(t.combine?(e,i)=>e===i:_a),!!t.static,t.enables)}of(t){return new Hs([],this,0,t)}compute(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new Hs(t,this,1,e)}computeN(t,e){if(this.isStatic)throw new Error("Can't compute a static facet");return new Hs(t,this,2,e)}from(t,e){return e||(e=i=>i),this.compute([t],i=>e(i.field(t)))}}function _a(s,t){return s==t||s.length==t.length&&s.every((e,i)=>e===t[i])}class Hs{constructor(t,e,i,n){this.dependencies=t,this.facet=e,this.type=i,this.value=n,this.id=za++}dynamicSlot(t){var e;let i=this.value,n=this.facet.compareInput,r=this.id,o=t[r]>>1,l=this.type==2,a=!1,h=!1,c=[];for(let f of this.dependencies)f=="doc"?a=!0:f=="selection"?h=!0:((e=t[f.id])!==null&&e!==void 0?e:1)&1||c.push(t[f.id]);return{create(f){return f.values[o]=i(f),1},update(f,u){if(a&&u.docChanged||h&&(u.docChanged||u.selection)||al(f,c)){let d=i(f);if(l?!Nh(d,f.values[o],n):!n(d,f.values[o]))return f.values[o]=d,1}return 0},reconfigure:(f,u)=>{let d,p=u.config.address[r];if(p!=null){let g=Or(u,p);if(this.dependencies.every(m=>m instanceof P?u.facet(m)===f.facet(m):m instanceof wt?u.field(m,!1)==f.field(m,!1):!0)||(l?Nh(d=i(f),g,n):n(d=i(f),g)))return f.values[o]=g,0}else d=i(f);return f.values[o]=d,1}}}}function Nh(s,t,e){if(s.length!=t.length)return!1;for(let i=0;i<s.length;i++)if(!e(s[i],t[i]))return!1;return!0}function al(s,t){let e=!1;for(let i of t)Bn(s,i)&1&&(e=!0);return e}function $O(s,t,e){let i=e.map(a=>s[a.id]),n=e.map(a=>a.type),r=i.filter(a=>!(a&1)),o=s[t.id]>>1;function l(a){let h=[];for(let c=0;c<i.length;c++){let f=Or(a,i[c]);if(n[c]==2)for(let u of f)h.push(u);else h.push(f)}return t.combine(h)}return{create(a){for(let h of i)Bn(a,h);return a.values[o]=l(a),1},update(a,h){if(!al(a,r))return 0;let c=l(a);return t.compare(c,a.values[o])?0:(a.values[o]=c,1)},reconfigure(a,h){let c=al(a,i),f=h.config.facets[t.id],u=h.facet(t);if(f&&!c&&_a(e,f))return a.values[o]=u,0;let d=l(a);return t.compare(d,u)?(a.values[o]=u,0):(a.values[o]=d,1)}}}const Ih=P.define({static:!0});class wt{constructor(t,e,i,n,r){this.id=t,this.createF=e,this.updateF=i,this.compareF=n,this.spec=r,this.provides=void 0}static define(t){let e=new wt(za++,t.create,t.update,t.compare||((i,n)=>i===n),t);return t.provide&&(e.provides=t.provide(e)),e}create(t){let e=t.facet(Ih).find(i=>i.field==this);return((e==null?void 0:e.create)||this.createF)(t)}slot(t){let e=t[this.id]>>1;return{create:i=>(i.values[e]=this.create(i),1),update:(i,n)=>{let r=i.values[e],o=this.updateF(r,n);return this.compareF(r,o)?0:(i.values[e]=o,1)},reconfigure:(i,n)=>n.config.address[this.id]!=null?(i.values[e]=n.field(this),0):(i.values[e]=this.create(i),1)}}init(t){return[this,Ih.of({field:this,create:t})]}get extension(){return this}}const bi={lowest:4,low:3,default:2,high:1,highest:0};function pn(s){return t=>new _u(t,s)}const pe={highest:pn(bi.highest),high:pn(bi.high),default:pn(bi.default),low:pn(bi.low),lowest:pn(bi.lowest)};class _u{constructor(t,e){this.inner=t,this.prec=e}}class Ur{of(t){return new hl(this,t)}reconfigure(t){return Ur.reconfigure.of({compartment:this,extension:t})}get(t){return t.config.compartments.get(this)}}class hl{constructor(t,e){this.compartment=t,this.inner=e}}class mr{constructor(t,e,i,n,r,o){for(this.base=t,this.compartments=e,this.dynamicSlots=i,this.address=n,this.staticValues=r,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<i.length;)this.statusTemplate.push(0)}staticFacet(t){let e=this.address[t.id];return e==null?t.default:this.staticValues[e>>1]}static resolve(t,e,i){let n=[],r=Object.create(null),o=new Map;for(let u of QO(t,e,o))u instanceof wt?n.push(u):(r[u.facet.id]||(r[u.facet.id]=[])).push(u);let l=Object.create(null),a=[],h=[];for(let u of n)l[u.id]=h.length<<1,h.push(d=>u.slot(d));let c=i==null?void 0:i.config.facets;for(let u in r){let d=r[u],p=d[0].facet,g=c&&c[u]||[];if(d.every(m=>m.type==0))if(l[p.id]=a.length<<1|1,_a(g,d))a.push(i.facet(p));else{let m=p.combine(d.map(O=>O.value));a.push(i&&p.compare(m,i.facet(p))?i.facet(p):m)}else{for(let m of d)m.type==0?(l[m.id]=a.length<<1|1,a.push(m.value)):(l[m.id]=h.length<<1,h.push(O=>m.dynamicSlot(O)));l[p.id]=h.length<<1,h.push(m=>$O(m,p,d))}}let f=h.map(u=>u(l));return new mr(t,o,f,l,a,r)}}function QO(s,t,e){let i=[[],[],[],[],[]],n=new Map;function r(o,l){let a=n.get(o);if(a!=null){if(a<=l)return;let h=i[a].indexOf(o);h>-1&&i[a].splice(h,1),o instanceof hl&&e.delete(o.compartment)}if(n.set(o,l),Array.isArray(o))for(let h of o)r(h,l);else if(o instanceof hl){if(e.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let h=t.get(o.compartment)||o.inner;e.set(o.compartment,h),r(h,l)}else if(o instanceof _u)r(o.inner,o.prec);else if(o instanceof wt)i[l].push(o),o.provides&&r(o.provides,l);else if(o instanceof Hs)i[l].push(o),o.facet.extensions&&r(o.facet.extensions,bi.default);else{let h=o.extension;if(!h)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(h,l)}}return r(s,bi.default),i.reduce((o,l)=>o.concat(l))}function Bn(s,t){if(t&1)return 2;let e=t>>1,i=s.status[e];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;s.status[e]=4;let n=s.computeSlot(s,s.config.dynamicSlots[e]);return s.status[e]=2|n}function Or(s,t){return t&1?s.config.staticValues[t>>1]:s.values[t>>1]}const Gu=P.define(),cl=P.define({combine:s=>s.some(t=>t),static:!0}),Hu=P.define({combine:s=>s.length?s[0]:void 0,static:!0}),Fu=P.define(),Uu=P.define(),Ku=P.define(),Ju=P.define({combine:s=>s.length?s[0]:!1});class se{constructor(t,e){this.type=t,this.value=e}static define(){return new PO}}class PO{of(t){return new se(this,t)}}class CO{constructor(t){this.map=t}of(t){return new j(this,t)}}class j{constructor(t,e){this.type=t,this.value=e}map(t){let e=this.type.map(this.value,t);return e===void 0?void 0:e==this.value?this:new j(this.type,e)}is(t){return this.type==t}static define(t={}){return new CO(t.map||(e=>e))}static mapEffects(t,e){if(!t.length)return t;let i=[];for(let n of t){let r=n.map(e);r&&i.push(r)}return i}}j.reconfigure=j.define();j.appendConfig=j.define();class mt{constructor(t,e,i,n,r,o){this.startState=t,this.changes=e,this.selection=i,this.effects=n,this.annotations=r,this.scrollIntoView=o,this._doc=null,this._state=null,i&&zu(i,e.newLength),r.some(l=>l.type==mt.time)||(this.annotations=r.concat(mt.time.of(Date.now())))}static create(t,e,i,n,r,o){return new mt(t,e,i,n,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(t){for(let e of this.annotations)if(e.type==t)return e.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(t){let e=this.annotation(mt.userEvent);return!!(e&&(e==t||e.length>t.length&&e.slice(0,t.length)==t&&e[t.length]=="."))}}mt.time=se.define();mt.userEvent=se.define();mt.addToHistory=se.define();mt.remote=se.define();function ZO(s,t){let e=[];for(let i=0,n=0;;){let r,o;if(i<s.length&&(n==t.length||t[n]>=s[i]))r=s[i++],o=s[i++];else if(n<t.length)r=t[n++],o=t[n++];else return e;!e.length||e[e.length-1]<r?e.push(r,o):e[e.length-1]<o&&(e[e.length-1]=o)}}function td(s,t,e){var i;let n,r,o;return e?(n=t.changes,r=gt.empty(t.changes.length),o=s.changes.compose(t.changes)):(n=t.changes.map(s.changes),r=s.changes.mapDesc(t.changes,!0),o=s.changes.compose(n)),{changes:o,selection:t.selection?t.selection.map(r):(i=s.selection)===null||i===void 0?void 0:i.map(n),effects:j.mapEffects(s.effects,n).concat(j.mapEffects(t.effects,r)),annotations:s.annotations.length?s.annotations.concat(t.annotations):t.annotations,scrollIntoView:s.scrollIntoView||t.scrollIntoView}}function fl(s,t,e){let i=t.selection,n=ji(t.annotations);return t.userEvent&&(n=n.concat(mt.userEvent.of(t.userEvent))),{changes:t.changes instanceof gt?t.changes:gt.of(t.changes||[],e,s.facet(Hu)),selection:i&&(i instanceof S?i:S.single(i.anchor,i.head)),effects:ji(t.effects),annotations:n,scrollIntoView:!!t.scrollIntoView}}function ed(s,t,e){let i=fl(s,t.length?t[0]:{},s.doc.length);t.length&&t[0].filter===!1&&(e=!1);for(let r=1;r<t.length;r++){t[r].filter===!1&&(e=!1);let o=!!t[r].sequential;i=td(i,fl(s,t[r],o?i.changes.newLength:s.doc.length),o)}let n=mt.create(s,i.changes,i.selection,i.effects,i.annotations,i.scrollIntoView);return TO(e?AO(n):n)}function AO(s){let t=s.startState,e=!0;for(let n of t.facet(Fu)){let r=n(s);if(r===!1){e=!1;break}Array.isArray(r)&&(e=e===!0?r:ZO(e,r))}if(e!==!0){let n,r;if(e===!1)r=s.changes.invertedDesc,n=gt.empty(t.doc.length);else{let o=s.changes.filter(e);n=o.changes,r=o.filtered.mapDesc(o.changes).invertedDesc}s=mt.create(t,n,s.selection&&s.selection.map(r),j.mapEffects(s.effects,r),s.annotations,s.scrollIntoView)}let i=t.facet(Uu);for(let n=i.length-1;n>=0;n--){let r=i[n](s);r instanceof mt?s=r:Array.isArray(r)&&r.length==1&&r[0]instanceof mt?s=r[0]:s=ed(t,ji(r),!1)}return s}function TO(s){let t=s.startState,e=t.facet(Ku),i=s;for(let n=e.length-1;n>=0;n--){let r=e[n](s);r&&Object.keys(r).length&&(i=td(i,fl(t,r,s.changes.newLength),!0))}return i==s?s:mt.create(t,s.changes,s.selection,i.effects,i.annotations,i.scrollIntoView)}const MO=[];function ji(s){return s==null?MO:Array.isArray(s)?s:[s]}var rt=function(s){return s[s.Word=0]="Word",s[s.Space=1]="Space",s[s.Other=2]="Other",s}(rt||(rt={}));const RO=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let ul;try{ul=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function DO(s){if(ul)return ul.test(s);for(let t=0;t<s.length;t++){let e=s[t];if(/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||RO.test(e)))return!0}return!1}function WO(s){return t=>{if(!/\S/.test(t))return rt.Space;if(DO(t))return rt.Word;for(let e=0;e<s.length;e++)if(t.indexOf(s[e])>-1)return rt.Word;return rt.Other}}class V{constructor(t,e,i,n,r,o){this.config=t,this.doc=e,this.selection=i,this.values=n,this.status=t.statusTemplate.slice(),this.computeSlot=r,o&&(o._state=this);for(let l=0;l<this.config.dynamicSlots.length;l++)Bn(this,l<<1);this.computeSlot=null}field(t,e=!0){let i=this.config.address[t.id];if(i==null){if(e)throw new RangeError("Field is not present in this state");return}return Bn(this,i),Or(this,i)}update(...t){return ed(this,t,!0)}applyTransaction(t){let e=this.config,{base:i,compartments:n}=e;for(let l of t.effects)l.is(Ur.reconfigure)?(e&&(n=new Map,e.compartments.forEach((a,h)=>n.set(h,a)),e=null),n.set(l.value.compartment,l.value.extension)):l.is(j.reconfigure)?(e=null,i=l.value):l.is(j.appendConfig)&&(e=null,i=ji(i).concat(l.value));let r;e?r=t.startState.values.slice():(e=mr.resolve(i,n,this),r=new V(e,this.doc,this.selection,e.dynamicSlots.map(()=>null),(a,h)=>h.reconfigure(a,this),null).values);let o=t.startState.facet(cl)?t.newSelection:t.newSelection.asSingle();new V(e,t.newDoc,o,r,(l,a)=>a.update(l,t),t)}replaceSelection(t){return typeof t=="string"&&(t=this.toText(t)),this.changeByRange(e=>({changes:{from:e.from,to:e.to,insert:t},range:S.cursor(e.from+t.length)}))}changeByRange(t){let e=this.selection,i=t(e.ranges[0]),n=this.changes(i.changes),r=[i.range],o=ji(i.effects);for(let l=1;l<e.ranges.length;l++){let a=t(e.ranges[l]),h=this.changes(a.changes),c=h.map(n);for(let u=0;u<l;u++)r[u]=r[u].map(c);let f=n.mapDesc(h,!0);r.push(a.range.map(f)),n=n.compose(c),o=j.mapEffects(o,c).concat(j.mapEffects(ji(a.effects),f))}return{changes:n,selection:S.create(r,e.mainIndex),effects:o}}changes(t=[]){return t instanceof gt?t:gt.of(t,this.doc.length,this.facet(V.lineSeparator))}toText(t){return q.of(t.split(this.facet(V.lineSeparator)||rl))}sliceDoc(t=0,e=this.doc.length){return this.doc.sliceString(t,e,this.lineBreak)}facet(t){let e=this.config.address[t.id];return e==null?t.default:(Bn(this,e),Or(this,e))}toJSON(t){let e={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(t)for(let i in t){let n=t[i];n instanceof wt&&this.config.address[n.id]!=null&&(e[i]=n.spec.toJSON(this.field(t[i]),this))}return e}static fromJSON(t,e={},i){if(!t||typeof t.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let n=[];if(i){for(let r in i)if(Object.prototype.hasOwnProperty.call(t,r)){let o=i[r],l=t[r];n.push(o.init(a=>o.spec.fromJSON(l,a)))}}return V.create({doc:t.doc,selection:S.fromJSON(t.selection),extensions:e.extensions?n.concat([e.extensions]):n})}static create(t={}){let e=mr.resolve(t.extensions||[],new Map),i=t.doc instanceof q?t.doc:q.of((t.doc||"").split(e.staticFacet(V.lineSeparator)||rl)),n=t.selection?t.selection instanceof S?t.selection:S.single(t.selection.anchor,t.selection.head):S.single(0);return zu(n,i.length),e.staticFacet(cl)||(n=n.asSingle()),new V(e,i,n,e.dynamicSlots.map(()=>null),(r,o)=>o.create(r),null)}get tabSize(){return this.facet(V.tabSize)}get lineBreak(){return this.facet(V.lineSeparator)||`
5
+ `}get readOnly(){return this.facet(Ju)}phrase(t,...e){for(let i of this.facet(V.phrases))if(Object.prototype.hasOwnProperty.call(i,t)){t=i[t];break}return e.length&&(t=t.replace(/\$(\$|\d*)/g,(i,n)=>{if(n=="$")return"$";let r=+(n||1);return!r||r>e.length?i:e[r-1]})),t}languageDataAt(t,e,i=-1){let n=[];for(let r of this.facet(Gu))for(let o of r(this,e,i))Object.prototype.hasOwnProperty.call(o,t)&&n.push(o[t]);return n}charCategorizer(t){return WO(this.languageDataAt("wordChars",t).join(""))}wordAt(t){let{text:e,from:i,length:n}=this.doc.lineAt(t),r=this.charCategorizer(t),o=t-i,l=t-i;for(;o>0;){let a=ct(e,o,!1);if(r(e.slice(a,o))!=rt.Word)break;o=a}for(;l<n;){let a=ct(e,l);if(r(e.slice(l,a))!=rt.Word)break;l=a}return o==l?null:S.range(o+i,l+i)}}V.allowMultipleSelections=cl;V.tabSize=P.define({combine:s=>s.length?s[0]:4});V.lineSeparator=Hu;V.readOnly=Ju;V.phrases=P.define({compare(s,t){let e=Object.keys(s),i=Object.keys(t);return e.length==i.length&&e.every(n=>s[n]==t[n])}});V.languageData=Gu;V.changeFilter=Fu;V.transactionFilter=Uu;V.transactionExtender=Ku;Ur.reconfigure=j.define();function Xe(s,t,e={}){let i={};for(let n of s)for(let r of Object.keys(n)){let o=n[r],l=i[r];if(l===void 0)i[r]=o;else if(!(l===o||o===void 0))if(Object.hasOwnProperty.call(e,r))i[r]=e[r](l,o);else throw new Error("Config merge conflict for field "+r)}for(let n in t)i[n]===void 0&&(i[n]=t[n]);return i}class De{eq(t){return this==t}range(t,e=t){return dl.create(t,e,this)}}De.prototype.startSide=De.prototype.endSide=0;De.prototype.point=!1;De.prototype.mapMode=ut.TrackDel;let dl=class id{constructor(t,e,i){this.from=t,this.to=e,this.value=i}static create(t,e,i){return new id(t,e,i)}};function pl(s,t){return s.from-t.from||s.value.startSide-t.value.startSide}class Ga{constructor(t,e,i,n){this.from=t,this.to=e,this.value=i,this.maxPoint=n}get length(){return this.to[this.to.length-1]}findIndex(t,e,i,n=0){let r=i?this.to:this.from;for(let o=n,l=r.length;;){if(o==l)return o;let a=o+l>>1,h=r[a]-t||(i?this.value[a].endSide:this.value[a].startSide)-e;if(a==o)return h>=0?o:l;h>=0?l=a:o=a+1}}between(t,e,i,n){for(let r=this.findIndex(e,-1e9,!0),o=this.findIndex(i,1e9,!1,r);r<o;r++)if(n(this.from[r]+t,this.to[r]+t,this.value[r])===!1)return!1}map(t,e){let i=[],n=[],r=[],o=-1,l=-1;for(let a=0;a<this.value.length;a++){let h=this.value[a],c=this.from[a]+t,f=this.to[a]+t,u,d;if(c==f){let p=e.mapPos(c,h.startSide,h.mapMode);if(p==null||(u=d=p,h.startSide!=h.endSide&&(d=e.mapPos(c,h.endSide),d<u)))continue}else if(u=e.mapPos(c,h.startSide),d=e.mapPos(f,h.endSide),u>d||u==d&&h.startSide>0&&h.endSide<=0)continue;(d-u||h.endSide-h.startSide)<0||(o<0&&(o=u),h.point&&(l=Math.max(l,d-u)),i.push(h),n.push(u-o),r.push(d-o))}return{mapped:i.length?new Ga(n,r,i,l):null,pos:o}}}class I{constructor(t,e,i,n){this.chunkPos=t,this.chunk=e,this.nextLayer=i,this.maxPoint=n}static create(t,e,i,n){return new I(t,e,i,n)}get length(){let t=this.chunk.length-1;return t<0?0:Math.max(this.chunkEnd(t),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let t=this.nextLayer.size;for(let e of this.chunk)t+=e.value.length;return t}chunkEnd(t){return this.chunkPos[t]+this.chunk[t].length}update(t){let{add:e=[],sort:i=!1,filterFrom:n=0,filterTo:r=this.length}=t,o=t.filter;if(e.length==0&&!o)return this;if(i&&(e=e.slice().sort(pl)),this.isEmpty)return e.length?I.of(e):this;let l=new nd(this,null,-1).goto(0),a=0,h=[],c=new qe;for(;l.value||a<e.length;)if(a<e.length&&(l.from-e[a].from||l.startSide-e[a].value.startSide)>=0){let f=e[a++];c.addInner(f.from,f.to,f.value)||h.push(f)}else l.rangeIndex==1&&l.chunkIndex<this.chunk.length&&(a==e.length||this.chunkEnd(l.chunkIndex)<e[a].from)&&(!o||n>this.chunkEnd(l.chunkIndex)||r<this.chunkPos[l.chunkIndex])&&c.addChunk(this.chunkPos[l.chunkIndex],this.chunk[l.chunkIndex])?l.nextChunk():((!o||n>l.to||r<l.from||o(l.from,l.to,l.value))&&(c.addInner(l.from,l.to,l.value)||h.push(dl.create(l.from,l.to,l.value))),l.next());return c.finishInner(this.nextLayer.isEmpty&&!h.length?I.empty:this.nextLayer.update({add:h,filter:o,filterFrom:n,filterTo:r}))}map(t){if(t.empty||this.isEmpty)return this;let e=[],i=[],n=-1;for(let o=0;o<this.chunk.length;o++){let l=this.chunkPos[o],a=this.chunk[o],h=t.touchesRange(l,l+a.length);if(h===!1)n=Math.max(n,a.maxPoint),e.push(a),i.push(t.mapPos(l));else if(h===!0){let{mapped:c,pos:f}=a.map(l,t);c&&(n=Math.max(n,c.maxPoint),e.push(c),i.push(f))}}let r=this.nextLayer.map(t);return e.length==0?r:new I(i,e,r||I.empty,n)}between(t,e,i){if(!this.isEmpty){for(let n=0;n<this.chunk.length;n++){let r=this.chunkPos[n],o=this.chunk[n];if(e>=r&&t<=r+o.length&&o.between(r,t-r,e-r,i)===!1)return}this.nextLayer.between(t,e,i)}}iter(t=0){return Nn.from([this]).goto(t)}get isEmpty(){return this.nextLayer==this}static iter(t,e=0){return Nn.from(t).goto(e)}static compare(t,e,i,n,r=-1){let o=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),l=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=r),a=qh(o,l,i),h=new gn(o,a,r),c=new gn(l,a,r);i.iterGaps((f,u,d)=>zh(h,f,c,u,d,n)),i.empty&&i.length==0&&zh(h,0,c,0,0,n)}static eq(t,e,i=0,n){n==null&&(n=1e9-1);let r=t.filter(c=>!c.isEmpty&&e.indexOf(c)<0),o=e.filter(c=>!c.isEmpty&&t.indexOf(c)<0);if(r.length!=o.length)return!1;if(!r.length)return!0;let l=qh(r,o),a=new gn(r,l,0).goto(i),h=new gn(o,l,0).goto(i);for(;;){if(a.to!=h.to||!gl(a.active,h.active)||a.point&&(!h.point||!a.point.eq(h.point)))return!1;if(a.to>n)return!0;a.next(),h.next()}}static spans(t,e,i,n,r=-1){let o=new gn(t,null,r).goto(e),l=e,a=o.openStart;for(;;){let h=Math.min(o.to,i);if(o.point){let c=o.activeForPoint(o.to),f=o.pointFrom<e?c.length+1:o.point.startSide<0?c.length:Math.min(c.length,a);n.point(l,h,o.point,c,f,o.pointRank),a=Math.min(o.openEnd(h),c.length)}else h>l&&(n.span(l,h,o.active,a),a=o.openEnd(h));if(o.to>i)return a+(o.point&&o.to>i?1:0);l=o.to,o.next()}}static of(t,e=!1){let i=new qe;for(let n of t instanceof dl?[t]:e?EO(t):t)i.add(n.from,n.to,n.value);return i.finish()}static join(t){if(!t.length)return I.empty;let e=t[t.length-1];for(let i=t.length-2;i>=0;i--)for(let n=t[i];n!=I.empty;n=n.nextLayer)e=new I(n.chunkPos,n.chunk,e,Math.max(n.maxPoint,e.maxPoint));return e}}I.empty=new I([],[],null,-1);function EO(s){if(s.length>1)for(let t=s[0],e=1;e<s.length;e++){let i=s[e];if(pl(t,i)>0)return s.slice().sort(pl);t=i}return s}I.empty.nextLayer=I.empty;class qe{finishChunk(t){this.chunks.push(new Ga(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,t&&(this.from=[],this.to=[],this.value=[])}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(t,e,i){this.addInner(t,e,i)||(this.nextLayer||(this.nextLayer=new qe)).add(t,e,i)}addInner(t,e,i){let n=t-this.lastTo||i.startSide-this.last.endSide;if(n<=0&&(t-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return n<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=t),this.from.push(t-this.chunkStart),this.to.push(e-this.chunkStart),this.last=i,this.lastFrom=t,this.lastTo=e,this.value.push(i),i.point&&(this.maxPoint=Math.max(this.maxPoint,e-t)),!0)}addChunk(t,e){if((t-this.lastTo||e.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,e.maxPoint),this.chunks.push(e),this.chunkPos.push(t);let i=e.value.length-1;return this.last=e.value[i],this.lastFrom=e.from[i]+t,this.lastTo=e.to[i]+t,!0}finish(){return this.finishInner(I.empty)}finishInner(t){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return t;let e=I.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(t):t,this.setMaxPoint);return this.from=null,e}}function qh(s,t,e){let i=new Map;for(let r of s)for(let o=0;o<r.chunk.length;o++)r.chunk[o].maxPoint<=0&&i.set(r.chunk[o],r.chunkPos[o]);let n=new Set;for(let r of t)for(let o=0;o<r.chunk.length;o++){let l=i.get(r.chunk[o]);l!=null&&(e?e.mapPos(l):l)==r.chunkPos[o]&&!(e!=null&&e.touchesRange(l,l+r.chunk[o].length))&&n.add(r.chunk[o])}return n}class nd{constructor(t,e,i,n=0){this.layer=t,this.skip=e,this.minPoint=i,this.rank=n}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(t,e=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(t,e,!1),this}gotoInner(t,e,i){for(;this.chunkIndex<this.layer.chunk.length;){let n=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(n)||this.layer.chunkEnd(this.chunkIndex)<t||n.maxPoint<this.minPoint))break;this.chunkIndex++,i=!1}if(this.chunkIndex<this.layer.chunk.length){let n=this.layer.chunk[this.chunkIndex].findIndex(t-this.layer.chunkPos[this.chunkIndex],e,!0);(!i||this.rangeIndex<n)&&this.setRangeIndex(n)}this.next()}forward(t,e){(this.to-t||this.endSide-e)<0&&this.gotoInner(t,e,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let t=this.layer.chunkPos[this.chunkIndex],e=this.layer.chunk[this.chunkIndex],i=t+e.from[this.rangeIndex];if(this.from=i,this.to=t+e.to[this.rangeIndex],this.value=e.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(t){if(t==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=t}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(t){return this.from-t.from||this.startSide-t.startSide||this.rank-t.rank||this.to-t.to||this.endSide-t.endSide}}class Nn{constructor(t){this.heap=t}static from(t,e=null,i=-1){let n=[];for(let r=0;r<t.length;r++)for(let o=t[r];!o.isEmpty;o=o.nextLayer)o.maxPoint>=i&&n.push(new nd(o,e,i,r));return n.length==1?n[0]:new Nn(n)}get startSide(){return this.value?this.value.startSide:0}goto(t,e=-1e9){for(let i of this.heap)i.goto(t,e);for(let i=this.heap.length>>1;i>=0;i--)mo(this.heap,i);return this.next(),this}forward(t,e){for(let i of this.heap)i.forward(t,e);for(let i=this.heap.length>>1;i>=0;i--)mo(this.heap,i);(this.to-t||this.value.endSide-e)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let t=this.heap[0];this.from=t.from,this.to=t.to,this.value=t.value,this.rank=t.rank,t.value&&t.next(),mo(this.heap,0)}}}function mo(s,t){for(let e=s[t];;){let i=(t<<1)+1;if(i>=s.length)break;let n=s[i];if(i+1<s.length&&n.compare(s[i+1])>=0&&(n=s[i+1],i++),e.compare(n)<0)break;s[i]=e,s[t]=n,t=i}}class gn{constructor(t,e,i){this.minPoint=i,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=Nn.from(t,e,i)}goto(t,e=-1e9){return this.cursor.goto(t,e),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=t,this.endSide=e,this.openStart=-1,this.next(),this}forward(t,e){for(;this.minActive>-1&&(this.activeTo[this.minActive]-t||this.active[this.minActive].endSide-e)<0;)this.removeActive(this.minActive);this.cursor.forward(t,e)}removeActive(t){fs(this.active,t),fs(this.activeTo,t),fs(this.activeRank,t),this.minActive=_h(this.active,this.activeTo)}addActive(t){let e=0,{value:i,to:n,rank:r}=this.cursor;for(;e<this.activeRank.length&&(r-this.activeRank[e]||n-this.activeTo[e])>0;)e++;us(this.active,e,i),us(this.activeTo,e,n),us(this.activeRank,e,r),t&&us(t,e,this.cursor.from),this.minActive=_h(this.active,this.activeTo)}next(){let t=this.to,e=this.point;this.point=null;let i=this.openStart<0?[]:null;for(;;){let n=this.minActive;if(n>-1&&(this.activeTo[n]-this.cursor.from||this.active[n].endSide-this.cursor.startSide)<0){if(this.activeTo[n]>t){this.to=this.activeTo[n],this.endSide=this.active[n].endSide;break}this.removeActive(n),i&&fs(i,n)}else if(this.cursor.value)if(this.cursor.from>t){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let r=this.cursor.value;if(!r.point)this.addActive(i),this.cursor.next();else if(e&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=r,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=r.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(i){this.openStart=0;for(let n=i.length-1;n>=0&&i[n]<t;n--)this.openStart++}}activeForPoint(t){if(!this.active.length)return this.active;let e=[];for(let i=this.active.length-1;i>=0&&!(this.activeRank[i]<this.pointRank);i--)(this.activeTo[i]>t||this.activeTo[i]==t&&this.active[i].endSide>=this.point.endSide)&&e.push(this.active[i]);return e.reverse()}openEnd(t){let e=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>t;i--)e++;return e}}function zh(s,t,e,i,n,r){s.goto(t),e.goto(i);let o=i+n,l=i,a=i-t;for(;;){let h=s.to+a-e.to||s.endSide-e.endSide,c=h<0?s.to+a:e.to,f=Math.min(c,o);if(s.point||e.point?s.point&&e.point&&(s.point==e.point||s.point.eq(e.point))&&gl(s.activeForPoint(s.to),e.activeForPoint(e.to))||r.comparePoint(l,f,s.point,e.point):f>l&&!gl(s.active,e.active)&&r.compareRange(l,f,s.active,e.active),c>o)break;l=c,h<=0&&s.next(),h>=0&&e.next()}}function gl(s,t){if(s.length!=t.length)return!1;for(let e=0;e<s.length;e++)if(s[e]!=t[e]&&!s[e].eq(t[e]))return!1;return!0}function fs(s,t){for(let e=t,i=s.length-1;e<i;e++)s[e]=s[e+1];s.pop()}function us(s,t,e){for(let i=s.length-1;i>=t;i--)s[i+1]=s[i];s[t]=e}function _h(s,t){let e=-1,i=1e9;for(let n=0;n<t.length;n++)(t[n]-i||s[n].endSide-s[e].endSide)<0&&(e=n,i=t[n]);return e}function Ti(s,t,e=s.length){let i=0;for(let n=0;n<e;)s.charCodeAt(n)==9?(i+=t-i%t,n++):(i++,n=ct(s,n));return i}function br(s,t,e,i){for(let n=0,r=0;;){if(r>=t)return n;if(n==s.length)break;r+=s.charCodeAt(n)==9?e-r%e:1,n=ct(s,n)}return i===!0?-1:s.length}const ml="ͼ",Gh=typeof Symbol>"u"?"__"+ml:Symbol.for(ml),Ol=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Hh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class At{constructor(t,e){this.rules=[];let{finish:i}=e||{};function n(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function r(o,l,a,h){let c=[],f=/^@(\w+)\b/.exec(o[0]),u=f&&f[1]=="keyframes";if(f&&l==null)return a.push(o[0]+";");for(let d in l){let p=l[d];if(/&/.test(d))r(d.split(/,\s*/).map(g=>o.map(m=>g.replace(/&/,m))).reduce((g,m)=>g.concat(m)),p,a);else if(p&&typeof p=="object"){if(!f)throw new RangeError("The value of a property ("+d+") should be a primitive value.");r(n(d),p,c,u)}else p!=null&&c.push(d.replace(/_.*/,"").replace(/[A-Z]/g,g=>"-"+g.toLowerCase())+": "+p+";")}(c.length||u)&&a.push((i&&!f&&!h?o.map(i):o).join(", ")+" {"+c.join(" ")+"}")}for(let o in t)r(n(o),t[o],this.rules)}getRules(){return this.rules.join(`
6
+ `)}static newName(){let t=Hh[Gh]||1;return Hh[Gh]=t+1,ml+t.toString(36)}static mount(t,e,i){let n=t[Ol],r=i&&i.nonce;n?r&&n.setNonce(r):n=new BO(t,r),n.mount(Array.isArray(e)?e:[e],t)}}let Fh=new Map;class BO{constructor(t,e){let i=t.ownerDocument||t,n=i.defaultView;if(!t.head&&t.adoptedStyleSheets&&n.CSSStyleSheet){let r=Fh.get(i);if(r)return t[Ol]=r;this.sheet=new n.CSSStyleSheet,Fh.set(i,this)}else this.styleTag=i.createElement("style"),e&&this.styleTag.setAttribute("nonce",e);this.modules=[],t[Ol]=this}mount(t,e){let i=this.sheet,n=0,r=0;for(let o=0;o<t.length;o++){let l=t[o],a=this.modules.indexOf(l);if(a<r&&a>-1&&(this.modules.splice(a,1),r--,a=-1),a==-1){if(this.modules.splice(r++,0,l),i)for(let h=0;h<l.rules.length;h++)i.insertRule(l.rules[h],n++)}else{for(;r<a;)n+=this.modules[r++].rules.length;n+=l.rules.length,r++}}if(i)e.adoptedStyleSheets.indexOf(this.sheet)<0&&(e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets]);else{let o="";for(let a=0;a<this.modules.length;a++)o+=this.modules[a].getRules()+`
7
+ `;this.styleTag.textContent=o;let l=e.head||e;this.styleTag.parentNode!=l&&l.insertBefore(this.styleTag,l.firstChild)}}setNonce(t){this.styleTag&&this.styleTag.getAttribute("nonce")!=t&&this.styleTag.setAttribute("nonce",t)}}var ze={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:"'"},Fi={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},YO=typeof navigator<"u"&&/Mac/.test(navigator.platform),XO=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var $t=0;$t<10;$t++)ze[48+$t]=ze[96+$t]=String($t);for(var $t=1;$t<=24;$t++)ze[$t+111]="F"+$t;for(var $t=65;$t<=90;$t++)ze[$t]=String.fromCharCode($t+32),Fi[$t]=String.fromCharCode($t);for(var Oo in ze)Fi.hasOwnProperty(Oo)||(Fi[Oo]=ze[Oo]);function sd(s){var t=YO&&s.metaKey&&s.shiftKey&&!s.ctrlKey&&!s.altKey||XO&&s.shiftKey&&s.key&&s.key.length==1||s.key=="Unidentified",e=!t&&s.key||(s.shiftKey?Fi:ze)[s.keyCode]||s.key||"Unidentified";return e=="Esc"&&(e="Escape"),e=="Del"&&(e="Delete"),e=="Left"&&(e="ArrowLeft"),e=="Up"&&(e="ArrowUp"),e=="Right"&&(e="ArrowRight"),e=="Down"&&(e="ArrowDown"),e}function yr(s){let t;return s.nodeType==11?t=s.getSelection?s:s.ownerDocument:t=s,t.getSelection()}function bl(s,t){return t?s==t||s.contains(t.nodeType!=1?t.parentNode:t):!1}function LO(s){let t=s.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}function Fs(s,t){if(!t.anchorNode)return!1;try{return bl(s,t.anchorNode)}catch{return!1}}function Ui(s){return s.nodeType==3?$i(s,0,s.nodeValue.length).getClientRects():s.nodeType==1?s.getClientRects():[]}function Yn(s,t,e,i){return e?Uh(s,t,e,i,-1)||Uh(s,t,e,i,1):!1}function In(s){for(var t=0;;t++)if(s=s.previousSibling,!s)return t}function Uh(s,t,e,i,n){for(;;){if(s==e&&t==i)return!0;if(t==(n<0?0:_e(s))){if(s.nodeName=="DIV")return!1;let r=s.parentNode;if(!r||r.nodeType!=1)return!1;t=In(s)+(n<0?0:1),s=r}else if(s.nodeType==1){if(s=s.childNodes[t+(n<0?-1:0)],s.nodeType==1&&s.contentEditable=="false")return!1;t=n<0?_e(s):0}else return!1}}function _e(s){return s.nodeType==3?s.nodeValue.length:s.childNodes.length}function Kr(s,t){let e=t?s.left:s.right;return{left:e,right:e,top:s.top,bottom:s.bottom}}function jO(s){return{left:0,right:s.innerWidth,top:0,bottom:s.innerHeight}}function rd(s,t){let e=t.width/s.offsetWidth,i=t.height/s.offsetHeight;return(e>.995&&e<1.005||!isFinite(e)||Math.abs(t.width-s.offsetWidth)<1)&&(e=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-s.offsetHeight)<1)&&(i=1),{scaleX:e,scaleY:i}}function VO(s,t,e,i,n,r,o,l){let a=s.ownerDocument,h=a.defaultView||window;for(let c=s,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==a.body,p=1,g=1;if(d)u=jO(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let y=c.getBoundingClientRect();({scaleX:p,scaleY:g}=rd(c,y)),u={left:y.left,right:y.left+c.clientWidth*p,top:y.top,bottom:y.top+c.clientHeight*g}}let m=0,O=0;if(n=="nearest")t.top<u.top?(O=-(u.top-t.top+o),e>0&&t.bottom>u.bottom+O&&(O=t.bottom-u.bottom+O+o)):t.bottom>u.bottom&&(O=t.bottom-u.bottom+o,e<0&&t.top-O<u.top&&(O=-(u.top+O-t.top+o)));else{let y=t.bottom-t.top,x=u.bottom-u.top;O=(n=="center"&&y<=x?t.top+y/2-x/2:n=="start"||n=="center"&&e<0?t.top-o:t.bottom-x+o)-u.top}if(i=="nearest"?t.left<u.left?(m=-(u.left-t.left+r),e>0&&t.right>u.right+m&&(m=t.right-u.right+m+r)):t.right>u.right&&(m=t.right-u.right+r,e<0&&t.left<u.left+m&&(m=-(u.left+m-t.left+r))):m=(i=="center"?t.left+(t.right-t.left)/2-(u.right-u.left)/2:i=="start"==l?t.left-r:t.right-(u.right-u.left)+r)-u.left,m||O)if(d)h.scrollBy(m,O);else{let y=0,x=0;if(O){let k=c.scrollTop;c.scrollTop+=O/g,x=(c.scrollTop-k)*g}if(m){let k=c.scrollLeft;c.scrollLeft+=m/p,y=(c.scrollLeft-k)*p}t={left:t.left-y,top:t.top-x,right:t.right-y,bottom:t.bottom-x},y&&Math.abs(y-m)<1&&(i="nearest"),x&&Math.abs(x-O)<1&&(n="nearest")}if(d)break;c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function NO(s){let t=s.ownerDocument;for(let e=s.parentNode;e&&e!=t.body;)if(e.nodeType==1){if(e.scrollHeight>e.clientHeight||e.scrollWidth>e.clientWidth)return e;e=e.assignedSlot||e.parentNode}else if(e.nodeType==11)e=e.host;else break;return null}let IO=class{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:i}=t;this.set(e,Math.min(t.anchorOffset,e?_e(e):0),i,Math.min(t.focusOffset,i?_e(i):0))}set(t,e,i,n){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=n}},Mi=null;function od(s){if(s.setActive)return s.setActive();if(Mi)return s.focus(Mi);let t=[];for(let e=s;e&&(t.push(e,e.scrollTop,e.scrollLeft),e!=e.ownerDocument);e=e.parentNode);if(s.focus(Mi==null?{get preventScroll(){return Mi={preventScroll:!0},!0}}:void 0),!Mi){Mi=!1;for(let e=0;e<t.length;){let i=t[e++],n=t[e++],r=t[e++];i.scrollTop!=n&&(i.scrollTop=n),i.scrollLeft!=r&&(i.scrollLeft=r)}}}let Kh;function $i(s,t,e=t){let i=Kh||(Kh=document.createRange());return i.setEnd(s,e),i.setStart(s,t),i}function Vi(s,t,e){let i={key:t,code:t,keyCode:e,which:e,cancelable:!0},n=new KeyboardEvent("keydown",i);n.synthetic=!0,s.dispatchEvent(n);let r=new KeyboardEvent("keyup",i);return r.synthetic=!0,s.dispatchEvent(r),n.defaultPrevented||r.defaultPrevented}function qO(s){for(;s;){if(s&&(s.nodeType==9||s.nodeType==11&&s.host))return s;s=s.assignedSlot||s.parentNode}return null}function ld(s){for(;s.attributes.length;)s.removeAttributeNode(s.attributes[0])}function zO(s,t){let e=t.focusNode,i=t.focusOffset;if(!e||t.anchorNode!=e||t.anchorOffset!=i)return!1;for(i=Math.min(i,_e(e));;)if(i){if(e.nodeType!=1)return!1;let n=e.childNodes[i-1];n.contentEditable=="false"?i--:(e=n,i=_e(e))}else{if(e==s)return!0;i=In(e),e=e.parentNode}}function ad(s){return s.scrollTop>Math.max(1,s.scrollHeight-s.clientHeight-4)}let Ht=class yl{constructor(t,e,i=!0){this.node=t,this.offset=e,this.precise=i}static before(t,e){return new yl(t.parentNode,In(t),e)}static after(t,e){return new yl(t.parentNode,In(t)+1,e)}};const Ha=[];let dt=class wl{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t){let e=this.posAtStart;for(let i of this.children){if(i==t)return e;e+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}sync(t,e){if(this.flags&2){let i=this.dom,n=null,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=n?n.nextSibling:i.firstChild)){let l=wl.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(t,e),o.flags&=-8}if(r=n?n.nextSibling:i.firstChild,e&&!e.written&&e.node==i&&r!=o.dom&&(e.written=!0),o.dom.parentNode==i)for(;r&&r!=o.dom;)r=Jh(r);else i.insertBefore(o.dom,r);n=o.dom}for(r=n?n.nextSibling:i.firstChild,r&&e&&e.node==i&&(e.written=!0);r;)r=Jh(r)}else if(this.flags&1)for(let i of this.children)i.flags&7&&(i.sync(t,e),i.flags&=-8)}reuseDOM(t){}localPosFromDOM(t,e){let i;if(t==this.dom)i=this.dom.childNodes[e];else{let n=_e(t)==0?0:e==0?-1:1;for(;;){let r=t.parentNode;if(r==this.dom)break;n==0&&r.firstChild!=r.lastChild&&(t==r.firstChild?n=-1:n=1),t=r}n<0?i=t:i=t.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!wl.get(i);)i=i.nextSibling;if(!i)return this.length;for(let n=0,r=0;;n++){let o=this.children[n];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(t,e,i=0){let n=-1,r=-1,o=-1,l=-1;for(let a=0,h=i,c=i;a<this.children.length;a++){let f=this.children[a],u=h+f.length;if(h<t&&u>e)return f.domBoundsAround(t,e,h);if(u>=t&&n==-1&&(n=a,r=h),h>e&&f.dom.parentNode==this.dom){o=a,l=c;break}c=u,h=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(n?this.children[n-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(t=!1){this.flags|=2,this.markParentsDirty(t)}markParentsDirty(t){for(let e=this.parent;e;e=e.parent){if(t&&(e.flags|=2),e.flags&1)return;e.flags|=1,t=!1}}setParent(t){this.parent!=t&&(this.parent=t,this.flags&7&&this.markParentsDirty(!0))}setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this)}get rootView(){for(let t=this;;){let e=t.parent;if(!e)return t;t=e}}replaceChildren(t,e,i=Ha){this.markDirty();for(let n=t;n<e;n++){let r=this.children[n];r.parent==this&&i.indexOf(r)<0&&r.destroy()}this.children.splice(t,e-t,...i);for(let n=0;n<i.length;n++)i[n].setParent(this)}ignoreMutation(t){return!1}ignoreEvent(t){return!1}childCursor(t=this.length){return new hd(this.children,t,this.children.length)}childPos(t,e=1){return this.childCursor().findPos(t,e)}toString(){let t=this.constructor.name.replace("View","");return t+(this.children.length?"("+this.children.join()+")":this.length?"["+(t=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(t){return t.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(t,e,i,n,r,o){return!1}become(t){return!1}canReuseDOM(t){return t.constructor==this.constructor&&!((this.flags|t.flags)&8)}getSide(){return 0}destroy(){for(let t of this.children)t.parent==this&&t.destroy();this.parent=null}};dt.prototype.breakAfter=0;function Jh(s){let t=s.nextSibling;return s.parentNode.removeChild(s),t}let hd=class{constructor(t,e,i){this.children=t,this.pos=e,this.i=i,this.off=0}findPos(t,e=1){for(;;){if(t>this.pos||t==this.pos&&(e>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}};function cd(s,t,e,i,n,r,o,l,a){let{children:h}=s,c=h.length?h[t]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(t==i&&c&&!o&&!u&&r.length<2&&c.merge(e,n,r.length?f:null,e==0,l,a))){if(i<h.length){let d=h[i];d&&(n<d.length||d.breakAfter&&(f!=null&&f.breakAfter))?(t==i&&(d=d.split(n),n=0),!u&&f&&d.merge(0,n,f,!0,0,a)?r[r.length-1]=d:((n||d.children.length&&!d.children[0].length)&&d.merge(0,n,null,!1,0,a),r.push(d))):d!=null&&d.breakAfter&&(f?f.breakAfter=1:o=1),i++}for(c&&(c.breakAfter=o,e>0&&(!o&&r.length&&c.merge(e,c.length,r[0],!1,l,0)?c.breakAfter=r.shift().breakAfter:(e<c.length||c.children.length&&c.children[c.children.length-1].length==0)&&c.merge(e,c.length,null,!1,l,0),t++));t<i&&r.length;)if(h[i-1].become(r[r.length-1]))i--,r.pop(),a=r.length?0:l;else if(h[t].become(r[0]))t++,r.shift(),l=r.length?0:a;else break;!r.length&&t&&i<h.length&&!h[t-1].breakAfter&&h[i].merge(0,0,h[t-1],!1,l,a)&&t--,(t<i||r.length)&&s.replaceChildren(t,i,r)}}function fd(s,t,e,i,n,r){let o=s.childCursor(),{i:l,off:a}=o.findPos(e,1),{i:h,off:c}=o.findPos(t,-1),f=t-e;for(let u of i)f+=u.length;s.length+=f,cd(s,h,c,l,a,i,0,n,r)}let Ft=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Sl=typeof document<"u"?document:{documentElement:{style:{}}};const xl=/Edge\/(\d+)/.exec(Ft.userAgent),ud=/MSIE \d/.test(Ft.userAgent),kl=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Ft.userAgent),Jr=!!(ud||kl||xl),tc=!Jr&&/gecko\/(\d+)/i.test(Ft.userAgent),bo=!Jr&&/Chrome\/(\d+)/.exec(Ft.userAgent),ec="webkitFontSmoothing"in Sl.documentElement.style,dd=!Jr&&/Apple Computer/.test(Ft.vendor),ic=dd&&(/Mobile\/\w+/.test(Ft.userAgent)||Ft.maxTouchPoints>2);var E={mac:ic||/Mac/.test(Ft.platform),windows:/Win/.test(Ft.platform),linux:/Linux|X11/.test(Ft.platform),ie:Jr,ie_version:ud?Sl.documentMode||6:kl?+kl[1]:xl?+xl[1]:0,gecko:tc,gecko_version:tc?+(/Firefox\/(\d+)/.exec(Ft.userAgent)||[0,0])[1]:0,chrome:!!bo,chrome_version:bo?+bo[1]:0,ios:ic,android:/Android\b/.test(Ft.userAgent),webkit:ec,safari:dd,webkit_version:ec?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:Sl.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const _O=256;let Ki=class vl extends dt{constructor(t){super(),this.text=t}get length(){return this.text.length}createDOM(t){this.setDOM(t||document.createTextNode(this.text))}sync(t,e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(t){t.nodeType==3&&this.createDOM(t)}merge(t,e,i){return this.flags&8||i&&(!(i instanceof vl)||this.length-(e-t)+i.length>_O||i.flags&8)?!1:(this.text=this.text.slice(0,t)+(i?i.text:"")+this.text.slice(e),this.markDirty(),!0)}split(t){let e=new vl(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e.flags|=this.flags&8,e}localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0}domAtPos(t){return new Ht(this.dom,t)}domBoundsAround(t,e,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,e){return GO(this.dom,t,e)}},Ji=class $l extends dt{constructor(t,e=[],i=0){super(),this.mark=t,this.children=e,this.length=i;for(let n of e)n.setParent(this)}setAttrs(t){if(ld(t),this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(let e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);return t}canReuseDOM(t){return super.canReuseDOM(t)&&!((this.flags|t.flags)&8)}reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6)}sync(t,e){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(t,e)}merge(t,e,i,n,r,o){return i&&(!(i instanceof $l&&i.mark.eq(this.mark))||t&&r<=0||e<this.length&&o<=0)?!1:(fd(this,t,e,i?i.children.slice():[],r-1,o-1),this.markDirty(),!0)}split(t){let e=[],i=0,n=-1,r=0;for(let l of this.children){let a=i+l.length;a>t&&e.push(i<t?l.split(t-i):l),n<0&&i>=t&&(n=r),i=a,r++}let o=this.length-t;return this.length=t,n>-1&&(this.children.length=n,this.markDirty()),new $l(this.mark,e,o)}domAtPos(t){return pd(this,t)}coordsAt(t,e){return md(this,t,e)}};function GO(s,t,e){let i=s.nodeValue.length;t>i&&(t=i);let n=t,r=t,o=0;t==0&&e<0||t==i&&e>=0?E.chrome||E.gecko||(t?(n--,o=1):r<i&&(r++,o=-1)):e<0?n--:r<i&&r++;let l=$i(s,n,r).getClientRects();if(!l.length)return null;let a=l[(o?o<0:e>=0)?0:l.length-1];return E.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,h=>h.width)||a),o?Kr(a,o<0):a||null}let Fa=class kn extends dt{static create(t,e,i){return new kn(t,e,i)}constructor(t,e,i){super(),this.widget=t,this.length=e,this.side=i,this.prevWidget=null}split(t){let e=kn.create(this.widget,this.length-t,this.side);return this.length-=t,e}sync(t){(!this.dom||!this.widget.updateDOM(this.dom,t))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(t,e,i,n,r,o){return i&&(!(i instanceof kn)||!this.widget.compare(i.widget)||t>0&&r<=0||e<this.length&&o<=0)?!1:(this.length=t+(i?i.length:0)+(this.length-e),!0)}become(t){return t instanceof kn&&t.side==this.side&&this.widget.constructor==t.widget.constructor?(this.widget.compare(t.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(t){return this.widget.ignoreEvent(t)}get overrideDOMText(){if(this.length==0)return q.empty;let t=this;for(;t.parent;)t=t.parent;let{view:e}=t,i=e&&e.state.doc,n=this.posAtStart;return i?i.slice(n,n+this.length):q.empty}domAtPos(t){return(this.length?t==0:this.side>0)?Ht.before(this.dom):Ht.after(this.dom,t==this.length)}domBoundsAround(){return null}coordsAt(t,e){let i=this.widget.coordsAt(this.dom,t,e);if(i)return i;let n=this.dom.getClientRects(),r=null;if(!n.length)return null;let o=this.side?this.side<0:t>0;for(let l=o?n.length-1:0;r=n[l],!(t>0?l==0:l==n.length-1||r.top<r.bottom);l+=o?-1:1);return Kr(r,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}},Ql=class Pl extends dt{constructor(t){super(),this.side=t}get length(){return 0}merge(){return!1}become(t){return t instanceof Pl&&t.side==this.side}split(){return new Pl(this.side)}sync(){if(!this.dom){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),this.setDOM(t)}}getSide(){return this.side}domAtPos(t){return this.side>0?Ht.before(this.dom):Ht.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){return this.dom.getBoundingClientRect()}get overrideDOMText(){return q.empty}get isHidden(){return!0}};Ki.prototype.children=Fa.prototype.children=Ql.prototype.children=Ha;function pd(s,t){let e=s.dom,{children:i}=s,n=0;for(let r=0;n<i.length;n++){let o=i[n],l=r+o.length;if(!(l==r&&o.getSide()<=0)){if(t>r&&t<l&&o.dom.parentNode==e)return o.domAtPos(t-r);if(t<=r)break;r=l}}for(let r=n;r>0;r--){let o=i[r-1];if(o.dom.parentNode==e)return o.domAtPos(o.length)}for(let r=n;r<i.length;r++){let o=i[r];if(o.dom.parentNode==e)return o.domAtPos(0)}return new Ht(e,0)}function gd(s,t,e){let i,{children:n}=s;e>0&&t instanceof Ji&&n.length&&(i=n[n.length-1])instanceof Ji&&i.mark.eq(t.mark)?gd(i,t.children[0],e-1):(n.push(t),t.setParent(s)),s.length+=t.length}function md(s,t,e){let i=null,n=-1,r=null,o=-1;function l(h,c){for(let f=0,u=0;f<h.children.length&&u<=c;f++){let d=h.children[f],p=u+d.length;p>=c&&(d.children.length?l(d,c-u):(!r||r.isHidden&&e>0)&&(p>c||u==p&&d.getSide()>0)?(r=d,o=c-u):(u<c||u==p&&d.getSide()<0&&!d.isHidden)&&(i=d,n=c-u)),u=p}}l(s,t);let a=(e<0?i:r)||i||r;return a?a.coordsAt(Math.max(0,a==i?n:o),e):HO(s)}function HO(s){let t=s.dom.lastChild;if(!t)return s.dom.getBoundingClientRect();let e=Ui(t);return e[e.length-1]||null}function Cl(s,t){for(let e in s)e=="class"&&t.class?t.class+=" "+s.class:e=="style"&&t.style?t.style+=";"+s.style:t[e]=s[e];return t}const nc=Object.create(null);function Ua(s,t,e){if(s==t)return!0;s||(s=nc),t||(t=nc);let i=Object.keys(s),n=Object.keys(t);if(i.length-(e&&i.indexOf(e)>-1?1:0)!=n.length-(e&&n.indexOf(e)>-1?1:0))return!1;for(let r of i)if(r!=e&&(n.indexOf(r)==-1||s[r]!==t[r]))return!1;return!0}function Zl(s,t,e){let i=!1;if(t)for(let n in t)e&&n in e||(i=!0,n=="style"?s.style.cssText="":s.removeAttribute(n));if(e)for(let n in e)t&&t[n]==e[n]||(i=!0,n=="style"?s.style.cssText=e[n]:s.setAttribute(n,e[n]));return i}function FO(s){let t=Object.create(null);for(let e=0;e<s.attributes.length;e++){let i=s.attributes[e];t[i.name]=i.value}return t}let Dt=class Us extends dt{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(t,e,i,n,r,o){if(i){if(!(i instanceof Us))return!1;this.dom||i.transferDOM(this)}return n&&this.setDeco(i?i.attrs:null),fd(this,t,e,i?i.children.slice():[],r,o),!0}split(t){let e=new Us;if(e.breakAfter=this.breakAfter,this.length==0)return e;let{i,off:n}=this.childPos(t);n&&(e.append(this.children[i].split(n),0),this.children[i].merge(n,this.children[i].length,null,!1,0,0),i++);for(let r=i;r<this.children.length;r++)e.append(this.children[r],0);for(;i>0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=t,e}transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(t){Ua(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}append(t,e){gd(this,t,e)}addLineDeco(t){let e=t.spec.attributes,i=t.spec.class;e&&(this.attrs=Cl(e,this.attrs||{})),i&&(this.attrs=Cl({class:i},this.attrs||{}))}domAtPos(t){return pd(this,t)}reuseDOM(t){t.nodeName=="DIV"&&(this.setDOM(t),this.flags|=6)}sync(t,e){var i;this.dom?this.flags&4&&(ld(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&&(Zl(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(t,e);let n=this.dom.lastChild;for(;n&&dt.get(n)instanceof Ji;)n=n.lastChild;if(!n||!this.length||n.nodeName!="BR"&&((i=dt.get(n))===null||i===void 0?void 0:i.isEditable)==!1&&(!E.ios||!this.children.some(r=>r instanceof Ki))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let t=0,e;for(let i of this.children){if(!(i instanceof Ki)||/[^ -~]/.test(i.text))return null;let n=Ui(i.dom);if(n.length!=1)return null;t+=n[0].width,e=n[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:e}:null}coordsAt(t,e){let i=md(this,t,e);if(!this.children.length&&i&&this.parent){let{heightOracle:n}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-n.lineHeight)<2&&n.textHeight<r){let o=(r-n.textHeight)/2;return{top:i.top+o,bottom:i.bottom-o,left:i.left,right:i.left}}}return i}become(t){return!1}covers(){return!0}static find(t,e){for(let i=0,n=0;i<t.children.length;i++){let r=t.children[i],o=n+r.length;if(o>=e){if(r instanceof Us)return r;if(o>e)break}n=o+r.breakAfter}return null}},Ks=class Js extends dt{constructor(t,e,i){super(),this.widget=t,this.length=e,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(t,e,i,n,r,o){return i&&(!(i instanceof Js)||!this.widget.compare(i.widget)||t>0&&r<=0||e<this.length&&o<=0)?!1:(this.length=t+(i?i.length:0)+(this.length-e),!0)}domAtPos(t){return t==0?Ht.before(this.dom):Ht.after(this.dom,t==this.length)}split(t){let e=this.length-t;this.length=t;let i=new Js(this.widget,e,this.deco);return i.breakAfter=this.breakAfter,i}get children(){return Ha}sync(t){(!this.dom||!this.widget.updateDOM(this.dom,t))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):q.empty}domBoundsAround(){return null}become(t){return t instanceof Js&&t.widget.constructor==this.widget.constructor?(t.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,this.deco=t.deco,this.breakAfter=t.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(t){return this.widget.ignoreEvent(t)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(t,e){return this.widget.coordsAt(this.dom,t,e)}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(t){let{startSide:e,endSide:i}=this.deco;return e==i?!1:t<0?e<0:i>0}},Le=class{eq(t){return!1}updateDOM(t,e){return!1}compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(t){return!0}coordsAt(t,e,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(t){}};var Et=function(s){return s[s.Text=0]="Text",s[s.WidgetBefore=1]="WidgetBefore",s[s.WidgetAfter=2]="WidgetAfter",s[s.WidgetRange=3]="WidgetRange",s}(Et||(Et={}));let z=class extends De{constructor(t,e,i,n){super(),this.startSide=t,this.endSide=e,this.widget=i,this.spec=n}get heightRelevant(){return!1}static mark(t){return new Ka(t)}static widget(t){let e=Math.max(-1e4,Math.min(1e4,t.side||0)),i=!!t.block;return e+=i&&!t.inlineOrder?e>0?3e8:-4e8:e>0?1e8:-1e8,new tn(t,e,e,i,t.widget||null,!1)}static replace(t){let e=!!t.block,i,n;if(t.isBlockGap)i=-5e8,n=4e8;else{let{start:r,end:o}=wd(t,e);i=(r?e?-3e8:-1:5e8)-1,n=(o?e?2e8:1:-6e8)+1}return new tn(t,i,n,e,t.widget||null,!0)}static line(t){return new Ja(t)}static set(t,e=!1){return I.of(t,e)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}};z.none=I.empty;let Ka=class Od extends z{constructor(t){let{start:e,end:i}=wd(t);super(e?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.class=t.class||"",this.attrs=t.attributes||null}eq(t){var e,i;return this==t||t instanceof Od&&this.tagName==t.tagName&&(this.class||((e=this.attrs)===null||e===void 0?void 0:e.class))==(t.class||((i=t.attrs)===null||i===void 0?void 0:i.class))&&Ua(this.attrs,t.attrs,"class")}range(t,e=t){if(t>=e)throw new RangeError("Mark decorations may not be empty");return super.range(t,e)}};Ka.prototype.point=!1;let Ja=class bd extends z{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof bd&&this.spec.class==t.spec.class&&Ua(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}};Ja.prototype.mapMode=ut.TrackBefore;Ja.prototype.point=!0;let tn=class yd extends z{constructor(t,e,i,n,r,o){super(e,i,r,t),this.block=n,this.isReplace=o,this.mapMode=n?e<=0?ut.TrackBefore:ut.TrackAfter:ut.TrackDel}get type(){return this.startSide!=this.endSide?Et.WidgetRange:this.startSide<=0?Et.WidgetBefore:Et.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof yd&&UO(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}};tn.prototype.point=!0;function wd(s,t=!1){let{inclusiveStart:e,inclusiveEnd:i}=s;return e==null&&(e=s.inclusive),i==null&&(i=s.inclusive),{start:e??t,end:i??t}}function UO(s,t){return s==t||!!(s&&t&&s.compare(t))}function Al(s,t,e,i=0){let n=e.length-1;n>=0&&e[n]+i>=s?e[n]=Math.max(e[n],t):e.push(s,t)}let yo=class Sd{constructor(t,e,i,n){this.doc=t,this.pos=e,this.end=i,this.disallowBlockEffectsFor=n,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=t.iter(),this.skip=e}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof Ks&&t.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Dt),this.atCursorPos=!0),this.curLine}flushBuffer(t=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(ds(new Ql(-1),t),t.length),this.pendingBuffer=0)}addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t)}finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(t&&this.content.length&&this.content[this.content.length-1]instanceof Ks)&&this.getLine()}buildText(t,e,i){for(;t>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,t--;continue}else this.text=r,this.textOff=0}let n=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e.slice(e.length-i)),this.getLine().append(ds(new Ki(this.text.slice(this.textOff,this.textOff+n)),e),i),this.atCursorPos=!0,this.textOff+=n,t-=n,i=0}}span(t,e,i,n){this.buildText(e-t,i,n),this.pos=e,this.openStart<0&&(this.openStart=n)}point(t,e,i,n,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof tn){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=e-t;if(i instanceof tn)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Ks(i.widget||new sc("div"),l,i));else{let a=Fa.create(i.widget||new sc("span"),l,l?0:i.startSide),h=this.atCursorPos&&!a.isEditable&&r<=n.length&&(t<e||i.startSide>0),c=!a.isEditable&&(t<e||r>n.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!h&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(n),h&&(f.append(ds(new Ql(1),n),r),r=n.length+Math.max(0,r-n.length)),f.append(ds(a,n),r),this.atCursorPos=c,this.pendingBuffer=c?t<e||r>n.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=n.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);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=e),this.openStart<0&&(this.openStart=r)}static build(t,e,i,n,r){let o=new Sd(t,e,i,r);return o.openEnd=I.spans(n,e,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}};function ds(s,t){for(let e of t)s=new Ji(e,[s],s.length);return s}let sc=class extends Le{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}};var at=function(s){return s[s.LTR=0]="LTR",s[s.RTL=1]="RTL",s}(at||(at={}));const Qi=at.LTR,th=at.RTL;function xd(s){let t=[];for(let e=0;e<s.length;e++)t.push(1<<+s[e]);return t}const KO=xd("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),JO=xd("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),Tl=Object.create(null),me=[];for(let s of["()","[]","{}"]){let t=s.charCodeAt(0),e=s.charCodeAt(1);Tl[t]=e,Tl[e]=-t}function kd(s){return s<=247?KO[s]:1424<=s&&s<=1524?2:1536<=s&&s<=1785?JO[s-1536]:1774<=s&&s<=2220?4:8192<=s&&s<=8204?256:64336<=s&&s<=65023?4:1}const t0=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;let ri=class{get dir(){return this.level%2?th:Qi}constructor(t,e,i){this.from=t,this.to=e,this.level=i}side(t,e){return this.dir==e==t?this.to:this.from}forward(t,e){return t==(this.dir==e)}static find(t,e,i,n){let r=-1;for(let o=0;o<t.length;o++){let l=t[o];if(l.from<=e&&l.to>=e){if(l.level==i)return o;(r<0||(n!=0?n<0?l.from<e:l.to>e:t[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}};function vd(s,t){if(s.length!=t.length)return!1;for(let e=0;e<s.length;e++){let i=s[e],n=t[e];if(i.from!=n.from||i.to!=n.to||i.direction!=n.direction||!vd(i.inner,n.inner))return!1}return!0}const K=[];function e0(s,t,e,i,n){for(let r=0;r<=i.length;r++){let o=r?i[r-1].to:t,l=r<i.length?i[r].from:e,a=r?256:n;for(let h=o,c=a,f=a;h<l;h++){let u=kd(s.charCodeAt(h));u==512?u=c:u==8&&f==4&&(u=16),K[h]=u==4?2:u,u&7&&(f=u),c=u}for(let h=o,c=a,f=a;h<l;h++){let u=K[h];if(u==128)h<l-1&&c==K[h+1]&&c&24?u=K[h]=c:K[h]=256;else if(u==64){let d=h+1;for(;d<l&&K[d]==64;)d++;let p=h&&c==8||d<e&&K[d]==8?f==1?1:8:256;for(let g=h;g<d;g++)K[g]=p;h=d-1}else u==8&&f==1&&(K[h]=1);c=u,u&7&&(f=u)}}}function i0(s,t,e,i,n){let r=n==1?2:1;for(let o=0,l=0,a=0;o<=i.length;o++){let h=o?i[o-1].to:t,c=o<i.length?i[o].from:e;for(let f=h,u,d,p;f<c;f++)if(d=Tl[u=s.charCodeAt(f)])if(d<0){for(let g=l-3;g>=0;g-=3)if(me[g+1]==-d){let m=me[g+2],O=m&2?n:m&4?m&1?r:n:0;O&&(K[f]=K[me[g]]=O),l=g;break}}else{if(me.length==189)break;me[l++]=f,me[l++]=u,me[l++]=a}else if((p=K[f])==2||p==1){let g=p==n;a=g?0:1;for(let m=l-3;m>=0;m-=3){let O=me[m+2];if(O&2)break;if(g)me[m+2]|=2;else{if(O&4)break;me[m+2]|=4}}}}}function n0(s,t,e,i){for(let n=0,r=i;n<=e.length;n++){let o=n?e[n-1].to:s,l=n<e.length?e[n].from:t;for(let a=o;a<l;){let h=K[a];if(h==256){let c=a+1;for(;;)if(c==l){if(n==e.length)break;c=e[n++].to,l=n<e.length?e[n].from:t}else if(K[c]==256)c++;else break;let f=r==1,u=(c<t?K[c]:i)==1,d=f==u?f?1:2:i;for(let p=c,g=n,m=g?e[g-1].to:s;p>a;)p==m&&(p=e[--g].from,m=g?e[g-1].to:s),K[--p]=d;a=c}else r=h,a++}}}function Ml(s,t,e,i,n,r,o){let l=i%2?2:1;if(i%2==n%2)for(let a=t,h=0;a<e;){let c=!0,f=!1;if(h==r.length||a<r[h].from){let g=K[a];g!=l&&(c=!1,f=g==16)}let u=!c&&l==1?[]:null,d=c?i:i+1,p=a;t:for(;;)if(h<r.length&&p==r[h].from){if(f)break t;let g=r[h];if(!c)for(let m=g.to,O=h+1;;){if(m==e)break t;if(O<r.length&&r[O].from==m)m=r[O++].to;else{if(K[m]==l)break t;break}}if(h++,u)u.push(g);else{g.from>a&&o.push(new ri(a,g.from,d));let m=g.direction==Qi!=!(d%2);Rl(s,m?i+1:i,n,g.inner,g.from,g.to,o),a=g.to}p=g.to}else{if(p==e||(c?K[p]!=l:K[p]==l))break;p++}u?Ml(s,a,p,i+1,n,u,o):a<p&&o.push(new ri(a,p,d)),a=p}else for(let a=e,h=r.length;a>t;){let c=!0,f=!1;if(!h||a>r[h-1].to){let g=K[a-1];g!=l&&(c=!1,f=g==16)}let u=!c&&l==1?[]:null,d=c?i:i+1,p=a;t:for(;;)if(h&&p==r[h-1].to){if(f)break t;let g=r[--h];if(!c)for(let m=g.from,O=h;;){if(m==t)break t;if(O&&r[O-1].to==m)m=r[--O].from;else{if(K[m-1]==l)break t;break}}if(u)u.push(g);else{g.to<a&&o.push(new ri(g.to,a,d));let m=g.direction==Qi!=!(d%2);Rl(s,m?i+1:i,n,g.inner,g.from,g.to,o),a=g.from}p=g.from}else{if(p==t||(c?K[p-1]!=l:K[p-1]==l))break;p--}u?Ml(s,p,a,i+1,n,u,o):p<a&&o.push(new ri(p,a,d)),a=p}}function Rl(s,t,e,i,n,r,o){let l=t%2?2:1;e0(s,n,r,i,l),i0(s,n,r,i,l),n0(n,r,i,l),Ml(s,n,r,t,e,i,o)}function s0(s,t,e){if(!s)return[new ri(0,0,t==th?1:0)];if(t==Qi&&!e.length&&!t0.test(s))return $d(s.length);if(e.length)for(;s.length>K.length;)K[K.length]=256;let i=[],n=t==Qi?0:1;return Rl(s,n,n,e,0,s.length,i),i}function $d(s){return[new ri(0,s,0)]}let Qd="";function r0(s,t,e,i,n){var r;let o=i.head-s.from,l=ri.find(t,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc),a=t[l],h=a.side(n,e);if(o==h){let u=l+=n?1:-1;if(u<0||u>=t.length)return null;a=t[l=u],o=a.side(!n,e),h=a.side(n,e)}let c=ct(s.text,o,a.forward(n,e));(c<a.from||c>a.to)&&(c=h),Qd=s.text.slice(Math.min(o,c),Math.max(o,c));let f=l==(n?t.length-1:0)?null:t[l+(n?1:-1)];return f&&c==h&&f.level+(n?0:1)<a.level?S.cursor(f.side(!n,e)+s.from,f.forward(n,e)?1:-1,f.level):S.cursor(c+s.from,a.forward(n,e)?-1:1,a.level)}function o0(s,t,e){for(let i=t;i<e;i++){let n=kd(s.charCodeAt(i));if(n==1)return Qi;if(n==2||n==4)return th}return Qi}const Pd=P.define(),Cd=P.define(),Zd=P.define(),Ad=P.define(),Dl=P.define(),Td=P.define(),Md=P.define(),Rd=P.define({combine:s=>s.some(t=>t)}),Dd=P.define({combine:s=>s.some(t=>t)});let wo=class Wl{constructor(t,e="nearest",i="nearest",n=5,r=5,o=!1){this.range=t,this.y=e,this.x=i,this.yMargin=n,this.xMargin=r,this.isSnapshot=o}map(t){return t.empty?this:new Wl(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new Wl(S.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}};const ps=j.define({map:(s,t)=>s.map(t)});function ee(s,t,e){let i=s.facet(Ad);i.length?i[0](t):window.onerror?window.onerror(String(t),e,void 0,void 0,t):e?console.error(e+":",t):console.error(t)}const to=P.define({combine:s=>s.length?s[0]:!0});let l0=0;const vn=P.define();let Tt=class El{constructor(t,e,i,n,r){this.id=t,this.create=e,this.domEventHandlers=i,this.domEventObservers=n,this.extension=r(this)}static define(t,e){const{eventHandlers:i,eventObservers:n,provide:r,decorations:o}=e||{};return new El(l0++,t,i,n,l=>{let a=[vn.of(l)];return o&&a.push(qn.of(h=>{let c=h.plugin(l);return c?o(c):z.none})),r&&a.push(r(l)),a})}static fromClass(t,e){return El.define(i=>new t(i),e)}},So=class{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}update(t){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(i){if(ee(e.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(t)}catch(e){ee(t.state,e,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(!((e=this.value)===null||e===void 0)&&e.destroy)try{this.value.destroy()}catch(i){ee(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}};const Wd=P.define(),eh=P.define(),qn=P.define(),Ed=P.define(),ih=P.define(),Bd=P.define();function rc(s,t){let e=s.state.facet(Bd);if(!e.length)return e;let i=e.map(r=>r instanceof Function?r(s):r),n=[];return I.spans(i,t.from,t.to,{point(){},span(r,o,l,a){let h=r-t.from,c=o-t.from,f=n;for(let u=l.length-1;u>=0;u--,a--){let d=l[u].spec.bidiIsolate,p;if(d==null&&(d=o0(t.text,h,c)),a>0&&f.length&&(p=f[f.length-1]).to==h&&p.direction==d)p.to=c,f=p.inner;else{let g={from:h,to:c,direction:d,inner:[]};f.push(g),f=g.inner}}}}),n}const Yd=P.define();function Xd(s){let t=0,e=0,i=0,n=0;for(let r of s.state.facet(Yd)){let o=r(s);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(e=Math.max(e,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(n=Math.max(n,o.bottom)))}return{left:t,right:e,top:i,bottom:n}}const $n=P.define();let li=class tr{constructor(t,e,i,n){this.fromA=t,this.toA=e,this.fromB=i,this.toB=n}join(t){return new tr(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;e>0;e--){let n=t[e-1];if(!(n.fromA>i.toA)){if(n.toA<i.fromA)break;i=i.join(n),t.splice(e-1,1)}}return t.splice(e,0,i),t}static extendWithRanges(t,e){if(e.length==0)return t;let i=[];for(let n=0,r=0,o=0,l=0;;n++){let a=n==t.length?null:t[n],h=o-l,c=a?a.fromB:1e9;for(;r<e.length&&e[r]<c;){let f=e[r],u=e[r+1],d=Math.max(l,f),p=Math.min(c,u);if(d<=p&&new tr(d+h,p+h,d,p).addToSet(i),u>c)break;r+=2}if(!a)return i;new tr(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}},oc=class Ld{constructor(t,e,i){this.view=t,this.state=e,this.transactions=i,this.flags=0,this.startState=t.state,this.changes=gt.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let n=[];this.changes.iterChangedRanges((r,o,l,a)=>n.push(new li(r,o,l,a))),this.changedRanges=n}static create(t,e,i){return new Ld(t,e,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}},lc=class extends dt{get length(){return this.view.state.doc.length}constructor(t){super(),this.view=t,this.decorations=[],this.dynamicDecorationMap=[],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.setDOM(t.contentDOM),this.children=[new Dt],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new li(0,0,0,t.state.doc.length)],0,null)}update(t){var e;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:h,toA:c})=>c<this.minWidthFrom||h>this.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let n=-1;this.view.inputState.composing>=0&&(!((e=this.domChanged)===null||e===void 0)&&e.newSel?n=this.domChanged.newSel.head:!p0(t.changes,this.hasComposition)&&!t.selectionSet&&(n=t.state.selection.main.head));let r=n>-1?h0(this.view,t.changes,n):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:h,to:c}=this.hasComposition;i=new li(h,c,t.changes.mapPos(h,-1),t.changes.mapPos(c,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(E.ie||E.chrome)&&!r&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=u0(o,l,t.changes);return i=li.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,t.startState.doc.length,r),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,e,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,e,i);let{observer:n}=this.view;n.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=E.chrome||E.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||n.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<this.view.state.doc.length)for(let o of this.children)o instanceof Ks&&o.widget instanceof ac&&r.push(o.dom);n.updateGaps(r)}updateChildren(t,e,i){let n=i?i.range.addToSet(t.slice()):t,r=this.childCursor(e);for(let o=n.length-1;;o--){let l=o>=0?n[o]:null;if(!l)break;let{fromA:a,toA:h,fromB:c,toB:f}=l,u,d,p,g;if(i&&i.range.fromB<f&&i.range.toB>c){let k=yo.build(this.view.state.doc,c,i.range.fromB,this.decorations,this.dynamicDecorationMap),w=yo.build(this.view.state.doc,i.range.toB,f,this.decorations,this.dynamicDecorationMap);d=k.breakAtStart,p=k.openStart,g=w.openEnd;let $=this.compositionView(i);w.breakAtStart?$.breakAfter=1:w.content.length&&$.merge($.length,$.length,w.content[0],!1,w.openStart,0)&&($.breakAfter=w.content[0].breakAfter,w.content.shift()),k.content.length&&$.merge(0,0,k.content[k.content.length-1],!0,0,k.openEnd)&&k.content.pop(),u=k.content.concat($).concat(w.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:g}=yo.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:m,off:O}=r.findPos(h,1),{i:y,off:x}=r.findPos(a,-1);cd(this,y,x,m,O,u,d,p,g)}i&&this.fixCompositionDOM(i)}compositionView(t){let e=new Ki(t.text.nodeValue);e.flags|=8;for(let{deco:n}of t.marks)e=new Ji(n,[e],e.length);let i=new Dt;return i.append(e,0),i}fixCompositionDOM(t){let e=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=dt.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(t.range.fromB,1),n=this.children[i.i];e(t.line,n);for(let r=t.marks.length-1;r>=-1;r--)i=n.childPos(i.off,1),n=n.children[i.i],e(r>=0?t.marks[r].node:t.text,n)}updateSelection(t=!1,e=!1){(t||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,n=i==this.dom,r=!n&&Fs(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(n||e||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),h=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(E.gecko&&l.empty&&!this.hasComposition&&a0(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=h=new Ht(f,0),o=!0}let c=this.view.observer.selectionRange;(o||!c.focusNode||(!Yn(a.node,a.offset,c.anchorNode,c.anchorOffset)||!Yn(h.node,h.offset,c.focusNode,c.focusOffset))&&!this.suppressWidgetCursorChange(c,l))&&(this.view.observer.ignore(()=>{E.android&&E.chrome&&this.dom.contains(c.focusNode)&&d0(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=yr(this.view.root);if(f)if(l.empty){if(E.gecko){let u=c0(a.node,a.offset);if(u&&u!=3){let d=Vd(a.node,a.offset,u==1?1:-1);d&&(a=new Ht(d.node,d.offset))}}f.collapse(a.node,a.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(h.node,h.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,h]=[h,a]),u.setEnd(h.node,h.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,h)),this.impreciseAnchor=a.precise?null:new Ht(c.anchorNode,c.anchorOffset),this.impreciseHead=h.precise?null:new Ht(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&Yn(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,e=t.state.selection.main,i=yr(t.root),{anchorNode:n,anchorOffset:r}=t.observer.selectionRange;if(!i||!e.empty||!e.assoc||!i.modify)return;let o=Dt.find(this,e.head);if(!o)return;let l=o.posAtStart;if(e.head==l||e.head==l+o.length)return;let a=this.coordsAt(e.head,-1),h=this.coordsAt(e.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(e.head+e.assoc);i.collapse(c.node,c.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=e.from&&i.collapse(n,r)}moveToLine(t){let e=this.dom,i;if(t.node!=e)return t;for(let n=t.offset;!i&&n<e.childNodes.length;n++){let r=dt.get(e.childNodes[n]);r instanceof Dt&&(i=r.domAtPos(0))}for(let n=t.offset-1;!i&&n>=0;n--){let r=dt.get(e.childNodes[n]);r instanceof Dt&&(i=r.domAtPos(r.length))}return i?new Ht(i.node,i.offset,!0):t}nearest(t){for(let e=t;e;){let i=dt.get(e);if(i&&i.rootView==this)return i;e=e.parentNode}return null}posFromDOM(t,e){let i=this.nearest(t);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart}domAtPos(t){let{i:e,off:i}=this.childCursor().findPos(t,-1);for(;e<this.children.length-1;){let n=this.children[e];if(i<n.length||n instanceof Dt)break;e++,i=0}return this.children[e].domAtPos(i)}coordsAt(t,e){let i=null,n=0;for(let r=this.length,o=this.children.length-1;o>=0;o--){let l=this.children[o],a=r-l.breakAfter,h=a-l.length;if(a<t)break;h<=t&&(h<t||l.covers(-1))&&(a>t||l.covers(1))&&(!i||l instanceof Dt&&!(i instanceof Dt&&e>=0))&&(i=l,n=h),r=h}return i?i.coordsAt(t-n,e):null}coordsForChar(t){let{i:e,off:i}=this.childPos(t,1),n=this.children[e];if(!(n instanceof Dt))return null;for(;n.children.length;){let{i:l,off:a}=n.childPos(i,1);for(;;l++){if(l==n.children.length)return null;if((n=n.children[l]).length)break}i=a}if(!(n instanceof Ki))return null;let r=ct(n.text,i);if(r==i)return null;let o=$i(n.dom,i,r).getClientRects();for(let l=0;l<o.length;l++){let a=o[l];if(l==o.length-1||a.top<a.bottom&&a.left<a.right)return a}return null}measureVisibleLineHeights(t){let e=[],{from:i,to:n}=t,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==at.LTR;for(let h=0,c=0;c<this.children.length;c++){let f=this.children[c],u=h+f.length;if(u>n)break;if(h>=i){let d=f.dom.getBoundingClientRect();if(e.push(d.height),o){let p=f.dom.lastChild,g=p?Ui(p):[];if(g.length){let m=g[g.length-1],O=a?m.right-d.left:d.right-m.left;O>l&&(l=O,this.minWidth=r,this.minWidthFrom=h,this.minWidthTo=u)}}}h=u+f.breakAfter}return e}textDirectionAt(t){let{i:e}=this.childPos(t,1);return getComputedStyle(this.children[e].dom).direction=="rtl"?at.RTL:at.LTR}measureTextSize(){for(let r of this.children)if(r instanceof Dt){let o=r.measureTextSize();if(o)return o}let t=document.createElement("div"),e,i,n;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(t);let r=Ui(t.firstChild)[0];e=t.getBoundingClientRect().height,i=r?r.width/27:7,n=r?r.height:e,t.remove()}),{lineHeight:e,charWidth:i,textHeight:n}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new hd(this.children,t,e)}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let i=0,n=0;;n++){let r=n==e.viewports.length?null:e.viewports[n],o=r?r.from-1:this.length;if(o>i){let l=(e.lineBlockAt(o).bottom-e.lineBlockAt(i).top)/this.view.scaleY;t.push(z.replace({widget:new ac(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return z.set(t)}updateDeco(){let t=this.view.state.facet(qn).map((n,r)=>(this.dynamicDecorationMap[r]=typeof n=="function")?n(this.view):n),e=!1,i=this.view.state.facet(Ed).map((n,r)=>{let o=typeof n=="function";return o&&(e=!0),o?n(this.view):n});i.length&&(this.dynamicDecorationMap[t.length]=e,t.push(I.join(i)));for(let n=t.length;n<t.length+3;n++)this.dynamicDecorationMap[n]=!1;return this.decorations=[...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco]}scrollIntoView(t){if(t.isSnapshot){let h=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=h.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}let{range:e}=t,i=this.coordsAt(e.head,e.empty?e.assoc:e.head>e.anchor?-1:1),n;if(!i)return;!e.empty&&(n=this.coordsAt(e.anchor,e.anchor>e.head?-1:1))&&(i={left:Math.min(i.left,n.left),top:Math.min(i.top,n.top),right:Math.max(i.right,n.right),bottom:Math.max(i.bottom,n.bottom)});let r=Xd(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;VO(this.view.scrollDOM,o,e.head<e.anchor?-1:1,t.x,t.y,Math.max(Math.min(t.xMargin,l),-l),Math.max(Math.min(t.yMargin,a),-a),this.view.textDirection==at.LTR)}};function a0(s){return s.node.nodeType==1&&s.node.firstChild&&(s.offset==0||s.node.childNodes[s.offset-1].contentEditable=="false")&&(s.offset==s.node.childNodes.length||s.node.childNodes[s.offset].contentEditable=="false")}let ac=class extends Le{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}};function jd(s,t){let e=s.observer.selectionRange,i=e.focusNode&&Vd(e.focusNode,e.focusOffset,0);if(!i)return null;let n=t-i.offset;return{from:n,to:n+i.node.nodeValue.length,node:i.node}}function h0(s,t,e){let i=jd(s,e);if(!i)return null;let{node:n,from:r,to:o}=i,l=n.nodeValue;if(/[\n\r]/.test(l)||s.state.doc.sliceString(i.from,i.to)!=l)return null;let a=t.invertedDesc,h=new li(a.mapPos(r),a.mapPos(o),r,o),c=[];for(let f=n.parentNode;;f=f.parentNode){let u=dt.get(f);if(u instanceof Ji)c.push({node:f,deco:u.mark});else{if(u instanceof Dt||f.nodeName=="DIV"&&f.parentNode==s.contentDOM)return{range:h,text:n,marks:c,line:f};if(f!=s.contentDOM)c.push({node:f,deco:new Ka({inclusive:!0,attributes:FO(f),tagName:f.tagName.toLowerCase()})});else return null}}}function Vd(s,t,e){if(e<=0)for(let i=s,n=t;;){if(i.nodeType==3)return{node:i,offset:n};if(i.nodeType==1&&n>0)i=i.childNodes[n-1],n=_e(i);else break}if(e>=0)for(let i=s,n=t;;){if(i.nodeType==3)return{node:i,offset:n};if(i.nodeType==1&&n<i.childNodes.length&&e>=0)i=i.childNodes[n],n=0;else break}return null}function c0(s,t){return s.nodeType!=1?0:(t&&s.childNodes[t-1].contentEditable=="false"?1:0)|(t<s.childNodes.length&&s.childNodes[t].contentEditable=="false"?2:0)}let f0=class{constructor(){this.changes=[]}compareRange(t,e){Al(t,e,this.changes)}comparePoint(t,e){Al(t,e,this.changes)}};function u0(s,t,e){let i=new f0;return I.compare(s,t,e,i),i.changes}function d0(s,t){for(let e=s;e&&e!=t;e=e.assignedSlot||e.parentNode)if(e.nodeType==1&&e.contentEditable=="false")return!0;return!1}function p0(s,t){let e=!1;return t&&s.iterChangedRanges((i,n)=>{i<t.to&&n>t.from&&(e=!0)}),e}function g0(s,t,e=1){let i=s.charCategorizer(t),n=s.doc.lineAt(t),r=t-n.from;if(n.length==0)return S.cursor(t);r==0?e=1:r==n.length&&(e=-1);let o=r,l=r;e<0?o=ct(n.text,r,!1):l=ct(n.text,r);let a=i(n.text.slice(o,l));for(;o>0;){let h=ct(n.text,o,!1);if(i(n.text.slice(h,o))!=a)break;o=h}for(;l<n.length;){let h=ct(n.text,l);if(i(n.text.slice(l,h))!=a)break;l=h}return S.range(o+n.from,l+n.from)}function m0(s,t){return t.left>s?t.left-s:Math.max(0,s-t.right)}function O0(s,t){return t.top>s?t.top-s:Math.max(0,s-t.bottom)}function xo(s,t){return s.top<t.bottom-1&&s.bottom>t.top+1}function hc(s,t){return t<s.top?{top:t,left:s.left,right:s.right,bottom:s.bottom}:s}function cc(s,t){return t>s.bottom?{top:s.top,left:s.left,right:s.right,bottom:t}:s}function Bl(s,t,e){let i,n,r,o,l=!1,a,h,c,f;for(let p=s.firstChild;p;p=p.nextSibling){let g=Ui(p);for(let m=0;m<g.length;m++){let O=g[m];n&&xo(n,O)&&(O=hc(cc(O,n.bottom),n.top));let y=m0(t,O),x=O0(e,O);if(y==0&&x==0)return p.nodeType==3?fc(p,t,e):Bl(p,t,e);if(!i||o>x||o==x&&r>y){i=p,n=O,r=y,o=x;let k=x?e<O.top?-1:1:y?t<O.left?-1:1:0;l=!k||(k>0?m<g.length-1:m>0)}y==0?e>O.bottom&&(!c||c.bottom<O.bottom)?(a=p,c=O):e<O.top&&(!f||f.top>O.top)&&(h=p,f=O):c&&xo(c,O)?c=cc(c,O.bottom):f&&xo(f,O)&&(f=hc(f,O.top))}}if(c&&c.bottom>=e?(i=a,n=c):f&&f.top<=e&&(i=h,n=f),!i)return{node:s,offset:0};let u=Math.max(n.left,Math.min(n.right,t));if(i.nodeType==3)return fc(i,u,e);if(l&&i.contentEditable!="false")return Bl(i,u,e);let d=Array.prototype.indexOf.call(s.childNodes,i)+(t>=(n.left+n.right)/2?1:0);return{node:s,offset:d}}function fc(s,t,e){let i=s.nodeValue.length,n=-1,r=1e9,o=0;for(let l=0;l<i;l++){let a=$i(s,l,l+1).getClientRects();for(let h=0;h<a.length;h++){let c=a[h];if(c.top==c.bottom)continue;o||(o=t-c.left);let f=(c.top>e?c.top-e:e-c.bottom)-1;if(c.left-1<=t&&c.right+1>=t&&f<r){let u=t>=(c.left+c.right)/2,d=u;if((E.chrome||E.gecko)&&$i(s,l).getBoundingClientRect().left==c.right&&(d=!u),f<=0)return{node:s,offset:l+(d?1:0)};n=l+(d?1:0),r=f}}}return{node:s,offset:n>-1?n:o>0?s.nodeValue.length:0}}function Nd(s,t,e,i=-1){var n,r;let o=s.contentDOM.getBoundingClientRect(),l=o.top+s.viewState.paddingTop,a,{docHeight:h}=s.viewState,{x:c,y:f}=t,u=f-l;if(u<0)return 0;if(u>h)return s.state.doc.length;for(let k=s.viewState.heightOracle.textHeight/2,w=!1;a=s.elementAtHeight(u),a.type!=Et.Text;)for(;u=i>0?a.bottom+k:a.top-k,!(u>=0&&u<=h);){if(w)return e?null:0;w=!0,i=-i}f=l+u;let d=a.from;if(d<s.viewport.from)return s.viewport.from==0?0:e?null:uc(s,o,a,c,f);if(d>s.viewport.to)return s.viewport.to==s.state.doc.length?s.state.doc.length:e?null:uc(s,o,a,c,f);let p=s.dom.ownerDocument,g=s.root.elementFromPoint?s.root:p,m=g.elementFromPoint(c,f);m&&!s.contentDOM.contains(m)&&(m=null),m||(c=Math.max(o.left+1,Math.min(o.right-1,c)),m=g.elementFromPoint(c,f),m&&!s.contentDOM.contains(m)&&(m=null));let O,y=-1;if(m&&((n=s.docView.nearest(m))===null||n===void 0?void 0:n.isEditable)!=!1){if(p.caretPositionFromPoint){let k=p.caretPositionFromPoint(c,f);k&&({offsetNode:O,offset:y}=k)}else if(p.caretRangeFromPoint){let k=p.caretRangeFromPoint(c,f);k&&({startContainer:O,startOffset:y}=k,(!s.contentDOM.contains(O)||E.safari&&b0(O,y,c)||E.chrome&&y0(O,y,c))&&(O=void 0))}}if(!O||!s.docView.dom.contains(O)){let k=Dt.find(s.docView,d);if(!k)return u>a.top+a.height/2?a.to:a.from;({node:O,offset:y}=Bl(k.dom,c,f))}let x=s.docView.nearest(O);if(!x)return null;if(x.isWidget&&((r=x.dom)===null||r===void 0?void 0:r.nodeType)==1){let k=x.dom.getBoundingClientRect();return t.y<k.top||t.y<=k.bottom&&t.x<=(k.left+k.right)/2?x.posAtStart:x.posAtEnd}else return x.localPosFromDOM(O,y)+x.posAtStart}function uc(s,t,e,i,n){let r=Math.round((i-t.left)*s.defaultCharacterWidth);if(s.lineWrapping&&e.height>s.defaultLineHeight*1.5){let l=s.viewState.heightOracle.textHeight,a=Math.floor((n-e.top-(s.defaultLineHeight-l)*.5)/l);r+=a*s.viewState.heightOracle.lineLength}let o=s.state.sliceDoc(e.from,e.to);return e.from+br(o,r,s.state.tabSize)}function b0(s,t,e){let i;if(s.nodeType!=3||t!=(i=s.nodeValue.length))return!1;for(let n=s.nextSibling;n;n=n.nextSibling)if(n.nodeType!=1||n.nodeName!="BR")return!1;return $i(s,i-1,i).getBoundingClientRect().left>e}function y0(s,t,e){if(t!=0)return!1;for(let n=s;;){let r=n.parentNode;if(!r||r.nodeType!=1||r.firstChild!=n)return!1;if(r.classList.contains("cm-line"))break;n=r}let i=s.nodeType==1?s.getBoundingClientRect():$i(s,0,Math.max(s.nodeValue.length,1)).getBoundingClientRect();return e-i.left>5}function Yl(s,t){let e=s.lineBlockAt(t);if(Array.isArray(e.type)){for(let i of e.type)if(i.to>t||i.to==t&&(i.to==e.to||i.type==Et.Text))return i}return e}function w0(s,t,e,i){let n=Yl(s,t.head),r=!i||n.type!=Et.Text||!(s.lineWrapping||n.widgetLineBreaks)?null:s.coordsAtPos(t.assoc<0&&t.head>n.from?t.head-1:t.head);if(r){let o=s.dom.getBoundingClientRect(),l=s.textDirectionAt(n.from),a=s.posAtCoords({x:e==(l==at.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return S.cursor(a,e?-1:1)}return S.cursor(e?n.to:n.from,e?-1:1)}function dc(s,t,e,i){let n=s.state.doc.lineAt(t.head),r=s.bidiSpans(n),o=s.textDirectionAt(n.from);for(let l=t,a=null;;){let h=r0(n,r,o,l,e),c=Qd;if(!h){if(n.number==(e?s.state.doc.lines:1))return l;c=`
8
+ `,n=s.state.doc.line(n.number+(e?1:-1)),r=s.bidiSpans(n),h=s.visualLineSide(n,!e)}if(a){if(!a(c))return l}else{if(!i)return h;a=i(c)}l=h}}function S0(s,t,e){let i=s.state.charCategorizer(t),n=i(e);return r=>{let o=i(r);return n==rt.Space&&(n=o),n==o}}function x0(s,t,e,i){let n=t.head,r=e?1:-1;if(n==(e?s.state.doc.length:0))return S.cursor(n,t.assoc);let o=t.goalColumn,l,a=s.contentDOM.getBoundingClientRect(),h=s.coordsAtPos(n,t.assoc||-1),c=s.documentTop;if(h)o==null&&(o=h.left-a.left),l=r<0?h.top:h.bottom;else{let d=s.viewState.lineBlockAt(n);o==null&&(o=Math.min(a.right-a.left,s.defaultCharacterWidth*(n-d.from))),l=(r<0?d.top:d.bottom)+c}let f=a.left+o,u=i??s.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,g=Nd(s,{x:f,y:p},!1,r);if(p<a.top||p>a.bottom||(r<0?g<n:g>n)){let m=s.docView.coordsForChar(g),O=!m||p<m.top?-1:1;return S.cursor(g,O,void 0,o)}}}function er(s,t,e){for(;;){let i=0;for(let n of s)n.between(t-1,t+1,(r,o,l)=>{if(t>r&&t<o){let a=i||e||(t-r<o-t?-1:1);t=a<0?r:o,i=a}});if(!i)return t}}function ko(s,t,e){let i=er(s.state.facet(ih).map(n=>n(s)),e.from,t.head>e.from?-1:1);return i==e.from?e:S.cursor(i,i<e.from?1:-1)}let k0=class{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastEscPress=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=t.hasFocus,E.safari&&t.contentDOM.addEventListener("input",()=>null),E.gecko&&X0(t.contentDOM.ownerDocument)}handleEvent(t){!T0(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||this.runHandlers(t.type,t)}runHandlers(t,e){let i=this.handlers[t];if(i){for(let n of i.observers)n(this.view,e);for(let n of i.handlers){if(e.defaultPrevented)break;if(n(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=v0(t),i=this.handlers,n=this.view.contentDOM;for(let r in e)if(r!="scroll"){let o=!e[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(n.removeEventListener(r,this.handleEvent),l=null),l||n.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!e[r]&&n.removeEventListener(r,this.handleEvent);this.handlers=e}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&Date.now()<this.lastEscPress+2e3)return!0;if(t.keyCode!=27&&qd.indexOf(t.keyCode)<0&&(this.view.inputState.lastEscPress=0),E.android&&E.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let e;return E.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&((e=Id.find(i=>i.keyCode==t.keyCode))&&!t.ctrlKey||$0.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=e||t,setTimeout(()=>this.flushIOSKey(),250),!0):(t.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(){let t=this.pendingIOSKey;return t?(this.pendingIOSKey=void 0,Vi(this.view.contentDOM,t.key,t.keyCode)):!1}ignoreDuringComposition(t){return/^key/.test(t.type)?this.composing>0?!0:E.safari&&!E.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}};function pc(s,t){return(e,i)=>{try{return t.call(s,i,e)}catch(n){ee(e.state,n)}}}function v0(s){let t=Object.create(null);function e(i){return t[i]||(t[i]={observers:[],handlers:[]})}for(let i of s){let n=i.spec;if(n&&n.domEventHandlers)for(let r in n.domEventHandlers){let o=n.domEventHandlers[r];o&&e(r).handlers.push(pc(i.value,o))}if(n&&n.domEventObservers)for(let r in n.domEventObservers){let o=n.domEventObservers[r];o&&e(r).observers.push(pc(i.value,o))}}for(let i in ce)e(i).handlers.push(ce[i]);for(let i in fe)e(i).observers.push(fe[i]);return t}const Id=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],$0="dthko",qd=[16,17,18,20,91,92,224,225],gs=6;function ms(s){return Math.max(0,s)*.7+8}function Q0(s,t){return Math.max(Math.abs(s.clientX-t.clientX),Math.abs(s.clientY-t.clientY))}let P0=class{constructor(t,e,i,n){this.view=t,this.startEvent=e,this.style=i,this.mustSelect=n,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParent=NO(t.contentDOM),this.atoms=t.state.facet(ih).map(o=>o(t));let r=t.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(V.allowMultipleSelections)&&C0(t,e),this.dragging=A0(t,e)&&Hd(e)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){var e;if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Q0(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let i=0,n=0,r=((e=this.scrollParent)===null||e===void 0?void 0:e.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},o=Xd(this.view);t.clientX-o.left<=r.left+gs?i=-ms(r.left-t.clientX):t.clientX+o.right>=r.right-gs&&(i=ms(t.clientX-r.right)),t.clientY-o.top<=r.top+gs?n=-ms(r.top-t.clientY):t.clientY+o.bottom>=r.bottom-gs&&(n=ms(t.clientY-r.bottom)),this.setScrollSpeed(i,n)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,e){this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(t){let e=null;for(let i=0;i<t.ranges.length;i++){let n=t.ranges[i],r=null;if(n.empty){let o=er(this.atoms,n.from,0);o!=n.from&&(r=S.cursor(o,-1))}else{let o=er(this.atoms,n.from,-1),l=er(this.atoms,n.to,1);(o!=n.from||l!=n.to)&&(r=S.range(n.from==n.anchor?o:l,n.from==n.head?o:l))}r&&(e||(e=t.ranges.slice()),e[i]=r)}return e?S.create(e,t.mainIndex):t}select(t){let{view:e}=this,i=this.skipAtoms(this.style.get(t,this.extend,this.multiple));(this.mustSelect||!i.eq(e.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}};function C0(s,t){let e=s.state.facet(Pd);return e.length?e[0](t):E.mac?t.metaKey:t.ctrlKey}function Z0(s,t){let e=s.state.facet(Cd);return e.length?e[0](t):E.mac?!t.altKey:!t.ctrlKey}function A0(s,t){let{main:e}=s.state.selection;if(e.empty)return!1;let i=yr(s.root);if(!i||i.rangeCount==0)return!0;let n=i.getRangeAt(0).getClientRects();for(let r=0;r<n.length;r++){let o=n[r];if(o.left<=t.clientX&&o.right>=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}function T0(s,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let e=t.target,i;e!=s.contentDOM;e=e.parentNode)if(!e||e.nodeType==11||(i=dt.get(e))&&i.ignoreEvent(t))return!1;return!0}const ce=Object.create(null),fe=Object.create(null),zd=E.ie&&E.ie_version<15||E.ios&&E.webkit_version<604;function M0(s){let t=s.dom.parentNode;if(!t)return;let e=t.appendChild(document.createElement("textarea"));e.style.cssText="position: fixed; left: -10000px; top: 10px",e.focus(),setTimeout(()=>{s.focus(),e.remove(),_d(s,e.value)},50)}function _d(s,t){let{state:e}=s,i,n=1,r=e.toText(t),o=r.lines==e.selection.ranges.length;if(Xl!=null&&e.selection.ranges.every(a=>a.empty)&&Xl==r.toString()){let a=-1;i=e.changeByRange(h=>{let c=e.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=e.toText((o?r.line(n++).text:t)+e.lineBreak);return{changes:{from:c.from,insert:f},range:S.cursor(h.from+f.length)}})}else o?i=e.changeByRange(a=>{let h=r.line(n++);return{changes:{from:a.from,to:a.to,insert:h.text},range:S.cursor(a.from+h.length)}}):i=e.replaceSelection(r);s.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}fe.scroll=s=>{s.inputState.lastScrollTop=s.scrollDOM.scrollTop,s.inputState.lastScrollLeft=s.scrollDOM.scrollLeft};ce.keydown=(s,t)=>(s.inputState.setSelectionOrigin("select"),t.keyCode==27&&(s.inputState.lastEscPress=Date.now()),!1);fe.touchstart=(s,t)=>{s.inputState.lastTouchTime=Date.now(),s.inputState.setSelectionOrigin("select.pointer")};fe.touchmove=s=>{s.inputState.setSelectionOrigin("select.pointer")};ce.mousedown=(s,t)=>{if(s.observer.flush(),s.inputState.lastTouchTime>Date.now()-2e3)return!1;let e=null;for(let i of s.state.facet(Zd))if(e=i(s,t),e)break;if(!e&&t.button==0&&(e=W0(s,t)),e){let i=!s.hasFocus;s.inputState.startMouseSelection(new P0(s,t,e,i)),i&&s.observer.ignore(()=>od(s.contentDOM));let n=s.inputState.mouseSelection;if(n)return n.start(t),n.dragging===!1}return!1};function gc(s,t,e,i){if(i==1)return S.cursor(t,e);if(i==2)return g0(s.state,t,e);{let n=Dt.find(s.docView,t),r=s.state.doc.lineAt(n?n.posAtEnd:t),o=n?n.posAtStart:r.from,l=n?n.posAtEnd:r.to;return l<s.state.doc.length&&l==r.to&&l++,S.range(o,l)}}let Gd=(s,t)=>s>=t.top&&s<=t.bottom,mc=(s,t,e)=>Gd(t,e)&&s>=e.left&&s<=e.right;function R0(s,t,e,i){let n=Dt.find(s.docView,t);if(!n)return 1;let r=t-n.posAtStart;if(r==0)return 1;if(r==n.length)return-1;let o=n.coordsAt(r,-1);if(o&&mc(e,i,o))return-1;let l=n.coordsAt(r,1);return l&&mc(e,i,l)?1:o&&Gd(i,o)?-1:1}function Oc(s,t){let e=s.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:e,bias:R0(s,e,t.clientX,t.clientY)}}const D0=E.ie&&E.ie_version<=11;let bc=null,yc=0,wc=0;function Hd(s){if(!D0)return s.detail;let t=bc,e=wc;return bc=s,wc=Date.now(),yc=!t||e>Date.now()-400&&Math.abs(t.clientX-s.clientX)<2&&Math.abs(t.clientY-s.clientY)<2?(yc+1)%3:1}function W0(s,t){let e=Oc(s,t),i=Hd(t),n=s.state.selection;return{update(r){r.docChanged&&(e.pos=r.changes.mapPos(e.pos),n=n.map(r.changes))},get(r,o,l){let a=Oc(s,r),h,c=gc(s,a.pos,a.bias,i);if(e.pos!=a.pos&&!o){let f=gc(s,e.pos,e.bias,i),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u<c.from?S.range(u,d):S.range(d,u)}return o?n.replaceRange(n.main.extend(c.from,c.to)):l&&i==1&&n.ranges.length>1&&(h=E0(n,a.pos))?h:l?n.addRange(c):S.create([c])}}}function E0(s,t){for(let e=0;e<s.ranges.length;e++){let{from:i,to:n}=s.ranges[e];if(i<=t&&n>=t)return S.create(s.ranges.slice(0,e).concat(s.ranges.slice(e+1)),s.mainIndex==e?0:s.mainIndex-(s.mainIndex>e?1:0))}return null}ce.dragstart=(s,t)=>{let{selection:{main:e}}=s.state;if(t.target.draggable){let n=s.docView.nearest(t.target);if(n&&n.isWidget){let r=n.posAtStart,o=r+n.length;(r>=e.to||o<=e.from)&&(e=S.range(r,o))}}let{inputState:i}=s;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=e,t.dataTransfer&&(t.dataTransfer.setData("Text",s.state.sliceDoc(e.from,e.to)),t.dataTransfer.effectAllowed="copyMove"),!1};ce.dragend=s=>(s.inputState.draggedContent=null,!1);function Sc(s,t,e,i){if(!e)return;let n=s.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:r}=s.inputState,o=i&&r&&Z0(s,t)?{from:r.from,to:r.to}:null,l={from:n,insert:e},a=s.state.changes(o?[o,l]:l);s.focus(),s.dispatch({changes:a,selection:{anchor:a.mapPos(n,-1),head:a.mapPos(n,1)},userEvent:o?"move.drop":"input.drop"}),s.inputState.draggedContent=null}ce.drop=(s,t)=>{if(!t.dataTransfer)return!1;if(s.state.readOnly)return!0;let e=t.dataTransfer.files;if(e&&e.length){let i=Array(e.length),n=0,r=()=>{++n==e.length&&Sc(s,t,i.filter(o=>o!=null).join(s.state.lineBreak),!1)};for(let o=0;o<e.length;o++){let l=new FileReader;l.onerror=r,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(e[o])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return Sc(s,t,i,!0),!0}return!1};ce.paste=(s,t)=>{if(s.state.readOnly)return!0;s.observer.flush();let e=zd?null:t.clipboardData;return e?(_d(s,e.getData("text/plain")||e.getData("text/uri-text")),!0):(M0(s),!1)};function B0(s,t){let e=s.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),s.focus()},50)}function Y0(s){let t=[],e=[],i=!1;for(let n of s.selection.ranges)n.empty||(t.push(s.sliceDoc(n.from,n.to)),e.push(n));if(!t.length){let n=-1;for(let{from:r}of s.selection.ranges){let o=s.doc.lineAt(r);o.number>n&&(t.push(o.text),e.push({from:o.from,to:Math.min(s.doc.length,o.to+1)})),n=o.number}i=!0}return{text:t.join(s.lineBreak),ranges:e,linewise:i}}let Xl=null;ce.copy=ce.cut=(s,t)=>{let{text:e,ranges:i,linewise:n}=Y0(s.state);if(!e&&!n)return!1;Xl=n?e:null,t.type=="cut"&&!s.state.readOnly&&s.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=zd?null:t.clipboardData;return r?(r.clearData(),r.setData("text/plain",e),!0):(B0(s,e),!1)};const Fd=se.define();function Ud(s,t){let e=[];for(let i of s.facet(Md)){let n=i(s,t);n&&e.push(n)}return e?s.update({effects:e,annotations:Fd.of(!0)}):null}function Kd(s){setTimeout(()=>{let t=s.hasFocus;if(t!=s.inputState.notifiedFocused){let e=Ud(s.state,t);e?s.dispatch(e):s.update([])}},10)}fe.focus=s=>{s.inputState.lastFocusTime=Date.now(),!s.scrollDOM.scrollTop&&(s.inputState.lastScrollTop||s.inputState.lastScrollLeft)&&(s.scrollDOM.scrollTop=s.inputState.lastScrollTop,s.scrollDOM.scrollLeft=s.inputState.lastScrollLeft),Kd(s)};fe.blur=s=>{s.observer.clearSelectionRange(),Kd(s)};fe.compositionstart=fe.compositionupdate=s=>{s.inputState.compositionFirstChange==null&&(s.inputState.compositionFirstChange=!0),s.inputState.composing<0&&(s.inputState.composing=0)};fe.compositionend=s=>{s.inputState.composing=-1,s.inputState.compositionEndedAt=Date.now(),s.inputState.compositionPendingKey=!0,s.inputState.compositionPendingChange=s.observer.pendingRecords().length>0,s.inputState.compositionFirstChange=null,E.chrome&&E.android?s.observer.flushSoon():s.inputState.compositionPendingChange?Promise.resolve().then(()=>s.observer.flush()):setTimeout(()=>{s.inputState.composing<0&&s.docView.hasComposition&&s.update([])},50)};fe.contextmenu=s=>{s.inputState.lastContextMenu=Date.now()};ce.beforeinput=(s,t)=>{var e;let i;if(E.chrome&&E.android&&(i=Id.find(n=>n.inputType==t.inputType))&&(s.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let n=((e=window.visualViewport)===null||e===void 0?void 0:e.height)||0;setTimeout(()=>{var r;(((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0)>n+10&&s.hasFocus&&(s.contentDOM.blur(),s.focus())},100)}return!1};const xc=new Set;function X0(s){xc.has(s)||(xc.add(s),s.addEventListener("copy",()=>{}),s.addEventListener("cut",()=>{}))}const kc=["pre-wrap","normal","pre-line","break-spaces"];let L0=class{constructor(t){this.lineWrapping=t,this.doc=q.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return kc.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let i=0;i<t.length;i++){let n=t[i];n<0?i++:this.heightSamples[Math.floor(n*10)]||(e=!0,this.heightSamples[Math.floor(n*10)]=!0)}return e}refresh(t,e,i,n,r,o){let l=kc.indexOf(t)>-1,a=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=e,this.charWidth=i,this.textHeight=n,this.lineLength=r,a){this.heightSamples={};for(let h=0;h<o.length;h++){let c=o[h];c<0?h++:this.heightSamples[Math.floor(c*10)]=!0}}return a}},j0=class{constructor(t,e){this.from=t,this.heights=e,this.index=0}get more(){return this.index<this.heights.length}},ti=class Jd{constructor(t,e,i,n,r){this.from=t,this.length=e,this.top=i,this.height=n,this._content=r}get type(){return typeof this._content=="number"?Et.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof tn?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(t){let e=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new Jd(this.from,this.length+t.length,this.top,this.height+t.height,e)}};var nt=function(s){return s[s.ByPos=0]="ByPos",s[s.ByHeight=1]="ByHeight",s[s.ByPosNoHeight=2]="ByPosNoHeight",s}(nt||(nt={}));const ir=.001;let he=class nr{constructor(t,e,i=2){this.length=t,this.height=e,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t,e){this.height!=e&&(Math.abs(this.height-e)>ir&&(t.heightChanged=!0),this.height=e)}replace(t,e,i){return nr.of(i)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,i,n){let r=this,o=i.doc;for(let l=n.length-1;l>=0;l--){let{fromA:a,toA:h,fromB:c,toB:f}=n[l],u=r.lineAt(a,nt.ByPosNoHeight,i.setDoc(e),0,0),d=u.to>=h?u:r.lineAt(h,nt.ByPosNoHeight,i,0,0);for(f+=d.to-h,h=d.to;l>0&&u.from<=n[l-1].toA;)a=n[l-1].fromA,c=n[l-1].fromB,l--,a<u.from&&(u=r.lineAt(a,nt.ByPosNoHeight,i,0,0));c+=u.from-a,a=u.from;let p=I0.build(i.setDoc(o),t,c,f);r=r.replace(a,h,p)}return r.updateHeight(i,0)}static empty(){return new ve(0,0)}static of(t){if(t.length==1)return t[0];let e=0,i=t.length,n=0,r=0;for(;;)if(e==i)if(n>r*2){let l=t[e-1];l.break?t.splice(--e,1,l.left,null,l.right):t.splice(--e,1,l.left,l.right),i+=1+l.break,n-=l.size}else if(r>n*2){let l=t[i];l.break?t.splice(i,1,l.left,null,l.right):t.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(n<r){let l=t[e++];l&&(n+=l.size)}else{let l=t[--i];l&&(r+=l.size)}let o=0;return t[e-1]==null?(o=1,e--):t[e]==null&&(o=1,i++),new V0(nr.of(t.slice(0,e)),o,nr.of(t.slice(i)))}};he.prototype.size=1;let tp=class extends he{constructor(t,e,i){super(t,e),this.deco=i}blockAt(t,e,i,n){return new ti(n,this.length,i,this.height,this.deco||0)}lineAt(t,e,i,n,r){return this.blockAt(0,i,n,r)}forEachLine(t,e,i,n,r,o){t<=r+this.length&&e>=r&&o(this.blockAt(0,i,n,r))}updateHeight(t,e=0,i=!1,n){return n&&n.from<=e&&n.more&&this.setHeight(t,n.heights[n.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}},ve=class Ll extends tp{constructor(t,e){super(t,e,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(t,e,i,n){return new ti(n,this.length,i,this.height,this.breaks)}replace(t,e,i){let n=i[0];return i.length==1&&(n instanceof Ll||n instanceof Ni&&n.flags&4)&&Math.abs(this.length-n.length)<10?(n instanceof Ni?n=new Ll(n.length,this.height):n.height=this.height,this.outdated||(n.outdated=!1),n):he.of(i)}updateHeight(t,e=0,i=!1,n){return n&&n.from<=e&&n.more?this.setHeight(t,n.heights[n.index++]):(i||this.outdated)&&this.setHeight(t,Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}},Ni=class le extends he{constructor(t){super(t,0)}heightMetrics(t,e){let i=t.doc.lineAt(e).number,n=t.doc.lineAt(e+this.length).number,r=n-i+1,o,l=0;if(t.lineWrapping){let a=Math.min(this.height,t.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:n,perLine:o,perChar:l}}blockAt(t,e,i,n){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(e,n);if(e.lineWrapping){let h=n+Math.round(Math.max(0,Math.min(1,(t-i)/this.height))*this.length),c=e.doc.lineAt(h),f=l+c.length*a,u=Math.max(i,t-f/2);return new ti(c.from,c.length,u,f,0)}else{let h=Math.max(0,Math.min(o-r,Math.floor((t-i)/l))),{from:c,length:f}=e.doc.line(r+h);return new ti(c,f,i+l*h,l,0)}}lineAt(t,e,i,n,r){if(e==nt.ByHeight)return this.blockAt(t,i,n,r);if(e==nt.ByPosNoHeight){let{from:d,to:p}=i.doc.lineAt(t);return new ti(d,p-d,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),h=i.doc.lineAt(t),c=l+h.length*a,f=h.number-o,u=n+l*f+a*(h.from-r-f);return new ti(h.from,h.length,Math.max(n,Math.min(u,n+this.height-c)),c,0)}forEachLine(t,e,i,n,r,o){t=Math.max(t,r),e=Math.min(e,r+this.length);let{firstLine:l,perLine:a,perChar:h}=this.heightMetrics(i,r);for(let c=t,f=n;c<=e;){let u=i.doc.lineAt(c);if(c==t){let p=u.number-l;f+=a*p+h*(t-r-p)}let d=a+h*u.length;o(new ti(u.from,u.length,f,d,0)),f+=d,c=u.to+1}}replace(t,e,i){let n=this.length-e;if(n>0){let r=i[i.length-1];r instanceof le?i[i.length-1]=new le(r.length+n):i.push(null,new le(n-1))}if(t>0){let r=i[0];r instanceof le?i[0]=new le(t+r.length):i.unshift(new le(t-1),null)}return he.of(i)}decomposeLeft(t,e){e.push(new le(t-1),null)}decomposeRight(t,e){e.push(null,new le(this.length-t-1))}updateHeight(t,e=0,i=!1,n){let r=e+this.length;if(n&&n.from<=e+this.length&&n.more){let o=[],l=Math.max(e,n.from),a=-1;for(n.from>e&&o.push(new le(n.from-e-1).updateHeight(t,e));l<=r&&n.more;){let c=t.doc.lineAt(l).length;o.length&&o.push(null);let f=n.heights[n.index++];a==-1?a=f:Math.abs(f-a)>=ir&&(a=-2);let u=new ve(c,f);u.outdated=!1,o.push(u),l+=c+1}l<=r&&o.push(null,new le(r-l).updateHeight(t,l));let h=he.of(o);return(a<0||Math.abs(h.height-this.height)>=ir||Math.abs(a-this.heightMetrics(t,e).perLine)>=ir)&&(t.heightChanged=!0),h}else(i||this.outdated)&&(this.setHeight(t,t.heightForGap(e,e+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}},V0=class extends he{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return this.flags&1}blockAt(t,e,i,n){let r=i+this.left.height;return t<r?this.left.blockAt(t,e,i,n):this.right.blockAt(t,e,r,n+this.left.length+this.break)}lineAt(t,e,i,n,r){let o=n+this.left.height,l=r+this.left.length+this.break,a=e==nt.ByHeight?t<o:t<l,h=a?this.left.lineAt(t,e,i,n,r):this.right.lineAt(t,e,i,o,l);if(this.break||(a?h.to<l:h.from>l))return h;let c=e==nt.ByPosNoHeight?nt.ByPosNoHeight:nt.ByPos;return a?h.join(this.right.lineAt(l,c,i,o,l)):this.left.lineAt(l,c,i,n,r).join(h)}forEachLine(t,e,i,n,r,o){let l=n+this.left.height,a=r+this.left.length+this.break;if(this.break)t<a&&this.left.forEachLine(t,e,i,n,r,o),e>=a&&this.right.forEachLine(t,e,i,l,a,o);else{let h=this.lineAt(a,nt.ByPos,i,n,r);t<h.from&&this.left.forEachLine(t,h.from-1,i,n,r,o),h.to>=t&&h.from<=e&&o(h),e>h.to&&this.right.forEachLine(h.to+1,e,i,l,a,o)}}replace(t,e,i){let n=this.left.length+this.break;if(e<n)return this.balanced(this.left.replace(t,e,i),this.right);if(t>this.left.length)return this.balanced(this.left,this.right.replace(t-n,e-n,i));let r=[];t>0&&this.decomposeLeft(t,r);let o=r.length;for(let l of i)r.push(l);if(t>0&&vc(r,o-1),e<this.length){let l=r.length;this.decomposeRight(e,r),vc(r,l)}return he.of(r)}decomposeLeft(t,e){let i=this.left.length;if(t<=i)return this.left.decomposeLeft(t,e);e.push(this.left),this.break&&(i++,t>=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){let i=this.left.length,n=i+this.break;if(t>=n)return this.right.decomposeRight(t-n,e);t<i&&this.left.decomposeRight(t,e),this.break&&t<n&&e.push(null),e.push(this.right)}balanced(t,e){return t.size>2*e.size||e.size>2*t.size?he.of(this.break?[t,null,e]:[t,e]):(this.left=t,this.right=e,this.height=t.height+e.height,this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,i=!1,n){let{left:r,right:o}=this,l=e+r.length+this.break,a=null;return n&&n.from<=e+r.length&&n.more?a=r=r.updateHeight(t,e,i,n):r.updateHeight(t,e,i),n&&n.from<=l+o.length&&n.more?a=o=o.updateHeight(t,l,i,n):o.updateHeight(t,l,i),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 vc(s,t){let e,i;s[t]==null&&(e=s[t-1])instanceof Ni&&(i=s[t+1])instanceof Ni&&s.splice(t-1,3,new Ni(e.length+1+i.length))}const N0=5;let I0=class ep{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let i=Math.min(e,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof ve?n.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new ve(i-this.pos,-1)),this.writtenTo=i,e>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,i){if(t<e||i.heightRelevant){let n=i.widget?i.widget.estimatedHeight:0,r=i.widget?i.widget.lineBreaks:0;n<0&&(n=this.oracle.lineHeight);let o=e-t;i.block?this.addBlock(new tp(o,n,i)):(o||r||n>=N0)&&this.addLineDeco(n,r,o)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTo<t&&((this.writtenTo<t-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,t-1)),this.nodes.push(null)),this.pos>t&&this.nodes.push(new ve(this.pos-t,-1)),this.writtenTo=this.pos}blankContent(t,e){let i=new Ni(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof ve)return t;let e=new ve(0,-1);return this.nodes.push(e),e}addBlock(t){this.enterLine();let e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t)}addLineDeco(t,e,i){let n=this.ensureLine();n.length+=i,n.collapsed+=i,n.widgetHeight=Math.max(n.widgetHeight,t),n.breaks+=e,this.writtenTo=this.pos=this.pos+i}finish(t){let e=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(e instanceof ve)&&!this.isCovered?this.nodes.push(new ve(0,-1)):(this.writtenTo<this.pos||e==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=t;for(let n of this.nodes)n instanceof ve&&n.updateHeight(this.oracle,i),i+=n?n.length:1;return this.nodes}static build(t,e,i,n){let r=new ep(i,t);return I.spans(e,i,n,r,0),r.finish(i)}};function q0(s,t,e){let i=new z0;return I.compare(s,t,e,i,0),i.changes}let z0=class{constructor(){this.changes=[]}compareRange(){}comparePoint(t,e,i,n){(t<e||i&&i.heightRelevant||n&&n.heightRelevant)&&Al(t,e,this.changes,5)}};function _0(s,t){let e=s.getBoundingClientRect(),i=s.ownerDocument,n=i.defaultView||window,r=Math.max(0,e.left),o=Math.min(n.innerWidth,e.right),l=Math.max(0,e.top),a=Math.min(n.innerHeight,e.bottom);for(let h=s.parentNode;h&&h!=i.body;)if(h.nodeType==1){let c=h,f=window.getComputedStyle(c);if((c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let u=c.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=h==s.parentNode?u.bottom:Math.min(a,u.bottom)}h=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:r-e.left,right:Math.max(r,o)-e.left,top:l-(e.top+t),bottom:Math.max(l,a)-(e.top+t)}}function G0(s,t){let e=s.getBoundingClientRect();return{left:0,right:e.right-e.left,top:t,bottom:e.bottom-(e.top+t)}}let vo=class{constructor(t,e,i){this.from=t,this.to=e,this.size=i}static same(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++){let n=t[i],r=e[i];if(n.from!=r.from||n.to!=r.to||n.size!=r.size)return!1}return!0}draw(t,e){return z.replace({widget:new H0(this.size*(e?t.scaleY:t.scaleX),e)}).range(this.from,this.to)}},H0=class extends Le{constructor(t,e){super(),this.size=t,this.vertical=e}eq(t){return t.size==this.size&&t.vertical==this.vertical}toDOM(){let t=document.createElement("div");return this.vertical?t.style.height=this.size+"px":(t.style.width=this.size+"px",t.style.height="2px",t.style.display="inline-block"),t}get estimatedHeight(){return this.vertical?this.size:-1}},$c=class{constructor(t){this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!0,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Qc,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=at.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let e=t.facet(eh).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new L0(e),this.stateDeco=t.facet(qn).filter(i=>typeof i!="function"),this.heightMap=he.empty().applyChanges(this.stateDeco,q.empty,this.heightOracle.setDoc(t.doc),[new li(0,0,0,t.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=z.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let i=0;i<=1;i++){let n=i?e.head:e.anchor;if(!t.some(({from:r,to:o})=>n>=r&&n<=o)){let{from:r,to:o}=this.lineBlockAt(n);t.push(new Os(r,o))}}this.viewports=t.sort((i,n)=>i.from-n.from),this.scaler=this.heightMap.height<=7e6?Qc:new K0(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,t=>{this.viewportLines.push(this.scaler.scale==1?t:Qn(t,this.scaler))})}update(t,e=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=this.state.facet(qn).filter(c=>typeof c!="function");let n=t.changedRanges,r=li.extendWithRanges(n,q0(i,this.stateDeco,t?t.changes:gt.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=o&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.head<a.from||e.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,e));let h=!t.changes.empty||t.flags&2||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),h&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(Dd)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let e=t.contentDOM,i=window.getComputedStyle(e),n=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?at.RTL:at.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=e.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let h=0,c=0;if(l.width&&l.height){let{scaleX:k,scaleY:w}=rd(e,l);(this.scaleX!=k||this.scaleY!=w)&&(this.scaleX=k,this.scaleY=w,h|=8,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=10),this.editorWidth!=t.scrollDOM.clientWidth&&(n.lineWrapping&&(a=!0),this.editorWidth=t.scrollDOM.clientWidth,h|=8);let d=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=ad(t.scrollDOM);let p=(this.printing?G0:_0)(e,this.paddingTop),g=p.top-this.pixelViewport.top,m=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let O=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(O!=this.inView&&(this.inView=O,O&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let y=l.width;if((this.contentDOMWidth!=y||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,h|=8),a){let k=t.docView.measureVisibleLineHeights(this.viewport);if(n.mustRefreshForHeights(k)&&(o=!0),o||n.lineWrapping&&Math.abs(y-this.contentDOMWidth)>n.charWidth){let{lineHeight:w,charWidth:$,textHeight:v}=t.docView.measureTextSize();o=w>0&&n.refresh(r,w,$,v,y/$,k),o&&(t.docView.minWidth=0,h|=8)}g>0&&m>0?c=Math.max(g,m):g<0&&m<0&&(c=Math.min(g,m)),n.heightChanged=!1;for(let w of this.viewports){let $=w.from==this.viewport.from?k:t.docView.measureVisibleLineHeights(w);this.heightMap=(o?he.empty().applyChanges(this.stateDeco,q.empty,this.heightOracle,[new li(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(n,0,o,new j0(w.from,$))}n.heightChanged&&(h|=2)}let x=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return x&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(h&2||x)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,t)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),n=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Os(n.lineAt(o-i*1e3,nt.ByHeight,r,0,0).from,n.lineAt(l+(1-i)*1e3,nt.ByHeight,r,0,0).to);if(e){let{head:h}=e.range;if(h<a.from||h>a.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=n.lineAt(h,nt.ByPos,r,0,0),u;e.y=="center"?u=(f.top+f.bottom)/2-c/2:e.y=="start"||e.y=="nearest"&&h<a.from?u=f.top:u=f.bottom-c,a=new Os(n.lineAt(u-1e3/2,nt.ByHeight,r,0,0).from,n.lineAt(u+c+1e3/2,nt.ByHeight,r,0,0).to)}}return a}mapViewport(t,e){let i=e.mapPos(t.from,-1),n=e.mapPos(t.to,1);return new Os(this.heightMap.lineAt(i,nt.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(n,nt.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:t,to:e},i=0){if(!this.inView)return!0;let{top:n}=this.heightMap.lineAt(t,nt.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(e,nt.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(t==0||n<=o-Math.max(10,Math.min(-i,250)))&&(e==this.state.doc.length||r>=l+Math.max(10,Math.min(i,250)))&&n>o-2*1e3&&r<l+2*1e3}mapLineGaps(t,e){if(!t.length||e.empty)return t;let i=[];for(let n of t)e.touchesRange(n.from,n.to)||i.push(new vo(e.mapPos(n.from),e.mapPos(n.to),n.size));return i}ensureLineGaps(t,e){let i=this.heightOracle.lineWrapping,n=i?1e4:2e3,r=n>>1,o=n<<1;if(this.defaultTextDirection!=at.LTR&&!i)return[];let l=[],a=(h,c,f,u)=>{if(c-h<r)return;let d=this.state.selection.main,p=[d.from];d.empty||p.push(d.to);for(let m of p)if(m>h&&m<c){a(h,m-10,f,u),a(m+10,c,f,u);return}let g=U0(t,m=>m.from>=f.from&&m.to<=f.to&&Math.abs(m.from-h)<r&&Math.abs(m.to-c)<r&&!p.some(O=>m.from<O&&m.to>O));if(!g){if(c<f.to&&e&&i&&e.visibleRanges.some(m=>m.from<=c&&m.to>=c)){let m=e.moveToLineBoundary(S.cursor(c),!1,!0).head;m>h&&(c=m)}g=new vo(h,c,this.gapSize(f,h,c,u))}l.push(g)};for(let h of this.viewportLines){if(h.length<o)continue;let c=F0(h.from,h.to,this.stateDeco);if(c.total<o)continue;let f=this.scrollTarget?this.scrollTarget.range.head:null,u,d;if(i){let p=n/this.heightOracle.lineLength*this.heightOracle.lineHeight,g,m;if(f!=null){let O=ys(c,f),y=((this.visibleBottom-this.visibleTop)/2+p)/h.height;g=O-y,m=O+y}else g=(this.visibleTop-h.top-p)/h.height,m=(this.visibleBottom-h.top+p)/h.height;u=bs(c,g),d=bs(c,m)}else{let p=c.total*this.heightOracle.charWidth,g=n*this.heightOracle.charWidth,m,O;if(f!=null){let y=ys(c,f),x=((this.pixelViewport.right-this.pixelViewport.left)/2+g)/p;m=y-x,O=y+x}else m=(this.pixelViewport.left-g)/p,O=(this.pixelViewport.right+g)/p;u=bs(c,m),d=bs(c,O)}u>h.from&&a(h.from,u,h,c),d<h.to&&a(d,h.to,h,c)}return l}gapSize(t,e,i,n){let r=ys(n,i)-ys(n,e);return this.heightOracle.lineWrapping?t.height*r:n.total*this.heightOracle.charWidth*r}updateLineGaps(t){vo.same(t,this.lineGaps)||(this.lineGaps=t,this.lineGapDeco=z.set(t.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let e=[];I.spans(t,this.viewport.from,this.viewport.to,{span(n,r){e.push({from:n,to:r})},point(){}},20);let i=e.length!=this.visibleRanges.length||this.visibleRanges.some((n,r)=>n.from!=e[r].from||n.to!=e[r].to);return this.visibleRanges=e,i?4:0}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(e=>e.from<=t&&e.to>=t)||Qn(this.heightMap.lineAt(t,nt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return Qn(this.heightMap.lineAt(this.scaler.fromDOM(t),nt.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(t){let e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0]}elementAtHeight(t){return Qn(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}},Os=class{constructor(t,e){this.from=t,this.to=e}};function F0(s,t,e){let i=[],n=s,r=0;return I.spans(e,s,t,{span(){},point(o,l){o>n&&(i.push({from:n,to:o}),r+=o-n),n=l}},20),n<t&&(i.push({from:n,to:t}),r+=t-n),{total:r,ranges:i}}function bs({total:s,ranges:t},e){if(e<=0)return t[0].from;if(e>=1)return t[t.length-1].to;let i=Math.floor(s*e);for(let n=0;;n++){let{from:r,to:o}=t[n],l=o-r;if(i<=l)return r+i;i-=l}}function ys(s,t){let e=0;for(let{from:i,to:n}of s.ranges){if(t<=n){e+=t-i;break}e+=n-i}return e/s.total}function U0(s,t){for(let e of s)if(t(e))return e}const Qc={toDOM(s){return s},fromDOM(s){return s},scale:1};let K0=class{constructor(t,e,i){let n=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let h=e.lineAt(l,nt.ByPos,t,0,0).top,c=e.lineAt(a,nt.ByPos,t,0,0).bottom;return n+=c-h,{from:l,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-n)/(e.height-n);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(t){for(let e=0,i=0,n=0;;e++){let r=e<this.viewports.length?this.viewports[e]:null;if(!r||t<r.top)return n+(t-i)*this.scale;if(t<=r.bottom)return r.domTop+(t-r.top);i=r.bottom,n=r.domBottom}}fromDOM(t){for(let e=0,i=0,n=0;;e++){let r=e<this.viewports.length?this.viewports[e]:null;if(!r||t<r.domTop)return i+(t-n)/this.scale;if(t<=r.domBottom)return r.top+(t-r.domTop);i=r.bottom,n=r.domBottom}}};function Qn(s,t){if(t.scale==1)return s;let e=t.toDOM(s.top),i=t.toDOM(s.bottom);return new ti(s.from,s.length,e,i-e,Array.isArray(s._content)?s._content.map(n=>Qn(n,t)):s._content)}const ws=P.define({combine:s=>s.join(" ")}),jl=P.define({combine:s=>s.indexOf(!0)>-1}),Vl=At.newName(),ip=At.newName(),np=At.newName(),sp={"&light":"."+ip,"&dark":"."+np};function Nl(s,t,e){return new At(t,{finish(i){return/&/.test(i)?i.replace(/&\w*/,n=>{if(n=="&")return s;if(!e||!e[n])throw new RangeError(`Unsupported selector: ${n}`);return e[n]}):s+" "+i}})}const J0=Nl("."+Vl,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0},".cm-content":{margin:0,flexGrow:2,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:"#444"},".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},"&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"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,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"}},sp),Pn="￿";let t1=class{constructor(t,e){this.points=t,this.text="",this.lineSeparator=e.facet(V.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=Pn}readRange(t,e){if(!t)return this;let i=t.parentNode;for(let n=t;;){this.findPointBefore(i,n);let r=this.text.length;this.readNode(n);let o=n.nextSibling;if(o==e)break;let l=dt.get(n),a=dt.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:Pc(n))||Pc(o)&&(n.nodeName!="BR"||n.cmIgnore)&&this.text.length>r)&&this.lineBreak(),n=o}return this.findPointBefore(i,e),this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e.length));for(let i=0,n=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=e.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=n.exec(e))&&(r=l.index,o=l[0].length),this.append(e.slice(i,r<0?e.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==t&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(t){if(t.cmIgnore)return;let e=dt.get(t),i=e&&e.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let n=i.iter();!n.next().done;)n.lineBreak?this.lineBreak():this.append(n.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointInside(t,e){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(e1(t,i.node,i.offset)?e:0))}};function e1(s,t,e){for(;;){if(!t||e<_e(t))return!1;if(t==s)return!0;e=In(t)+1,t=t.parentNode}}function Pc(s){return s.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(s.nodeName)}let Cc=class{constructor(t,e){this.node=t,this.offset=e,this.pos=-1}},i1=class{constructor(t,e,i,n){this.typeOver=n,this.bounds=null,this.text="";let{impreciseHead:r,impreciseAnchor:o}=t.docView;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,i,0))){let l=r||o?[]:r1(t),a=new t1(l,t.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=o1(l,this.bounds.from)}else{let l=t.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!bl(t.contentDOM,l.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(l.focusNode,l.focusOffset),h=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!bl(t.contentDOM,l.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(l.anchorNode,l.anchorOffset),c=t.viewport;if((E.ios||E.chrome)&&t.state.selection.main.empty&&a!=h&&(c.from>0||c.to<t.state.doc.length)){let f=Math.min(a,h),u=Math.max(a,h),d=c.from-f,p=c.to-u;(d==0||d==1||f==0)&&(p==0||p==-1||u==t.state.doc.length)&&(a=0,h=t.state.doc.length)}this.newSel=S.single(h,a)}}};function rp(s,t){let e,{newSel:i}=t,n=s.state.selection.main,r=s.inputState.lastKeyTime>Date.now()-100?s.inputState.lastKeyCode:-1;if(t.bounds){let{from:o,to:l}=t.bounds,a=n.from,h=null;(r===8||E.android&&t.text.length<l-o)&&(a=n.to,h="end");let c=s1(s.state.doc.sliceString(o,l,Pn),t.text,a-o,h);c&&(E.chrome&&r==13&&c.toB==c.from+2&&t.text.slice(c.from,c.toB)==Pn+Pn&&c.toB--,e={from:o+c.from,to:o+c.toA,insert:q.of(t.text.slice(c.from,c.toB).split(Pn))})}else i&&(!s.hasFocus&&s.state.facet(to)||i.main.eq(n))&&(i=null);if(!e&&!i)return!1;if(!e&&t.typeOver&&!n.empty&&i&&i.main.empty?e={from:n.from,to:n.to,insert:s.state.doc.slice(n.from,n.to)}:e&&e.from>=n.from&&e.to<=n.to&&(e.from!=n.from||e.to!=n.to)&&n.to-n.from-(e.to-e.from)<=4?e={from:n.from,to:n.to,insert:s.state.doc.slice(n.from,e.from).append(e.insert).append(s.state.doc.slice(e.to,n.to))}:(E.mac||E.android)&&e&&e.from==e.to&&e.from==n.head-1&&/^\. ?$/.test(e.insert.toString())&&s.contentDOM.getAttribute("autocorrect")=="off"?(i&&e.insert.length==2&&(i=S.single(i.main.anchor-1,i.main.head-1)),e={from:n.from,to:n.to,insert:q.of([" "])}):E.chrome&&e&&e.from==e.to&&e.from==n.head&&e.insert.toString()==`
9
+ `&&s.lineWrapping&&(i&&(i=S.single(i.main.anchor-1,i.main.head-1)),e={from:n.from,to:n.to,insert:q.of([" "])}),e){if(E.ios&&s.inputState.flushIOSKey()||E.android&&(e.from==n.from&&e.to==n.to&&e.insert.length==1&&e.insert.lines==2&&Vi(s.contentDOM,"Enter",13)||(e.from==n.from-1&&e.to==n.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>n.head)&&Vi(s.contentDOM,"Backspace",8)||e.from==n.from&&e.to==n.to+1&&e.insert.length==0&&Vi(s.contentDOM,"Delete",46)))return!0;let o=e.insert.toString();s.inputState.composing>=0&&s.inputState.composing++;let l,a=()=>l||(l=n1(s,e,i));return s.state.facet(Td).some(h=>h(s,e.from,e.to,o,a))||s.dispatch(a()),!0}else if(i&&!i.main.eq(n)){let o=!1,l="select";return s.inputState.lastSelectionTime>Date.now()-50&&(s.inputState.lastSelectionOrigin=="select"&&(o=!0),l=s.inputState.lastSelectionOrigin),s.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function n1(s,t,e){let i,n=s.state,r=n.selection.main;if(t.from>=r.from&&t.to<=r.to&&t.to-t.from>=(r.to-r.from)/3&&(!e||e.main.empty&&e.main.from==t.from+t.insert.length)&&s.inputState.composing<0){let l=r.from<t.from?n.sliceDoc(r.from,t.from):"",a=r.to>t.to?n.sliceDoc(t.to,r.to):"";i=n.replaceSelection(s.state.toText(l+t.insert.sliceString(0,void 0,s.state.lineBreak)+a))}else{let l=n.changes(t),a=e&&e.main.to<=l.newLength?e.main:void 0;if(n.selection.ranges.length>1&&s.inputState.composing>=0&&t.to<=r.to&&t.to>=r.to-10){let h=s.state.sliceDoc(t.from,t.to),c,f=e&&jd(s,e.main.head);if(f){let p=t.insert.length-(t.to-t.from);c={from:f.from,to:f.to-p}}else c=s.state.doc.lineAt(r.head);let u=r.to-t.to,d=r.to-r.from;i=n.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let g=p.to-u,m=g-h.length;if(p.to-p.from!=d||s.state.sliceDoc(m,g)!=h||p.to>=c.from&&p.from<=c.to)return{range:p};let O=n.changes({from:m,to:g,insert:t.insert}),y=p.to-r.to;return{changes:O,range:a?S.range(Math.max(0,a.anchor+y),Math.max(0,a.head+y)):p.map(O)}})}else i={changes:l,selection:a&&n.selection.replaceRange(a)}}let o="input.type";return(s.composing||s.inputState.compositionPendingChange&&s.inputState.compositionEndedAt>Date.now()-50)&&(s.inputState.compositionPendingChange=!1,o+=".compose",s.inputState.compositionFirstChange&&(o+=".start",s.inputState.compositionFirstChange=!1)),n.update(i,{userEvent:o,scrollIntoView:!0})}function s1(s,t,e,i){let n=Math.min(s.length,t.length),r=0;for(;r<n&&s.charCodeAt(r)==t.charCodeAt(r);)r++;if(r==n&&s.length==t.length)return null;let o=s.length,l=t.length;for(;o>0&&l>0&&s.charCodeAt(o-1)==t.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));e-=o+a-r}if(o<r&&s.length<t.length){let a=e<=r&&e>=o?r-e:0;r-=a,l=r+(l-o),o=r}else if(l<r){let a=e<=r&&e>=l?r-e:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function r1(s){let t=[];if(s.root.activeElement!=s.contentDOM)return t;let{anchorNode:e,anchorOffset:i,focusNode:n,focusOffset:r}=s.observer.selectionRange;return e&&(t.push(new Cc(e,i)),(n!=e||r!=i)&&t.push(new Cc(n,r))),t}function o1(s,t){if(s.length==0)return null;let e=s[0].pos,i=s.length==2?s[1].pos:e;return e>-1&&i>-1?S.single(e+t,i+t):null}const l1={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},$o=E.ie&&E.ie_version<=11;let a1=class{constructor(t){this.view=t,this.active=!1,this.selectionRange=new IO,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.parentCheck=-1,this.dom=t.contentDOM,this.observer=new MutationObserver(e=>{for(let i of e)this.queue.push(i);(E.ie&&E.ie_version<=11||E.ios&&t.composing)&&e.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),$o&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.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),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var e;((e=this.view.docView)===null||e===void 0?void 0:e.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(t.scrollDOM)),this.addWindowListeners(this.win=t.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.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(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500)}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((e,i)=>e!=t[i]))){this.gapIntersection.disconnect();for(let e of t)this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,n=this.selectionRange;if(i.state.facet(to)?i.root.activeElement!=this.dom:!Fs(i.dom,n))return;let r=n.anchorNode&&i.docView.nearest(n.anchorNode);if(r&&r.ignoreEvent(t)){e||(this.selectionChanged=!1);return}(E.ie&&E.ie_version<=11||E.android&&E.chrome)&&!i.state.selection.main.empty&&n.focusNode&&Yn(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=E.safari&&t.root.nodeType==11&&LO(this.dom.ownerDocument)==this.dom&&h1(this.view)||yr(t.root);if(!e||this.selectionRange.eq(e))return!1;let i=Fs(this.dom,e);return i&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime<Date.now()-300&&zO(this.dom,e)?(this.view.inputState.lastFocusTime=0,t.docView.updateSelection(),!1):(this.selectionRange.setRange(e),i&&(this.selectionChanged=!0),!0)}setSelectionRange(t,e){this.selectionRange.set(t.node,t.offset,e.node,e.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let t=0,e=null;for(let i=this.dom;i;)if(i.nodeType==1)!e&&t<this.scrollTargets.length&&this.scrollTargets[t]==i?t++:e||(e=this.scrollTargets.slice(0,t)),e&&e.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(t<this.scrollTargets.length&&!e&&(e=this.scrollTargets.slice(0,t)),e){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=e)i.addEventListener("scroll",this.onScroll)}}ignore(t){if(!this.active)return t();try{return this.stop(),t()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,l1),$o&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),$o&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(t,e){var i;if(!this.delayedAndroidKey){let n=()=>{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Vi(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(n)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let e=-1,i=-1,n=!1;for(let r of t){let o=this.readMutation(r);o&&(o.typeOver&&(n=!0),e==-1?{from:e,to:i}=o:(e=Math.min(o.from,e),i=Math.max(o.to,i)))}return{from:e,to:i,typeOver:n}}readChange(){let{from:t,to:e,typeOver:i}=this.processRecords(),n=this.selectionChanged&&Fs(this.dom,this.selectionRange);if(t<0&&!n)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new i1(this.view,t,e,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return this.view.requestMeasure(),!1;let i=this.view.state,n=rp(this.view,e);return this.view.state==i&&this.view.update([]),n}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty(t.type=="attributes"),t.type=="attributes"&&(e.flags|=4),t.type=="childList"){let i=Zc(e,t.previousSibling||t.target.previousSibling,-1),n=Zc(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:n?e.posBefore(n):e.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var t,e,i;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(e=this.gapIntersection)===null||e===void 0||e.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let n of this.scrollTargets)n.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}};function Zc(s,t,e){for(;t;){let i=dt.get(t);if(i&&i.parent==s)return i;let n=t.parentNode;t=n!=s.dom?n:e>0?t.nextSibling:t.previousSibling}return null}function h1(s){let t=null;function e(a){a.preventDefault(),a.stopImmediatePropagation(),t=a.getTargetRanges()[0]}if(s.contentDOM.addEventListener("beforeinput",e,!0),s.dom.ownerDocument.execCommand("indent"),s.contentDOM.removeEventListener("beforeinput",e,!0),!t)return null;let i=t.startContainer,n=t.startOffset,r=t.endContainer,o=t.endOffset,l=s.docView.domAtPos(s.state.selection.main.anchor);return Yn(l.node,l.offset,r,o)&&([i,n,r,o]=[r,o,i,n]),{anchorNode:i,anchorOffset:n,focusNode:r,focusOffset:o}}let X=class Il{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.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(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),t.parent&&t.parent.appendChild(this.dom);let{dispatch:e}=t;this.dispatchTransactions=t.dispatchTransactions||e&&(i=>i.forEach(n=>e(n,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=t.root||qO(t.parent)||document,this.viewState=new $c(t.state||V.create(t)),t.scrollTo&&t.scrollTo.is(ps)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(vn).map(i=>new So(i));for(let i of this.plugins)i.update(this);this.observer=new a1(this),this.inputState=new k0(this),this.inputState.ensureHandlers(this.plugins),this.docView=new lc(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...t){let e=t.length==1&&t[0]instanceof mt?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e=!1,i=!1,n,r=this.state;for(let u of t){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;t.some(u=>u.annotation(Fd))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=Ud(r,o),a||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(V.phrases)!=this.state.facet(V.phrases))return this.setState(r);n=oc.create(this,r,t),n.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of t){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new wo(d.empty?d:S.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is(ps)&&(f=d.value.clip(this.state))}this.viewState.update(n,f),this.bidiCache=Tc.update(this.bidiCache,n.changes),n.empty||(this.updatePlugins(n),this.inputState.update(n)),e=this.docView.update(n),this.state.facet($n)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(e,t.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(n.startState.facet(ws)!=n.state.facet(ws)&&(this.viewState.mustMeasureContent=!0),(e||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!n.empty)for(let u of this.state.facet(Dl))try{u(n)}catch(d){ee(this.state,d,"update listener")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!rp(this,c)&&h.force&&Vi(this.contentDOM,h.key,h.keyCode)})}setState(t){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=t;return}this.updateState=2;let e=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new $c(t),this.plugins=t.facet(vn).map(i=>new So(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new lc(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(vn),i=t.state.facet(vn);if(e!=i){let n=[];for(let r of i){let o=e.indexOf(r);if(o<0)n.push(new So(r));else{let l=this.plugins[o];l.mustUpdate=t,n.push(l)}}for(let r of this.plugins)r.mustUpdate!=t&&r.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let n of this.plugins)n.mustUpdate=t;for(let n=0;n<this.plugins.length;n++)this.plugins[n].update(this);e!=i&&this.inputState.ensureHandlers(this.plugins)}measure(t=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,i=this.scrollDOM,n=i.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(n-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(ad(i))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(n);r=d.from,o=d.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 h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return ee(this.state,p),Ac}}),f=oc.create(this,this.state,[]),u=!1;f.flags|=a,e?e.flags|=a:e=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f));for(let d=0;d<h.length;d++)if(c[d]!=Ac)try{let p=h[d];p.write&&p.write(c[d],this)}catch(p){ee(this.state,p)}if(u&&this.docView.updateSelection(!0),!f.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let p=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o;if(p>1||p<-1){n=n+p,i.scrollTop=n/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let l of this.state.facet(Dl))l(e)}get themeClasses(){return Vl+" "+(this.state.facet(jl)?np:ip)+" "+this.state.facet(ws)}updateAttrs(){let t=Mc(this,Wd,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(to)?"true":"false",class:"cm-content",style:`${E.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),Mc(this,eh,e);let i=this.observer.ignore(()=>{let n=Zl(this.contentDOM,this.contentAttrs,e),r=Zl(this.dom,this.editorAttrs,t);return n||r});return this.editorAttrs=t,this.contentAttrs=e,i}showAnnouncements(t){let e=!0;for(let i of t)for(let n of i.effects)if(n.is(Il.announce)){e&&(this.announceDOM.textContent=""),e=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=n.value}}mountStyles(){this.styleModules=this.state.facet($n);let t=this.state.facet(Il.cspNonce);At.mount(this.root,this.styleModules.concat(J0).reverse(),t?{nonce:t}: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(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let e=0;e<this.measureRequests.length;e++)if(this.measureRequests[e].key===t.key){this.measureRequests[e]=t;return}}this.measureRequests.push(t)}}plugin(t){let e=this.pluginMap.get(t);return(e===void 0||e&&e.spec!=t)&&this.pluginMap.set(t,e=this.plugins.find(i=>i.spec==t)||null),e&&e.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(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,i){return ko(this,t,dc(this,t,e,i))}moveByGroup(t,e){return ko(this,t,dc(this,t,e,i=>S0(this,t.head,i)))}visualLineSide(t,e){let i=this.bidiSpans(t),n=this.textDirectionAt(t.from),r=i[e?i.length-1:0];return S.cursor(r.side(e,n)+t.from,r.forward(!e,n)?1:-1)}moveToLineBoundary(t,e,i=!0){return w0(this,t,e,i)}moveVertically(t,e,i){return ko(this,t,x0(this,t,e,i))}domAtPos(t){return this.docView.domAtPos(t)}posAtDOM(t,e=0){return this.docView.posFromDOM(t,e)}posAtCoords(t,e=!0){return this.readMeasured(),Nd(this,t,e)}coordsAtPos(t,e=1){this.readMeasured();let i=this.docView.coordsAt(t,e);if(!i||i.left==i.right)return i;let n=this.state.doc.lineAt(t),r=this.bidiSpans(n),o=r[ri.find(r,t-n.from,-1,e)];return Kr(i,o.dir==at.LTR==e>0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(Rd)||t<this.viewport.from||t>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>c1)return $d(t.length);let e=this.textDirectionAt(t.from),i;for(let r of this.bidiCache)if(r.from==t.from&&r.dir==e&&(r.fresh||vd(r.isolates,i=rc(this,t))))return r.order;i||(i=rc(this,t));let n=s0(t.text,e,i);return this.bidiCache.push(new Tc(t.from,t.to,e,i,!0,n)),n}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||E.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{od(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let t of this.plugins)t.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(t,e={}){return ps.of(new wo(typeof t=="number"?S.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return ps.of(new wo(S.cursor(i.from),"start","start",i.top-t,e,!0))}static domEventHandlers(t){return Tt.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return Tt.define(()=>({}),{eventObservers:t})}static theme(t,e){let i=At.newName(),n=[ws.of(i),$n.of(Nl(`.${i}`,t))];return e&&e.dark&&n.push(jl.of(!0)),n}static baseTheme(t){return pe.lowest($n.of(Nl("."+Vl,t,sp)))}static findFromDOM(t){var e;let i=t.querySelector(".cm-content"),n=i&&dt.get(i)||dt.get(t);return((e=n==null?void 0:n.rootView)===null||e===void 0?void 0:e.view)||null}};X.styleModule=$n;X.inputHandler=Td;X.focusChangeEffect=Md;X.perLineTextDirection=Rd;X.exceptionSink=Ad;X.updateListener=Dl;X.editable=to;X.mouseSelectionStyle=Zd;X.dragMovesSelection=Cd;X.clickAddsSelectionRange=Pd;X.decorations=qn;X.outerDecorations=Ed;X.atomicRanges=ih;X.bidiIsolatedRanges=Bd;X.scrollMargins=Yd;X.darkTheme=jl;X.cspNonce=P.define({combine:s=>s.length?s[0]:""});X.contentAttributes=eh;X.editorAttributes=Wd;X.lineWrapping=X.contentAttributes.of({class:"cm-lineWrapping"});X.announce=j.define();const c1=4096,Ac={};let Tc=class op{constructor(t,e,i,n,r,o){this.from=t,this.to=e,this.dir=i,this.isolates=n,this.fresh=r,this.order=o}static update(t,e){if(e.empty&&!t.some(r=>r.fresh))return t;let i=[],n=t.length?t[t.length-1].dir:at.LTR;for(let r=Math.max(0,t.length-10);r<t.length;r++){let o=t[r];o.dir==n&&!e.touchesRange(o.from,o.to)&&i.push(new op(e.mapPos(o.from,1),e.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}};function Mc(s,t,e){for(let i=s.state.facet(t),n=i.length-1;n>=0;n--){let r=i[n],o=typeof r=="function"?r(s):r;o&&Cl(o,e)}return e}const f1=E.mac?"mac":E.windows?"win":E.linux?"linux":"key";function u1(s,t){const e=s.split(/-(?!$)/);let i=e[e.length-1];i=="Space"&&(i=" ");let n,r,o,l;for(let a=0;a<e.length-1;++a){const h=e[a];if(/^(cmd|meta|m)$/i.test(h))l=!0;else if(/^a(lt)?$/i.test(h))n=!0;else if(/^(c|ctrl|control)$/i.test(h))r=!0;else if(/^s(hift)?$/i.test(h))o=!0;else if(/^mod$/i.test(h))t=="mac"?l=!0:r=!0;else throw new Error("Unrecognized modifier name: "+h)}return n&&(i="Alt-"+i),r&&(i="Ctrl-"+i),l&&(i="Meta-"+i),o&&(i="Shift-"+i),i}function Ss(s,t,e){return t.altKey&&(s="Alt-"+s),t.ctrlKey&&(s="Ctrl-"+s),t.metaKey&&(s="Meta-"+s),e!==!1&&t.shiftKey&&(s="Shift-"+s),s}const d1=pe.default(X.domEventHandlers({keydown(s,t){return O1(p1(t.state),s,t,"editor")}})),is=P.define({enables:d1}),Rc=new WeakMap;function p1(s){let t=s.facet(is),e=Rc.get(t);return e||Rc.set(t,e=m1(t.reduce((i,n)=>i.concat(n),[]))),e}let ei=null;const g1=4e3;function m1(s,t=f1){let e=Object.create(null),i=Object.create(null),n=(o,l)=>{let a=i[o];if(a==null)i[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,h,c)=>{var f,u;let d=e[o]||(e[o]=Object.create(null)),p=l.split(/ (?!$)/).map(O=>u1(O,t));for(let O=1;O<p.length;O++){let y=p.slice(0,O).join(" ");n(y,!0),d[y]||(d[y]={preventDefault:!0,stopPropagation:!1,run:[x=>{let k=ei={view:x,prefix:y,scope:o};return setTimeout(()=>{ei==k&&(ei=null)},g1),!0}]})}let g=p.join(" ");n(g,!1);let m=d[g]||(d[g]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&m.run.push(a),h&&(m.preventDefault=!0),c&&(m.stopPropagation=!0)};for(let o of s){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of l){let c=e[h]||(e[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let f in c)c[f].run.push(o.any)}let a=o[t]||o.key;if(a)for(let h of l)r(h,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(h,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return e}function O1(s,t,e,i){let n=sd(t),r=xt(n,0),o=Gt(r)==n.length&&n!=" ",l="",a=!1,h=!1,c=!1;ei&&ei.view==e&&ei.scope==i&&(l=ei.prefix+" ",qd.indexOf(t.keyCode)<0&&(h=!0,ei=null));let f=new Set,u=m=>{if(m){for(let O of m.run)if(!f.has(O)&&(f.add(O),O(e,t)))return m.stopPropagation&&(c=!0),!0;m.preventDefault&&(m.stopPropagation&&(c=!0),h=!0)}return!1},d=s[i],p,g;return d&&(u(d[l+Ss(n,t,!o)])?a=!0:o&&(t.altKey||t.metaKey||t.ctrlKey)&&!(E.windows&&t.ctrlKey&&t.altKey)&&(p=ze[t.keyCode])&&p!=n?(u(d[l+Ss(p,t,!0)])||t.shiftKey&&(g=Fi[t.keyCode])!=n&&g!=p&&u(d[l+Ss(g,t,!1)]))&&(a=!0):o&&t.shiftKey&&u(d[l+Ss(n,t,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&t.stopPropagation(),a}class ns{constructor(t,e,i,n,r){this.className=t,this.left=e,this.top=i,this.width=n,this.height=r}draw(){let t=document.createElement("div");return t.className=this.className,this.adjust(t),t}update(t,e){return e.className!=this.className?!1:(this.adjust(t),!0)}adjust(t){t.style.left=this.left+"px",t.style.top=this.top+"px",this.width!=null&&(t.style.width=this.width+"px"),t.style.height=this.height+"px"}eq(t){return this.left==t.left&&this.top==t.top&&this.width==t.width&&this.height==t.height&&this.className==t.className}static forRange(t,e,i){if(i.empty){let n=t.coordsAtPos(i.head,i.assoc||1);if(!n)return[];let r=lp(t);return[new ns(e,n.left-r.left,n.top-r.top,null,n.bottom-n.top)]}else return b1(t,e,i)}}function lp(s){let t=s.scrollDOM.getBoundingClientRect();return{left:(s.textDirection==at.LTR?t.left:t.right-s.scrollDOM.clientWidth*s.scaleX)-s.scrollDOM.scrollLeft*s.scaleX,top:t.top-s.scrollDOM.scrollTop*s.scaleY}}function Dc(s,t,e){let i=S.cursor(t);return{from:Math.max(e.from,s.moveToLineBoundary(i,!1,!0).from),to:Math.min(e.to,s.moveToLineBoundary(i,!0,!0).from),type:Et.Text}}function b1(s,t,e){if(e.to<=s.viewport.from||e.from>=s.viewport.to)return[];let i=Math.max(e.from,s.viewport.from),n=Math.min(e.to,s.viewport.to),r=s.textDirection==at.LTR,o=s.contentDOM,l=o.getBoundingClientRect(),a=lp(s),h=o.querySelector(".cm-line"),c=h&&window.getComputedStyle(h),f=l.left+(c?parseInt(c.paddingLeft)+Math.min(0,parseInt(c.textIndent)):0),u=l.right-(c?parseInt(c.paddingRight):0),d=Yl(s,i),p=Yl(s,n),g=d.type==Et.Text?d:null,m=p.type==Et.Text?p:null;if(g&&(s.lineWrapping||d.widgetLineBreaks)&&(g=Dc(s,i,g)),m&&(s.lineWrapping||p.widgetLineBreaks)&&(m=Dc(s,n,m)),g&&m&&g.from==m.from)return y(x(e.from,e.to,g));{let w=g?x(e.from,null,g):k(d,!1),$=m?x(null,e.to,m):k(p,!0),v=[];return(g||d).to<(m||p).from-(g&&m?1:0)||d.widgetLineBreaks>1&&w.bottom+s.defaultLineHeight/2<$.top?v.push(O(f,w.bottom,u,$.top)):w.bottom<$.top&&s.elementAtHeight((w.bottom+$.top)/2).type==Et.Text&&(w.bottom=$.top=(w.bottom+$.top)/2),y(w).concat(v).concat(y($))}function O(w,$,v,R){return new ns(t,w-a.left,$-a.top-.01,v-w,R-$+.01)}function y({top:w,bottom:$,horizontal:v}){let R=[];for(let Z=0;Z<v.length;Z+=2)R.push(O(v[Z],w,v[Z+1],$));return R}function x(w,$,v){let R=1e9,Z=-1e9,D=[];function A(B,N,U,H,ot){let it=s.coordsAtPos(B,B==v.to?-2:2),lt=s.coordsAtPos(U,U==v.from?2:-2);!it||!lt||(R=Math.min(it.top,lt.top,R),Z=Math.max(it.bottom,lt.bottom,Z),ot==at.LTR?D.push(r&&N?f:it.left,r&&H?u:lt.right):D.push(!r&&H?f:lt.left,!r&&N?u:it.right))}let C=w??v.from,Y=$??v.to;for(let B of s.visibleRanges)if(B.to>C&&B.from<Y)for(let N=Math.max(B.from,C),U=Math.min(B.to,Y);;){let H=s.state.doc.lineAt(N);for(let ot of s.bidiSpans(H)){let it=ot.from+H.from,lt=ot.to+H.from;if(it>=U)break;lt>N&&A(Math.max(it,N),w==null&&it<=C,Math.min(lt,U),$==null&&lt>=Y,ot.dir)}if(N=H.to+1,N>=U)break}return D.length==0&&A(C,w==null,Y,$==null,s.textDirection),{top:R,bottom:Z,horizontal:D}}function k(w,$){let v=l.top+($?w.top:w.bottom);return{top:v,bottom:v,horizontal:[]}}}function y1(s,t){return s.constructor==t.constructor&&s.eq(t)}class w1{constructor(t,e){this.view=t,this.layer=e,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=t.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),e.above&&this.dom.classList.add("cm-layer-above"),e.class&&this.dom.classList.add(e.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(t.state),t.requestMeasure(this.measureReq),e.mount&&e.mount(this.dom,t)}update(t){t.startState.facet(sr)!=t.state.facet(sr)&&this.setOrder(t.state),(this.layer.update(t,this.dom)||t.geometryChanged)&&(this.scale(),t.view.requestMeasure(this.measureReq))}setOrder(t){let e=0,i=t.facet(sr);for(;e<i.length&&i[e]!=this.layer;)e++;this.dom.style.zIndex=String((this.layer.above?150:-1)-e)}measure(){return this.layer.markers(this.view)}scale(){let{scaleX:t,scaleY:e}=this.view;(t!=this.scaleX||e!=this.scaleY)&&(this.scaleX=t,this.scaleY=e,this.dom.style.transform=`scale(${1/t}, ${1/e})`)}draw(t){if(t.length!=this.drawn.length||t.some((e,i)=>!y1(e,this.drawn[i]))){let e=this.dom.firstChild,i=0;for(let n of t)n.update&&e&&n.constructor&&this.drawn[i].constructor&&n.update(e,this.drawn[i])?(e=e.nextSibling,i++):this.dom.insertBefore(n.draw(),e);for(;e;){let n=e.nextSibling;e.remove(),e=n}this.drawn=t}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const sr=P.define();function ap(s){return[Tt.define(t=>new w1(t,s)),sr.of(s)]}const hp=!E.ios,zn=P.define({combine(s){return Xe(s,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(t,e)=>Math.min(t,e),drawRangeCursor:(t,e)=>t||e})}});function S1(s={}){return[zn.of(s),x1,k1,v1,Dd.of(!0)]}function cp(s){return s.startState.facet(zn)!=s.state.facet(zn)}const x1=ap({above:!0,markers(s){let{state:t}=s,e=t.facet(zn),i=[];for(let n of t.selection.ranges){let r=n==t.selection.main;if(n.empty?!r||hp:e.drawRangeCursor){let o=r?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",l=n.empty?n:S.cursor(n.head,n.head>n.anchor?-1:1);for(let a of ns.forRange(s,o,l))i.push(a)}}return i},update(s,t){s.transactions.some(i=>i.selection)&&(t.style.animationName=t.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let e=cp(s);return e&&Wc(s.state,t),s.docChanged||s.selectionSet||e},mount(s,t){Wc(t.state,s)},class:"cm-cursorLayer"});function Wc(s,t){t.style.animationDuration=s.facet(zn).cursorBlinkRate+"ms"}const k1=ap({above:!1,markers(s){return s.state.selection.ranges.map(t=>t.empty?[]:ns.forRange(s,"cm-selectionBackground",t)).reduce((t,e)=>t.concat(e))},update(s,t){return s.docChanged||s.selectionSet||s.viewportChanged||cp(s)},class:"cm-selectionLayer"}),ql={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};hp&&(ql[".cm-line"].caretColor="transparent !important",ql[".cm-content"]={caretColor:"transparent !important"});const v1=pe.highest(X.theme(ql)),fp=j.define({map(s,t){return s==null?null:t.mapPos(s)}}),Cn=wt.define({create(){return null},update(s,t){return s!=null&&(s=t.changes.mapPos(s)),t.effects.reduce((e,i)=>i.is(fp)?i.value:e,s)}}),$1=Tt.fromClass(class{constructor(s){this.view=s,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(s){var t;let e=s.state.field(Cn);e==null?this.cursor!=null&&((t=this.cursor)===null||t===void 0||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(s.startState.field(Cn)!=e||s.docChanged||s.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:s}=this,t=s.state.field(Cn),e=t!=null&&s.coordsAtPos(t);if(!e)return null;let i=s.scrollDOM.getBoundingClientRect();return{left:e.left-i.left+s.scrollDOM.scrollLeft*s.scaleX,top:e.top-i.top+s.scrollDOM.scrollTop*s.scaleY,height:e.bottom-e.top}}drawCursor(s){if(this.cursor){let{scaleX:t,scaleY:e}=this.view;s?(this.cursor.style.left=s.left/t+"px",this.cursor.style.top=s.top/e+"px",this.cursor.style.height=s.height/e+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(s){this.view.state.field(Cn)!=s&&this.view.dispatch({effects:fp.of(s)})}},{eventObservers:{dragover(s){this.setDropPos(this.view.posAtCoords({x:s.clientX,y:s.clientY}))},dragleave(s){(s.target==this.view.contentDOM||!this.view.contentDOM.contains(s.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function Q1(){return[Cn,$1]}function Ec(s,t,e,i,n){t.lastIndex=0;for(let r=s.iterRange(e,i),o=e,l;!r.next().done;o+=r.value.length)if(!r.lineBreak)for(;l=t.exec(r.value);)n(o+l.index,l)}function P1(s,t){let e=s.visibleRanges;if(e.length==1&&e[0].from==s.viewport.from&&e[0].to==s.viewport.to)return e;let i=[];for(let{from:n,to:r}of e)n=Math.max(s.state.doc.lineAt(n).from,n-t),r=Math.min(s.state.doc.lineAt(r).to,r+t),i.length&&i[i.length-1].to>=n?i[i.length-1].to=r:i.push({from:n,to:r});return i}class C1{constructor(t){const{regexp:e,decoration:i,decorate:n,boundary:r,maxLength:o=1e3}=t;if(!e.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=e,n)this.addMatch=(l,a,h,c)=>n(c,h,h+l[0].length,l,a);else if(typeof i=="function")this.addMatch=(l,a,h,c)=>{let f=i(l,a,h);f&&c(h,h+l[0].length,f)};else if(i)this.addMatch=(l,a,h,c)=>c(h,h+l[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=r,this.maxLength=o}createDeco(t){let e=new qe,i=e.add.bind(e);for(let{from:n,to:r}of P1(t,this.maxLength))Ec(t.state.doc,this.regexp,n,r,(o,l)=>this.addMatch(l,t,o,i));return e.finish()}updateDeco(t,e){let i=1e9,n=-1;return t.docChanged&&t.changes.iterChanges((r,o,l,a)=>{a>t.view.viewport.from&&l<t.view.viewport.to&&(i=Math.min(l,i),n=Math.max(a,n))}),t.viewportChanged||n-i>1e3?this.createDeco(t.view):n>-1?this.updateRange(t.view,e.map(t.changes),i,n):e}updateRange(t,e,i,n){for(let r of t.visibleRanges){let o=Math.max(r.from,i),l=Math.min(r.to,n);if(l>o){let a=t.state.doc.lineAt(o),h=a.to<l?t.state.doc.lineAt(l):a,c=Math.max(r.from,a.from),f=Math.min(r.to,h.to);if(this.boundary){for(;o>a.from;o--)if(this.boundary.test(a.text[o-1-a.from])){c=o;break}for(;l<h.to;l++)if(this.boundary.test(h.text[l-h.from])){f=l;break}}let u=[],d,p=(g,m,O)=>u.push(O.range(g,m));if(a==h)for(this.regexp.lastIndex=c-a.from;(d=this.regexp.exec(a.text))&&d.index<f-a.from;)this.addMatch(d,t,d.index+a.from,p);else Ec(t.state.doc,this.regexp,c,f,(g,m)=>this.addMatch(m,t,g,p));e=e.update({filterFrom:c,filterTo:f,filter:(g,m)=>g<c||m>f,add:u})}}return e}}const zl=/x/.unicode!=null?"gu":"g",Z1=new RegExp(`[\0-\b
10
+ --Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,zl),A1={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Qo=null;function T1(){var s;if(Qo==null&&typeof document<"u"&&document.body){let t=document.body.style;Qo=((s=t.tabSize)!==null&&s!==void 0?s:t.MozTabSize)!=null}return Qo||!1}const rr=P.define({combine(s){let t=Xe(s,{render:null,specialChars:Z1,addSpecialChars:null});return(t.replaceTabs=!T1())&&(t.specialChars=new RegExp(" |"+t.specialChars.source,zl)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,zl)),t}});function M1(s={}){return[rr.of(s),R1()]}let Bc=null;function R1(){return Bc||(Bc=Tt.fromClass(class{constructor(s){this.view=s,this.decorations=z.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(s.state.facet(rr)),this.decorations=this.decorator.createDeco(s)}makeDecorator(s){return new C1({regexp:s.specialChars,decoration:(t,e,i)=>{let{doc:n}=e.state,r=xt(t[0],0);if(r==9){let o=n.lineAt(i),l=e.state.tabSize,a=Ti(o.text,l,i-o.from);return z.replace({widget:new B1((l-a%l)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[r]||(this.decorationCache[r]=z.replace({widget:new E1(s,r)}))},boundary:s.replaceTabs?void 0:/[^]/})}update(s){let t=s.state.facet(rr);s.startState.facet(rr)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(s.view)):this.decorations=this.decorator.updateDeco(s,this.decorations)}},{decorations:s=>s.decorations}))}const D1="•";function W1(s){return s>=32?D1:s==10?"␤":String.fromCharCode(9216+s)}class E1 extends Le{constructor(t,e){super(),this.options=t,this.code=e}eq(t){return t.code==this.code}toDOM(t){let e=W1(this.code),i=t.state.phrase("Control character")+" "+(A1[this.code]||"0x"+this.code.toString(16)),n=this.options.render&&this.options.render(this.code,i,e);if(n)return n;let r=document.createElement("span");return r.textContent=e,r.title=i,r.setAttribute("aria-label",i),r.className="cm-specialChar",r}ignoreEvent(){return!1}}class B1 extends Le{constructor(t){super(),this.width=t}eq(t){return t.width==this.width}toDOM(){let t=document.createElement("span");return t.textContent=" ",t.className="cm-tab",t.style.width=this.width+"px",t}ignoreEvent(){return!1}}function Y1(){return L1}const X1=z.line({class:"cm-activeLine"}),L1=Tt.fromClass(class{constructor(s){this.decorations=this.getDeco(s)}update(s){(s.docChanged||s.selectionSet)&&(this.decorations=this.getDeco(s.view))}getDeco(s){let t=-1,e=[];for(let i of s.state.selection.ranges){let n=s.lineBlockAt(i.head);n.from>t&&(e.push(X1.range(n.from)),t=n.from)}return z.set(e)}},{decorations:s=>s.decorations});class j1 extends Le{constructor(t){super(),this.content=t}toDOM(){let t=document.createElement("span");return t.className="cm-placeholder",t.style.pointerEvents="none",t.appendChild(typeof this.content=="string"?document.createTextNode(this.content):this.content),typeof this.content=="string"?t.setAttribute("aria-label","placeholder "+this.content):t.setAttribute("aria-hidden","true"),t}coordsAt(t){let e=t.firstChild?Ui(t.firstChild):[];if(!e.length)return null;let i=window.getComputedStyle(t.parentNode),n=Kr(e[0],i.direction!="rtl"),r=parseInt(i.lineHeight);return n.bottom-n.top>r*1.5?{left:n.left,right:n.right,top:n.top,bottom:n.top+r}:n}ignoreEvent(){return!1}}function V1(s){return Tt.fromClass(class{constructor(t){this.view=t,this.placeholder=s?z.set([z.widget({widget:new j1(s),side:1}).range(0)]):z.none}get decorations(){return this.view.state.doc.length?z.none:this.placeholder}},{decorations:t=>t.decorations})}const _l=2e3;function N1(s,t,e){let i=Math.min(t.line,e.line),n=Math.max(t.line,e.line),r=[];if(t.off>_l||e.off>_l||t.col<0||e.col<0){let o=Math.min(t.off,e.off),l=Math.max(t.off,e.off);for(let a=i;a<=n;a++){let h=s.doc.line(a);h.length<=l&&r.push(S.range(h.from+o,h.to+l))}}else{let o=Math.min(t.col,e.col),l=Math.max(t.col,e.col);for(let a=i;a<=n;a++){let h=s.doc.line(a),c=br(h.text,o,s.tabSize,!0);if(c<0)r.push(S.cursor(h.to));else{let f=br(h.text,l,s.tabSize);r.push(S.range(h.from+c,h.from+f))}}}return r}function I1(s,t){let e=s.coordsAtPos(s.viewport.from);return e?Math.round(Math.abs((e.left-t)/s.defaultCharacterWidth)):-1}function Yc(s,t){let e=s.posAtCoords({x:t.clientX,y:t.clientY},!1),i=s.state.doc.lineAt(e),n=e-i.from,r=n>_l?-1:n==i.length?I1(s,t.clientX):Ti(i.text,s.state.tabSize,e-i.from);return{line:i.number,col:r,off:n}}function q1(s,t){let e=Yc(s,t),i=s.state.selection;return e?{update(n){if(n.docChanged){let r=n.changes.mapPos(n.startState.doc.line(e.line).from),o=n.state.doc.lineAt(r);e={line:o.number,col:e.col,off:Math.min(e.off,o.length)},i=i.map(n.changes)}},get(n,r,o){let l=Yc(s,n);if(!l)return i;let a=N1(s.state,e,l);return a.length?o?S.create(a.concat(i.ranges)):S.create(a):i}}:null}function z1(s){let t=(s==null?void 0:s.eventFilter)||(e=>e.altKey&&e.button==0);return X.mouseSelectionStyle.of((e,i)=>t(i)?q1(e,i):null)}const _1={Alt:[18,s=>!!s.altKey],Control:[17,s=>!!s.ctrlKey],Shift:[16,s=>!!s.shiftKey],Meta:[91,s=>!!s.metaKey]},G1={style:"cursor: crosshair"};function H1(s={}){let[t,e]=_1[s.key||"Alt"],i=Tt.fromClass(class{constructor(n){this.view=n,this.isDown=!1}set(n){this.isDown!=n&&(this.isDown=n,this.view.update([]))}},{eventObservers:{keydown(n){this.set(n.keyCode==t||e(n))},keyup(n){(n.keyCode==t||!e(n))&&this.set(!1)},mousemove(n){this.set(e(n))}}});return[i,X.contentAttributes.of(n=>{var r;return!((r=n.plugin(i))===null||r===void 0)&&r.isDown?G1:null})]}const mn="-10000px";class up{constructor(t,e,i,n){this.facet=e,this.createTooltipView=i,this.removeTooltipView=n,this.input=t.state.facet(e),this.tooltips=this.input.filter(o=>o);let r=null;this.tooltipViews=this.tooltips.map(o=>r=i(o,r))}update(t,e){var i;let n=t.state.facet(this.facet),r=n.filter(a=>a);if(n===this.input){for(let a of this.tooltipViews)a.update&&a.update(t);return!1}let o=[],l=e?[]:null;for(let a=0;a<r.length;a++){let h=r[a],c=-1;if(h){for(let f=0;f<this.tooltips.length;f++){let u=this.tooltips[f];u&&u.create==h.create&&(c=f)}if(c<0)o[a]=this.createTooltipView(h,a?o[a-1]:null),l&&(l[a]=!!h.above);else{let f=o[a]=this.tooltipViews[c];l&&(l[a]=e[c]),f.update&&f.update(t)}}}for(let a of this.tooltipViews)o.indexOf(a)<0&&(this.removeTooltipView(a),(i=a.destroy)===null||i===void 0||i.call(a));return e&&(l.forEach((a,h)=>e[h]=a),e.length=l.length),this.input=n,this.tooltips=r,this.tooltipViews=o,!0}}function F1(s){let{win:t}=s;return{top:0,left:0,bottom:t.innerHeight,right:t.innerWidth}}const Po=P.define({combine:s=>{var t,e,i;return{position:E.ios?"absolute":((t=s.find(n=>n.position))===null||t===void 0?void 0:t.position)||"fixed",parent:((e=s.find(n=>n.parent))===null||e===void 0?void 0:e.parent)||null,tooltipSpace:((i=s.find(n=>n.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||F1}}}),Xc=new WeakMap,nh=Tt.fromClass(class{constructor(s){this.view=s,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=s.state.facet(Po);this.position=t.position,this.parent=t.parent,this.classes=s.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 up(s,sh,(e,i)=>this.createTooltip(e,i),e=>{this.resizeObserver&&this.resizeObserver.unobserve(e.dom),e.dom.remove()}),this.above=this.manager.tooltips.map(e=>!!e.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),s.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 s of this.manager.tooltipViews)this.intersectionObserver.observe(s.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(s){s.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(s,this.above);t&&this.observeIntersection();let e=t||s.geometryChanged,i=s.state.facet(Po);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let n of this.manager.tooltipViews)n.dom.style.position=this.position;e=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let n of this.manager.tooltipViews)this.container.appendChild(n.dom);e=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);e&&this.maybeMeasure()}createTooltip(s,t){let e=s.create(this.view),i=t?t.dom:null;if(e.dom.classList.add("cm-tooltip"),s.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let n=document.createElement("div");n.className="cm-tooltip-arrow",e.dom.insertBefore(n,i)}return e.dom.style.position=this.position,e.dom.style.top=mn,e.dom.style.left="0px",this.container.insertBefore(e.dom,i),e.mount&&e.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(e.dom),e}destroy(){var s,t,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let i of this.manager.tooltipViews)i.dom.remove(),(s=i.destroy)===null||s===void 0||s.call(i);this.parent&&this.container.remove(),(t=this.resizeObserver)===null||t===void 0||t.disconnect(),(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let s=this.view.dom.getBoundingClientRect(),t=1,e=1,i=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:n}=this.manager.tooltipViews[0];if(E.gecko)i=n.offsetParent!=this.container.ownerDocument.body;else if(n.style.top==mn&&n.style.left=="0px"){let r=n.getBoundingClientRect();i=Math.abs(r.top+1e4)>1||Math.abs(r.left)>1}}if(i||this.position=="absolute")if(this.parent){let n=this.parent.getBoundingClientRect();n.width&&n.height&&(t=n.width/this.parent.offsetWidth,e=n.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:e}=this.view.viewState);return{editor:s,parent:this.parent?this.container.getBoundingClientRect():s,pos:this.manager.tooltips.map((n,r)=>{let o=this.manager.tooltipViews[r];return o.getCoords?o.getCoords(n.pos):this.view.coordsAtPos(n.pos)}),size:this.manager.tooltipViews.map(({dom:n})=>n.getBoundingClientRect()),space:this.view.state.facet(Po).tooltipSpace(this.view),scaleX:t,scaleY:e,makeAbsolute:i}}writeMeasure(s){var t;if(s.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let l of this.manager.tooltipViews)l.dom.style.position="absolute"}let{editor:e,space:i,scaleX:n,scaleY:r}=s,o=[];for(let l=0;l<this.manager.tooltips.length;l++){let a=this.manager.tooltips[l],h=this.manager.tooltipViews[l],{dom:c}=h,f=s.pos[l],u=s.size[l];if(!f||f.bottom<=Math.max(e.top,i.top)||f.top>=Math.min(e.bottom,i.bottom)||f.right<Math.max(e.left,i.left)-.1||f.left>Math.min(e.right,i.right)+.1){c.style.top=mn;continue}let d=a.arrow?h.dom.querySelector(".cm-tooltip-arrow"):null,p=d?7:0,g=u.right-u.left,m=(t=Xc.get(h))!==null&&t!==void 0?t:u.bottom-u.top,O=h.offset||K1,y=this.view.textDirection==at.LTR,x=u.width>i.right-i.left?y?i.left:i.right-u.width:y?Math.min(f.left-(d?14:0)+O.x,i.right-g):Math.max(i.left,f.left-g+(d?14:0)-O.x),k=this.above[l];!a.strictSide&&(k?f.top-(u.bottom-u.top)-O.y<i.top:f.bottom+(u.bottom-u.top)+O.y>i.bottom)&&k==i.bottom-f.bottom>f.top-i.top&&(k=this.above[l]=!k);let w=(k?f.top-i.top:i.bottom-f.bottom)-p;if(w<m&&h.resize!==!1){if(w<this.view.defaultLineHeight){c.style.top=mn;continue}Xc.set(h,m),c.style.height=(m=w)/r+"px"}else c.style.height&&(c.style.height="");let $=k?f.top-m-p-O.y:f.bottom+p+O.y,v=x+g;if(h.overlap!==!0)for(let R of o)R.left<v&&R.right>x&&R.top<$+m&&R.bottom>$&&($=k?R.top-m-2-p:R.bottom+p+2);if(this.position=="absolute"?(c.style.top=($-s.parent.top)/r+"px",c.style.left=(x-s.parent.left)/n+"px"):(c.style.top=$/r+"px",c.style.left=x/n+"px"),d){let R=f.left+(y?O.x:-O.x)-(x+14-7);d.style.left=R/n+"px"}h.overlap!==!0&&o.push({left:x,top:$,right:v,bottom:$+m}),c.classList.toggle("cm-tooltip-above",k),c.classList.toggle("cm-tooltip-below",!k),h.positioned&&h.positioned(s.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 s of this.manager.tooltipViews)s.dom.style.top=mn}},{eventObservers:{scroll(){this.maybeMeasure()}}}),U1=X.baseTheme({".cm-tooltip":{zIndex:100,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"}}}),K1={x:0,y:0},sh=P.define({enables:[nh,U1]}),wr=P.define({combine:s=>s.reduce((t,e)=>t.concat(e),[])});class eo{static create(t){return new eo(t)}constructor(t){this.view=t,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new up(t,wr,(e,i)=>this.createHostedView(e,i),e=>e.dom.remove())}createHostedView(t,e){let i=t.create(this.view);return i.dom.classList.add("cm-tooltip-section"),this.dom.insertBefore(i.dom,e?e.dom.nextSibling:this.dom.firstChild),this.mounted&&i.mount&&i.mount(this.view),i}mount(t){for(let e of this.manager.tooltipViews)e.mount&&e.mount(t);this.mounted=!0}positioned(t){for(let e of this.manager.tooltipViews)e.positioned&&e.positioned(t)}update(t){this.manager.update(t)}destroy(){var t;for(let e of this.manager.tooltipViews)(t=e.destroy)===null||t===void 0||t.call(e)}passProp(t){let e;for(let i of this.manager.tooltipViews){let n=i[t];if(n!==void 0){if(e===void 0)e=n;else if(e!==n)return}}return e}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const J1=sh.compute([wr],s=>{let t=s.facet(wr);return t.length===0?null:{pos:Math.min(...t.map(e=>e.pos)),end:Math.max(...t.map(e=>{var i;return(i=e.end)!==null&&i!==void 0?i:e.pos})),create:eo.create,above:t[0].above,arrow:t.some(e=>e.arrow)}});class tb{constructor(t,e,i,n,r){this.view=t,this.source=e,this.field=i,this.setHover=n,this.hoverTime=r,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:t.dom,time:0},this.checkHover=this.checkHover.bind(this),t.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),t.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 t=Date.now()-this.lastMove.time;t<this.hoverTime?this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime-t):this.startHover()}startHover(){clearTimeout(this.restartTimeout);let{view:t,lastMove:e}=this,i=t.docView.nearest(e.target);if(!i)return;let n,r=1;if(i instanceof Fa)n=i.posAtStart;else{if(n=t.posAtCoords(e),n==null)return;let l=t.coordsAtPos(n);if(!l||e.y<l.top||e.y>l.bottom||e.x<l.left-t.defaultCharacterWidth||e.x>l.right+t.defaultCharacterWidth)return;let a=t.bidiSpans(t.state.doc.lineAt(n)).find(c=>c.from<=n&&c.to>=n),h=a&&a.dir==at.RTL?-1:1;r=e.x<l.left?-h:h}let o=this.source(t,n,r);if(o!=null&&o.then){let l=this.pending={pos:n};o.then(a=>{this.pending==l&&(this.pending=null,a&&!(Array.isArray(a)&&!a.length)&&t.dispatch({effects:this.setHover.of(Array.isArray(a)?a:[a])}))},a=>ee(t.state,a,"hover tooltip"))}else o&&!(Array.isArray(o)&&!o.length)&&t.dispatch({effects:this.setHover.of(Array.isArray(o)?o:[o])})}get tooltip(){let t=this.view.plugin(nh),e=t?t.manager.tooltips.findIndex(i=>i.create==eo.create):-1;return e>-1?t.manager.tooltipViews[e]:null}mousemove(t){var e,i;this.lastMove={x:t.clientX,y:t.clientY,target:t.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let{active:n,tooltip:r}=this;if(n.length&&r&&!eb(r.dom,t)||this.pending){let{pos:o}=n[0]||this.pending,l=(i=(e=n[0])===null||e===void 0?void 0:e.end)!==null&&i!==void 0?i:o;(o==l?this.view.posAtCoords(this.lastMove)!=o:!ib(this.view,o,l,t.clientX,t.clientY))&&(this.view.dispatch({effects:this.setHover.of([])}),this.pending=null)}}mouseleave(t){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:e}=this;if(e.length){let{tooltip:i}=this;i&&i.dom.contains(t.relatedTarget)?this.watchTooltipLeave(i.dom):this.view.dispatch({effects:this.setHover.of([])})}}watchTooltipLeave(t){let e=i=>{t.removeEventListener("mouseleave",e),this.active.length&&!this.view.dom.contains(i.relatedTarget)&&this.view.dispatch({effects:this.setHover.of([])})};t.addEventListener("mouseleave",e)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}const xs=4;function eb(s,t){let e=s.getBoundingClientRect();return t.clientX>=e.left-xs&&t.clientX<=e.right+xs&&t.clientY>=e.top-xs&&t.clientY<=e.bottom+xs}function ib(s,t,e,i,n,r){let o=s.scrollDOM.getBoundingClientRect(),l=s.documentTop+s.documentPadding.top+s.contentHeight;if(o.left>i||o.right<i||o.top>n||Math.min(o.bottom,l)<n)return!1;let a=s.posAtCoords({x:i,y:n},!1);return a>=t&&a<=e}function nb(s,t={}){let e=j.define(),i=wt.define({create(){return[]},update(n,r){if(n.length&&(t.hideOnChange&&(r.docChanged||r.selection)?n=[]:t.hideOn&&(n=n.filter(o=>!t.hideOn(r,o))),r.docChanged)){let o=[];for(let l of n){let a=r.changes.mapPos(l.pos,-1,ut.TrackDel);if(a!=null){let h=Object.assign(Object.create(null),l);h.pos=a,h.end!=null&&(h.end=r.changes.mapPos(h.end)),o.push(h)}}n=o}for(let o of r.effects)o.is(e)&&(n=o.value),o.is(sb)&&(n=[]);return n},provide:n=>wr.from(n)});return[i,Tt.define(n=>new tb(n,s,i,e,t.hoverTime||300)),J1]}function dp(s,t){let e=s.plugin(nh);if(!e)return null;let i=e.manager.tooltips.indexOf(t);return i<0?null:e.manager.tooltipViews[i]}const sb=j.define(),Lc=P.define({combine(s){let t,e;for(let i of s)t=t||i.topContainer,e=e||i.bottomContainer;return{topContainer:t,bottomContainer:e}}});function rb(s,t){let e=s.plugin(pp),i=e?e.specs.indexOf(t):-1;return i>-1?e.panels[i]:null}const pp=Tt.fromClass(class{constructor(s){this.input=s.state.facet(Gl),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(e=>e(s));let t=s.state.facet(Lc);this.top=new ks(s,!0,t.topContainer),this.bottom=new ks(s,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(s){let t=s.state.facet(Lc);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new ks(s.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new ks(s.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let e=s.state.facet(Gl);if(e!=this.input){let i=e.filter(a=>a),n=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),c;h<0?(c=a(s.view),l.push(c)):(c=this.panels[h],c.update&&c.update(s)),n.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=n,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 i of this.panels)i.update&&i.update(s)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:s=>X.scrollMargins.of(t=>{let e=t.plugin(s);return e&&{top:e.top.scrollMargin(),bottom:e.bottom.scrollMargin()}})});let ks=class{constructor(t,e,i){this.view=t,this.top=e,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let e of this.panels)e.destroy&&t.indexOf(e)<0&&e.destroy();this.panels=t,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 e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let t=this.dom.firstChild;for(let e of this.panels)if(e.dom.parentNode==this.dom){for(;t!=e.dom;)t=jc(t);t=t.nextSibling}else this.dom.insertBefore(e.dom,t);for(;t;)t=jc(t)}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 t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}};function jc(s){let t=s.nextSibling;return s.remove(),t}const Gl=P.define({enables:pp});let Ge=class extends De{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}};Ge.prototype.elementClass="";Ge.prototype.toDOM=void 0;Ge.prototype.mapMode=ut.TrackBefore;Ge.prototype.startSide=Ge.prototype.endSide=-1;Ge.prototype.point=!0;const or=P.define(),ob={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>I.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},Xn=P.define();function lb(s){return[gp(),Xn.of(Object.assign(Object.assign({},ob),s))]}const Hl=P.define({combine:s=>s.some(t=>t)});function gp(s){let t=[ab];return s&&s.fixed===!1&&t.push(Hl.of(!0)),t}const ab=Tt.fromClass(class{constructor(s){this.view=s,this.prevViewport=s.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=s.state.facet(Xn).map(t=>new Nc(s,t));for(let t of this.gutters)this.dom.appendChild(t.dom);this.fixed=!s.state.facet(Hl),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),s.scrollDOM.insertBefore(this.dom,s.contentDOM)}update(s){if(this.updateGutters(s)){let t=this.prevViewport,e=s.view.viewport,i=Math.min(t.to,e.to)-Math.max(t.from,e.from);this.syncGutters(i<(e.to-e.from)*.8)}s.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(Hl)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=s.view.viewport}syncGutters(s){let t=this.dom.nextSibling;s&&this.dom.remove();let e=I.iter(this.view.state.facet(or),this.view.viewport.from),i=[],n=this.gutters.map(r=>new hb(r,this.view.viewport,-this.view.documentPadding.top));for(let r of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(r.type)){let o=!0;for(let l of r.type)if(l.type==Et.Text&&o){Fl(e,i,l.from);for(let a of n)a.line(this.view,l,i);o=!1}else if(l.widget)for(let a of n)a.widget(this.view,l)}else if(r.type==Et.Text){Fl(e,i,r.from);for(let o of n)o.line(this.view,r,i)}else if(r.widget)for(let o of n)o.widget(this.view,r);for(let r of n)r.finish();s&&this.view.scrollDOM.insertBefore(this.dom,t)}updateGutters(s){let t=s.startState.facet(Xn),e=s.state.facet(Xn),i=s.docChanged||s.heightChanged||s.viewportChanged||!I.eq(s.startState.facet(or),s.state.facet(or),s.view.viewport.from,s.view.viewport.to);if(t==e)for(let n of this.gutters)n.update(s)&&(i=!0);else{i=!0;let n=[];for(let r of e){let o=t.indexOf(r);o<0?n.push(new Nc(this.view,r)):(this.gutters[o].update(s),n.push(this.gutters[o]))}for(let r of this.gutters)r.dom.remove(),n.indexOf(r)<0&&r.destroy();for(let r of n)this.dom.appendChild(r.dom);this.gutters=n}return i}destroy(){for(let s of this.gutters)s.destroy();this.dom.remove()}},{provide:s=>X.scrollMargins.of(t=>{let e=t.plugin(s);return!e||e.gutters.length==0||!e.fixed?null:t.textDirection==at.LTR?{left:e.dom.offsetWidth*t.scaleX}:{right:e.dom.offsetWidth*t.scaleX}})});function Vc(s){return Array.isArray(s)?s:[s]}function Fl(s,t,e){for(;s.value&&s.from<=e;)s.from==e&&t.push(s.value),s.next()}class hb{constructor(t,e,i){this.gutter=t,this.height=i,this.i=0,this.cursor=I.iter(t.markers,e.from)}addElement(t,e,i){let{gutter:n}=this,r=(e.top-this.height)/t.scaleY,o=e.height/t.scaleY;if(this.i==n.elements.length){let l=new mp(t,o,r,i);n.elements.push(l),n.dom.appendChild(l.dom)}else n.elements[this.i].update(t,o,r,i);this.height=e.bottom,this.i++}line(t,e,i){let n=[];Fl(this.cursor,n,e.from),i.length&&(n=n.concat(i));let r=this.gutter.config.lineMarker(t,e,n);r&&n.unshift(r);let o=this.gutter;n.length==0&&!o.config.renderEmptyElements||this.addElement(t,e,n)}widget(t,e){let i=this.gutter.config.widgetMarker(t,e.widget,e);i&&this.addElement(t,e,[i])}finish(){let t=this.gutter;for(;t.elements.length>this.i;){let e=t.elements.pop();t.dom.removeChild(e.dom),e.destroy()}}}class Nc{constructor(t,e){this.view=t,this.config=e,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let i in e.domEventHandlers)this.dom.addEventListener(i,n=>{let r=n.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=n.clientY;let l=t.lineBlockAtHeight(o-t.documentTop);e.domEventHandlers[i](t,l,n)&&n.preventDefault()});this.markers=Vc(e.markers(t)),e.initialSpacer&&(this.spacer=new mp(t,0,0,[e.initialSpacer(t)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(t){let e=this.markers;if(this.markers=Vc(this.config.markers(t.view)),this.spacer&&this.config.updateSpacer){let n=this.config.updateSpacer(this.spacer.markers[0],t);n!=this.spacer.markers[0]&&this.spacer.update(t.view,0,0,[n])}let i=t.view.viewport;return!I.eq(this.markers,e,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(t):!1)}destroy(){for(let t of this.elements)t.destroy()}}class mp{constructor(t,e,i,n){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(t,e,i,n)}update(t,e,i,n){this.height!=e&&(this.height=e,this.dom.style.height=e+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),cb(this.markers,n)||this.setMarkers(t,n)}setMarkers(t,e){let i="cm-gutterElement",n=this.dom.firstChild;for(let r=0,o=0;;){let l=o,a=r<e.length?e[r++]:null,h=!1;if(a){let c=a.elementClass;c&&(i+=" "+c);for(let f=o;f<this.markers.length;f++)if(this.markers[f].compare(a)){l=f,h=!0;break}}else l=this.markers.length;for(;o<l;){let c=this.markers[o++];if(c.toDOM){c.destroy(n);let f=n.nextSibling;n.remove(),n=f}}if(!a)break;a.toDOM&&(h?n=n.nextSibling:this.dom.insertBefore(a.toDOM(t),n)),h&&o++}this.dom.className=i,this.markers=e}destroy(){this.setMarkers(null,[])}}function cb(s,t){if(s.length!=t.length)return!1;for(let e=0;e<s.length;e++)if(!s[e].compare(t[e]))return!1;return!0}const fb=P.define(),Ei=P.define({combine(s){return Xe(s,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(t,e){let i=Object.assign({},t);for(let n in e){let r=i[n],o=e[n];i[n]=r?(l,a,h)=>r(l,a,h)||o(l,a,h):o}return i}})}});class Co extends Ge{constructor(t){super(),this.number=t}eq(t){return this.number==t.number}toDOM(){return document.createTextNode(this.number)}}function Zo(s,t){return s.state.facet(Ei).formatNumber(t,s.state)}const ub=Xn.compute([Ei],s=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(t){return t.state.facet(fb)},lineMarker(t,e,i){return i.some(n=>n.toDOM)?null:new Co(Zo(t,t.state.doc.lineAt(e.from).number))},widgetMarker:()=>null,lineMarkerChange:t=>t.startState.facet(Ei)!=t.state.facet(Ei),initialSpacer(t){return new Co(Zo(t,Ic(t.state.doc.lines)))},updateSpacer(t,e){let i=Zo(e.view,Ic(e.view.state.doc.lines));return i==t.number?t:new Co(i)},domEventHandlers:s.facet(Ei).domEventHandlers}));function db(s={}){return[Ei.of(s),gp(),ub]}function Ic(s){let t=9;for(;t<s;)t=t*10+9;return t}const pb=new class extends Ge{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},gb=or.compute(["selection"],s=>{let t=[],e=-1;for(let i of s.selection.ranges){let n=s.doc.lineAt(i.head).from;n>e&&(e=n,t.push(pb.range(n)))}return I.of(t)});function mb(){return gb}function _n(s){let t;return s.nodeType==11?t=s.getSelection?s:s.ownerDocument:t=s,t.getSelection()}function Ul(s,t){return t?s==t||s.contains(t.nodeType!=1?t.parentNode:t):!1}function lr(s,t){if(!t.anchorNode)return!1;try{return Ul(s,t.anchorNode)}catch{return!1}}function Gn(s){return s.nodeType==3?Ci(s,0,s.nodeValue.length).getClientRects():s.nodeType==1?s.getClientRects():[]}function Ln(s,t,e,i){return e?qc(s,t,e,i,-1)||qc(s,t,e,i,1):!1}function Pi(s){for(var t=0;;t++)if(s=s.previousSibling,!s)return t}function Sr(s){return s.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(s.nodeName)}function qc(s,t,e,i,n){for(;;){if(s==e&&t==i)return!0;if(t==(n<0?0:We(s))){if(s.nodeName=="DIV")return!1;let r=s.parentNode;if(!r||r.nodeType!=1)return!1;t=Pi(s)+(n<0?0:1),s=r}else if(s.nodeType==1){if(s=s.childNodes[t+(n<0?-1:0)],s.nodeType==1&&s.contentEditable=="false")return!1;t=n<0?We(s):0}else return!1}}function We(s){return s.nodeType==3?s.nodeValue.length:s.childNodes.length}function io(s,t){let e=t?s.left:s.right;return{left:e,right:e,top:s.top,bottom:s.bottom}}function Ob(s){let t=s.visualViewport;return t?{left:0,right:t.width,top:0,bottom:t.height}:{left:0,right:s.innerWidth,top:0,bottom:s.innerHeight}}function Op(s,t){let e=t.width/s.offsetWidth,i=t.height/s.offsetHeight;return(e>.995&&e<1.005||!isFinite(e)||Math.abs(t.width-s.offsetWidth)<1)&&(e=1),(i>.995&&i<1.005||!isFinite(i)||Math.abs(t.height-s.offsetHeight)<1)&&(i=1),{scaleX:e,scaleY:i}}function bb(s,t,e,i,n,r,o,l){let a=s.ownerDocument,h=a.defaultView||window;for(let c=s,f=!1;c&&!f;)if(c.nodeType==1){let u,d=c==a.body,p=1,g=1;if(d)u=Ob(h);else{if(/^(fixed|sticky)$/.test(getComputedStyle(c).position)&&(f=!0),c.scrollHeight<=c.clientHeight&&c.scrollWidth<=c.clientWidth){c=c.assignedSlot||c.parentNode;continue}let y=c.getBoundingClientRect();({scaleX:p,scaleY:g}=Op(c,y)),u={left:y.left,right:y.left+c.clientWidth*p,top:y.top,bottom:y.top+c.clientHeight*g}}let m=0,O=0;if(n=="nearest")t.top<u.top?(O=-(u.top-t.top+o),e>0&&t.bottom>u.bottom+O&&(O=t.bottom-u.bottom+O+o)):t.bottom>u.bottom&&(O=t.bottom-u.bottom+o,e<0&&t.top-O<u.top&&(O=-(u.top+O-t.top+o)));else{let y=t.bottom-t.top,x=u.bottom-u.top;O=(n=="center"&&y<=x?t.top+y/2-x/2:n=="start"||n=="center"&&e<0?t.top-o:t.bottom-x+o)-u.top}if(i=="nearest"?t.left<u.left?(m=-(u.left-t.left+r),e>0&&t.right>u.right+m&&(m=t.right-u.right+m+r)):t.right>u.right&&(m=t.right-u.right+r,e<0&&t.left<u.left+m&&(m=-(u.left+m-t.left+r))):m=(i=="center"?t.left+(t.right-t.left)/2-(u.right-u.left)/2:i=="start"==l?t.left-r:t.right-(u.right-u.left)+r)-u.left,m||O)if(d)h.scrollBy(m,O);else{let y=0,x=0;if(O){let k=c.scrollTop;c.scrollTop+=O/g,x=(c.scrollTop-k)*g}if(m){let k=c.scrollLeft;c.scrollLeft+=m/p,y=(c.scrollLeft-k)*p}t={left:t.left-y,top:t.top-x,right:t.right-y,bottom:t.bottom-x},y&&Math.abs(y-m)<1&&(i="nearest"),x&&Math.abs(x-O)<1&&(n="nearest")}if(d)break;c=c.assignedSlot||c.parentNode}else if(c.nodeType==11)c=c.host;else break}function yb(s){let t=s.ownerDocument,e,i;for(let n=s.parentNode;n&&!(n==t.body||e&&i);)if(n.nodeType==1)!i&&n.scrollHeight>n.clientHeight&&(i=n),!e&&n.scrollWidth>n.clientWidth&&(e=n),n=n.assignedSlot||n.parentNode;else if(n.nodeType==11)n=n.host;else break;return{x:e,y:i}}class wb{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(t){return this.anchorNode==t.anchorNode&&this.anchorOffset==t.anchorOffset&&this.focusNode==t.focusNode&&this.focusOffset==t.focusOffset}setRange(t){let{anchorNode:e,focusNode:i}=t;this.set(e,Math.min(t.anchorOffset,e?We(e):0),i,Math.min(t.focusOffset,i?We(i):0))}set(t,e,i,n){this.anchorNode=t,this.anchorOffset=e,this.focusNode=i,this.focusOffset=n}}let Ri=null;function bp(s){if(s.setActive)return s.setActive();if(Ri)return s.focus(Ri);let t=[];for(let e=s;e&&(t.push(e,e.scrollTop,e.scrollLeft),e!=e.ownerDocument);e=e.parentNode);if(s.focus(Ri==null?{get preventScroll(){return Ri={preventScroll:!0},!0}}:void 0),!Ri){Ri=!1;for(let e=0;e<t.length;){let i=t[e++],n=t[e++],r=t[e++];i.scrollTop!=n&&(i.scrollTop=n),i.scrollLeft!=r&&(i.scrollLeft=r)}}}let zc;function Ci(s,t,e=t){let i=zc||(zc=document.createRange());return i.setEnd(s,e),i.setStart(s,t),i}function Ii(s,t,e,i){let n={key:t,code:t,keyCode:e,which:e,cancelable:!0};i&&({altKey:n.altKey,ctrlKey:n.ctrlKey,shiftKey:n.shiftKey,metaKey:n.metaKey}=i);let r=new KeyboardEvent("keydown",n);r.synthetic=!0,s.dispatchEvent(r);let o=new KeyboardEvent("keyup",n);return o.synthetic=!0,s.dispatchEvent(o),r.defaultPrevented||o.defaultPrevented}function Sb(s){for(;s;){if(s&&(s.nodeType==9||s.nodeType==11&&s.host))return s;s=s.assignedSlot||s.parentNode}return null}function yp(s){for(;s.attributes.length;)s.removeAttributeNode(s.attributes[0])}function xb(s,t){let e=t.focusNode,i=t.focusOffset;if(!e||t.anchorNode!=e||t.anchorOffset!=i)return!1;for(i=Math.min(i,We(e));;)if(i){if(e.nodeType!=1)return!1;let n=e.childNodes[i-1];n.contentEditable=="false"?i--:(e=n,i=We(e))}else{if(e==s)return!0;i=Pi(e),e=e.parentNode}}function wp(s){return s.scrollTop>Math.max(1,s.scrollHeight-s.clientHeight-4)}function Sp(s,t){for(let e=s,i=t;;){if(e.nodeType==3&&i>0)return{node:e,offset:i};if(e.nodeType==1&&i>0){if(e.contentEditable=="false")return null;e=e.childNodes[i-1],i=We(e)}else if(e.parentNode&&!Sr(e))i=Pi(e),e=e.parentNode;else return null}}function xp(s,t){for(let e=s,i=t;;){if(e.nodeType==3&&i<e.nodeValue.length)return{node:e,offset:i};if(e.nodeType==1&&i<e.childNodes.length){if(e.contentEditable=="false")return null;e=e.childNodes[i],i=0}else if(e.parentNode&&!Sr(e))i=Pi(e)+1,e=e.parentNode;else return null}}class Zt{constructor(t,e,i=!0){this.node=t,this.offset=e,this.precise=i}static before(t,e){return new Zt(t.parentNode,Pi(t),e)}static after(t,e){return new Zt(t.parentNode,Pi(t)+1,e)}}const rh=[];class tt{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(t){let e=this.posAtStart;for(let i of this.children){if(i==t)return e;e+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(t){return this.posBefore(t)+t.length}sync(t,e){if(this.flags&2){let i=this.dom,n=null,r;for(let o of this.children){if(o.flags&7){if(!o.dom&&(r=n?n.nextSibling:i.firstChild)){let l=tt.get(r);(!l||!l.parent&&l.canReuseDOM(o))&&o.reuseDOM(r)}o.sync(t,e),o.flags&=-8}if(r=n?n.nextSibling:i.firstChild,e&&!e.written&&e.node==i&&r!=o.dom&&(e.written=!0),o.dom.parentNode==i)for(;r&&r!=o.dom;)r=_c(r);else i.insertBefore(o.dom,r);n=o.dom}for(r=n?n.nextSibling:i.firstChild,r&&e&&e.node==i&&(e.written=!0);r;)r=_c(r)}else if(this.flags&1)for(let i of this.children)i.flags&7&&(i.sync(t,e),i.flags&=-8)}reuseDOM(t){}localPosFromDOM(t,e){let i;if(t==this.dom)i=this.dom.childNodes[e];else{let n=We(t)==0?0:e==0?-1:1;for(;;){let r=t.parentNode;if(r==this.dom)break;n==0&&r.firstChild!=r.lastChild&&(t==r.firstChild?n=-1:n=1),t=r}n<0?i=t:i=t.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!tt.get(i);)i=i.nextSibling;if(!i)return this.length;for(let n=0,r=0;;n++){let o=this.children[n];if(o.dom==i)return r;r+=o.length+o.breakAfter}}domBoundsAround(t,e,i=0){let n=-1,r=-1,o=-1,l=-1;for(let a=0,h=i,c=i;a<this.children.length;a++){let f=this.children[a],u=h+f.length;if(h<t&&u>e)return f.domBoundsAround(t,e,h);if(u>=t&&n==-1&&(n=a,r=h),h>e&&f.dom.parentNode==this.dom){o=a,l=c;break}c=u,h=u+f.breakAfter}return{from:r,to:l<0?i+this.length:l,startDOM:(n?this.children[n-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:o<this.children.length&&o>=0?this.children[o].dom:null}}markDirty(t=!1){this.flags|=2,this.markParentsDirty(t)}markParentsDirty(t){for(let e=this.parent;e;e=e.parent){if(t&&(e.flags|=2),e.flags&1)return;e.flags|=1,t=!1}}setParent(t){this.parent!=t&&(this.parent=t,this.flags&7&&this.markParentsDirty(!0))}setDOM(t){this.dom!=t&&(this.dom&&(this.dom.cmView=null),this.dom=t,t.cmView=this)}get rootView(){for(let t=this;;){let e=t.parent;if(!e)return t;t=e}}replaceChildren(t,e,i=rh){this.markDirty();for(let n=t;n<e;n++){let r=this.children[n];r.parent==this&&i.indexOf(r)<0&&r.destroy()}i.length<250?this.children.splice(t,e-t,...i):this.children=[].concat(this.children.slice(0,t),i,this.children.slice(e));for(let n=0;n<i.length;n++)i[n].setParent(this)}ignoreMutation(t){return!1}ignoreEvent(t){return!1}childCursor(t=this.length){return new kp(this.children,t,this.children.length)}childPos(t,e=1){return this.childCursor().findPos(t,e)}toString(){let t=this.constructor.name.replace("View","");return t+(this.children.length?"("+this.children.join()+")":this.length?"["+(t=="Text"?this.text:this.length)+"]":"")+(this.breakAfter?"#":"")}static get(t){return t.cmView}get isEditable(){return!0}get isWidget(){return!1}get isHidden(){return!1}merge(t,e,i,n,r,o){return!1}become(t){return!1}canReuseDOM(t){return t.constructor==this.constructor&&!((this.flags|t.flags)&8)}getSide(){return 0}destroy(){for(let t of this.children)t.parent==this&&t.destroy();this.parent=null}}tt.prototype.breakAfter=0;function _c(s){let t=s.nextSibling;return s.parentNode.removeChild(s),t}class kp{constructor(t,e,i){this.children=t,this.pos=e,this.i=i,this.off=0}findPos(t,e=1){for(;;){if(t>this.pos||t==this.pos&&(e>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=t-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function vp(s,t,e,i,n,r,o,l,a){let{children:h}=s,c=h.length?h[t]:null,f=r.length?r[r.length-1]:null,u=f?f.breakAfter:o;if(!(t==i&&c&&!o&&!u&&r.length<2&&c.merge(e,n,r.length?f:null,e==0,l,a))){if(i<h.length){let d=h[i];d&&(n<d.length||d.breakAfter&&(f!=null&&f.breakAfter))?(t==i&&(d=d.split(n),n=0),!u&&f&&d.merge(0,n,f,!0,0,a)?r[r.length-1]=d:((n||d.children.length&&!d.children[0].length)&&d.merge(0,n,null,!1,0,a),r.push(d))):d!=null&&d.breakAfter&&(f?f.breakAfter=1:o=1),i++}for(c&&(c.breakAfter=o,e>0&&(!o&&r.length&&c.merge(e,c.length,r[0],!1,l,0)?c.breakAfter=r.shift().breakAfter:(e<c.length||c.children.length&&c.children[c.children.length-1].length==0)&&c.merge(e,c.length,null,!1,l,0),t++));t<i&&r.length;)if(h[i-1].become(r[r.length-1]))i--,r.pop(),a=r.length?0:l;else if(h[t].become(r[0]))t++,r.shift(),l=r.length?0:a;else break;!r.length&&t&&i<h.length&&!h[t-1].breakAfter&&h[i].merge(0,0,h[t-1],!1,l,a)&&t--,(t<i||r.length)&&s.replaceChildren(t,i,r)}}function $p(s,t,e,i,n,r){let o=s.childCursor(),{i:l,off:a}=o.findPos(e,1),{i:h,off:c}=o.findPos(t,-1),f=t-e;for(let u of i)f+=u.length;s.length+=f,vp(s,h,c,l,a,i,0,n,r)}let Lt=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Kl=typeof document<"u"?document:{documentElement:{style:{}}};const Jl=/Edge\/(\d+)/.exec(Lt.userAgent),Qp=/MSIE \d/.test(Lt.userAgent),ta=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(Lt.userAgent),no=!!(Qp||ta||Jl),Gc=!no&&/gecko\/(\d+)/i.test(Lt.userAgent),Ao=!no&&/Chrome\/(\d+)/.exec(Lt.userAgent),Hc="webkitFontSmoothing"in Kl.documentElement.style,Pp=!no&&/Apple Computer/.test(Lt.vendor),Fc=Pp&&(/Mobile\/\w+/.test(Lt.userAgent)||Lt.maxTouchPoints>2);var W={mac:Fc||/Mac/.test(Lt.platform),windows:/Win/.test(Lt.platform),linux:/Linux|X11/.test(Lt.platform),ie:no,ie_version:Qp?Kl.documentMode||6:ta?+ta[1]:Jl?+Jl[1]:0,gecko:Gc,gecko_version:Gc?+(/Firefox\/(\d+)/.exec(Lt.userAgent)||[0,0])[1]:0,chrome:!!Ao,chrome_version:Ao?+Ao[1]:0,ios:Fc,android:/Android\b/.test(Lt.userAgent),webkit:Hc,safari:Pp,webkit_version:Hc?+(/\bAppleWebKit\/(\d+)/.exec(Lt.userAgent)||[0,0])[1]:0,tabSize:Kl.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const kb=256;class ue extends tt{constructor(t){super(),this.text=t}get length(){return this.text.length}createDOM(t){this.setDOM(t||document.createTextNode(this.text))}sync(t,e){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text)}reuseDOM(t){t.nodeType==3&&this.createDOM(t)}merge(t,e,i){return this.flags&8||i&&(!(i instanceof ue)||this.length-(e-t)+i.length>kb||i.flags&8)?!1:(this.text=this.text.slice(0,t)+(i?i.text:"")+this.text.slice(e),this.markDirty(),!0)}split(t){let e=new ue(this.text.slice(t));return this.text=this.text.slice(0,t),this.markDirty(),e.flags|=this.flags&8,e}localPosFromDOM(t,e){return t==this.dom?e:e?this.text.length:0}domAtPos(t){return new Zt(this.dom,t)}domBoundsAround(t,e,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(t,e){return vb(this.dom,t,e)}}class He extends tt{constructor(t,e=[],i=0){super(),this.mark=t,this.children=e,this.length=i;for(let n of e)n.setParent(this)}setAttrs(t){if(yp(t),this.mark.class&&(t.className=this.mark.class),this.mark.attrs)for(let e in this.mark.attrs)t.setAttribute(e,this.mark.attrs[e]);return t}canReuseDOM(t){return super.canReuseDOM(t)&&!((this.flags|t.flags)&8)}reuseDOM(t){t.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(t),this.flags|=6)}sync(t,e){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(t,e)}merge(t,e,i,n,r,o){return i&&(!(i instanceof He&&i.mark.eq(this.mark))||t&&r<=0||e<this.length&&o<=0)?!1:($p(this,t,e,i?i.children.slice():[],r-1,o-1),this.markDirty(),!0)}split(t){let e=[],i=0,n=-1,r=0;for(let l of this.children){let a=i+l.length;a>t&&e.push(i<t?l.split(t-i):l),n<0&&i>=t&&(n=r),i=a,r++}let o=this.length-t;return this.length=t,n>-1&&(this.children.length=n,this.markDirty()),new He(this.mark,e,o)}domAtPos(t){return Cp(this,t)}coordsAt(t,e){return Ap(this,t,e)}}function vb(s,t,e){let i=s.nodeValue.length;t>i&&(t=i);let n=t,r=t,o=0;t==0&&e<0||t==i&&e>=0?W.chrome||W.gecko||(t?(n--,o=1):r<i&&(r++,o=-1)):e<0?n--:r<i&&r++;let l=Ci(s,n,r).getClientRects();if(!l.length)return null;let a=l[(o?o<0:e>=0)?0:l.length-1];return W.safari&&!o&&a.width==0&&(a=Array.prototype.find.call(l,h=>h.width)||a),o?io(a,o<0):a||null}class Si extends tt{static create(t,e,i){return new Si(t,e,i)}constructor(t,e,i){super(),this.widget=t,this.length=e,this.side=i,this.prevWidget=null}split(t){let e=Si.create(this.widget,this.length-t,this.side);return this.length-=t,e}sync(t){(!this.dom||!this.widget.updateDOM(this.dom,t))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}getSide(){return this.side}merge(t,e,i,n,r,o){return i&&(!(i instanceof Si)||!this.widget.compare(i.widget)||t>0&&r<=0||e<this.length&&o<=0)?!1:(this.length=t+(i?i.length:0)+(this.length-e),!0)}become(t){return t instanceof Si&&t.side==this.side&&this.widget.constructor==t.widget.constructor?(this.widget.compare(t.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,!0):!1}ignoreMutation(){return!0}ignoreEvent(t){return this.widget.ignoreEvent(t)}get overrideDOMText(){if(this.length==0)return q.empty;let t=this;for(;t.parent;)t=t.parent;let{view:e}=t,i=e&&e.state.doc,n=this.posAtStart;return i?i.slice(n,n+this.length):q.empty}domAtPos(t){return(this.length?t==0:this.side>0)?Zt.before(this.dom):Zt.after(this.dom,t==this.length)}domBoundsAround(){return null}coordsAt(t,e){let i=this.widget.coordsAt(this.dom,t,e);if(i)return i;let n=this.dom.getClientRects(),r=null;if(!n.length)return null;let o=this.side?this.side<0:t>0;for(let l=o?n.length-1:0;r=n[l],!(t>0?l==0:l==n.length-1||r.top<r.bottom);l+=o?-1:1);return io(r,!o)}get isEditable(){return!1}get isWidget(){return!0}get isHidden(){return this.widget.isHidden}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}}class en extends tt{constructor(t){super(),this.side=t}get length(){return 0}merge(){return!1}become(t){return t instanceof en&&t.side==this.side}split(){return new en(this.side)}sync(){if(!this.dom){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),this.setDOM(t)}}getSide(){return this.side}domAtPos(t){return this.side>0?Zt.before(this.dom):Zt.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(t){return this.dom.getBoundingClientRect()}get overrideDOMText(){return q.empty}get isHidden(){return!0}}ue.prototype.children=Si.prototype.children=en.prototype.children=rh;function Cp(s,t){let e=s.dom,{children:i}=s,n=0;for(let r=0;n<i.length;n++){let o=i[n],l=r+o.length;if(!(l==r&&o.getSide()<=0)){if(t>r&&t<l&&o.dom.parentNode==e)return o.domAtPos(t-r);if(t<=r)break;r=l}}for(let r=n;r>0;r--){let o=i[r-1];if(o.dom.parentNode==e)return o.domAtPos(o.length)}for(let r=n;r<i.length;r++){let o=i[r];if(o.dom.parentNode==e)return o.domAtPos(0)}return new Zt(e,0)}function Zp(s,t,e){let i,{children:n}=s;e>0&&t instanceof He&&n.length&&(i=n[n.length-1])instanceof He&&i.mark.eq(t.mark)?Zp(i,t.children[0],e-1):(n.push(t),t.setParent(s)),s.length+=t.length}function Ap(s,t,e){let i=null,n=-1,r=null,o=-1;function l(h,c){for(let f=0,u=0;f<h.children.length&&u<=c;f++){let d=h.children[f],p=u+d.length;p>=c&&(d.children.length?l(d,c-u):(!r||r.isHidden&&e>0)&&(p>c||u==p&&d.getSide()>0)?(r=d,o=c-u):(u<c||u==p&&d.getSide()<0&&!d.isHidden)&&(i=d,n=c-u)),u=p}}l(s,t);let a=(e<0?i:r)||i||r;return a?a.coordsAt(Math.max(0,a==i?n:o),e):$b(s)}function $b(s){let t=s.dom.lastChild;if(!t)return s.dom.getBoundingClientRect();let e=Gn(t);return e[e.length-1]||null}function ea(s,t){for(let e in s)e=="class"&&t.class?t.class+=" "+s.class:e=="style"&&t.style?t.style+=";"+s.style:t[e]=s[e];return t}const Uc=Object.create(null);function xr(s,t,e){if(s==t)return!0;s||(s=Uc),t||(t=Uc);let i=Object.keys(s),n=Object.keys(t);if(i.length-(e&&i.indexOf(e)>-1?1:0)!=n.length-(e&&n.indexOf(e)>-1?1:0))return!1;for(let r of i)if(r!=e&&(n.indexOf(r)==-1||s[r]!==t[r]))return!1;return!0}function ia(s,t,e){let i=!1;if(t)for(let n in t)e&&n in e||(i=!0,n=="style"?s.style.cssText="":s.removeAttribute(n));if(e)for(let n in e)t&&t[n]==e[n]||(i=!0,n=="style"?s.style.cssText=e[n]:s.setAttribute(n,e[n]));return i}function Qb(s){let t=Object.create(null);for(let e=0;e<s.attributes.length;e++){let i=s.attributes[e];t[i.name]=i.value}return t}class oh{eq(t){return!1}updateDOM(t,e){return!1}compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(t){return!0}coordsAt(t,e,i){return null}get isHidden(){return!1}get editable(){return!1}destroy(t){}}var Re=function(s){return s[s.Text=0]="Text",s[s.WidgetBefore=1]="WidgetBefore",s[s.WidgetAfter=2]="WidgetAfter",s[s.WidgetRange=3]="WidgetRange",s}(Re||(Re={}));class F extends De{constructor(t,e,i,n){super(),this.startSide=t,this.endSide=e,this.widget=i,this.spec=n}get heightRelevant(){return!1}static mark(t){return new ss(t)}static widget(t){let e=Math.max(-1e4,Math.min(1e4,t.side||0)),i=!!t.block;return e+=i&&!t.inlineOrder?e>0?3e8:-4e8:e>0?1e8:-1e8,new ci(t,e,e,i,t.widget||null,!1)}static replace(t){let e=!!t.block,i,n;if(t.isBlockGap)i=-5e8,n=4e8;else{let{start:r,end:o}=Tp(t,e);i=(r?e?-3e8:-1:5e8)-1,n=(o?e?2e8:1:-6e8)+1}return new ci(t,i,n,e,t.widget||null,!0)}static line(t){return new rs(t)}static set(t,e=!1){return I.of(t,e)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}F.none=I.empty;class ss extends F{constructor(t){let{start:e,end:i}=Tp(t);super(e?-1:5e8,i?1:-6e8,null,t),this.tagName=t.tagName||"span",this.class=t.class||"",this.attrs=t.attributes||null}eq(t){var e,i;return this==t||t instanceof ss&&this.tagName==t.tagName&&(this.class||((e=this.attrs)===null||e===void 0?void 0:e.class))==(t.class||((i=t.attrs)===null||i===void 0?void 0:i.class))&&xr(this.attrs,t.attrs,"class")}range(t,e=t){if(t>=e)throw new RangeError("Mark decorations may not be empty");return super.range(t,e)}}ss.prototype.point=!1;class rs extends F{constructor(t){super(-2e8,-2e8,null,t)}eq(t){return t instanceof rs&&this.spec.class==t.spec.class&&xr(this.spec.attributes,t.spec.attributes)}range(t,e=t){if(e!=t)throw new RangeError("Line decoration ranges must be zero-length");return super.range(t,e)}}rs.prototype.mapMode=ut.TrackBefore;rs.prototype.point=!0;class ci extends F{constructor(t,e,i,n,r,o){super(e,i,r,t),this.block=n,this.isReplace=o,this.mapMode=n?e<=0?ut.TrackBefore:ut.TrackAfter:ut.TrackDel}get type(){return this.startSide!=this.endSide?Re.WidgetRange:this.startSide<=0?Re.WidgetBefore:Re.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(t){return t instanceof ci&&Pb(this.widget,t.widget)&&this.block==t.block&&this.startSide==t.startSide&&this.endSide==t.endSide}range(t,e=t){if(this.isReplace&&(t>e||t==e&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&e!=t)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(t,e)}}ci.prototype.point=!0;function Tp(s,t=!1){let{inclusiveStart:e,inclusiveEnd:i}=s;return e==null&&(e=s.inclusive),i==null&&(i=s.inclusive),{start:e??t,end:i??t}}function Pb(s,t){return s==t||!!(s&&t&&s.compare(t))}function na(s,t,e,i=0){let n=e.length-1;n>=0&&e[n]+i>=s?e[n]=Math.max(e[n],t):e.push(s,t)}class Ot extends tt{constructor(){super(...arguments),this.children=[],this.length=0,this.prevAttrs=void 0,this.attrs=null,this.breakAfter=0}merge(t,e,i,n,r,o){if(i){if(!(i instanceof Ot))return!1;this.dom||i.transferDOM(this)}return n&&this.setDeco(i?i.attrs:null),$p(this,t,e,i?i.children.slice():[],r,o),!0}split(t){let e=new Ot;if(e.breakAfter=this.breakAfter,this.length==0)return e;let{i,off:n}=this.childPos(t);n&&(e.append(this.children[i].split(n),0),this.children[i].merge(n,this.children[i].length,null,!1,0,0),i++);for(let r=i;r<this.children.length;r++)e.append(this.children[r],0);for(;i>0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=t,e}transferDOM(t){this.dom&&(this.markDirty(),t.setDOM(this.dom),t.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(t){xr(this.attrs,t)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=t)}append(t,e){Zp(this,t,e)}addLineDeco(t){let e=t.spec.attributes,i=t.spec.class;e&&(this.attrs=ea(e,this.attrs||{})),i&&(this.attrs=ea({class:i},this.attrs||{}))}domAtPos(t){return Cp(this,t)}reuseDOM(t){t.nodeName=="DIV"&&(this.setDOM(t),this.flags|=6)}sync(t,e){var i;this.dom?this.flags&4&&(yp(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&&(ia(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(t,e);let n=this.dom.lastChild;for(;n&&tt.get(n)instanceof He;)n=n.lastChild;if(!n||!this.length||n.nodeName!="BR"&&((i=tt.get(n))===null||i===void 0?void 0:i.isEditable)==!1&&(!W.ios||!this.children.some(r=>r instanceof ue))){let r=document.createElement("BR");r.cmIgnore=!0,this.dom.appendChild(r)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let t=0,e;for(let i of this.children){if(!(i instanceof ue)||/[^ -~]/.test(i.text))return null;let n=Gn(i.dom);if(n.length!=1)return null;t+=n[0].width,e=n[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:e}:null}coordsAt(t,e){let i=Ap(this,t,e);if(!this.children.length&&i&&this.parent){let{heightOracle:n}=this.parent.view.viewState,r=i.bottom-i.top;if(Math.abs(r-n.lineHeight)<2&&n.textHeight<r){let o=(r-n.textHeight)/2;return{top:i.top+o,bottom:i.bottom-o,left:i.left,right:i.left}}}return i}become(t){return t instanceof Ot&&this.children.length==0&&t.children.length==0&&xr(this.attrs,t.attrs)&&this.breakAfter==t.breakAfter}covers(){return!0}static find(t,e){for(let i=0,n=0;i<t.children.length;i++){let r=t.children[i],o=n+r.length;if(o>=e){if(r instanceof Ot)return r;if(o>e)break}n=o+r.breakAfter}return null}}class Ie extends tt{constructor(t,e,i){super(),this.widget=t,this.length=e,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(t,e,i,n,r,o){return i&&(!(i instanceof Ie)||!this.widget.compare(i.widget)||t>0&&r<=0||e<this.length&&o<=0)?!1:(this.length=t+(i?i.length:0)+(this.length-e),!0)}domAtPos(t){return t==0?Zt.before(this.dom):Zt.after(this.dom,t==this.length)}split(t){let e=this.length-t;this.length=t;let i=new Ie(this.widget,e,this.deco);return i.breakAfter=this.breakAfter,i}get children(){return rh}sync(t){(!this.dom||!this.widget.updateDOM(this.dom,t))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(t)),this.widget.editable||(this.dom.contentEditable="false"))}get overrideDOMText(){return this.parent?this.parent.view.state.doc.slice(this.posAtStart,this.posAtEnd):q.empty}domBoundsAround(){return null}become(t){return t instanceof Ie&&t.widget.constructor==this.widget.constructor?(t.widget.compare(this.widget)||this.markDirty(!0),this.dom&&!this.prevWidget&&(this.prevWidget=this.widget),this.widget=t.widget,this.length=t.length,this.deco=t.deco,this.breakAfter=t.breakAfter,!0):!1}ignoreMutation(){return!0}ignoreEvent(t){return this.widget.ignoreEvent(t)}get isEditable(){return!1}get isWidget(){return!0}coordsAt(t,e){let i=this.widget.coordsAt(this.dom,t,e);return i||(this.widget instanceof sa?null:io(this.dom.getBoundingClientRect(),this.length?t==0:e<=0))}destroy(){super.destroy(),this.dom&&this.widget.destroy(this.dom)}covers(t){let{startSide:e,endSide:i}=this.deco;return e==i?!1:t<0?e<0:i>0}}class sa extends oh{constructor(t){super(),this.height=t}toDOM(){let t=document.createElement("div");return t.className="cm-gap",this.updateDOM(t),t}eq(t){return t.height==this.height}updateDOM(t){return t.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}class jn{constructor(t,e,i,n){this.doc=t,this.pos=e,this.end=i,this.disallowBlockEffectsFor=n,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=t.iter(),this.skip=e}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let t=this.content[this.content.length-1];return!(t.breakAfter||t instanceof Ie&&t.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new Ot),this.atCursorPos=!0),this.curLine}flushBuffer(t=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(vs(new en(-1),t),t.length),this.pendingBuffer=0)}addBlockWidget(t){this.flushBuffer(),this.curLine=null,this.content.push(t)}finish(t){this.pendingBuffer&&t<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(t&&this.content.length&&this.content[this.content.length-1]instanceof Ie)&&this.getLine()}buildText(t,e,i){for(;t>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,t--;continue}else this.text=r,this.textOff=0}let n=Math.min(this.text.length-this.textOff,t,512);this.flushBuffer(e.slice(e.length-i)),this.getLine().append(vs(new ue(this.text.slice(this.textOff,this.textOff+n)),e),i),this.atCursorPos=!0,this.textOff+=n,t-=n,i=0}}span(t,e,i,n){this.buildText(e-t,i,n),this.pos=e,this.openStart<0&&(this.openStart=n)}point(t,e,i,n,r,o){if(this.disallowBlockEffectsFor[o]&&i instanceof ci){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(e>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let l=e-t;if(i instanceof ci)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Ie(i.widget||nn.block,l,i));else{let a=Si.create(i.widget||nn.inline,l,l?0:i.startSide),h=this.atCursorPos&&!a.isEditable&&r<=n.length&&(t<e||i.startSide>0),c=!a.isEditable&&(t<e||r>n.length||i.startSide<=0),f=this.getLine();this.pendingBuffer==2&&!h&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(n),h&&(f.append(vs(new en(1),n),r),r=n.length+Math.max(0,r-n.length)),f.append(vs(a,n),r),this.atCursorPos=c,this.pendingBuffer=c?t<e||r>n.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=n.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);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=e),this.openStart<0&&(this.openStart=r)}static build(t,e,i,n,r){let o=new jn(t,e,i,r);return o.openEnd=I.spans(n,e,i,o),o.openStart<0&&(o.openStart=o.openEnd),o.finish(o.openEnd),o}}function vs(s,t){for(let e of t)s=new He(e,[s],s.length);return s}class nn extends oh{constructor(t){super(),this.tag=t}eq(t){return t.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(t){return t.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}nn.inline=new nn("span");nn.block=new nn("div");var kt=function(s){return s[s.LTR=0]="LTR",s[s.RTL=1]="RTL",s}(kt||(kt={}));const Zi=kt.LTR,lh=kt.RTL;function Mp(s){let t=[];for(let e=0;e<s.length;e++)t.push(1<<+s[e]);return t}const Cb=Mp("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),Zb=Mp("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),ra=Object.create(null),Oe=[];for(let s of["()","[]","{}"]){let t=s.charCodeAt(0),e=s.charCodeAt(1);ra[t]=e,ra[e]=-t}function Rp(s){return s<=247?Cb[s]:1424<=s&&s<=1524?2:1536<=s&&s<=1785?Zb[s-1536]:1774<=s&&s<=2220?4:8192<=s&&s<=8204?256:64336<=s&&s<=65023?4:1}const Ab=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class oi{get dir(){return this.level%2?lh:Zi}constructor(t,e,i){this.from=t,this.to=e,this.level=i}side(t,e){return this.dir==e==t?this.to:this.from}forward(t,e){return t==(this.dir==e)}static find(t,e,i,n){let r=-1;for(let o=0;o<t.length;o++){let l=t[o];if(l.from<=e&&l.to>=e){if(l.level==i)return o;(r<0||(n!=0?n<0?l.from<e:l.to>e:t[r].level>l.level))&&(r=o)}}if(r<0)throw new RangeError("Index out of range");return r}}function Dp(s,t){if(s.length!=t.length)return!1;for(let e=0;e<s.length;e++){let i=s[e],n=t[e];if(i.from!=n.from||i.to!=n.to||i.direction!=n.direction||!Dp(i.inner,n.inner))return!1}return!0}const J=[];function Tb(s,t,e,i,n){for(let r=0;r<=i.length;r++){let o=r?i[r-1].to:t,l=r<i.length?i[r].from:e,a=r?256:n;for(let h=o,c=a,f=a;h<l;h++){let u=Rp(s.charCodeAt(h));u==512?u=c:u==8&&f==4&&(u=16),J[h]=u==4?2:u,u&7&&(f=u),c=u}for(let h=o,c=a,f=a;h<l;h++){let u=J[h];if(u==128)h<l-1&&c==J[h+1]&&c&24?u=J[h]=c:J[h]=256;else if(u==64){let d=h+1;for(;d<l&&J[d]==64;)d++;let p=h&&c==8||d<e&&J[d]==8?f==1?1:8:256;for(let g=h;g<d;g++)J[g]=p;h=d-1}else u==8&&f==1&&(J[h]=1);c=u,u&7&&(f=u)}}}function Mb(s,t,e,i,n){let r=n==1?2:1;for(let o=0,l=0,a=0;o<=i.length;o++){let h=o?i[o-1].to:t,c=o<i.length?i[o].from:e;for(let f=h,u,d,p;f<c;f++)if(d=ra[u=s.charCodeAt(f)])if(d<0){for(let g=l-3;g>=0;g-=3)if(Oe[g+1]==-d){let m=Oe[g+2],O=m&2?n:m&4?m&1?r:n:0;O&&(J[f]=J[Oe[g]]=O),l=g;break}}else{if(Oe.length==189)break;Oe[l++]=f,Oe[l++]=u,Oe[l++]=a}else if((p=J[f])==2||p==1){let g=p==n;a=g?0:1;for(let m=l-3;m>=0;m-=3){let O=Oe[m+2];if(O&2)break;if(g)Oe[m+2]|=2;else{if(O&4)break;Oe[m+2]|=4}}}}}function Rb(s,t,e,i){for(let n=0,r=i;n<=e.length;n++){let o=n?e[n-1].to:s,l=n<e.length?e[n].from:t;for(let a=o;a<l;){let h=J[a];if(h==256){let c=a+1;for(;;)if(c==l){if(n==e.length)break;c=e[n++].to,l=n<e.length?e[n].from:t}else if(J[c]==256)c++;else break;let f=r==1,u=(c<t?J[c]:i)==1,d=f==u?f?1:2:i;for(let p=c,g=n,m=g?e[g-1].to:s;p>a;)p==m&&(p=e[--g].from,m=g?e[g-1].to:s),J[--p]=d;a=c}else r=h,a++}}}function oa(s,t,e,i,n,r,o){let l=i%2?2:1;if(i%2==n%2)for(let a=t,h=0;a<e;){let c=!0,f=!1;if(h==r.length||a<r[h].from){let g=J[a];g!=l&&(c=!1,f=g==16)}let u=!c&&l==1?[]:null,d=c?i:i+1,p=a;t:for(;;)if(h<r.length&&p==r[h].from){if(f)break t;let g=r[h];if(!c)for(let m=g.to,O=h+1;;){if(m==e)break t;if(O<r.length&&r[O].from==m)m=r[O++].to;else{if(J[m]==l)break t;break}}if(h++,u)u.push(g);else{g.from>a&&o.push(new oi(a,g.from,d));let m=g.direction==Zi!=!(d%2);la(s,m?i+1:i,n,g.inner,g.from,g.to,o),a=g.to}p=g.to}else{if(p==e||(c?J[p]!=l:J[p]==l))break;p++}u?oa(s,a,p,i+1,n,u,o):a<p&&o.push(new oi(a,p,d)),a=p}else for(let a=e,h=r.length;a>t;){let c=!0,f=!1;if(!h||a>r[h-1].to){let g=J[a-1];g!=l&&(c=!1,f=g==16)}let u=!c&&l==1?[]:null,d=c?i:i+1,p=a;t:for(;;)if(h&&p==r[h-1].to){if(f)break t;let g=r[--h];if(!c)for(let m=g.from,O=h;;){if(m==t)break t;if(O&&r[O-1].to==m)m=r[--O].from;else{if(J[m-1]==l)break t;break}}if(u)u.push(g);else{g.to<a&&o.push(new oi(g.to,a,d));let m=g.direction==Zi!=!(d%2);la(s,m?i+1:i,n,g.inner,g.from,g.to,o),a=g.from}p=g.from}else{if(p==t||(c?J[p-1]!=l:J[p-1]==l))break;p--}u?oa(s,p,a,i+1,n,u,o):p<a&&o.push(new oi(p,a,d)),a=p}}function la(s,t,e,i,n,r,o){let l=t%2?2:1;Tb(s,n,r,i,l),Mb(s,n,r,i,l),Rb(n,r,i,l),oa(s,n,r,t,e,i,o)}function Db(s,t,e){if(!s)return[new oi(0,0,t==lh?1:0)];if(t==Zi&&!e.length&&!Ab.test(s))return Wp(s.length);if(e.length)for(;s.length>J.length;)J[J.length]=256;let i=[],n=t==Zi?0:1;return la(s,n,n,e,0,s.length,i),i}function Wp(s){return[new oi(0,s,0)]}let Ep="";function Wb(s,t,e,i,n){var r;let o=i.head-s.from,l=oi.find(t,o,(r=i.bidiLevel)!==null&&r!==void 0?r:-1,i.assoc),a=t[l],h=a.side(n,e);if(o==h){let u=l+=n?1:-1;if(u<0||u>=t.length)return null;a=t[l=u],o=a.side(!n,e),h=a.side(n,e)}let c=ct(s.text,o,a.forward(n,e));(c<a.from||c>a.to)&&(c=h),Ep=s.text.slice(Math.min(o,c),Math.max(o,c));let f=l==(n?t.length-1:0)?null:t[l+(n?1:-1)];return f&&c==h&&f.level+(n?0:1)<a.level?S.cursor(f.side(!n,e)+s.from,f.forward(n,e)?1:-1,f.level):S.cursor(c+s.from,a.forward(n,e)?-1:1,a.level)}function Eb(s,t,e){for(let i=t;i<e;i++){let n=Rp(s.charCodeAt(i));if(n==1)return Zi;if(n==2||n==4)return lh}return Zi}const Bp=P.define(),Yp=P.define(),Xp=P.define(),Lp=P.define(),aa=P.define(),jp=P.define(),Vp=P.define(),ah=P.define(),hh=P.define(),Np=P.define({combine:s=>s.some(t=>t)}),Bb=P.define({combine:s=>s.some(t=>t)}),Ip=P.define();class qi{constructor(t,e="nearest",i="nearest",n=5,r=5,o=!1){this.range=t,this.y=e,this.x=i,this.yMargin=n,this.xMargin=r,this.isSnapshot=o}map(t){return t.empty?this:new qi(this.range.map(t),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(t){return this.range.to<=t.doc.length?this:new qi(S.cursor(t.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const $s=j.define({map:(s,t)=>s.map(t)}),qp=j.define();function Ce(s,t,e){let i=s.facet(Lp);i.length?i[0](t):window.onerror?window.onerror(String(t),e,void 0,void 0,t):e?console.error(e+":",t):console.error(t)}const ii=P.define({combine:s=>s.length?s[0]:!0});let Yb=0;const Zn=P.define();class Ee{constructor(t,e,i,n,r){this.id=t,this.create=e,this.domEventHandlers=i,this.domEventObservers=n,this.extension=r(this)}static define(t,e){const{eventHandlers:i,eventObservers:n,provide:r,decorations:o}=e||{};return new Ee(Yb++,t,i,n,l=>{let a=[Zn.of(l)];return o&&a.push(Hn.of(h=>{let c=h.plugin(l);return c?o(c):F.none})),r&&a.push(r(l)),a})}static fromClass(t,e){return Ee.define(i=>new t(i),e)}}class To{constructor(t){this.spec=t,this.mustUpdate=null,this.value=null}update(t){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(i){if(Ce(e.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(t)}catch(e){Ce(t.state,e,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(t){var e;if(!((e=this.value)===null||e===void 0)&&e.destroy)try{this.value.destroy()}catch(i){Ce(t.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const zp=P.define(),ch=P.define(),Hn=P.define(),_p=P.define(),fh=P.define(),Gp=P.define();function Kc(s,t){let e=s.state.facet(Gp);if(!e.length)return e;let i=e.map(r=>r instanceof Function?r(s):r),n=[];return I.spans(i,t.from,t.to,{point(){},span(r,o,l,a){let h=r-t.from,c=o-t.from,f=n;for(let u=l.length-1;u>=0;u--,a--){let d=l[u].spec.bidiIsolate,p;if(d==null&&(d=Eb(t.text,h,c)),a>0&&f.length&&(p=f[f.length-1]).to==h&&p.direction==d)p.to=c,f=p.inner;else{let g={from:h,to:c,direction:d,inner:[]};f.push(g),f=g.inner}}}}),n}const Hp=P.define();function Fp(s){let t=0,e=0,i=0,n=0;for(let r of s.state.facet(Hp)){let o=r(s);o&&(o.left!=null&&(t=Math.max(t,o.left)),o.right!=null&&(e=Math.max(e,o.right)),o.top!=null&&(i=Math.max(i,o.top)),o.bottom!=null&&(n=Math.max(n,o.bottom)))}return{left:t,right:e,top:i,bottom:n}}const An=P.define();class ie{constructor(t,e,i,n){this.fromA=t,this.toA=e,this.fromB=i,this.toB=n}join(t){return new ie(Math.min(this.fromA,t.fromA),Math.max(this.toA,t.toA),Math.min(this.fromB,t.fromB),Math.max(this.toB,t.toB))}addToSet(t){let e=t.length,i=this;for(;e>0;e--){let n=t[e-1];if(!(n.fromA>i.toA)){if(n.toA<i.fromA)break;i=i.join(n),t.splice(e-1,1)}}return t.splice(e,0,i),t}static extendWithRanges(t,e){if(e.length==0)return t;let i=[];for(let n=0,r=0,o=0,l=0;;n++){let a=n==t.length?null:t[n],h=o-l,c=a?a.fromB:1e9;for(;r<e.length&&e[r]<c;){let f=e[r],u=e[r+1],d=Math.max(l,f),p=Math.min(c,u);if(d<=p&&new ie(d+h,p+h,d,p).addToSet(i),u>c)break;r+=2}if(!a)return i;new ie(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),o=a.toA,l=a.toB}}}class kr{constructor(t,e,i){this.view=t,this.state=e,this.transactions=i,this.flags=0,this.startState=t.state,this.changes=gt.empty(this.startState.doc.length);for(let r of i)this.changes=this.changes.compose(r.changes);let n=[];this.changes.iterChangedRanges((r,o,l,a)=>n.push(new ie(r,o,l,a))),this.changedRanges=n}static create(t,e,i){return new kr(t,e,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(t=>t.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}class Jc extends tt{get length(){return this.view.state.doc.length}constructor(t){super(),this.view=t,this.decorations=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.markedForComposition=new Set,this.editContextFormatting=F.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(t.contentDOM),this.children=[new Ot],this.children[0].setParent(this),this.updateDeco(),this.updateInner([new ie(0,0,0,t.state.doc.length)],0,null)}update(t){var e;let i=t.changedRanges;this.minWidth>0&&i.length&&(i.every(({fromA:h,toA:c})=>c<this.minWidthFrom||h>this.minWidthTo)?(this.minWidthFrom=t.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=t.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(t);let n=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((e=this.domChanged)===null||e===void 0)&&e.newSel?n=this.domChanged.newSel.head:!qb(t.changes,this.hasComposition)&&!t.selectionSet&&(n=t.state.selection.main.head));let r=n>-1?Lb(this.view,t.changes,n):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:h,to:c}=this.hasComposition;i=new ie(h,c,t.changes.mapPos(h,-1),t.changes.mapPos(c,1)).addToSet(i.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(W.ie||W.chrome)&&!r&&t&&t.state.doc.lines!=t.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,l=this.updateDeco(),a=Nb(o,l,t.changes);return i=ie.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,t.startState.doc.length,r),t.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(t,e,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(t,e,i);let{observer:n}=this.view;n.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let o=W.chrome||W.ios?{node:n.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,o),this.flags&=-8,o&&(o.written||n.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<this.view.state.doc.length)for(let o of this.children)o instanceof Ie&&o.widget instanceof sa&&r.push(o.dom);n.updateGaps(r)}updateChildren(t,e,i){let n=i?i.range.addToSet(t.slice()):t,r=this.childCursor(e);for(let o=n.length-1;;o--){let l=o>=0?n[o]:null;if(!l)break;let{fromA:a,toA:h,fromB:c,toB:f}=l,u,d,p,g;if(i&&i.range.fromB<f&&i.range.toB>c){let k=jn.build(this.view.state.doc,c,i.range.fromB,this.decorations,this.dynamicDecorationMap),w=jn.build(this.view.state.doc,i.range.toB,f,this.decorations,this.dynamicDecorationMap);d=k.breakAtStart,p=k.openStart,g=w.openEnd;let $=this.compositionView(i);w.breakAtStart?$.breakAfter=1:w.content.length&&$.merge($.length,$.length,w.content[0],!1,w.openStart,0)&&($.breakAfter=w.content[0].breakAfter,w.content.shift()),k.content.length&&$.merge(0,0,k.content[k.content.length-1],!0,0,k.openEnd)&&k.content.pop(),u=k.content.concat($).concat(w.content)}else({content:u,breakAtStart:d,openStart:p,openEnd:g}=jn.build(this.view.state.doc,c,f,this.decorations,this.dynamicDecorationMap));let{i:m,off:O}=r.findPos(h,1),{i:y,off:x}=r.findPos(a,-1);vp(this,y,x,m,O,u,d,p,g)}i&&this.fixCompositionDOM(i)}updateEditContextFormatting(t){this.editContextFormatting=this.editContextFormatting.map(t.changes);for(let e of t.transactions)for(let i of e.effects)i.is(qp)&&(this.editContextFormatting=i.value)}compositionView(t){let e=new ue(t.text.nodeValue);e.flags|=8;for(let{deco:n}of t.marks)e=new He(n,[e],e.length);let i=new Ot;return i.append(e,0),i}fixCompositionDOM(t){let e=(r,o)=>{o.flags|=8|(o.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(o);let l=tt.get(r);l&&l!=o&&(l.dom=null),o.setDOM(r)},i=this.childPos(t.range.fromB,1),n=this.children[i.i];e(t.line,n);for(let r=t.marks.length-1;r>=-1;r--)i=n.childPos(i.off,1),n=n.children[i.i],e(r>=0?t.marks[r].node:t.text,n)}updateSelection(t=!1,e=!1){(t||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,n=i==this.dom,r=!n&&lr(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(n||e||r))return;let o=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),h=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(W.gecko&&l.empty&&!this.hasComposition&&Xb(a)){let f=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(f,a.node.childNodes[a.offset]||null)),a=h=new Zt(f,0),o=!0}let c=this.view.observer.selectionRange;(o||!c.focusNode||(!Ln(a.node,a.offset,c.anchorNode,c.anchorOffset)||!Ln(h.node,h.offset,c.focusNode,c.focusOffset))&&!this.suppressWidgetCursorChange(c,l))&&(this.view.observer.ignore(()=>{W.android&&W.chrome&&this.dom.contains(c.focusNode)&&Ib(c.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let f=_n(this.view.root);if(f)if(l.empty){if(W.gecko){let u=jb(a.node,a.offset);if(u&&u!=3){let d=(u==1?Sp:xp)(a.node,a.offset);d&&(a=new Zt(d.node,d.offset))}}f.collapse(a.node,a.offset),l.bidiLevel!=null&&f.caretBidiLevel!==void 0&&(f.caretBidiLevel=l.bidiLevel)}else if(f.extend){f.collapse(a.node,a.offset);try{f.extend(h.node,h.offset)}catch{}}else{let u=document.createRange();l.anchor>l.head&&([a,h]=[h,a]),u.setEnd(h.node,h.offset),u.setStart(a.node,a.offset),f.removeAllRanges(),f.addRange(u)}r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,h)),this.impreciseAnchor=a.precise?null:new Zt(c.anchorNode,c.anchorOffset),this.impreciseHead=h.precise?null:new Zt(c.focusNode,c.focusOffset)}suppressWidgetCursorChange(t,e){return this.hasComposition&&e.empty&&Ln(t.focusNode,t.focusOffset,t.anchorNode,t.anchorOffset)&&this.posFromDOM(t.focusNode,t.focusOffset)==e.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:t}=this,e=t.state.selection.main,i=_n(t.root),{anchorNode:n,anchorOffset:r}=t.observer.selectionRange;if(!i||!e.empty||!e.assoc||!i.modify)return;let o=Ot.find(this,e.head);if(!o)return;let l=o.posAtStart;if(e.head==l||e.head==l+o.length)return;let a=this.coordsAt(e.head,-1),h=this.coordsAt(e.head,1);if(!a||!h||a.bottom>h.top)return;let c=this.domAtPos(e.head+e.assoc);i.collapse(c.node,c.offset),i.modify("move",e.assoc<0?"forward":"backward","lineboundary"),t.observer.readSelectionRange();let f=t.observer.selectionRange;t.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=e.from&&i.collapse(n,r)}moveToLine(t){let e=this.dom,i;if(t.node!=e)return t;for(let n=t.offset;!i&&n<e.childNodes.length;n++){let r=tt.get(e.childNodes[n]);r instanceof Ot&&(i=r.domAtPos(0))}for(let n=t.offset-1;!i&&n>=0;n--){let r=tt.get(e.childNodes[n]);r instanceof Ot&&(i=r.domAtPos(r.length))}return i?new Zt(i.node,i.offset,!0):t}nearest(t){for(let e=t;e;){let i=tt.get(e);if(i&&i.rootView==this)return i;e=e.parentNode}return null}posFromDOM(t,e){let i=this.nearest(t);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(t,e)+i.posAtStart}domAtPos(t){let{i:e,off:i}=this.childCursor().findPos(t,-1);for(;e<this.children.length-1;){let n=this.children[e];if(i<n.length||n instanceof Ot)break;e++,i=0}return this.children[e].domAtPos(i)}coordsAt(t,e){let i=null,n=0;for(let r=this.length,o=this.children.length-1;o>=0;o--){let l=this.children[o],a=r-l.breakAfter,h=a-l.length;if(a<t)break;if(h<=t&&(h<t||l.covers(-1))&&(a>t||l.covers(1))&&(!i||l instanceof Ot&&!(i instanceof Ot&&e>=0)))i=l,n=h;else if(i&&h==t&&a==t&&l instanceof Ie&&Math.abs(e)<2){if(l.deco.startSide<0)break;o&&(i=null)}r=h}return i?i.coordsAt(t-n,e):null}coordsForChar(t){let{i:e,off:i}=this.childPos(t,1),n=this.children[e];if(!(n instanceof Ot))return null;for(;n.children.length;){let{i:l,off:a}=n.childPos(i,1);for(;;l++){if(l==n.children.length)return null;if((n=n.children[l]).length)break}i=a}if(!(n instanceof ue))return null;let r=ct(n.text,i);if(r==i)return null;let o=Ci(n.dom,i,r).getClientRects();for(let l=0;l<o.length;l++){let a=o[l];if(l==o.length-1||a.top<a.bottom&&a.left<a.right)return a}return null}measureVisibleLineHeights(t){let e=[],{from:i,to:n}=t,r=this.view.contentDOM.clientWidth,o=r>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==kt.LTR;for(let h=0,c=0;c<this.children.length;c++){let f=this.children[c],u=h+f.length;if(u>n)break;if(h>=i){let d=f.dom.getBoundingClientRect();if(e.push(d.height),o){let p=f.dom.lastChild,g=p?Gn(p):[];if(g.length){let m=g[g.length-1],O=a?m.right-d.left:d.right-m.left;O>l&&(l=O,this.minWidth=r,this.minWidthFrom=h,this.minWidthTo=u)}}}h=u+f.breakAfter}return e}textDirectionAt(t){let{i:e}=this.childPos(t,1);return getComputedStyle(this.children[e].dom).direction=="rtl"?kt.RTL:kt.LTR}measureTextSize(){for(let r of this.children)if(r instanceof Ot){let o=r.measureTextSize();if(o)return o}let t=document.createElement("div"),e,i,n;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(t);let r=Gn(t.firstChild)[0];e=t.getBoundingClientRect().height,i=r?r.width/27:7,n=r?r.height:e,t.remove()}),{lineHeight:e,charWidth:i,textHeight:n}}childCursor(t=this.length){let e=this.children.length;return e&&(t-=this.children[--e].length),new kp(this.children,t,e)}computeBlockGapDeco(){let t=[],e=this.view.viewState;for(let i=0,n=0;;n++){let r=n==e.viewports.length?null:e.viewports[n],o=r?r.from-1:this.length;if(o>i){let l=(e.lineBlockAt(o).bottom-e.lineBlockAt(i).top)/this.view.scaleY;t.push(F.replace({widget:new sa(l),block:!0,inclusive:!0,isBlockGap:!0}).range(i,o))}if(!r)break;i=r.to+1}return F.set(t)}updateDeco(){let t=1,e=this.view.state.facet(Hn).map(r=>(this.dynamicDecorationMap[t++]=typeof r=="function")?r(this.view):r),i=!1,n=this.view.state.facet(_p).map((r,o)=>{let l=typeof r=="function";return l&&(i=!0),l?r(this.view):r});for(n.length&&(this.dynamicDecorationMap[t++]=i,e.push(I.join(n))),this.decorations=[this.editContextFormatting,...e,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];t<this.decorations.length;)this.dynamicDecorationMap[t++]=!1;return this.decorations}scrollIntoView(t){if(t.isSnapshot){let h=this.view.viewState.lineBlockAt(t.range.head);this.view.scrollDOM.scrollTop=h.top-t.yMargin,this.view.scrollDOM.scrollLeft=t.xMargin;return}for(let h of this.view.state.facet(Ip))try{if(h(this.view,t.range,t))return!0}catch(c){Ce(this.view.state,c,"scroll handler")}let{range:e}=t,i=this.coordsAt(e.head,e.empty?e.assoc:e.head>e.anchor?-1:1),n;if(!i)return;!e.empty&&(n=this.coordsAt(e.anchor,e.anchor>e.head?-1:1))&&(i={left:Math.min(i.left,n.left),top:Math.min(i.top,n.top),right:Math.max(i.right,n.right),bottom:Math.max(i.bottom,n.bottom)});let r=Fp(this.view),o={left:i.left-r.left,top:i.top-r.top,right:i.right+r.right,bottom:i.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;bb(this.view.scrollDOM,o,e.head<e.anchor?-1:1,t.x,t.y,Math.max(Math.min(t.xMargin,l),-l),Math.max(Math.min(t.yMargin,a),-a),this.view.textDirection==kt.LTR)}}function Xb(s){return s.node.nodeType==1&&s.node.firstChild&&(s.offset==0||s.node.childNodes[s.offset-1].contentEditable=="false")&&(s.offset==s.node.childNodes.length||s.node.childNodes[s.offset].contentEditable=="false")}function Up(s,t){let e=s.observer.selectionRange;if(!e.focusNode)return null;let i=Sp(e.focusNode,e.focusOffset),n=xp(e.focusNode,e.focusOffset),r=i||n;if(n&&i&&n.node!=i.node){let l=tt.get(n.node);if(!l||l instanceof ue&&l.text!=n.node.nodeValue)r=n;else if(s.docView.lastCompositionAfterCursor){let a=tt.get(i.node);!a||a instanceof ue&&a.text!=i.node.nodeValue||(r=n)}}if(s.docView.lastCompositionAfterCursor=r!=i,!r)return null;let o=t-r.offset;return{from:o,to:o+r.node.nodeValue.length,node:r.node}}function Lb(s,t,e){let i=Up(s,e);if(!i)return null;let{node:n,from:r,to:o}=i,l=n.nodeValue;if(/[\n\r]/.test(l)||s.state.doc.sliceString(i.from,i.to)!=l)return null;let a=t.invertedDesc,h=new ie(a.mapPos(r),a.mapPos(o),r,o),c=[];for(let f=n.parentNode;;f=f.parentNode){let u=tt.get(f);if(u instanceof He)c.push({node:f,deco:u.mark});else{if(u instanceof Ot||f.nodeName=="DIV"&&f.parentNode==s.contentDOM)return{range:h,text:n,marks:c,line:f};if(f!=s.contentDOM)c.push({node:f,deco:new ss({inclusive:!0,attributes:Qb(f),tagName:f.tagName.toLowerCase()})});else return null}}}function jb(s,t){return s.nodeType!=1?0:(t&&s.childNodes[t-1].contentEditable=="false"?1:0)|(t<s.childNodes.length&&s.childNodes[t].contentEditable=="false"?2:0)}let Vb=class{constructor(){this.changes=[]}compareRange(t,e){na(t,e,this.changes)}comparePoint(t,e){na(t,e,this.changes)}};function Nb(s,t,e){let i=new Vb;return I.compare(s,t,e,i),i.changes}function Ib(s,t){for(let e=s;e&&e!=t;e=e.assignedSlot||e.parentNode)if(e.nodeType==1&&e.contentEditable=="false")return!0;return!1}function qb(s,t){let e=!1;return t&&s.iterChangedRanges((i,n)=>{i<t.to&&n>t.from&&(e=!0)}),e}function zb(s,t,e=1){let i=s.charCategorizer(t),n=s.doc.lineAt(t),r=t-n.from;if(n.length==0)return S.cursor(t);r==0?e=1:r==n.length&&(e=-1);let o=r,l=r;e<0?o=ct(n.text,r,!1):l=ct(n.text,r);let a=i(n.text.slice(o,l));for(;o>0;){let h=ct(n.text,o,!1);if(i(n.text.slice(h,o))!=a)break;o=h}for(;l<n.length;){let h=ct(n.text,l);if(i(n.text.slice(l,h))!=a)break;l=h}return S.range(o+n.from,l+n.from)}function _b(s,t){return t.left>s?t.left-s:Math.max(0,s-t.right)}function Gb(s,t){return t.top>s?t.top-s:Math.max(0,s-t.bottom)}function Mo(s,t){return s.top<t.bottom-1&&s.bottom>t.top+1}function tf(s,t){return t<s.top?{top:t,left:s.left,right:s.right,bottom:s.bottom}:s}function ef(s,t){return t>s.bottom?{top:s.top,left:s.left,right:s.right,bottom:t}:s}function ha(s,t,e){let i,n,r,o,l=!1,a,h,c,f;for(let p=s.firstChild;p;p=p.nextSibling){let g=Gn(p);for(let m=0;m<g.length;m++){let O=g[m];n&&Mo(n,O)&&(O=tf(ef(O,n.bottom),n.top));let y=_b(t,O),x=Gb(e,O);if(y==0&&x==0)return p.nodeType==3?nf(p,t,e):ha(p,t,e);if(!i||o>x||o==x&&r>y){i=p,n=O,r=y,o=x;let k=x?e<O.top?-1:1:y?t<O.left?-1:1:0;l=!k||(k>0?m<g.length-1:m>0)}y==0?e>O.bottom&&(!c||c.bottom<O.bottom)?(a=p,c=O):e<O.top&&(!f||f.top>O.top)&&(h=p,f=O):c&&Mo(c,O)?c=ef(c,O.bottom):f&&Mo(f,O)&&(f=tf(f,O.top))}}if(c&&c.bottom>=e?(i=a,n=c):f&&f.top<=e&&(i=h,n=f),!i)return{node:s,offset:0};let u=Math.max(n.left,Math.min(n.right,t));if(i.nodeType==3)return nf(i,u,e);if(l&&i.contentEditable!="false")return ha(i,u,e);let d=Array.prototype.indexOf.call(s.childNodes,i)+(t>=(n.left+n.right)/2?1:0);return{node:s,offset:d}}function nf(s,t,e){let i=s.nodeValue.length,n=-1,r=1e9,o=0;for(let l=0;l<i;l++){let a=Ci(s,l,l+1).getClientRects();for(let h=0;h<a.length;h++){let c=a[h];if(c.top==c.bottom)continue;o||(o=t-c.left);let f=(c.top>e?c.top-e:e-c.bottom)-1;if(c.left-1<=t&&c.right+1>=t&&f<r){let u=t>=(c.left+c.right)/2,d=u;if((W.chrome||W.gecko)&&Ci(s,l).getBoundingClientRect().left==c.right&&(d=!u),f<=0)return{node:s,offset:l+(d?1:0)};n=l+(d?1:0),r=f}}}return{node:s,offset:n>-1?n:o>0?s.nodeValue.length:0}}function Kp(s,t,e,i=-1){var n,r;let o=s.contentDOM.getBoundingClientRect(),l=o.top+s.viewState.paddingTop,a,{docHeight:h}=s.viewState,{x:c,y:f}=t,u=f-l;if(u<0)return 0;if(u>h)return s.state.doc.length;for(let k=s.viewState.heightOracle.textHeight/2,w=!1;a=s.elementAtHeight(u),a.type!=Re.Text;)for(;u=i>0?a.bottom+k:a.top-k,!(u>=0&&u<=h);){if(w)return e?null:0;w=!0,i=-i}f=l+u;let d=a.from;if(d<s.viewport.from)return s.viewport.from==0?0:e?null:sf(s,o,a,c,f);if(d>s.viewport.to)return s.viewport.to==s.state.doc.length?s.state.doc.length:e?null:sf(s,o,a,c,f);let p=s.dom.ownerDocument,g=s.root.elementFromPoint?s.root:p,m=g.elementFromPoint(c,f);m&&!s.contentDOM.contains(m)&&(m=null),m||(c=Math.max(o.left+1,Math.min(o.right-1,c)),m=g.elementFromPoint(c,f),m&&!s.contentDOM.contains(m)&&(m=null));let O,y=-1;if(m&&((n=s.docView.nearest(m))===null||n===void 0?void 0:n.isEditable)!=!1){if(p.caretPositionFromPoint){let k=p.caretPositionFromPoint(c,f);k&&({offsetNode:O,offset:y}=k)}else if(p.caretRangeFromPoint){let k=p.caretRangeFromPoint(c,f);k&&({startContainer:O,startOffset:y}=k,(!s.contentDOM.contains(O)||W.safari&&Hb(O,y,c)||W.chrome&&Fb(O,y,c))&&(O=void 0))}O&&(y=Math.min(We(O),y))}if(!O||!s.docView.dom.contains(O)){let k=Ot.find(s.docView,d);if(!k)return u>a.top+a.height/2?a.to:a.from;({node:O,offset:y}=ha(k.dom,c,f))}let x=s.docView.nearest(O);if(!x)return null;if(x.isWidget&&((r=x.dom)===null||r===void 0?void 0:r.nodeType)==1){let k=x.dom.getBoundingClientRect();return t.y<k.top||t.y<=k.bottom&&t.x<=(k.left+k.right)/2?x.posAtStart:x.posAtEnd}else return x.localPosFromDOM(O,y)+x.posAtStart}function sf(s,t,e,i,n){let r=Math.round((i-t.left)*s.defaultCharacterWidth);if(s.lineWrapping&&e.height>s.defaultLineHeight*1.5){let l=s.viewState.heightOracle.textHeight,a=Math.floor((n-e.top-(s.defaultLineHeight-l)*.5)/l);r+=a*s.viewState.heightOracle.lineLength}let o=s.state.sliceDoc(e.from,e.to);return e.from+br(o,r,s.state.tabSize)}function Hb(s,t,e){let i;if(s.nodeType!=3||t!=(i=s.nodeValue.length))return!1;for(let n=s.nextSibling;n;n=n.nextSibling)if(n.nodeType!=1||n.nodeName!="BR")return!1;return Ci(s,i-1,i).getBoundingClientRect().left>e}function Fb(s,t,e){if(t!=0)return!1;for(let n=s;;){let r=n.parentNode;if(!r||r.nodeType!=1||r.firstChild!=n)return!1;if(r.classList.contains("cm-line"))break;n=r}let i=s.nodeType==1?s.getBoundingClientRect():Ci(s,0,Math.max(s.nodeValue.length,1)).getBoundingClientRect();return e-i.left>5}function Ub(s,t){let e=s.lineBlockAt(t);if(Array.isArray(e.type)){for(let i of e.type)if(i.to>t||i.to==t&&(i.to==e.to||i.type==Re.Text))return i}return e}function Kb(s,t,e,i){let n=Ub(s,t.head),r=!i||n.type!=Re.Text||!(s.lineWrapping||n.widgetLineBreaks)?null:s.coordsAtPos(t.assoc<0&&t.head>n.from?t.head-1:t.head);if(r){let o=s.dom.getBoundingClientRect(),l=s.textDirectionAt(n.from),a=s.posAtCoords({x:e==(l==kt.LTR)?o.right-1:o.left+1,y:(r.top+r.bottom)/2});if(a!=null)return S.cursor(a,e?-1:1)}return S.cursor(e?n.to:n.from,e?-1:1)}function rf(s,t,e,i){let n=s.state.doc.lineAt(t.head),r=s.bidiSpans(n),o=s.textDirectionAt(n.from);for(let l=t,a=null;;){let h=Wb(n,r,o,l,e),c=Ep;if(!h){if(n.number==(e?s.state.doc.lines:1))return l;c=`
11
+ `,n=s.state.doc.line(n.number+(e?1:-1)),r=s.bidiSpans(n),h=s.visualLineSide(n,!e)}if(a){if(!a(c))return l}else{if(!i)return h;a=i(c)}l=h}}function Jb(s,t,e){let i=s.state.charCategorizer(t),n=i(e);return r=>{let o=i(r);return n==rt.Space&&(n=o),n==o}}function ty(s,t,e,i){let n=t.head,r=e?1:-1;if(n==(e?s.state.doc.length:0))return S.cursor(n,t.assoc);let o=t.goalColumn,l,a=s.contentDOM.getBoundingClientRect(),h=s.coordsAtPos(n,t.assoc||-1),c=s.documentTop;if(h)o==null&&(o=h.left-a.left),l=r<0?h.top:h.bottom;else{let d=s.viewState.lineBlockAt(n);o==null&&(o=Math.min(a.right-a.left,s.defaultCharacterWidth*(n-d.from))),l=(r<0?d.top:d.bottom)+c}let f=a.left+o,u=i??s.viewState.heightOracle.textHeight>>1;for(let d=0;;d+=10){let p=l+(u+d)*r,g=Kp(s,{x:f,y:p},!1,r);if(p<a.top||p>a.bottom||(r<0?g<n:g>n)){let m=s.docView.coordsForChar(g),O=!m||p<m.top?-1:1;return S.cursor(g,O,void 0,o)}}}function ar(s,t,e){for(;;){let i=0;for(let n of s)n.between(t-1,t+1,(r,o,l)=>{if(t>r&&t<o){let a=i||e||(t-r<o-t?-1:1);t=a<0?r:o,i=a}});if(!i)return t}}function Ro(s,t,e){let i=ar(s.state.facet(fh).map(n=>n(s)),e.from,t.head>e.from?-1:1);return i==e.from?e:S.cursor(i,i<e.from?1:-1)}const Tn="￿";class ey{constructor(t,e){this.points=t,this.text="",this.lineSeparator=e.facet(V.lineSeparator)}append(t){this.text+=t}lineBreak(){this.text+=Tn}readRange(t,e){if(!t)return this;let i=t.parentNode;for(let n=t;;){this.findPointBefore(i,n);let r=this.text.length;this.readNode(n);let o=n.nextSibling;if(o==e)break;let l=tt.get(n),a=tt.get(o);(l&&a?l.breakAfter:(l?l.breakAfter:Sr(n))||Sr(o)&&(n.nodeName!="BR"||n.cmIgnore)&&this.text.length>r)&&this.lineBreak(),n=o}return this.findPointBefore(i,e),this}readTextNode(t){let e=t.nodeValue;for(let i of this.points)i.node==t&&(i.pos=this.text.length+Math.min(i.offset,e.length));for(let i=0,n=this.lineSeparator?null:/\r\n?|\n/g;;){let r=-1,o=1,l;if(this.lineSeparator?(r=e.indexOf(this.lineSeparator,i),o=this.lineSeparator.length):(l=n.exec(e))&&(r=l.index,o=l[0].length),this.append(e.slice(i,r<0?e.length:r)),r<0)break;if(this.lineBreak(),o>1)for(let a of this.points)a.node==t&&a.pos>this.text.length&&(a.pos-=o-1);i=r+o}}readNode(t){if(t.cmIgnore)return;let e=tt.get(t),i=e&&e.overrideDOMText;if(i!=null){this.findPointInside(t,i.length);for(let n=i.iter();!n.next().done;)n.lineBreak?this.lineBreak():this.append(n.value)}else t.nodeType==3?this.readTextNode(t):t.nodeName=="BR"?t.nextSibling&&this.lineBreak():t.nodeType==1&&this.readRange(t.firstChild,null)}findPointBefore(t,e){for(let i of this.points)i.node==t&&t.childNodes[i.offset]==e&&(i.pos=this.text.length)}findPointInside(t,e){for(let i of this.points)(t.nodeType==3?i.node==t:t.contains(i.node))&&(i.pos=this.text.length+(iy(t,i.node,i.offset)?e:0))}}function iy(s,t,e){for(;;){if(!t||e<We(t))return!1;if(t==s)return!0;e=Pi(t)+1,t=t.parentNode}}class of{constructor(t,e){this.node=t,this.offset=e,this.pos=-1}}class ny{constructor(t,e,i,n){this.typeOver=n,this.bounds=null,this.text="",this.domChanged=e>-1;let{impreciseHead:r,impreciseAnchor:o}=t.docView;if(t.state.readOnly&&e>-1)this.newSel=null;else if(e>-1&&(this.bounds=t.docView.domBoundsAround(e,i,0))){let l=r||o?[]:oy(t),a=new ey(l,t.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=ly(l,this.bounds.from)}else{let l=t.observer.selectionRange,a=r&&r.node==l.focusNode&&r.offset==l.focusOffset||!Ul(t.contentDOM,l.focusNode)?t.state.selection.main.head:t.docView.posFromDOM(l.focusNode,l.focusOffset),h=o&&o.node==l.anchorNode&&o.offset==l.anchorOffset||!Ul(t.contentDOM,l.anchorNode)?t.state.selection.main.anchor:t.docView.posFromDOM(l.anchorNode,l.anchorOffset),c=t.viewport;if((W.ios||W.chrome)&&t.state.selection.main.empty&&a!=h&&(c.from>0||c.to<t.state.doc.length)){let f=Math.min(a,h),u=Math.max(a,h),d=c.from-f,p=c.to-u;(d==0||d==1||f==0)&&(p==0||p==-1||u==t.state.doc.length)&&(a=0,h=t.state.doc.length)}this.newSel=S.single(h,a)}}}function Jp(s,t){let e,{newSel:i}=t,n=s.state.selection.main,r=s.inputState.lastKeyTime>Date.now()-100?s.inputState.lastKeyCode:-1;if(t.bounds){let{from:o,to:l}=t.bounds,a=n.from,h=null;(r===8||W.android&&t.text.length<l-o)&&(a=n.to,h="end");let c=ry(s.state.doc.sliceString(o,l,Tn),t.text,a-o,h);c&&(W.chrome&&r==13&&c.toB==c.from+2&&t.text.slice(c.from,c.toB)==Tn+Tn&&c.toB--,e={from:o+c.from,to:o+c.toA,insert:q.of(t.text.slice(c.from,c.toB).split(Tn))})}else i&&(!s.hasFocus&&s.state.facet(ii)||i.main.eq(n))&&(i=null);if(!e&&!i)return!1;if(!e&&t.typeOver&&!n.empty&&i&&i.main.empty?e={from:n.from,to:n.to,insert:s.state.doc.slice(n.from,n.to)}:e&&e.from>=n.from&&e.to<=n.to&&(e.from!=n.from||e.to!=n.to)&&n.to-n.from-(e.to-e.from)<=4?e={from:n.from,to:n.to,insert:s.state.doc.slice(n.from,e.from).append(e.insert).append(s.state.doc.slice(e.to,n.to))}:(W.mac||W.android)&&e&&e.from==e.to&&e.from==n.head-1&&/^\. ?$/.test(e.insert.toString())&&s.contentDOM.getAttribute("autocorrect")=="off"?(i&&e.insert.length==2&&(i=S.single(i.main.anchor-1,i.main.head-1)),e={from:n.from,to:n.to,insert:q.of([" "])}):W.chrome&&e&&e.from==e.to&&e.from==n.head&&e.insert.toString()==`
12
+ `&&s.lineWrapping&&(i&&(i=S.single(i.main.anchor-1,i.main.head-1)),e={from:n.from,to:n.to,insert:q.of([" "])}),e)return uh(s,e,i,r);if(i&&!i.main.eq(n)){let o=!1,l="select";return s.inputState.lastSelectionTime>Date.now()-50&&(s.inputState.lastSelectionOrigin=="select"&&(o=!0),l=s.inputState.lastSelectionOrigin),s.dispatch({selection:i,scrollIntoView:o,userEvent:l}),!0}else return!1}function uh(s,t,e,i=-1){if(W.ios&&s.inputState.flushIOSKey(t))return!0;let n=s.state.selection.main;if(W.android&&(t.to==n.to&&(t.from==n.from||t.from==n.from-1&&s.state.sliceDoc(t.from,n.from)==" ")&&t.insert.length==1&&t.insert.lines==2&&Ii(s.contentDOM,"Enter",13)||(t.from==n.from-1&&t.to==n.to&&t.insert.length==0||i==8&&t.insert.length<t.to-t.from&&t.to>n.head)&&Ii(s.contentDOM,"Backspace",8)||t.from==n.from&&t.to==n.to+1&&t.insert.length==0&&Ii(s.contentDOM,"Delete",46)))return!0;let r=t.insert.toString();s.inputState.composing>=0&&s.inputState.composing++;let o,l=()=>o||(o=sy(s,t,e));return s.state.facet(jp).some(a=>a(s,t.from,t.to,r,l))||s.dispatch(l()),!0}function sy(s,t,e){let i,n=s.state,r=n.selection.main;if(t.from>=r.from&&t.to<=r.to&&t.to-t.from>=(r.to-r.from)/3&&(!e||e.main.empty&&e.main.from==t.from+t.insert.length)&&s.inputState.composing<0){let l=r.from<t.from?n.sliceDoc(r.from,t.from):"",a=r.to>t.to?n.sliceDoc(t.to,r.to):"";i=n.replaceSelection(s.state.toText(l+t.insert.sliceString(0,void 0,s.state.lineBreak)+a))}else{let l=n.changes(t),a=e&&e.main.to<=l.newLength?e.main:void 0;if(n.selection.ranges.length>1&&s.inputState.composing>=0&&t.to<=r.to&&t.to>=r.to-10){let h=s.state.sliceDoc(t.from,t.to),c,f=e&&Up(s,e.main.head);if(f){let p=t.insert.length-(t.to-t.from);c={from:f.from,to:f.to-p}}else c=s.state.doc.lineAt(r.head);let u=r.to-t.to,d=r.to-r.from;i=n.changeByRange(p=>{if(p.from==r.from&&p.to==r.to)return{changes:l,range:a||p.map(l)};let g=p.to-u,m=g-h.length;if(p.to-p.from!=d||s.state.sliceDoc(m,g)!=h||p.to>=c.from&&p.from<=c.to)return{range:p};let O=n.changes({from:m,to:g,insert:t.insert}),y=p.to-r.to;return{changes:O,range:a?S.range(Math.max(0,a.anchor+y),Math.max(0,a.head+y)):p.map(O)}})}else i={changes:l,selection:a&&n.selection.replaceRange(a)}}let o="input.type";return(s.composing||s.inputState.compositionPendingChange&&s.inputState.compositionEndedAt>Date.now()-50)&&(s.inputState.compositionPendingChange=!1,o+=".compose",s.inputState.compositionFirstChange&&(o+=".start",s.inputState.compositionFirstChange=!1)),n.update(i,{userEvent:o,scrollIntoView:!0})}function ry(s,t,e,i){let n=Math.min(s.length,t.length),r=0;for(;r<n&&s.charCodeAt(r)==t.charCodeAt(r);)r++;if(r==n&&s.length==t.length)return null;let o=s.length,l=t.length;for(;o>0&&l>0&&s.charCodeAt(o-1)==t.charCodeAt(l-1);)o--,l--;if(i=="end"){let a=Math.max(0,r-Math.min(o,l));e-=o+a-r}if(o<r&&s.length<t.length){let a=e<=r&&e>=o?r-e:0;r-=a,l=r+(l-o),o=r}else if(l<r){let a=e<=r&&e>=l?r-e:0;r-=a,o=r+(o-l),l=r}return{from:r,toA:o,toB:l}}function oy(s){let t=[];if(s.root.activeElement!=s.contentDOM)return t;let{anchorNode:e,anchorOffset:i,focusNode:n,focusOffset:r}=s.observer.selectionRange;return e&&(t.push(new of(e,i)),(n!=e||r!=i)&&t.push(new of(n,r))),t}function ly(s,t){if(s.length==0)return null;let e=s[0].pos,i=s.length==2?s[1].pos:e;return e>-1&&i>-1?S.single(e+t,i+t):null}class ay{setSelectionOrigin(t){this.lastSelectionOrigin=t,this.lastSelectionTime=Date.now()}constructor(t){this.view=t,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=t.hasFocus,W.safari&&t.contentDOM.addEventListener("input",()=>null),W.gecko&&vy(t.contentDOM.ownerDocument)}handleEvent(t){!my(this.view,t)||this.ignoreDuringComposition(t)||t.type=="keydown"&&this.keydown(t)||this.runHandlers(t.type,t)}runHandlers(t,e){let i=this.handlers[t];if(i){for(let n of i.observers)n(this.view,e);for(let n of i.handlers){if(e.defaultPrevented)break;if(n(this.view,e)){e.preventDefault();break}}}}ensureHandlers(t){let e=hy(t),i=this.handlers,n=this.view.contentDOM;for(let r in e)if(r!="scroll"){let o=!e[r].handlers.length,l=i[r];l&&o!=!l.handlers.length&&(n.removeEventListener(r,this.handleEvent),l=null),l||n.addEventListener(r,this.handleEvent,{passive:o})}for(let r in i)r!="scroll"&&!e[r]&&n.removeEventListener(r,this.handleEvent);this.handlers=e}keydown(t){if(this.lastKeyCode=t.keyCode,this.lastKeyTime=Date.now(),t.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&t.keyCode!=27&&eg.indexOf(t.keyCode)<0&&(this.tabFocusMode=-1),W.android&&W.chrome&&!t.synthetic&&(t.keyCode==13||t.keyCode==8))return this.view.observer.delayAndroidKey(t.key,t.keyCode),!0;let e;return W.ios&&!t.synthetic&&!t.altKey&&!t.metaKey&&((e=tg.find(i=>i.keyCode==t.keyCode))&&!t.ctrlKey||cy.indexOf(t.key)>-1&&t.ctrlKey&&!t.shiftKey)?(this.pendingIOSKey=e||t,setTimeout(()=>this.flushIOSKey(),250),!0):(t.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(t){let e=this.pendingIOSKey;return!e||e.key=="Enter"&&t&&t.from<t.to&&/^\S+$/.test(t.insert.toString())?!1:(this.pendingIOSKey=void 0,Ii(this.view.contentDOM,e.key,e.keyCode,e instanceof KeyboardEvent?e:void 0))}ignoreDuringComposition(t){return/^key/.test(t.type)?this.composing>0?!0:W.safari&&!W.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(t){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=t}update(t){this.view.observer.update(t),this.mouseSelection&&this.mouseSelection.update(t),this.draggedContent&&t.docChanged&&(this.draggedContent=this.draggedContent.map(t.changes)),t.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function lf(s,t){return(e,i)=>{try{return t.call(s,i,e)}catch(n){Ce(e.state,n)}}}function hy(s){let t=Object.create(null);function e(i){return t[i]||(t[i]={observers:[],handlers:[]})}for(let i of s){let n=i.spec;if(n&&n.domEventHandlers)for(let r in n.domEventHandlers){let o=n.domEventHandlers[r];o&&e(r).handlers.push(lf(i.value,o))}if(n&&n.domEventObservers)for(let r in n.domEventObservers){let o=n.domEventObservers[r];o&&e(r).observers.push(lf(i.value,o))}}for(let i in de)e(i).handlers.push(de[i]);for(let i in ne)e(i).observers.push(ne[i]);return t}const tg=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],cy="dthko",eg=[16,17,18,20,91,92,224,225],Qs=6;function Ps(s){return Math.max(0,s)*.7+8}function fy(s,t){return Math.max(Math.abs(s.clientX-t.clientX),Math.abs(s.clientY-t.clientY))}class uy{constructor(t,e,i,n){this.view=t,this.startEvent=e,this.style=i,this.mustSelect=n,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=e,this.scrollParents=yb(t.contentDOM),this.atoms=t.state.facet(fh).map(o=>o(t));let r=t.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=e.shiftKey,this.multiple=t.state.facet(V.allowMultipleSelections)&&dy(t,e),this.dragging=gy(t,e)&&sg(e)==1?null:!1}start(t){this.dragging===!1&&this.select(t)}move(t){if(t.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&fy(this.startEvent,t)<10)return;this.select(this.lastEvent=t);let e=0,i=0,n=0,r=0,o=this.view.win.innerWidth,l=this.view.win.innerHeight;this.scrollParents.x&&({left:n,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:r,bottom:l}=this.scrollParents.y.getBoundingClientRect());let a=Fp(this.view);t.clientX-a.left<=n+Qs?e=-Ps(n-t.clientX):t.clientX+a.right>=o-Qs&&(e=Ps(t.clientX-o)),t.clientY-a.top<=r+Qs?i=-Ps(r-t.clientY):t.clientY+a.bottom>=l-Qs&&(i=Ps(t.clientY-l)),this.setScrollSpeed(e,i)}up(t){this.dragging==null&&this.select(this.lastEvent),this.dragging||t.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let t=this.view.contentDOM.ownerDocument;t.removeEventListener("mousemove",this.move),t.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(t,e){this.scrollSpeed={x:t,y:e},t||e?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:t,y:e}=this.scrollSpeed;t&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=t,t=0),e&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=e,e=0),(t||e)&&this.view.win.scrollBy(t,e),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(t){let e=null;for(let i=0;i<t.ranges.length;i++){let n=t.ranges[i],r=null;if(n.empty){let o=ar(this.atoms,n.from,0);o!=n.from&&(r=S.cursor(o,-1))}else{let o=ar(this.atoms,n.from,-1),l=ar(this.atoms,n.to,1);(o!=n.from||l!=n.to)&&(r=S.range(n.from==n.anchor?o:l,n.from==n.head?o:l))}r&&(e||(e=t.ranges.slice()),e[i]=r)}return e?S.create(e,t.mainIndex):t}select(t){let{view:e}=this,i=this.skipAtoms(this.style.get(t,this.extend,this.multiple));(this.mustSelect||!i.eq(e.state.selection,this.dragging===!1))&&this.view.dispatch({selection:i,userEvent:"select.pointer"}),this.mustSelect=!1}update(t){t.transactions.some(e=>e.isUserEvent("input.type"))?this.destroy():this.style.update(t)&&setTimeout(()=>this.select(this.lastEvent),20)}}function dy(s,t){let e=s.state.facet(Bp);return e.length?e[0](t):W.mac?t.metaKey:t.ctrlKey}function py(s,t){let e=s.state.facet(Yp);return e.length?e[0](t):W.mac?!t.altKey:!t.ctrlKey}function gy(s,t){let{main:e}=s.state.selection;if(e.empty)return!1;let i=_n(s.root);if(!i||i.rangeCount==0)return!0;let n=i.getRangeAt(0).getClientRects();for(let r=0;r<n.length;r++){let o=n[r];if(o.left<=t.clientX&&o.right>=t.clientX&&o.top<=t.clientY&&o.bottom>=t.clientY)return!0}return!1}function my(s,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let e=t.target,i;e!=s.contentDOM;e=e.parentNode)if(!e||e.nodeType==11||(i=tt.get(e))&&i.ignoreEvent(t))return!1;return!0}const de=Object.create(null),ne=Object.create(null),ig=W.ie&&W.ie_version<15||W.ios&&W.webkit_version<604;function Oy(s){let t=s.dom.parentNode;if(!t)return;let e=t.appendChild(document.createElement("textarea"));e.style.cssText="position: fixed; left: -10000px; top: 10px",e.focus(),setTimeout(()=>{s.focus(),e.remove(),ng(s,e.value)},50)}function so(s,t,e){for(let i of s.facet(t))e=i(e,s);return e}function ng(s,t){t=so(s.state,ah,t);let{state:e}=s,i,n=1,r=e.toText(t),o=r.lines==e.selection.ranges.length;if(ca!=null&&e.selection.ranges.every(a=>a.empty)&&ca==r.toString()){let a=-1;i=e.changeByRange(h=>{let c=e.doc.lineAt(h.from);if(c.from==a)return{range:h};a=c.from;let f=e.toText((o?r.line(n++).text:t)+e.lineBreak);return{changes:{from:c.from,insert:f},range:S.cursor(h.from+f.length)}})}else o?i=e.changeByRange(a=>{let h=r.line(n++);return{changes:{from:a.from,to:a.to,insert:h.text},range:S.cursor(a.from+h.length)}}):i=e.replaceSelection(r);s.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}ne.scroll=s=>{s.inputState.lastScrollTop=s.scrollDOM.scrollTop,s.inputState.lastScrollLeft=s.scrollDOM.scrollLeft};de.keydown=(s,t)=>(s.inputState.setSelectionOrigin("select"),t.keyCode==27&&s.inputState.tabFocusMode!=0&&(s.inputState.tabFocusMode=Date.now()+2e3),!1);ne.touchstart=(s,t)=>{s.inputState.lastTouchTime=Date.now(),s.inputState.setSelectionOrigin("select.pointer")};ne.touchmove=s=>{s.inputState.setSelectionOrigin("select.pointer")};de.mousedown=(s,t)=>{if(s.observer.flush(),s.inputState.lastTouchTime>Date.now()-2e3)return!1;let e=null;for(let i of s.state.facet(Xp))if(e=i(s,t),e)break;if(!e&&t.button==0&&(e=wy(s,t)),e){let i=!s.hasFocus;s.inputState.startMouseSelection(new uy(s,t,e,i)),i&&s.observer.ignore(()=>{bp(s.contentDOM);let r=s.root.activeElement;r&&!r.contains(s.contentDOM)&&r.blur()});let n=s.inputState.mouseSelection;if(n)return n.start(t),n.dragging===!1}return!1};function af(s,t,e,i){if(i==1)return S.cursor(t,e);if(i==2)return zb(s.state,t,e);{let n=Ot.find(s.docView,t),r=s.state.doc.lineAt(n?n.posAtEnd:t),o=n?n.posAtStart:r.from,l=n?n.posAtEnd:r.to;return l<s.state.doc.length&&l==r.to&&l++,S.range(o,l)}}let hf=(s,t,e)=>t>=e.top&&t<=e.bottom&&s>=e.left&&s<=e.right;function by(s,t,e,i){let n=Ot.find(s.docView,t);if(!n)return 1;let r=t-n.posAtStart;if(r==0)return 1;if(r==n.length)return-1;let o=n.coordsAt(r,-1);if(o&&hf(e,i,o))return-1;let l=n.coordsAt(r,1);return l&&hf(e,i,l)?1:o&&o.bottom>=i?-1:1}function cf(s,t){let e=s.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:e,bias:by(s,e,t.clientX,t.clientY)}}const yy=W.ie&&W.ie_version<=11;let ff=null,uf=0,df=0;function sg(s){if(!yy)return s.detail;let t=ff,e=df;return ff=s,df=Date.now(),uf=!t||e>Date.now()-400&&Math.abs(t.clientX-s.clientX)<2&&Math.abs(t.clientY-s.clientY)<2?(uf+1)%3:1}function wy(s,t){let e=cf(s,t),i=sg(t),n=s.state.selection;return{update(r){r.docChanged&&(e.pos=r.changes.mapPos(e.pos),n=n.map(r.changes))},get(r,o,l){let a=cf(s,r),h,c=af(s,a.pos,a.bias,i);if(e.pos!=a.pos&&!o){let f=af(s,e.pos,e.bias,i),u=Math.min(f.from,c.from),d=Math.max(f.to,c.to);c=u<c.from?S.range(u,d):S.range(d,u)}return o?n.replaceRange(n.main.extend(c.from,c.to)):l&&i==1&&n.ranges.length>1&&(h=Sy(n,a.pos))?h:l?n.addRange(c):S.create([c])}}}function Sy(s,t){for(let e=0;e<s.ranges.length;e++){let{from:i,to:n}=s.ranges[e];if(i<=t&&n>=t)return S.create(s.ranges.slice(0,e).concat(s.ranges.slice(e+1)),s.mainIndex==e?0:s.mainIndex-(s.mainIndex>e?1:0))}return null}de.dragstart=(s,t)=>{let{selection:{main:e}}=s.state;if(t.target.draggable){let n=s.docView.nearest(t.target);if(n&&n.isWidget){let r=n.posAtStart,o=r+n.length;(r>=e.to||o<=e.from)&&(e=S.range(r,o))}}let{inputState:i}=s;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=e,t.dataTransfer&&(t.dataTransfer.setData("Text",so(s.state,hh,s.state.sliceDoc(e.from,e.to))),t.dataTransfer.effectAllowed="copyMove"),!1};de.dragend=s=>(s.inputState.draggedContent=null,!1);function pf(s,t,e,i){if(e=so(s.state,ah,e),!e)return;let n=s.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:r}=s.inputState,o=i&&r&&py(s,t)?{from:r.from,to:r.to}:null,l={from:n,insert:e},a=s.state.changes(o?[o,l]:l);s.focus(),s.dispatch({changes:a,selection:{anchor:a.mapPos(n,-1),head:a.mapPos(n,1)},userEvent:o?"move.drop":"input.drop"}),s.inputState.draggedContent=null}de.drop=(s,t)=>{if(!t.dataTransfer)return!1;if(s.state.readOnly)return!0;let e=t.dataTransfer.files;if(e&&e.length){let i=Array(e.length),n=0,r=()=>{++n==e.length&&pf(s,t,i.filter(o=>o!=null).join(s.state.lineBreak),!1)};for(let o=0;o<e.length;o++){let l=new FileReader;l.onerror=r,l.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(l.result)||(i[o]=l.result),r()},l.readAsText(e[o])}return!0}else{let i=t.dataTransfer.getData("Text");if(i)return pf(s,t,i,!0),!0}return!1};de.paste=(s,t)=>{if(s.state.readOnly)return!0;s.observer.flush();let e=ig?null:t.clipboardData;return e?(ng(s,e.getData("text/plain")||e.getData("text/uri-list")),!0):(Oy(s),!1)};function xy(s,t){let e=s.dom.parentNode;if(!e)return;let i=e.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=t,i.focus(),i.selectionEnd=t.length,i.selectionStart=0,setTimeout(()=>{i.remove(),s.focus()},50)}function ky(s){let t=[],e=[],i=!1;for(let n of s.selection.ranges)n.empty||(t.push(s.sliceDoc(n.from,n.to)),e.push(n));if(!t.length){let n=-1;for(let{from:r}of s.selection.ranges){let o=s.doc.lineAt(r);o.number>n&&(t.push(o.text),e.push({from:o.from,to:Math.min(s.doc.length,o.to+1)})),n=o.number}i=!0}return{text:so(s,hh,t.join(s.lineBreak)),ranges:e,linewise:i}}let ca=null;de.copy=de.cut=(s,t)=>{let{text:e,ranges:i,linewise:n}=ky(s.state);if(!e&&!n)return!1;ca=n?e:null,t.type=="cut"&&!s.state.readOnly&&s.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let r=ig?null:t.clipboardData;return r?(r.clearData(),r.setData("text/plain",e),!0):(xy(s,e),!1)};const rg=se.define();function og(s,t){let e=[];for(let i of s.facet(Vp)){let n=i(s,t);n&&e.push(n)}return e?s.update({effects:e,annotations:rg.of(!0)}):null}function lg(s){setTimeout(()=>{let t=s.hasFocus;if(t!=s.inputState.notifiedFocused){let e=og(s.state,t);e?s.dispatch(e):s.update([])}},10)}ne.focus=s=>{s.inputState.lastFocusTime=Date.now(),!s.scrollDOM.scrollTop&&(s.inputState.lastScrollTop||s.inputState.lastScrollLeft)&&(s.scrollDOM.scrollTop=s.inputState.lastScrollTop,s.scrollDOM.scrollLeft=s.inputState.lastScrollLeft),lg(s)};ne.blur=s=>{s.observer.clearSelectionRange(),lg(s)};ne.compositionstart=ne.compositionupdate=s=>{s.observer.editContext||(s.inputState.compositionFirstChange==null&&(s.inputState.compositionFirstChange=!0),s.inputState.composing<0&&(s.inputState.composing=0))};ne.compositionend=s=>{s.observer.editContext||(s.inputState.composing=-1,s.inputState.compositionEndedAt=Date.now(),s.inputState.compositionPendingKey=!0,s.inputState.compositionPendingChange=s.observer.pendingRecords().length>0,s.inputState.compositionFirstChange=null,W.chrome&&W.android?s.observer.flushSoon():s.inputState.compositionPendingChange?Promise.resolve().then(()=>s.observer.flush()):setTimeout(()=>{s.inputState.composing<0&&s.docView.hasComposition&&s.update([])},50))};ne.contextmenu=s=>{s.inputState.lastContextMenu=Date.now()};de.beforeinput=(s,t)=>{var e,i;if(t.inputType=="insertReplacementText"&&s.observer.editContext){let r=(e=t.dataTransfer)===null||e===void 0?void 0:e.getData("text/plain"),o=t.getTargetRanges();if(r&&o.length){let l=o[0],a=s.posAtDOM(l.startContainer,l.startOffset),h=s.posAtDOM(l.endContainer,l.endOffset);return uh(s,{from:a,to:h,insert:s.state.toText(r)},null),!0}}let n;if(W.chrome&&W.android&&(n=tg.find(r=>r.inputType==t.inputType))&&(s.observer.delayAndroidKey(n.key,n.keyCode),n.key=="Backspace"||n.key=="Delete")){let r=((i=window.visualViewport)===null||i===void 0?void 0:i.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>r+10&&s.hasFocus&&(s.contentDOM.blur(),s.focus())},100)}return W.ios&&t.inputType=="deleteContentForward"&&s.observer.flushSoon(),W.safari&&t.inputType=="insertText"&&s.inputState.composing>=0&&setTimeout(()=>ne.compositionend(s,t),20),!1};const gf=new Set;function vy(s){gf.has(s)||(gf.add(s),s.addEventListener("copy",()=>{}),s.addEventListener("cut",()=>{}))}const mf=["pre-wrap","normal","pre-line","break-spaces"];let sn=!1;function Of(){sn=!1}class $y{constructor(t){this.lineWrapping=t,this.doc=q.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(t,e){let i=this.doc.lineAt(e).number-this.doc.lineAt(t).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((e-t-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(t){return this.lineWrapping?(1+Math.max(0,Math.ceil((t-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(t){return this.doc=t,this}mustRefreshForWrapping(t){return mf.indexOf(t)>-1!=this.lineWrapping}mustRefreshForHeights(t){let e=!1;for(let i=0;i<t.length;i++){let n=t[i];n<0?i++:this.heightSamples[Math.floor(n*10)]||(e=!0,this.heightSamples[Math.floor(n*10)]=!0)}return e}refresh(t,e,i,n,r,o){let l=mf.indexOf(t)>-1,a=Math.round(e)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=e,this.charWidth=i,this.textHeight=n,this.lineLength=r,a){this.heightSamples={};for(let h=0;h<o.length;h++){let c=o[h];c<0?h++:this.heightSamples[Math.floor(c*10)]=!0}}return a}}class Qy{constructor(t,e){this.from=t,this.heights=e,this.index=0}get more(){return this.index<this.heights.length}}class Pe{constructor(t,e,i,n,r){this.from=t,this.length=e,this.top=i,this.height=n,this._content=r}get type(){return typeof this._content=="number"?Re.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof ci?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(t){let e=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(t._content)?t._content:[t]);return new Pe(this.from,this.length+t.length,this.top,this.height+t.height,e)}}var st=function(s){return s[s.ByPos=0]="ByPos",s[s.ByHeight=1]="ByHeight",s[s.ByPosNoHeight=2]="ByPosNoHeight",s}(st||(st={}));const hr=.001;class Bt{constructor(t,e,i=2){this.length=t,this.height=e,this.flags=i}get outdated(){return(this.flags&2)>0}set outdated(t){this.flags=(t?2:0)|this.flags&-3}setHeight(t){this.height!=t&&(Math.abs(this.height-t)>hr&&(sn=!0),this.height=t)}replace(t,e,i){return Bt.of(i)}decomposeLeft(t,e){e.push(this)}decomposeRight(t,e){e.push(this)}applyChanges(t,e,i,n){let r=this,o=i.doc;for(let l=n.length-1;l>=0;l--){let{fromA:a,toA:h,fromB:c,toB:f}=n[l],u=r.lineAt(a,st.ByPosNoHeight,i.setDoc(e),0,0),d=u.to>=h?u:r.lineAt(h,st.ByPosNoHeight,i,0,0);for(f+=d.to-h,h=d.to;l>0&&u.from<=n[l-1].toA;)a=n[l-1].fromA,c=n[l-1].fromB,l--,a<u.from&&(u=r.lineAt(a,st.ByPosNoHeight,i,0,0));c+=u.from-a,a=u.from;let p=dh.build(i.setDoc(o),t,c,f);r=vr(r,r.replace(a,h,p))}return r.updateHeight(i,0)}static empty(){return new _t(0,0)}static of(t){if(t.length==1)return t[0];let e=0,i=t.length,n=0,r=0;for(;;)if(e==i)if(n>r*2){let l=t[e-1];l.break?t.splice(--e,1,l.left,null,l.right):t.splice(--e,1,l.left,l.right),i+=1+l.break,n-=l.size}else if(r>n*2){let l=t[i];l.break?t.splice(i,1,l.left,null,l.right):t.splice(i,1,l.left,l.right),i+=2+l.break,r-=l.size}else break;else if(n<r){let l=t[e++];l&&(n+=l.size)}else{let l=t[--i];l&&(r+=l.size)}let o=0;return t[e-1]==null?(o=1,e--):t[e]==null&&(o=1,i++),new Py(Bt.of(t.slice(0,e)),o,Bt.of(t.slice(i)))}}function vr(s,t){return s==t?s:(s.constructor!=t.constructor&&(sn=!0),t)}Bt.prototype.size=1;class ag extends Bt{constructor(t,e,i){super(t,e),this.deco=i}blockAt(t,e,i,n){return new Pe(n,this.length,i,this.height,this.deco||0)}lineAt(t,e,i,n,r){return this.blockAt(0,i,n,r)}forEachLine(t,e,i,n,r,o){t<=r+this.length&&e>=r&&o(this.blockAt(0,i,n,r))}updateHeight(t,e=0,i=!1,n){return n&&n.from<=e&&n.more&&this.setHeight(n.heights[n.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class _t extends ag{constructor(t,e){super(t,e,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(t,e,i,n){return new Pe(n,this.length,i,this.height,this.breaks)}replace(t,e,i){let n=i[0];return i.length==1&&(n instanceof _t||n instanceof vt&&n.flags&4)&&Math.abs(this.length-n.length)<10?(n instanceof vt?n=new _t(n.length,this.height):n.height=this.height,this.outdated||(n.outdated=!1),n):Bt.of(i)}updateHeight(t,e=0,i=!1,n){return n&&n.from<=e&&n.more?this.setHeight(n.heights[n.index++]):(i||this.outdated)&&this.setHeight(Math.max(this.widgetHeight,t.heightForLine(this.length-this.collapsed))+this.breaks*t.lineHeight),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class vt extends Bt{constructor(t){super(t,0)}heightMetrics(t,e){let i=t.doc.lineAt(e).number,n=t.doc.lineAt(e+this.length).number,r=n-i+1,o,l=0;if(t.lineWrapping){let a=Math.min(this.height,t.lineHeight*r);o=a/r,this.length>r+1&&(l=(this.height-a)/(this.length-r-1))}else o=this.height/r;return{firstLine:i,lastLine:n,perLine:o,perChar:l}}blockAt(t,e,i,n){let{firstLine:r,lastLine:o,perLine:l,perChar:a}=this.heightMetrics(e,n);if(e.lineWrapping){let h=n+(t<e.lineHeight?0:Math.round(Math.max(0,Math.min(1,(t-i)/this.height))*this.length)),c=e.doc.lineAt(h),f=l+c.length*a,u=Math.max(i,t-f/2);return new Pe(c.from,c.length,u,f,0)}else{let h=Math.max(0,Math.min(o-r,Math.floor((t-i)/l))),{from:c,length:f}=e.doc.line(r+h);return new Pe(c,f,i+l*h,l,0)}}lineAt(t,e,i,n,r){if(e==st.ByHeight)return this.blockAt(t,i,n,r);if(e==st.ByPosNoHeight){let{from:d,to:p}=i.doc.lineAt(t);return new Pe(d,p-d,0,0,0)}let{firstLine:o,perLine:l,perChar:a}=this.heightMetrics(i,r),h=i.doc.lineAt(t),c=l+h.length*a,f=h.number-o,u=n+l*f+a*(h.from-r-f);return new Pe(h.from,h.length,Math.max(n,Math.min(u,n+this.height-c)),c,0)}forEachLine(t,e,i,n,r,o){t=Math.max(t,r),e=Math.min(e,r+this.length);let{firstLine:l,perLine:a,perChar:h}=this.heightMetrics(i,r);for(let c=t,f=n;c<=e;){let u=i.doc.lineAt(c);if(c==t){let p=u.number-l;f+=a*p+h*(t-r-p)}let d=a+h*u.length;o(new Pe(u.from,u.length,f,d,0)),f+=d,c=u.to+1}}replace(t,e,i){let n=this.length-e;if(n>0){let r=i[i.length-1];r instanceof vt?i[i.length-1]=new vt(r.length+n):i.push(null,new vt(n-1))}if(t>0){let r=i[0];r instanceof vt?i[0]=new vt(t+r.length):i.unshift(new vt(t-1),null)}return Bt.of(i)}decomposeLeft(t,e){e.push(new vt(t-1),null)}decomposeRight(t,e){e.push(null,new vt(this.length-t-1))}updateHeight(t,e=0,i=!1,n){let r=e+this.length;if(n&&n.from<=e+this.length&&n.more){let o=[],l=Math.max(e,n.from),a=-1;for(n.from>e&&o.push(new vt(n.from-e-1).updateHeight(t,e));l<=r&&n.more;){let c=t.doc.lineAt(l).length;o.length&&o.push(null);let f=n.heights[n.index++];a==-1?a=f:Math.abs(f-a)>=hr&&(a=-2);let u=new _t(c,f);u.outdated=!1,o.push(u),l+=c+1}l<=r&&o.push(null,new vt(r-l).updateHeight(t,l));let h=Bt.of(o);return(a<0||Math.abs(h.height-this.height)>=hr||Math.abs(a-this.heightMetrics(t,e).perLine)>=hr)&&(sn=!0),vr(this,h)}else(i||this.outdated)&&(this.setHeight(t.heightForGap(e,e+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class Py extends Bt{constructor(t,e,i){super(t.length+e+i.length,t.height+i.height,e|(t.outdated||i.outdated?2:0)),this.left=t,this.right=i,this.size=t.size+i.size}get break(){return this.flags&1}blockAt(t,e,i,n){let r=i+this.left.height;return t<r?this.left.blockAt(t,e,i,n):this.right.blockAt(t,e,r,n+this.left.length+this.break)}lineAt(t,e,i,n,r){let o=n+this.left.height,l=r+this.left.length+this.break,a=e==st.ByHeight?t<o:t<l,h=a?this.left.lineAt(t,e,i,n,r):this.right.lineAt(t,e,i,o,l);if(this.break||(a?h.to<l:h.from>l))return h;let c=e==st.ByPosNoHeight?st.ByPosNoHeight:st.ByPos;return a?h.join(this.right.lineAt(l,c,i,o,l)):this.left.lineAt(l,c,i,n,r).join(h)}forEachLine(t,e,i,n,r,o){let l=n+this.left.height,a=r+this.left.length+this.break;if(this.break)t<a&&this.left.forEachLine(t,e,i,n,r,o),e>=a&&this.right.forEachLine(t,e,i,l,a,o);else{let h=this.lineAt(a,st.ByPos,i,n,r);t<h.from&&this.left.forEachLine(t,h.from-1,i,n,r,o),h.to>=t&&h.from<=e&&o(h),e>h.to&&this.right.forEachLine(h.to+1,e,i,l,a,o)}}replace(t,e,i){let n=this.left.length+this.break;if(e<n)return this.balanced(this.left.replace(t,e,i),this.right);if(t>this.left.length)return this.balanced(this.left,this.right.replace(t-n,e-n,i));let r=[];t>0&&this.decomposeLeft(t,r);let o=r.length;for(let l of i)r.push(l);if(t>0&&bf(r,o-1),e<this.length){let l=r.length;this.decomposeRight(e,r),bf(r,l)}return Bt.of(r)}decomposeLeft(t,e){let i=this.left.length;if(t<=i)return this.left.decomposeLeft(t,e);e.push(this.left),this.break&&(i++,t>=i&&e.push(null)),t>i&&this.right.decomposeLeft(t-i,e)}decomposeRight(t,e){let i=this.left.length,n=i+this.break;if(t>=n)return this.right.decomposeRight(t-n,e);t<i&&this.left.decomposeRight(t,e),this.break&&t<n&&e.push(null),e.push(this.right)}balanced(t,e){return t.size>2*e.size||e.size>2*t.size?Bt.of(this.break?[t,null,e]:[t,e]):(this.left=vr(this.left,t),this.right=vr(this.right,e),this.setHeight(t.height+e.height),this.outdated=t.outdated||e.outdated,this.size=t.size+e.size,this.length=t.length+this.break+e.length,this)}updateHeight(t,e=0,i=!1,n){let{left:r,right:o}=this,l=e+r.length+this.break,a=null;return n&&n.from<=e+r.length&&n.more?a=r=r.updateHeight(t,e,i,n):r.updateHeight(t,e,i),n&&n.from<=l+o.length&&n.more?a=o=o.updateHeight(t,l,i,n):o.updateHeight(t,l,i),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 bf(s,t){let e,i;s[t]==null&&(e=s[t-1])instanceof vt&&(i=s[t+1])instanceof vt&&s.splice(t-1,3,new vt(e.length+1+i.length))}const Cy=5;class dh{constructor(t,e){this.pos=t,this.oracle=e,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=t}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(t,e){if(this.lineStart>-1){let i=Math.min(e,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof _t?n.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new _t(i-this.pos,-1)),this.writtenTo=i,e>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=e}point(t,e,i){if(t<e||i.heightRelevant){let n=i.widget?i.widget.estimatedHeight:0,r=i.widget?i.widget.lineBreaks:0;n<0&&(n=this.oracle.lineHeight);let o=e-t;i.block?this.addBlock(new ag(o,n,i)):(o||r||n>=Cy)&&this.addLineDeco(n,r,o)}else e>t&&this.span(t,e);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:t,to:e}=this.oracle.doc.lineAt(this.pos);this.lineStart=t,this.lineEnd=e,this.writtenTo<t&&((this.writtenTo<t-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,t-1)),this.nodes.push(null)),this.pos>t&&this.nodes.push(new _t(this.pos-t,-1)),this.writtenTo=this.pos}blankContent(t,e){let i=new vt(e-t);return this.oracle.doc.lineAt(t).to==e&&(i.flags|=4),i}ensureLine(){this.enterLine();let t=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(t instanceof _t)return t;let e=new _t(0,-1);return this.nodes.push(e),e}addBlock(t){this.enterLine();let e=t.deco;e&&e.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(t),this.writtenTo=this.pos=this.pos+t.length,e&&e.endSide>0&&(this.covering=t)}addLineDeco(t,e,i){let n=this.ensureLine();n.length+=i,n.collapsed+=i,n.widgetHeight=Math.max(n.widgetHeight,t),n.breaks+=e,this.writtenTo=this.pos=this.pos+i}finish(t){let e=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(e instanceof _t)&&!this.isCovered?this.nodes.push(new _t(0,-1)):(this.writtenTo<this.pos||e==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let i=t;for(let n of this.nodes)n instanceof _t&&n.updateHeight(this.oracle,i),i+=n?n.length:1;return this.nodes}static build(t,e,i,n){let r=new dh(i,t);return I.spans(e,i,n,r,0),r.finish(i)}}function Zy(s,t,e){let i=new Ay;return I.compare(s,t,e,i,0),i.changes}class Ay{constructor(){this.changes=[]}compareRange(){}comparePoint(t,e,i,n){(t<e||i&&i.heightRelevant||n&&n.heightRelevant)&&na(t,e,this.changes,5)}}function Ty(s,t){let e=s.getBoundingClientRect(),i=s.ownerDocument,n=i.defaultView||window,r=Math.max(0,e.left),o=Math.min(n.innerWidth,e.right),l=Math.max(0,e.top),a=Math.min(n.innerHeight,e.bottom);for(let h=s.parentNode;h&&h!=i.body;)if(h.nodeType==1){let c=h,f=window.getComputedStyle(c);if((c.scrollHeight>c.clientHeight||c.scrollWidth>c.clientWidth)&&f.overflow!="visible"){let u=c.getBoundingClientRect();r=Math.max(r,u.left),o=Math.min(o,u.right),l=Math.max(l,u.top),a=Math.min(h==s.parentNode?n.innerHeight:a,u.bottom)}h=f.position=="absolute"||f.position=="fixed"?c.offsetParent:c.parentNode}else if(h.nodeType==11)h=h.host;else break;return{left:r-e.left,right:Math.max(r,o)-e.left,top:l-(e.top+t),bottom:Math.max(l,a)-(e.top+t)}}function My(s,t){let e=s.getBoundingClientRect();return{left:0,right:e.right-e.left,top:t,bottom:e.bottom-(e.top+t)}}class Do{constructor(t,e,i,n){this.from=t,this.to=e,this.size=i,this.displaySize=n}static same(t,e){if(t.length!=e.length)return!1;for(let i=0;i<t.length;i++){let n=t[i],r=e[i];if(n.from!=r.from||n.to!=r.to||n.size!=r.size)return!1}return!0}draw(t,e){return F.replace({widget:new Ry(this.displaySize*(e?t.scaleY:t.scaleX),e)}).range(this.from,this.to)}}class Ry extends oh{constructor(t,e){super(),this.size=t,this.vertical=e}eq(t){return t.size==this.size&&t.vertical==this.vertical}toDOM(){let t=document.createElement("div");return this.vertical?t.style.height=this.size+"px":(t.style.width=this.size+"px",t.style.height="2px",t.style.display="inline-block"),t}get estimatedHeight(){return this.vertical?this.size:-1}}class yf{constructor(t){this.state=t,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=wf,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=kt.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let e=t.facet(ch).some(i=>typeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new $y(e),this.stateDeco=t.facet(Hn).filter(i=>typeof i!="function"),this.heightMap=Bt.empty().applyChanges(this.stateDeco,q.empty,this.heightOracle.setDoc(t.doc),[new ie(0,0,0,t.doc.length)]);for(let i=0;i<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());i++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=F.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let t=[this.viewport],{main:e}=this.state.selection;for(let i=0;i<=1;i++){let n=i?e.head:e.anchor;if(!t.some(({from:r,to:o})=>n>=r&&n<=o)){let{from:r,to:o}=this.lineBlockAt(n);t.push(new Cs(r,o))}}return this.viewports=t.sort((i,n)=>i.from-n.from),this.updateScaler()}updateScaler(){let t=this.scaler;return this.scaler=this.heightMap.height<=7e6?wf:new ph(this.heightOracle,this.heightMap,this.viewports),t.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,t=>{this.viewportLines.push(Mn(t,this.scaler))})}update(t,e=null){this.state=t.state;let i=this.stateDeco;this.stateDeco=this.state.facet(Hn).filter(c=>typeof c!="function");let n=t.changedRanges,r=ie.extendWithRanges(n,Zy(i,this.stateDeco,t?t.changes:gt.empty(this.state.doc.length))),o=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);Of(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,t.startState.doc,this.heightOracle.setDoc(this.state.doc),r),(this.heightMap.height!=o||sn)&&(t.flags|=2),l?(this.scrollAnchorPos=t.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,t.changes):this.viewport;(e&&(e.range.head<a.from||e.range.head>a.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,e));let h=a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,t.flags|=this.updateForViewport(),(h||!t.changes.empty||t.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,t.changes))),t.flags|=this.computeVisibleRanges(),e&&(this.scrollTarget=e),!this.mustEnforceCursorAssoc&&t.selectionSet&&t.view.lineWrapping&&t.state.selection.main.empty&&t.state.selection.main.assoc&&!t.state.facet(Bb)&&(this.mustEnforceCursorAssoc=!0)}measure(t){let e=t.contentDOM,i=window.getComputedStyle(e),n=this.heightOracle,r=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?kt.RTL:kt.LTR;let o=this.heightOracle.mustRefreshForWrapping(r),l=e.getBoundingClientRect(),a=o||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let h=0,c=0;if(l.width&&l.height){let{scaleX:k,scaleY:w}=Op(e,l);(k>.005&&Math.abs(this.scaleX-k)>.005||w>.005&&Math.abs(this.scaleY-w)>.005)&&(this.scaleX=k,this.scaleY=w,h|=8,o=a=!0)}let f=(parseInt(i.paddingTop)||0)*this.scaleY,u=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=u)&&(this.paddingTop=f,this.paddingBottom=u,h|=10),this.editorWidth!=t.scrollDOM.clientWidth&&(n.lineWrapping&&(a=!0),this.editorWidth=t.scrollDOM.clientWidth,h|=8);let d=t.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=d&&(this.scrollAnchorHeight=-1,this.scrollTop=d),this.scrolledToBottom=wp(t.scrollDOM);let p=(this.printing?My:Ty)(e,this.paddingTop),g=p.top-this.pixelViewport.top,m=p.bottom-this.pixelViewport.bottom;this.pixelViewport=p;let O=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(O!=this.inView&&(this.inView=O,O&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let y=l.width;if((this.contentDOMWidth!=y||this.editorHeight!=t.scrollDOM.clientHeight)&&(this.contentDOMWidth=l.width,this.editorHeight=t.scrollDOM.clientHeight,h|=8),a){let k=t.docView.measureVisibleLineHeights(this.viewport);if(n.mustRefreshForHeights(k)&&(o=!0),o||n.lineWrapping&&Math.abs(y-this.contentDOMWidth)>n.charWidth){let{lineHeight:w,charWidth:$,textHeight:v}=t.docView.measureTextSize();o=w>0&&n.refresh(r,w,$,v,y/$,k),o&&(t.docView.minWidth=0,h|=8)}g>0&&m>0?c=Math.max(g,m):g<0&&m<0&&(c=Math.min(g,m)),Of();for(let w of this.viewports){let $=w.from==this.viewport.from?k:t.docView.measureVisibleLineHeights(w);this.heightMap=(o?Bt.empty().applyChanges(this.stateDeco,q.empty,this.heightOracle,[new ie(0,0,0,t.state.doc.length)]):this.heightMap).updateHeight(n,0,o,new Qy(w.from,$))}sn&&(h|=2)}let x=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return x&&(h&2&&(h|=this.updateScaler()),this.viewport=this.getViewport(c,this.scrollTarget),h|=this.updateForViewport()),(h&2||x)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,t)),h|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,t.docView.enforceCursorAssoc()),h}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(t,e){let i=.5-Math.max(-.5,Math.min(.5,t/1e3/2)),n=this.heightMap,r=this.heightOracle,{visibleTop:o,visibleBottom:l}=this,a=new Cs(n.lineAt(o-i*1e3,st.ByHeight,r,0,0).from,n.lineAt(l+(1-i)*1e3,st.ByHeight,r,0,0).to);if(e){let{head:h}=e.range;if(h<a.from||h>a.to){let c=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=n.lineAt(h,st.ByPos,r,0,0),u;e.y=="center"?u=(f.top+f.bottom)/2-c/2:e.y=="start"||e.y=="nearest"&&h<a.from?u=f.top:u=f.bottom-c,a=new Cs(n.lineAt(u-1e3/2,st.ByHeight,r,0,0).from,n.lineAt(u+c+1e3/2,st.ByHeight,r,0,0).to)}}return a}mapViewport(t,e){let i=e.mapPos(t.from,-1),n=e.mapPos(t.to,1);return new Cs(this.heightMap.lineAt(i,st.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(n,st.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:t,to:e},i=0){if(!this.inView)return!0;let{top:n}=this.heightMap.lineAt(t,st.ByPos,this.heightOracle,0,0),{bottom:r}=this.heightMap.lineAt(e,st.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:l}=this;return(t==0||n<=o-Math.max(10,Math.min(-i,250)))&&(e==this.state.doc.length||r>=l+Math.max(10,Math.min(i,250)))&&n>o-2*1e3&&r<l+2*1e3}mapLineGaps(t,e){if(!t.length||e.empty)return t;let i=[];for(let n of t)e.touchesRange(n.from,n.to)||i.push(new Do(e.mapPos(n.from),e.mapPos(n.to),n.size,n.displaySize));return i}ensureLineGaps(t,e){let i=this.heightOracle.lineWrapping,n=i?1e4:2e3,r=n>>1,o=n<<1;if(this.defaultTextDirection!=kt.LTR&&!i)return[];let l=[],a=(c,f,u,d)=>{if(f-c<r)return;let p=this.state.selection.main,g=[p.from];p.empty||g.push(p.to);for(let O of g)if(O>c&&O<f){a(c,O-10,u,d),a(O+10,f,u,d);return}let m=Wy(t,O=>O.from>=u.from&&O.to<=u.to&&Math.abs(O.from-c)<r&&Math.abs(O.to-f)<r&&!g.some(y=>O.from<y&&O.to>y));if(!m){if(f<u.to&&e&&i&&e.visibleRanges.some(x=>x.from<=f&&x.to>=f)){let x=e.moveToLineBoundary(S.cursor(f),!1,!0).head;x>c&&(f=x)}let O=this.gapSize(u,c,f,d),y=i||O<2e6?O:2e6;m=new Do(c,f,O,y)}l.push(m)},h=c=>{if(c.length<o||c.type!=Re.Text)return;let f=Dy(c.from,c.to,this.stateDeco);if(f.total<o)return;let u=this.scrollTarget?this.scrollTarget.range.head:null,d,p;if(i){let g=n/this.heightOracle.lineLength*this.heightOracle.lineHeight,m,O;if(u!=null){let y=As(f,u),x=((this.visibleBottom-this.visibleTop)/2+g)/c.height;m=y-x,O=y+x}else m=(this.visibleTop-c.top-g)/c.height,O=(this.visibleBottom-c.top+g)/c.height;d=Zs(f,m),p=Zs(f,O)}else{let g=f.total*this.heightOracle.charWidth,m=n*this.heightOracle.charWidth,O=0;if(g>2e6)for(let $ of t)$.from>=c.from&&$.from<c.to&&$.size!=$.displaySize&&$.from*this.heightOracle.charWidth+O<this.pixelViewport.left&&(O=$.size-$.displaySize);let y=this.pixelViewport.left+O,x=this.pixelViewport.right+O,k,w;if(u!=null){let $=As(f,u),v=((x-y)/2+m)/g;k=$-v,w=$+v}else k=(y-m)/g,w=(x+m)/g;d=Zs(f,k),p=Zs(f,w)}d>c.from&&a(c.from,d,c,f),p<c.to&&a(p,c.to,c,f)};for(let c of this.viewportLines)Array.isArray(c.type)?c.type.forEach(h):h(c);return l}gapSize(t,e,i,n){let r=As(n,i)-As(n,e);return this.heightOracle.lineWrapping?t.height*r:n.total*this.heightOracle.charWidth*r}updateLineGaps(t){Do.same(t,this.lineGaps)||(this.lineGaps=t,this.lineGapDeco=F.set(t.map(e=>e.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let e=[];I.spans(t,this.viewport.from,this.viewport.to,{span(n,r){e.push({from:n,to:r})},point(){}},20);let i=e.length!=this.visibleRanges.length||this.visibleRanges.some((n,r)=>n.from!=e[r].from||n.to!=e[r].to);return this.visibleRanges=e,i?4:0}lineBlockAt(t){return t>=this.viewport.from&&t<=this.viewport.to&&this.viewportLines.find(e=>e.from<=t&&e.to>=t)||Mn(this.heightMap.lineAt(t,st.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(t){return t>=this.viewportLines[0].top&&t<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(e=>e.top<=t&&e.bottom>=t)||Mn(this.heightMap.lineAt(this.scaler.fromDOM(t),st.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(t){let e=this.lineBlockAtHeight(t+8);return e.from>=this.viewport.from||this.viewportLines[0].top-t>200?e:this.viewportLines[0]}elementAtHeight(t){return Mn(this.heightMap.blockAt(this.scaler.fromDOM(t),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Cs{constructor(t,e){this.from=t,this.to=e}}function Dy(s,t,e){let i=[],n=s,r=0;return I.spans(e,s,t,{span(){},point(o,l){o>n&&(i.push({from:n,to:o}),r+=o-n),n=l}},20),n<t&&(i.push({from:n,to:t}),r+=t-n),{total:r,ranges:i}}function Zs({total:s,ranges:t},e){if(e<=0)return t[0].from;if(e>=1)return t[t.length-1].to;let i=Math.floor(s*e);for(let n=0;;n++){let{from:r,to:o}=t[n],l=o-r;if(i<=l)return r+i;i-=l}}function As(s,t){let e=0;for(let{from:i,to:n}of s.ranges){if(t<=n){e+=t-i;break}e+=n-i}return e/s.total}function Wy(s,t){for(let e of s)if(t(e))return e}const wf={toDOM(s){return s},fromDOM(s){return s},scale:1,eq(s){return s==this}};class ph{constructor(t,e,i){let n=0,r=0,o=0;this.viewports=i.map(({from:l,to:a})=>{let h=e.lineAt(l,st.ByPos,t,0,0).top,c=e.lineAt(a,st.ByPos,t,0,0).bottom;return n+=c-h,{from:l,to:a,top:h,bottom:c,domTop:0,domBottom:0}}),this.scale=(7e6-n)/(e.height-n);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(t){for(let e=0,i=0,n=0;;e++){let r=e<this.viewports.length?this.viewports[e]:null;if(!r||t<r.top)return n+(t-i)*this.scale;if(t<=r.bottom)return r.domTop+(t-r.top);i=r.bottom,n=r.domBottom}}fromDOM(t){for(let e=0,i=0,n=0;;e++){let r=e<this.viewports.length?this.viewports[e]:null;if(!r||t<r.domTop)return i+(t-n)/this.scale;if(t<=r.domBottom)return r.top+(t-r.domTop);i=r.bottom,n=r.domBottom}}eq(t){return t instanceof ph?this.scale==t.scale&&this.viewports.length==t.viewports.length&&this.viewports.every((e,i)=>e.from==t.viewports[i].from&&e.to==t.viewports[i].to):!1}}function Mn(s,t){if(t.scale==1)return s;let e=t.toDOM(s.top),i=t.toDOM(s.bottom);return new Pe(s.from,s.length,e,i-e,Array.isArray(s._content)?s._content.map(n=>Mn(n,t)):s._content)}const Ts=P.define({combine:s=>s.join(" ")}),fa=P.define({combine:s=>s.indexOf(!0)>-1}),ua=At.newName(),hg=At.newName(),cg=At.newName(),fg={"&light":"."+hg,"&dark":"."+cg};function da(s,t,e){return new At(t,{finish(i){return/&/.test(i)?i.replace(/&\w*/,n=>{if(n=="&")return s;if(!e||!e[n])throw new RangeError(`Unsupported selector: ${n}`);return e[n]}):s+" "+i}})}const Ey=da("."+ua,{"&":{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:"#444"},".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"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,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"}},fg),By={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Wo=W.ie&&W.ie_version<=11;class Yy{constructor(t){this.view=t,this.active=!1,this.editContext=null,this.selectionRange=new wb,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=t.contentDOM,this.observer=new MutationObserver(e=>{for(let i of e)this.queue.push(i);(W.ie&&W.ie_version<=11||W.ios&&t.composing)&&e.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&t.constructor.EDIT_CONTEXT!==!1&&!(W.chrome&&W.chrome_version<126)&&(this.editContext=new Ly(t),t.state.facet(ii)&&(t.contentDOM.editContext=this.editContext.editContext)),Wo&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.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 e;((e=this.view.docView)===null||e===void 0?void 0:e.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(t.scrollDOM)),this.addWindowListeners(this.win=t.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(e=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.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(e=>{e.length>0&&e[e.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(t){this.view.inputState.runHandlers("scroll",t),this.intersecting&&this.view.measure()}onScroll(t){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(t)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(t){(t.type=="change"||!t.type)&&!t.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(t){if(this.gapIntersection&&(t.length!=this.gaps.length||this.gaps.some((e,i)=>e!=t[i]))){this.gapIntersection.disconnect();for(let e of t)this.gapIntersection.observe(e);this.gaps=t}}onSelectionChange(t){let e=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:i}=this,n=this.selectionRange;if(i.state.facet(ii)?i.root.activeElement!=this.dom:!lr(this.dom,n))return;let r=n.anchorNode&&i.docView.nearest(n.anchorNode);if(r&&r.ignoreEvent(t)){e||(this.selectionChanged=!1);return}(W.ie&&W.ie_version<=11||W.android&&W.chrome)&&!i.state.selection.main.empty&&n.focusNode&&Ln(n.focusNode,n.focusOffset,n.anchorNode,n.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:t}=this,e=_n(t.root);if(!e)return!1;let i=W.safari&&t.root.nodeType==11&&t.root.activeElement==this.dom&&Xy(this.view,e)||e;if(!i||this.selectionRange.eq(i))return!1;let n=lr(this.dom,i);return n&&!this.selectionChanged&&t.inputState.lastFocusTime>Date.now()-200&&t.inputState.lastTouchTime<Date.now()-300&&xb(this.dom,i)?(this.view.inputState.lastFocusTime=0,t.docView.updateSelection(),!1):(this.selectionRange.setRange(i),n&&(this.selectionChanged=!0),!0)}setSelectionRange(t,e){this.selectionRange.set(t.node,t.offset,e.node,e.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let t=0,e=null;for(let i=this.dom;i;)if(i.nodeType==1)!e&&t<this.scrollTargets.length&&this.scrollTargets[t]==i?t++:e||(e=this.scrollTargets.slice(0,t)),e&&e.push(i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;if(t<this.scrollTargets.length&&!e&&(e=this.scrollTargets.slice(0,t)),e){for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);for(let i of this.scrollTargets=e)i.addEventListener("scroll",this.onScroll)}}ignore(t){if(!this.active)return t();try{return this.stop(),t()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,By),Wo&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Wo&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(t,e){var i;if(!this.delayedAndroidKey){let n=()=>{let r=this.delayedAndroidKey;r&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=r.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&r.force&&Ii(this.dom,r.key,r.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(n)}(!this.delayedAndroidKey||t=="Enter")&&(this.delayedAndroidKey={key:t,keyCode:e,force:this.lastChange<Date.now()-50||!!(!((i=this.delayedAndroidKey)===null||i===void 0)&&i.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let t of this.observer.takeRecords())this.queue.push(t);return this.queue}processRecords(){let t=this.pendingRecords();t.length&&(this.queue=[]);let e=-1,i=-1,n=!1;for(let r of t){let o=this.readMutation(r);o&&(o.typeOver&&(n=!0),e==-1?{from:e,to:i}=o:(e=Math.min(o.from,e),i=Math.max(o.to,i)))}return{from:e,to:i,typeOver:n}}readChange(){let{from:t,to:e,typeOver:i}=this.processRecords(),n=this.selectionChanged&&lr(this.dom,this.selectionRange);if(t<0&&!n)return null;t>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new ny(this.view,t,e,i);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}flush(t=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;t&&this.readSelectionRange();let e=this.readChange();if(!e)return this.view.requestMeasure(),!1;let i=this.view.state,n=Jp(this.view,e);return this.view.state==i&&(e.domChanged||e.newSel&&!e.newSel.main.eq(this.view.state.selection.main))&&this.view.update([]),n}readMutation(t){let e=this.view.docView.nearest(t.target);if(!e||e.ignoreMutation(t))return null;if(e.markDirty(t.type=="attributes"),t.type=="attributes"&&(e.flags|=4),t.type=="childList"){let i=Sf(e,t.previousSibling||t.target.previousSibling,-1),n=Sf(e,t.nextSibling||t.target.nextSibling,1);return{from:i?e.posAfter(i):e.posAtStart,to:n?e.posBefore(n):e.posAtEnd,typeOver:!1}}else return t.type=="characterData"?{from:e.posAtStart,to:e.posAtEnd,typeOver:t.target.nodeValue==t.oldValue}:null}setWindow(t){t!=this.win&&(this.removeWindowListeners(this.win),this.win=t,this.addWindowListeners(this.win))}addWindowListeners(t){t.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):t.addEventListener("beforeprint",this.onPrint),t.addEventListener("scroll",this.onScroll),t.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(t){t.removeEventListener("scroll",this.onScroll),t.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):t.removeEventListener("beforeprint",this.onPrint),t.document.removeEventListener("selectionchange",this.onSelectionChange)}update(t){this.editContext&&(this.editContext.update(t),t.startState.facet(ii)!=t.state.facet(ii)&&(t.view.contentDOM.editContext=t.state.facet(ii)?this.editContext.editContext:null))}destroy(){var t,e,i;this.stop(),(t=this.intersection)===null||t===void 0||t.disconnect(),(e=this.gapIntersection)===null||e===void 0||e.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let n of this.scrollTargets)n.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 Sf(s,t,e){for(;t;){let i=tt.get(t);if(i&&i.parent==s)return i;let n=t.parentNode;t=n!=s.dom?n:e>0?t.nextSibling:t.previousSibling}return null}function xf(s,t){let e=t.startContainer,i=t.startOffset,n=t.endContainer,r=t.endOffset,o=s.docView.domAtPos(s.state.selection.main.anchor);return Ln(o.node,o.offset,n,r)&&([e,i,n,r]=[n,r,e,i]),{anchorNode:e,anchorOffset:i,focusNode:n,focusOffset:r}}function Xy(s,t){if(t.getComposedRanges){let n=t.getComposedRanges(s.root)[0];if(n)return xf(s,n)}let e=null;function i(n){n.preventDefault(),n.stopImmediatePropagation(),e=n.getTargetRanges()[0]}return s.contentDOM.addEventListener("beforeinput",i,!0),s.dom.ownerDocument.execCommand("indent"),s.contentDOM.removeEventListener("beforeinput",i,!0),e?xf(s,e):null}class Ly{constructor(t){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.resetRange(t.state);let e=this.editContext=new window.EditContext({text:t.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,t.state.selection.main.anchor))),selectionEnd:this.toContextPos(t.state.selection.main.head)});this.handlers.textupdate=i=>{let{anchor:n}=t.state.selection.main,r={from:this.toEditorPos(i.updateRangeStart),to:this.toEditorPos(i.updateRangeEnd),insert:q.of(i.text.split(`
13
+ `))};r.from==this.from&&n<this.from?r.from=n:r.to==this.to&&n>this.to&&(r.to=n),!(r.from==r.to&&!r.insert.length)&&(this.pendingContextChange=r,t.state.readOnly||uh(t,r,S.single(this.toEditorPos(i.selectionStart),this.toEditorPos(i.selectionEnd))),this.pendingContextChange&&(this.revertPending(t.state),this.setSelection(t.state)))},this.handlers.characterboundsupdate=i=>{let n=[],r=null;for(let o=this.toEditorPos(i.rangeStart),l=this.toEditorPos(i.rangeEnd);o<l;o++){let a=t.coordsForChar(o);r=a&&new DOMRect(a.left,a.top,a.right-a.left,a.bottom-a.top)||r||new DOMRect,n.push(r)}e.updateCharacterBounds(i.rangeStart,n)},this.handlers.textformatupdate=i=>{let n=[];for(let r of i.getTextFormats()){let o=r.underlineStyle,l=r.underlineThickness;if(o!="None"&&l!="None"){let a=`text-decoration: underline ${o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${l=="Thin"?1:2}px`;n.push(F.mark({attributes:{style:a}}).range(this.toEditorPos(r.rangeStart),this.toEditorPos(r.rangeEnd)))}}t.dispatch({effects:qp.of(F.set(n))})},this.handlers.compositionstart=()=>{t.inputState.composing<0&&(t.inputState.composing=0,t.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{t.inputState.composing=-1,t.inputState.compositionFirstChange=null};for(let i in this.handlers)e.addEventListener(i,this.handlers[i]);this.measureReq={read:i=>{this.editContext.updateControlBounds(i.contentDOM.getBoundingClientRect());let n=_n(i.root);n&&n.rangeCount&&this.editContext.updateSelectionBounds(n.getRangeAt(0).getBoundingClientRect())}}}applyEdits(t){let e=0,i=!1,n=this.pendingContextChange;return t.changes.iterChanges((r,o,l,a,h)=>{if(i)return;let c=h.length-(o-r);if(n&&o>=n.to)if(n.from==r&&n.to==o&&n.insert.eq(h)){n=this.pendingContextChange=null,e+=c,this.to+=c;return}else n=null,this.revertPending(t.state);if(r+=e,o+=e,o<=this.from)this.from+=c,this.to+=c;else if(r<this.to){if(r<this.from||o>this.to||this.to-this.from+h.length>3e4){i=!0;return}this.editContext.updateText(this.toContextPos(r),this.toContextPos(o),h.toString()),this.to+=c}e+=c}),n&&!i&&this.revertPending(t.state),!i}update(t){let e=this.pendingContextChange;!this.applyEdits(t)||!this.rangeIsValid(t.state)?(this.pendingContextChange=null,this.resetRange(t.state),this.editContext.updateText(0,this.editContext.text.length,t.state.doc.sliceString(this.from,this.to)),this.setSelection(t.state)):(t.docChanged||t.selectionSet||e)&&this.setSelection(t.state),(t.geometryChanged||t.docChanged||t.selectionSet)&&t.view.requestMeasure(this.measureReq)}resetRange(t){let{head:e}=t.selection.main;this.from=Math.max(0,e-1e4),this.to=Math.min(t.doc.length,e+1e4)}revertPending(t){let e=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(e.from),this.toContextPos(e.from+e.insert.length),t.doc.sliceString(e.from,e.to))}setSelection(t){let{main:e}=t.selection,i=this.toContextPos(Math.max(this.from,Math.min(this.to,e.anchor))),n=this.toContextPos(e.head);(this.editContext.selectionStart!=i||this.editContext.selectionEnd!=n)&&this.editContext.updateSelection(i,n)}rangeIsValid(t){let{head:e}=t.selection.main;return!(this.from>0&&e-this.from<500||this.to<t.doc.length&&this.to-e<500||this.to-this.from>1e4*3)}toEditorPos(t){return t+this.from}toContextPos(t){return t-this.from}destroy(){for(let t in this.handlers)this.editContext.removeEventListener(t,this.handlers[t])}}class L{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.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(t={}){var e;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),t.parent&&t.parent.appendChild(this.dom);let{dispatch:i}=t;this.dispatchTransactions=t.dispatchTransactions||i&&(n=>n.forEach(r=>i(r,this)))||(n=>this.update(n)),this.dispatch=this.dispatch.bind(this),this._root=t.root||Sb(t.parent)||document,this.viewState=new yf(t.state||V.create(t)),t.scrollTo&&t.scrollTo.is($s)&&(this.viewState.scrollTarget=t.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Zn).map(n=>new To(n));for(let n of this.plugins)n.update(this);this.observer=new Yy(this),this.inputState=new ay(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Jc(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((e=document.fonts)===null||e===void 0)&&e.ready&&document.fonts.ready.then(()=>this.requestMeasure())}dispatch(...t){let e=t.length==1&&t[0]instanceof mt?t:t.length==1&&Array.isArray(t[0])?t[0]:[this.state.update(...t)];this.dispatchTransactions(e,this)}update(t){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let e=!1,i=!1,n,r=this.state;for(let u of t){if(u.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=u.state}if(this.destroyed){this.viewState.state=r;return}let o=this.hasFocus,l=0,a=null;t.some(u=>u.annotation(rg))?(this.inputState.notifiedFocused=o,l=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,a=og(r,o),a||(l=1));let h=this.observer.delayedAndroidKey,c=null;if(h?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(V.phrases)!=this.state.facet(V.phrases))return this.setState(r);n=kr.create(this,r,t),n.flags|=l;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let u of t){if(f&&(f=f.map(u.changes)),u.scrollIntoView){let{main:d}=u.state.selection;f=new qi(d.empty?d:S.cursor(d.head,d.head>d.anchor?-1:1))}for(let d of u.effects)d.is($s)&&(f=d.value.clip(this.state))}this.viewState.update(n,f),this.bidiCache=$r.update(this.bidiCache,n.changes),n.empty||(this.updatePlugins(n),this.inputState.update(n)),e=this.docView.update(n),this.state.facet(An)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(t),this.docView.updateSelection(e,t.some(u=>u.isUserEvent("select.pointer")))}finally{this.updateState=0}if(n.startState.facet(Ts)!=n.state.facet(Ts)&&(this.viewState.mustMeasureContent=!0),(e||i||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),e&&this.docViewUpdate(),!n.empty)for(let u of this.state.facet(aa))try{u(n)}catch(d){Ce(this.state,d,"update listener")}(a||c)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!Jp(this,c)&&h.force&&Ii(this.contentDOM,h.key,h.keyCode)})}setState(t){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=t;return}this.updateState=2;let e=this.hasFocus;try{for(let i of this.plugins)i.destroy(this);this.viewState=new yf(t),this.plugins=t.facet(Zn).map(i=>new To(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView.destroy(),this.docView=new Jc(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}e&&this.focus(),this.requestMeasure()}updatePlugins(t){let e=t.startState.facet(Zn),i=t.state.facet(Zn);if(e!=i){let n=[];for(let r of i){let o=e.indexOf(r);if(o<0)n.push(new To(r));else{let l=this.plugins[o];l.mustUpdate=t,n.push(l)}}for(let r of this.plugins)r.mustUpdate!=t&&r.destroy(this);this.plugins=n,this.pluginMap.clear()}else for(let n of this.plugins)n.mustUpdate=t;for(let n=0;n<this.plugins.length;n++)this.plugins[n].update(this);e!=i&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let t of this.plugins){let e=t.value;if(e&&e.docViewUpdate)try{e.docViewUpdate(this)}catch(i){Ce(this.state,i,"doc view update listener")}}}measure(t=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,t&&this.observer.forceFlush();let e=null,i=this.scrollDOM,n=i.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:o}=this.viewState;Math.abs(n-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let l=0;;l++){if(o<0)if(wp(i))r=-1,o=this.viewState.heightMap.height;else{let d=this.viewState.scrollAnchorAt(n);r=d.from,o=d.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 h=[];a&4||([this.measureRequests,h]=[h,this.measureRequests]);let c=h.map(d=>{try{return d.read(this)}catch(p){return Ce(this.state,p),kf}}),f=kr.create(this,this.state,[]),u=!1;f.flags|=a,e?e.flags|=a:e=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),u=this.docView.update(f),u&&this.docViewUpdate());for(let d=0;d<h.length;d++)if(c[d]!=kf)try{let p=h[d];p.write&&p.write(c[d],this)}catch(p){Ce(this.state,p)}if(u&&this.docView.updateSelection(!0),!f.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let p=(r<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(r).top)-o;if(p>1||p<-1){n=n+p,i.scrollTop=n/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(e&&!e.empty)for(let l of this.state.facet(aa))l(e)}get themeClasses(){return ua+" "+(this.state.facet(fa)?cg:hg)+" "+this.state.facet(Ts)}updateAttrs(){let t=vf(this,zp,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),e={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(ii)?"true":"false",class:"cm-content",style:`${W.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(e["aria-readonly"]="true"),vf(this,ch,e);let i=this.observer.ignore(()=>{let n=ia(this.contentDOM,this.contentAttrs,e),r=ia(this.dom,this.editorAttrs,t);return n||r});return this.editorAttrs=t,this.contentAttrs=e,i}showAnnouncements(t){let e=!0;for(let i of t)for(let n of i.effects)if(n.is(L.announce)){e&&(this.announceDOM.textContent=""),e=!1;let r=this.announceDOM.appendChild(document.createElement("div"));r.textContent=n.value}}mountStyles(){this.styleModules=this.state.facet(An);let t=this.state.facet(L.cspNonce);At.mount(this.root,this.styleModules.concat(Ey).reverse(),t?{nonce:t}: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(t){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),t){if(this.measureRequests.indexOf(t)>-1)return;if(t.key!=null){for(let e=0;e<this.measureRequests.length;e++)if(this.measureRequests[e].key===t.key){this.measureRequests[e]=t;return}}this.measureRequests.push(t)}}plugin(t){let e=this.pluginMap.get(t);return(e===void 0||e&&e.spec!=t)&&this.pluginMap.set(t,e=this.plugins.find(i=>i.spec==t)||null),e&&e.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(t){return this.readMeasured(),this.viewState.elementAtHeight(t)}lineBlockAtHeight(t){return this.readMeasured(),this.viewState.lineBlockAtHeight(t)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(t){return this.viewState.lineBlockAt(t)}get contentHeight(){return this.viewState.contentHeight}moveByChar(t,e,i){return Ro(this,t,rf(this,t,e,i))}moveByGroup(t,e){return Ro(this,t,rf(this,t,e,i=>Jb(this,t.head,i)))}visualLineSide(t,e){let i=this.bidiSpans(t),n=this.textDirectionAt(t.from),r=i[e?i.length-1:0];return S.cursor(r.side(e,n)+t.from,r.forward(!e,n)?1:-1)}moveToLineBoundary(t,e,i=!0){return Kb(this,t,e,i)}moveVertically(t,e,i){return Ro(this,t,ty(this,t,e,i))}domAtPos(t){return this.docView.domAtPos(t)}posAtDOM(t,e=0){return this.docView.posFromDOM(t,e)}posAtCoords(t,e=!0){return this.readMeasured(),Kp(this,t,e)}coordsAtPos(t,e=1){this.readMeasured();let i=this.docView.coordsAt(t,e);if(!i||i.left==i.right)return i;let n=this.state.doc.lineAt(t),r=this.bidiSpans(n),o=r[oi.find(r,t-n.from,-1,e)];return io(i,o.dir==kt.LTR==e>0)}coordsForChar(t){return this.readMeasured(),this.docView.coordsForChar(t)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(t){return!this.state.facet(Np)||t<this.viewport.from||t>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(t))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(t){if(t.length>jy)return Wp(t.length);let e=this.textDirectionAt(t.from),i;for(let r of this.bidiCache)if(r.from==t.from&&r.dir==e&&(r.fresh||Dp(r.isolates,i=Kc(this,t))))return r.order;i||(i=Kc(this,t));let n=Db(t.text,e,i);return this.bidiCache.push(new $r(t.from,t.to,e,i,!0,n)),n}get hasFocus(){var t;return(this.dom.ownerDocument.hasFocus()||W.safari&&((t=this.inputState)===null||t===void 0?void 0:t.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{bp(this.contentDOM),this.docView.updateSelection()})}setRoot(t){this._root!=t&&(this._root=t,this.observer.setWindow((t.nodeType==9?t:t.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let t of this.plugins)t.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(t,e={}){return $s.of(new qi(typeof t=="number"?S.cursor(t):t,e.y,e.x,e.yMargin,e.xMargin))}scrollSnapshot(){let{scrollTop:t,scrollLeft:e}=this.scrollDOM,i=this.viewState.scrollAnchorAt(t);return $s.of(new qi(S.cursor(i.from),"start","start",i.top-t,e,!0))}setTabFocusMode(t){t==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof t=="boolean"?this.inputState.tabFocusMode=t?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+t)}static domEventHandlers(t){return Ee.define(()=>({}),{eventHandlers:t})}static domEventObservers(t){return Ee.define(()=>({}),{eventObservers:t})}static theme(t,e){let i=At.newName(),n=[Ts.of(i),An.of(da(`.${i}`,t))];return e&&e.dark&&n.push(fa.of(!0)),n}static baseTheme(t){return pe.lowest(An.of(da("."+ua,t,fg)))}static findFromDOM(t){var e;let i=t.querySelector(".cm-content"),n=i&&tt.get(i)||tt.get(t);return((e=n==null?void 0:n.rootView)===null||e===void 0?void 0:e.view)||null}}L.styleModule=An;L.inputHandler=jp;L.clipboardInputFilter=ah;L.clipboardOutputFilter=hh;L.scrollHandler=Ip;L.focusChangeEffect=Vp;L.perLineTextDirection=Np;L.exceptionSink=Lp;L.updateListener=aa;L.editable=ii;L.mouseSelectionStyle=Xp;L.dragMovesSelection=Yp;L.clickAddsSelectionRange=Bp;L.decorations=Hn;L.outerDecorations=_p;L.atomicRanges=fh;L.bidiIsolatedRanges=Gp;L.scrollMargins=Hp;L.darkTheme=fa;L.cspNonce=P.define({combine:s=>s.length?s[0]:""});L.contentAttributes=ch;L.editorAttributes=zp;L.lineWrapping=L.contentAttributes.of({class:"cm-lineWrapping"});L.announce=j.define();const jy=4096,kf={};class $r{constructor(t,e,i,n,r,o){this.from=t,this.to=e,this.dir=i,this.isolates=n,this.fresh=r,this.order=o}static update(t,e){if(e.empty&&!t.some(r=>r.fresh))return t;let i=[],n=t.length?t[t.length-1].dir:kt.LTR;for(let r=Math.max(0,t.length-10);r<t.length;r++){let o=t[r];o.dir==n&&!e.touchesRange(o.from,o.to)&&i.push(new $r(e.mapPos(o.from,1),e.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return i}}function vf(s,t,e){for(let i=s.state.facet(t),n=i.length-1;n>=0;n--){let r=i[n],o=typeof r=="function"?r(s):r;o&&ea(o,e)}return e}const Vy=W.mac?"mac":W.windows?"win":W.linux?"linux":"key";function Ny(s,t){const e=s.split(/-(?!$)/);let i=e[e.length-1];i=="Space"&&(i=" ");let n,r,o,l;for(let a=0;a<e.length-1;++a){const h=e[a];if(/^(cmd|meta|m)$/i.test(h))l=!0;else if(/^a(lt)?$/i.test(h))n=!0;else if(/^(c|ctrl|control)$/i.test(h))r=!0;else if(/^s(hift)?$/i.test(h))o=!0;else if(/^mod$/i.test(h))t=="mac"?l=!0:r=!0;else throw new Error("Unrecognized modifier name: "+h)}return n&&(i="Alt-"+i),r&&(i="Ctrl-"+i),l&&(i="Meta-"+i),o&&(i="Shift-"+i),i}function Ms(s,t,e){return t.altKey&&(s="Alt-"+s),t.ctrlKey&&(s="Ctrl-"+s),t.metaKey&&(s="Meta-"+s),e!==!1&&t.shiftKey&&(s="Shift-"+s),s}const Iy=pe.default(L.domEventHandlers({keydown(s,t){return dg(ug(t.state),s,t,"editor")}})),qy=P.define({enables:Iy}),$f=new WeakMap;function ug(s){let t=s.facet(qy),e=$f.get(t);return e||$f.set(t,e=Gy(t.reduce((i,n)=>i.concat(n),[]))),e}function zy(s,t,e){return dg(ug(s.state),t,s,e)}let ni=null;const _y=4e3;function Gy(s,t=Vy){let e=Object.create(null),i=Object.create(null),n=(o,l)=>{let a=i[o];if(a==null)i[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,h,c)=>{var f,u;let d=e[o]||(e[o]=Object.create(null)),p=l.split(/ (?!$)/).map(O=>Ny(O,t));for(let O=1;O<p.length;O++){let y=p.slice(0,O).join(" ");n(y,!0),d[y]||(d[y]={preventDefault:!0,stopPropagation:!1,run:[x=>{let k=ni={view:x,prefix:y,scope:o};return setTimeout(()=>{ni==k&&(ni=null)},_y),!0}]})}let g=p.join(" ");n(g,!1);let m=d[g]||(d[g]={preventDefault:!1,stopPropagation:!1,run:((u=(f=d._any)===null||f===void 0?void 0:f.run)===null||u===void 0?void 0:u.slice())||[]});a&&m.run.push(a),h&&(m.preventDefault=!0),c&&(m.stopPropagation=!0)};for(let o of s){let l=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let h of l){let c=e[h]||(e[h]=Object.create(null));c._any||(c._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let u in c)c[u].run.push(d=>f(d,pa))}let a=o[t]||o.key;if(a)for(let h of l)r(h,a,o.run,o.preventDefault,o.stopPropagation),o.shift&&r(h,"Shift-"+a,o.shift,o.preventDefault,o.stopPropagation)}return e}let pa=null;function dg(s,t,e,i){pa=t;let n=sd(t),r=xt(n,0),o=Gt(r)==n.length&&n!=" ",l="",a=!1,h=!1,c=!1;ni&&ni.view==e&&ni.scope==i&&(l=ni.prefix+" ",eg.indexOf(t.keyCode)<0&&(h=!0,ni=null));let f=new Set,u=m=>{if(m){for(let O of m.run)if(!f.has(O)&&(f.add(O),O(e)))return m.stopPropagation&&(c=!0),!0;m.preventDefault&&(m.stopPropagation&&(c=!0),h=!0)}return!1},d=s[i],p,g;return d&&(u(d[l+Ms(n,t,!o)])?a=!0:o&&(t.altKey||t.metaKey||t.ctrlKey)&&!(W.windows&&t.ctrlKey&&t.altKey)&&(p=ze[t.keyCode])&&p!=n?(u(d[l+Ms(p,t,!0)])||t.shiftKey&&(g=Fi[t.keyCode])!=n&&g!=p&&u(d[l+Ms(g,t,!1)]))&&(a=!0):o&&t.shiftKey&&u(d[l+Ms(n,t,!0)])&&(a=!0),!a&&u(d._any)&&(a=!0)),h&&(a=!0),a&&c&&t.stopPropagation(),pa=null,a}const Hy=!W.ios,Qf={".cm-line":{"& ::selection, &::selection":{backgroundColor:"transparent !important"}},".cm-content":{"& :focus":{caretColor:"initial !important","&::selection, & ::selection":{backgroundColor:"Highlight !important"}}}};Hy&&(Qf[".cm-line"].caretColor=Qf[".cm-content"].caretColor="transparent !important");const Pf=P.define({combine(s){let t,e;for(let i of s)t=t||i.topContainer,e=e||i.bottomContainer;return{topContainer:t,bottomContainer:e}}});function Qr(s,t){let e=s.plugin(pg),i=e?e.specs.indexOf(t):-1;return i>-1?e.panels[i]:null}const pg=Ee.fromClass(class{constructor(s){this.input=s.state.facet(Pr),this.specs=this.input.filter(e=>e),this.panels=this.specs.map(e=>e(s));let t=s.state.facet(Pf);this.top=new Rs(s,!0,t.topContainer),this.bottom=new Rs(s,!1,t.bottomContainer),this.top.sync(this.panels.filter(e=>e.top)),this.bottom.sync(this.panels.filter(e=>!e.top));for(let e of this.panels)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}update(s){let t=s.state.facet(Pf);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Rs(s.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Rs(s.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let e=s.state.facet(Pr);if(e!=this.input){let i=e.filter(a=>a),n=[],r=[],o=[],l=[];for(let a of i){let h=this.specs.indexOf(a),c;h<0?(c=a(s.view),l.push(c)):(c=this.panels[h],c.update&&c.update(s)),n.push(c),(c.top?r:o).push(c)}this.specs=i,this.panels=n,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 i of this.panels)i.update&&i.update(s)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:s=>L.scrollMargins.of(t=>{let e=t.plugin(s);return e&&{top:e.top.scrollMargin(),bottom:e.bottom.scrollMargin()}})});class Rs{constructor(t,e,i){this.view=t,this.top=e,this.container=i,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(t){for(let e of this.panels)e.destroy&&t.indexOf(e)<0&&e.destroy();this.panels=t,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 e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let t=this.dom.firstChild;for(let e of this.panels)if(e.dom.parentNode==this.dom){for(;t!=e.dom;)t=Cf(t);t=t.nextSibling}else this.dom.insertBefore(e.dom,t);for(;t;)t=Cf(t)}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 t of this.classes.split(" "))t&&this.container.classList.remove(t);for(let t of(this.classes=this.view.themeClasses).split(" "))t&&this.container.classList.add(t)}}}function Cf(s){let t=s.nextSibling;return s.remove(),t}const Pr=P.define({enables:pg});class rn extends De{compare(t){return this==t||this.constructor==t.constructor&&this.eq(t)}eq(t){return!1}destroy(t){}}rn.prototype.elementClass="";rn.prototype.toDOM=void 0;rn.prototype.mapMode=ut.TrackBefore;rn.prototype.startSide=rn.prototype.endSide=-1;rn.prototype.point=!0;const Fy=1024;let Uy=0,Eo=class{constructor(t,e){this.from=t,this.to=e}},G=class{constructor(t={}){this.id=Uy++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=Be.match(t)),e=>{let i=t(e);return i===void 0?null:[this,i]}}};G.closedBy=new G({deserialize:s=>s.split(" ")});G.openedBy=new G({deserialize:s=>s.split(" ")});G.group=new G({deserialize:s=>s.split(" ")});G.isolate=new G({deserialize:s=>{if(s&&s!="rtl"&&s!="ltr"&&s!="auto")throw new RangeError("Invalid value for isolate: "+s);return s||"auto"}});G.contextHash=new G({perNode:!0});G.lookAhead=new G({perNode:!0});G.mounted=new G({perNode:!0});let Cr=class{constructor(t,e,i){this.tree=t,this.overlay=e,this.parser=i}static get(t){return t&&t.props&&t.props[G.mounted.id]}};const Ky=Object.create(null);let Be=class gg{constructor(t,e,i,n=0){this.name=t,this.props=e,this.id=i,this.flags=n}static define(t){let e=t.props&&t.props.length?Object.create(null):Ky,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),n=new gg(t.name||"",e,t.id,i);if(t.props){for(let r of t.props)if(Array.isArray(r)||(r=r(n)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[r[0].id]=r[1]}}return n}prop(t){return this.props[t.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(t){if(typeof t=="string"){if(this.name==t)return!0;let e=this.prop(G.group);return e?e.indexOf(t)>-1:!1}return this.id==t}static match(t){let e=Object.create(null);for(let i in t)for(let n of i.split(" "))e[n]=t[i];return i=>{for(let n=i.prop(G.group),r=-1;r<(n?n.length:0);r++){let o=e[r<0?i.name:n[r]];if(o)return o}}}};Be.none=new Be("",Object.create(null),0,8);const Ds=new WeakMap,Zf=new WeakMap;var Qt;(function(s){s[s.ExcludeBuffers=1]="ExcludeBuffers",s[s.IncludeAnonymous=2]="IncludeAnonymous",s[s.IgnoreMounts=4]="IgnoreMounts",s[s.IgnoreOverlays=8]="IgnoreOverlays"})(Qt||(Qt={}));let Ut=class ga{constructor(t,e,i,n,r){if(this.type=t,this.children=e,this.positions=i,this.length=n,this.props=null,r&&r.length){this.props=Object.create(null);for(let[o,l]of r)this.props[typeof o=="number"?o:o.id]=l}}toString(){let t=Cr.get(this);if(t&&!t.overlay)return t.tree.toString();let e="";for(let i of this.children){let n=i.toString();n&&(e&&(e+=","),e+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(e.length?"("+e+")":""):e}cursor(t=0){return new ba(this.topNode,t)}cursorAt(t,e=0,i=0){let n=Ds.get(this)||this.topNode,r=new ba(n);return r.moveTo(t,e),Ds.set(this,r._tree),r}get topNode(){return new fi(this,0,0,null)}resolve(t,e=0){let i=Fn(Ds.get(this)||this.topNode,t,e,!1);return Ds.set(this,i),i}resolveInner(t,e=0){let i=Fn(Zf.get(this)||this.topNode,t,e,!0);return Zf.set(this,i),i}resolveStack(t,e=0){return iw(this,t,e)}iterate(t){let{enter:e,leave:i,from:n=0,to:r=this.length}=t,o=t.mode||0,l=(o&Qt.IncludeAnonymous)>0;for(let a=this.cursor(o|Qt.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=n&&(!l&&a.type.isAnonymous||e(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:mh(Be.none,this.children,this.positions,0,this.children.length,0,this.length,(e,i,n)=>new ga(this.type,e,i,n,this.propValues),t.makeTree||((e,i,n)=>new ga(Be.none,e,i,n)))}static build(t){return nw(t)}};Ut.empty=new Ut(Be.none,[],[],0);let Jy=class mg{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new mg(this.buffer,this.index)}},on=class Og{constructor(t,e,i){this.buffer=t,this.length=e,this.set=i}get type(){return Be.none}toString(){let t=[];for(let e=0;e<this.buffer.length;)t.push(this.childString(e)),e=this.buffer[e+3];return t.join(",")}childString(t){let e=this.buffer[t],i=this.buffer[t+3],n=this.set.types[e],r=n.name;if(/\W/.test(r)&&!n.isError&&(r=JSON.stringify(r)),t+=4,i==t)return r;let o=[];for(;t<i;)o.push(this.childString(t)),t=this.buffer[t+3];return r+"("+o.join(",")+")"}findChild(t,e,i,n,r){let{buffer:o}=this,l=-1;for(let a=t;a!=e&&!(bg(r,n,o[a+1],o[a+2])&&(l=a,i>0));a=o[a+3]);return l}slice(t,e,i){let n=this.buffer,r=new Uint16Array(e-t),o=0;for(let l=t,a=0;l<e;){r[a++]=n[l++],r[a++]=n[l++]-i;let h=r[a++]=n[l++]-i;r[a++]=n[l++]-t,o=Math.max(o,h)}return new Og(r,o,this.set)}};function bg(s,t,e,i){switch(s){case-2:return e<t;case-1:return i>=t&&e<t;case 0:return e<t&&i>t;case 1:return e<=t&&i>t;case 2:return i>t;case 4:return!0}}function Fn(s,t,e,i){for(var n;s.from==s.to||(e<1?s.from>=t:s.from>t)||(e>-1?s.to<=t:s.to<t);){let o=!i&&s instanceof fi&&s.index<0?null:s.parent;if(!o)return s;s=o}let r=i?0:Qt.IgnoreOverlays;if(i)for(let o=s,l=o.parent;l;o=l,l=o.parent)o instanceof fi&&o.index<0&&((n=l.enter(t,e,r))===null||n===void 0?void 0:n.from)!=o.from&&(s=l);for(;;){let o=s.enter(t,e,r);if(!o)return s;s=o}}let yg=class{cursor(t=0){return new ba(this,t)}getChild(t,e=null,i=null){let n=Af(this,t,e,i);return n.length?n[0]:null}getChildren(t,e=null,i=null){return Af(this,t,e,i)}resolve(t,e=0){return Fn(this,t,e,!1)}resolveInner(t,e=0){return Fn(this,t,e,!0)}matchContext(t){return ma(this.parent,t)}enterUnfinishedNodesBefore(t){let e=this.childBefore(t),i=this;for(;e;){let n=e.lastChild;if(!n||n.to!=e.to)break;n.type.isError&&n.from==n.to?(i=e,e=n.prevSibling):e=n}return i}get node(){return this}get next(){return this.parent}},fi=class cr extends yg{constructor(t,e,i,n){super(),this._tree=t,this.from=e,this.index=i,this._parent=n}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,e,i,n,r=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,h=e>0?l.length:-1;t!=h;t+=e){let c=l[t],f=a[t]+o.from;if(bg(n,i,f,f+c.length)){if(c instanceof on){if(r&Qt.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,e,i-f,n);if(u>-1)return new Oa(new tw(o,c,t,f),null,u)}else if(r&Qt.IncludeAnonymous||!c.type.isAnonymous||gh(c)){let u;if(!(r&Qt.IgnoreMounts)&&(u=Cr.get(c))&&!u.overlay)return new cr(u.tree,f,t,o);let d=new cr(c,f,t,o);return r&Qt.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(e<0?c.children.length-1:0,e,i,n)}}}if(r&Qt.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?t=o.index+e:t=e<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(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}enter(t,e,i=0){let n;if(!(i&Qt.IgnoreOverlays)&&(n=Cr.get(this._tree))&&n.overlay){let r=t-this.from;for(let{from:o,to:l}of n.overlay)if((e>0?o<=r:o<r)&&(e<0?l>=r:l>r))return new cr(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}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 Af(s,t,e,i){let n=s.cursor(),r=[];if(!n.firstChild())return r;if(e!=null){for(let o=!1;!o;)if(o=n.type.is(e),!n.nextSibling())return r}for(;;){if(i!=null&&n.type.is(i))return r;if(n.type.is(t)&&r.push(n.node),!n.nextSibling())return i==null?r:[]}}function ma(s,t,e=t.length-1){for(let i=s;e>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[e]&&t[e]!=i.name)return!1;e--}}return!0}let tw=class{constructor(t,e,i,n){this.parent=t,this.buffer=e,this.index=i,this.start=n}},Oa=class Rn extends yg{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(t,e,i){super(),this.context=t,this._parent=e,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,e,i){let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.context.start,i);return r<0?null:new Rn(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}enter(t,e,i=0){if(i&Qt.ExcludeBuffers)return null;let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return r<0?null:new Rn(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Rn(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new Rn(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:i}=this.context,n=this.index+4,r=i.buffer[this.index+3];if(r>n){let o=i.buffer[this.index+1];t.push(i.slice(n,r,o)),e.push(0)}return new Ut(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}};function wg(s){if(!s.length)return null;let t=0,e=s[0];for(let r=1;r<s.length;r++){let o=s[r];(o.from>e.from||o.to<e.to)&&(e=o,t=r)}let i=e instanceof fi&&e.index<0?null:e.parent,n=s.slice();return i?n[t]=i:n.splice(t,1),new ew(n,e)}let ew=class{constructor(t,e){this.heads=t,this.node=e}get next(){return wg(this.heads)}};function iw(s,t,e){let i=s.resolveInner(t,e),n=null;for(let r=i instanceof fi?i:i.context.parent;r;r=r.parent)if(r.index<0){let o=r.parent;(n||(n=[i])).push(o.resolve(t,e)),r=o}else{let o=Cr.get(r.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let l=new fi(o.tree,o.overlay[0].from+r.from,-1,r);(n||(n=[i])).push(Fn(l,t,e,!1))}}return n?wg(n):i}let ba=class{get name(){return this.type.name}constructor(t,e=0){if(this.mode=e,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof fi)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let i=t._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,e){this.index=t;let{start:i,buffer:n}=this.buffer;return this.type=e||n.set.types[n.buffer[t]],this.from=i+n.buffer[t+1],this.to=i+n.buffer[t+2],!0}yield(t){return t?t instanceof fi?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,e,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,i,this.mode));let{buffer:n}=this.buffer,r=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.buffer.start,i);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(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,e,i=this.mode){return this.buffer?i&Qt.ExcludeBuffers?!1:this.enterChild(1,t,e):this.yield(this._tree.enter(t,e,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Qt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&Qt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:e}=this.buffer,i=this.stack.length-1;if(t<0){let n=i<0?0:this.stack[i]+4;if(this.index!=n)return this.yieldBuf(e.findChild(n,this.index,-1,0,4))}else{let n=e.buffer[this.index+3];if(n<(i<0?e.buffer.length:e.buffer[this.stack[i]+3]))return this.yieldBuf(n)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let e,i,{buffer:n}=this;if(n){if(t>0){if(this.index<n.buffer.buffer.length)return!1}else for(let r=0;r<this.index;r++)if(n.buffer.buffer[r+3]<this.index)return!1;({index:e,parent:i}=n)}else({index:e,_parent:i}=this._tree);for(;i;{index:e,_parent:i}=i)if(e>-1)for(let r=e+t,o=t<0?-1:i._tree.children.length;r!=o;r+=t){let l=i._tree.children[r];if(this.mode&Qt.IncludeAnonymous||l instanceof on||!l.type.isAnonymous||gh(l))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,e););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,e=null,i=0;if(t&&t.context==this.buffer)t:for(let n=this.index,r=this.stack.length;r>=0;){for(let o=t;o;o=o._parent)if(o.index==n){if(n==this.index)return o;e=o,i=r+1;break t}n=this.stack[--r]}for(let n=i;n<this.stack.length;n++)e=new Oa(this.buffer,e,this.stack[n]);return this.bufferNode=new Oa(this.buffer,e,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,e){for(let i=0;;){let n=!1;if(this.type.isAnonymous||t(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(n=!0)}for(;;){if(n&&e&&e(this),n=this.type.isAnonymous,!i)return;if(this.nextSibling())break;this.parent(),i--,n=!0}}}matchContext(t){if(!this.buffer)return ma(this.node.parent,t);let{buffer:e}=this.buffer,{types:i}=e.set;for(let n=t.length-1,r=this.stack.length-1;n>=0;r--){if(r<0)return ma(this._tree,t,n);let o=i[e.buffer[this.stack[r]]];if(!o.isAnonymous){if(t[n]&&t[n]!=o.name)return!1;n--}}return!0}};function gh(s){return s.children.some(t=>t instanceof on||!t.type.isAnonymous||gh(t))}function nw(s){var t;let{buffer:e,nodeSet:i,maxBufferLength:n=Fy,reused:r=[],minRepeatType:o=i.types.length}=s,l=Array.isArray(e)?new Jy(e,e.length):e,a=i.types,h=0,c=0;function f(w,$,v,R,Z,D){let{id:A,start:C,end:Y,size:B}=l,N=c,U=h;for(;B<0;)if(l.next(),B==-1){let ft=r[A];v.push(ft),R.push(C-w);return}else if(B==-3){h=A;return}else if(B==-4){c=A;return}else throw new RangeError(`Unrecognized record size: ${B}`);let H=a[A],ot,it,lt=C-w;if(Y-C<=n&&(it=m(l.pos-$,Z))){let ft=new Uint16Array(it.size-it.skip),ht=l.pos-it.size,St=ft.length;for(;l.pos>ht;)St=O(it.start,ft,St);ot=new on(ft,Y-it.start,i),lt=it.start-w}else{let ft=l.pos-B;l.next();let ht=[],St=[],Yt=A>=o?A:-1,oe=0,gi=Y;for(;l.pos>ft;)Yt>=0&&l.id==Yt&&l.size>=0?(l.end<=gi-n&&(p(ht,St,C,oe,l.end,gi,Yt,N,U),oe=ht.length,gi=l.end),l.next()):D>2500?u(C,ft,ht,St):f(C,ft,ht,St,Yt,D+1);if(Yt>=0&&oe>0&&oe<ht.length&&p(ht,St,C,oe,C,gi,Yt,N,U),ht.reverse(),St.reverse(),Yt>-1&&oe>0){let Xh=d(H,U);ot=mh(H,ht,St,0,ht.length,0,Y-C,Xh,Xh)}else ot=g(H,ht,St,Y-C,N-Y,U)}v.push(ot),R.push(lt)}function u(w,$,v,R){let Z=[],D=0,A=-1;for(;l.pos>$;){let{id:C,start:Y,end:B,size:N}=l;if(N>4)l.next();else{if(A>-1&&Y<A)break;A<0&&(A=B-n),Z.push(C,Y,B),D++,l.next()}}if(D){let C=new Uint16Array(D*4),Y=Z[Z.length-2];for(let B=Z.length-3,N=0;B>=0;B-=3)C[N++]=Z[B],C[N++]=Z[B+1]-Y,C[N++]=Z[B+2]-Y,C[N++]=N;v.push(new on(C,Z[2]-Y,i)),R.push(Y-w)}}function d(w,$){return(v,R,Z)=>{let D=0,A=v.length-1,C,Y;if(A>=0&&(C=v[A])instanceof Ut){if(!A&&C.type==w&&C.length==Z)return C;(Y=C.prop(G.lookAhead))&&(D=R[A]+C.length+Y)}return g(w,v,R,Z,D,$)}}function p(w,$,v,R,Z,D,A,C,Y){let B=[],N=[];for(;w.length>R;)B.push(w.pop()),N.push($.pop()+v-Z);w.push(g(i.types[A],B,N,D-Z,C-D,Y)),$.push(Z-v)}function g(w,$,v,R,Z,D,A){if(D){let C=[G.contextHash,D];A=A?[C].concat(A):[C]}if(Z>25){let C=[G.lookAhead,Z];A=A?[C].concat(A):[C]}return new Ut(w,$,v,R,A)}function m(w,$){let v=l.fork(),R=0,Z=0,D=0,A=v.end-n,C={size:0,start:0,skip:0};t:for(let Y=v.pos-w;v.pos>Y;){let B=v.size;if(v.id==$&&B>=0){C.size=R,C.start=Z,C.skip=D,D+=4,R+=4,v.next();continue}let N=v.pos-B;if(B<0||N<Y||v.start<A)break;let U=v.id>=o?4:0,H=v.start;for(v.next();v.pos>N;){if(v.size<0)if(v.size==-3)U+=4;else break t;else v.id>=o&&(U+=4);v.next()}Z=H,R+=B,D+=U}return($<0||R==w)&&(C.size=R,C.start=Z,C.skip=D),C.size>4?C:void 0}function O(w,$,v){let{id:R,start:Z,end:D,size:A}=l;if(l.next(),A>=0&&R<o){let C=v;if(A>4){let Y=l.pos-(A-4);for(;l.pos>Y;)v=O(w,$,v)}$[--v]=C,$[--v]=D-w,$[--v]=Z-w,$[--v]=R}else A==-3?h=R:A==-4&&(c=R);return v}let y=[],x=[];for(;l.pos>0;)f(s.start||0,s.bufferStart||0,y,x,-1,0);let k=(t=s.length)!==null&&t!==void 0?t:y.length?x[0]+y[0].length:0;return new Ut(a[s.topID],y.reverse(),x.reverse(),k)}const Tf=new WeakMap;function fr(s,t){if(!s.isAnonymous||t instanceof on||t.type!=s)return 1;let e=Tf.get(t);if(e==null){e=1;for(let i of t.children){if(i.type!=s||!(i instanceof Ut)){e=1;break}e+=fr(s,i)}Tf.set(t,e)}return e}function mh(s,t,e,i,n,r,o,l,a){let h=0;for(let p=i;p<n;p++)h+=fr(s,t[p]);let c=Math.ceil(h*1.5/8),f=[],u=[];function d(p,g,m,O,y){for(let x=m;x<O;){let k=x,w=g[x],$=fr(s,p[x]);for(x++;x<O;x++){let v=fr(s,p[x]);if($+v>=c)break;$+=v}if(x==k+1){if($>c){let v=p[k];d(v.children,v.positions,0,v.children.length,g[k]+y);continue}f.push(p[k])}else{let v=g[x-1]+p[x-1].length-w;f.push(mh(s,p,g,k,x,w,v,null,a))}u.push(w+y-r)}}return d(t,e,i,n,0),(l||a)(f,u,o)}let ur=class ya{constructor(t,e,i,n,r=!1,o=!1){this.from=t,this.to=e,this.tree=i,this.offset=n,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,e=[],i=!1){let n=[new ya(0,t.length,t,0,!1,i)];for(let r of e)r.to>t.length&&n.push(r);return n}static applyChanges(t,e,i=128){if(!e.length)return t;let n=[],r=1,o=t.length?t[0]:null;for(let l=0,a=0,h=0;;l++){let c=l<e.length?e[l]:null,f=c?c.fromA:1e9;if(f-a>=i)for(;o&&o.from<f;){let u=o;if(a>=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new ya(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&n.push(u),o.to>f)break;o=r<t.length?t[r++]:null}if(!c)break;a=c.toA,h=c.toA-c.toB}return n}},sw=class{startParse(t,e,i){return typeof t=="string"&&(t=new rw(t)),i=i?i.length?i.map(n=>new Eo(n.from,n.to)):[new Eo(0,0)]:[new Eo(0,t.length)],this.createParse(t,e||[],i)}parse(t,e,i){let n=this.startParse(t,e,i);for(;;){let r=n.advance();if(r)return r}}},rw=class{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}};new G({perNode:!0});let ow=0,Ve=class wa{constructor(t,e,i,n){this.name=t,this.set=e,this.base=i,this.modified=n,this.id=ow++}toString(){let{name:t}=this;for(let e of this.modified)e.name&&(t=`${e.name}(${t})`);return t}static define(t,e){let i=typeof t=="string"?t:"?";if(t instanceof wa&&(e=t),e!=null&&e.base)throw new Error("Can not derive from a modified tag");let n=new wa(i,[],null,[]);if(n.set.push(n),e)for(let r of e.set)n.set.push(r);return n}static defineModifier(t){let e=new Mf(t);return i=>i.modified.indexOf(e)>-1?i:Mf.get(i.base||i,i.modified.concat(e).sort((n,r)=>n.id-r.id))}},lw=0,Mf=class Sg{constructor(t){this.name=t,this.instances=[],this.id=lw++}static get(t,e){if(!e.length)return t;let i=e[0].instances.find(l=>l.base==t&&aw(e,l.modified));if(i)return i;let n=[],r=new Ve(t.name,n,t,e);for(let l of e)l.instances.push(r);let o=hw(e);for(let l of t.set)if(!l.modified.length)for(let a of o)n.push(Sg.get(l,a));return r}};function aw(s,t){return s.length==t.length&&s.every((e,i)=>e==t[i])}function hw(s){let t=[[]];for(let e=0;e<s.length;e++)for(let i=0,n=t.length;i<n;i++)t.push(t[i].concat(s[e]));return t.sort((e,i)=>i.length-e.length)}function cw(s){let t=Object.create(null);for(let e in s){let i=s[e];Array.isArray(i)||(i=[i]);for(let n of e.split(" "))if(n){let r=[],o=2,l=n;for(let f=0;;){if(l=="..."&&f>0&&f+3==n.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+n);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==n.length)break;let d=n[f++];if(f==n.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+n);l=n.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+n);let c=new Zr(i,o,a>0?r.slice(0,a):null);t[h]=c.sort(t[h])}}return xg.add(t)}const xg=new G;let Zr=class{constructor(t,e,i,n){this.tags=t,this.mode=e,this.context=i,this.next=n}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}};Zr.empty=new Zr([],2,null);function kg(s,t){let e=Object.create(null);for(let r of s)if(!Array.isArray(r.tag))e[r.tag.id]=r.class;else for(let o of r.tag)e[o.id]=r.class;let{scope:i,all:n=null}=t||{};return{style:r=>{let o=n;for(let l of r)for(let a of l.set){let h=e[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function fw(s,t){let e=null;for(let i of s){let n=i.style(t);n&&(e=e?e+" "+n:n)}return e}function uw(s,t,e,i=0,n=s.length){let r=new dw(i,Array.isArray(t)?t:[t],e);r.highlightRange(s.cursor(),i,n,"",r.highlighters),r.flush(n)}let dw=class{constructor(t,e,i){this.at=t,this.highlighters=e,this.span=i,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,i,n,r){let{type:o,from:l,to:a}=t;if(l>=i||a<=e)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=n,c=pw(t)||Zr.empty,f=fw(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(n+=(n?" ":"")+f)),this.startSpan(Math.max(e,l),h),c.opaque)return;let u=t.tree&&t.tree.prop(G.mounted);if(u&&u.overlay){let d=t.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(m=>!m.scope||m.scope(u.tree.type)),g=t.firstChild();for(let m=0,O=l;;m++){let y=m<u.overlay.length?u.overlay[m]:null,x=y?y.from+l:a,k=Math.max(e,O),w=Math.min(i,x);if(k<w&&g)for(;t.from<w&&(this.highlightRange(t,k,w,n,r),this.startSpan(Math.min(w,t.to),h),!(t.to>=x||!t.nextSibling())););if(!y||x>i)break;O=y.to+l,O>e&&(this.highlightRange(d.cursor(),Math.max(e,y.from+l),Math.min(i,O),"",p),this.startSpan(Math.min(i,O),h))}g&&t.parent()}else if(t.firstChild()){u&&(n="");do if(!(t.to<=e)){if(t.from>=i)break;this.highlightRange(t,e,i,n,r),this.startSpan(Math.min(i,t.to),h)}while(t.nextSibling());t.parent()}}};function pw(s){let t=s.type.prop(xg);for(;t&&t.context&&!s.matchContext(t.context);)t=t.next;return t||null}const T=Ve.define,Ws=T(),Fe=T(),Rf=T(Fe),Df=T(Fe),Ue=T(),Es=T(Ue),Bo=T(Ue),xe=T(),mi=T(xe),be=T(),ye=T(),Sa=T(),On=T(Sa),Bs=T(),Q={comment:Ws,lineComment:T(Ws),blockComment:T(Ws),docComment:T(Ws),name:Fe,variableName:T(Fe),typeName:Rf,tagName:T(Rf),propertyName:Df,attributeName:T(Df),className:T(Fe),labelName:T(Fe),namespace:T(Fe),macroName:T(Fe),literal:Ue,string:Es,docString:T(Es),character:T(Es),attributeValue:T(Es),number:Bo,integer:T(Bo),float:T(Bo),bool:T(Ue),regexp:T(Ue),escape:T(Ue),color:T(Ue),url:T(Ue),keyword:be,self:T(be),null:T(be),atom:T(be),unit:T(be),modifier:T(be),operatorKeyword:T(be),controlKeyword:T(be),definitionKeyword:T(be),moduleKeyword:T(be),operator:ye,derefOperator:T(ye),arithmeticOperator:T(ye),logicOperator:T(ye),bitwiseOperator:T(ye),compareOperator:T(ye),updateOperator:T(ye),definitionOperator:T(ye),typeOperator:T(ye),controlOperator:T(ye),punctuation:Sa,separator:T(Sa),bracket:On,angleBracket:T(On),squareBracket:T(On),paren:T(On),brace:T(On),content:xe,heading:mi,heading1:T(mi),heading2:T(mi),heading3:T(mi),heading4:T(mi),heading5:T(mi),heading6:T(mi),contentSeparator:T(xe),list:T(xe),quote:T(xe),emphasis:T(xe),strong:T(xe),link:T(xe),monospace:T(xe),strikethrough:T(xe),inserted:T(),deleted:T(),changed:T(),invalid:T(),meta:Bs,documentMeta:T(Bs),annotation:T(Bs),processingInstruction:T(Bs),definition:Ve.defineModifier("definition"),constant:Ve.defineModifier("constant"),function:Ve.defineModifier("function"),standard:Ve.defineModifier("standard"),local:Ve.defineModifier("local"),special:Ve.defineModifier("special")};for(let s in Q){let t=Q[s];t instanceof Ve&&(t.name=s)}kg([{tag:Q.link,class:"tok-link"},{tag:Q.heading,class:"tok-heading"},{tag:Q.emphasis,class:"tok-emphasis"},{tag:Q.strong,class:"tok-strong"},{tag:Q.keyword,class:"tok-keyword"},{tag:Q.atom,class:"tok-atom"},{tag:Q.bool,class:"tok-bool"},{tag:Q.url,class:"tok-url"},{tag:Q.labelName,class:"tok-labelName"},{tag:Q.inserted,class:"tok-inserted"},{tag:Q.deleted,class:"tok-deleted"},{tag:Q.literal,class:"tok-literal"},{tag:Q.string,class:"tok-string"},{tag:Q.number,class:"tok-number"},{tag:[Q.regexp,Q.escape,Q.special(Q.string)],class:"tok-string2"},{tag:Q.variableName,class:"tok-variableName"},{tag:Q.local(Q.variableName),class:"tok-variableName tok-local"},{tag:Q.definition(Q.variableName),class:"tok-variableName tok-definition"},{tag:Q.special(Q.variableName),class:"tok-variableName2"},{tag:Q.definition(Q.propertyName),class:"tok-propertyName tok-definition"},{tag:Q.typeName,class:"tok-typeName"},{tag:Q.namespace,class:"tok-namespace"},{tag:Q.className,class:"tok-className"},{tag:Q.macroName,class:"tok-macroName"},{tag:Q.propertyName,class:"tok-propertyName"},{tag:Q.operator,class:"tok-operator"},{tag:Q.comment,class:"tok-comment"},{tag:Q.meta,class:"tok-meta"},{tag:Q.invalid,class:"tok-invalid"},{tag:Q.punctuation,class:"tok-punctuation"}]);var Yo;const Dn=new G,gw=new G;let Ze=class{constructor(t,e,i=[],n=""){this.data=t,this.name=n,V.prototype.hasOwnProperty("tree")||Object.defineProperty(V.prototype,"tree",{get(){return Ye(this)}}),this.parser=e,this.extension=[ln.of(this),V.languageData.of((r,o,l)=>{let a=Wf(r,o,l),h=a.type.prop(Dn);if(!h)return[];let c=r.facet(h),f=a.type.prop(gw);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(t,e,i=-1){return Wf(t,e,i).type.prop(Dn)==this.data}findRegions(t){let e=t.facet(ln);if((e==null?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let i=[],n=(r,o)=>{if(r.prop(Dn)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(G.mounted);if(l){if(l.tree.prop(Dn)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(n(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;a<r.children.length;a++){let h=r.children[a];h instanceof Ut&&n(h,r.positions[a]+o)}};return n(Ye(t),0),i}get allowsNesting(){return!0}};Ze.setState=j.define();function Wf(s,t,e){let i=s.facet(ln),n=Ye(s).topNode;if(!i||i.allowsNesting)for(let r=n;r;r=r.enter(t,e,Qt.ExcludeBuffers))r.type.isTop&&(n=r);return n}function Ye(s){let t=s.field(Ze.state,!1);return t?t.tree:Ut.empty}let mw=class{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let i=this.cursorPos-this.string.length;return t<i||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i)}},bn=null,Ow=class xa{constructor(t,e,i=[],n,r,o,l,a){this.parser=t,this.state=e,this.fragments=i,this.tree=n,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,i){return new xa(t,e,[],Ut.empty,0,i,[],null)}startParse(){return this.parser.startParse(new mw(this.state.doc),this.fragments)}work(t,e){return e!=null&&e>=this.state.doc.length&&(e=void 0),this.tree!=Ut.empty&&this.isDone(e??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let n=Date.now()+t;t=()=>Date.now()>n}for(this.parse||(this.parse=this.startParse()),e!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&e<this.state.doc.length&&this.parse.stopAt(e);;){let n=this.parse.advance();if(n)if(this.fragments=this.withoutTempSkipped(ur.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(e??this.state.doc.length))this.parse=this.startParse();else return!0;if(t())return!1}})}takeTree(){let t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(e=this.parse.advance()););}),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(ur.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=bn;bn=this;try{return t()}finally{bn=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=Ef(t,e.from,e.to);return t}changes(t,e){let{fragments:i,tree:n,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!t.empty){let a=[];if(t.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=ur.applyChanges(i,a),n=Ut.empty,r=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=t.mapPos(h.from,1),f=t.mapPos(h.to,-1);c<f&&l.push({from:c,to:f})}}}return new xa(this.parser,e,i,n,r,o,l,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let e=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:n,to:r}=this.skipped[i];n<t.to&&r>t.from&&(this.fragments=Ef(this.fragments,n,r),this.skipped.splice(i--,1))}return this.skipped.length>=e?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends sw{createParse(e,i,n){let r=n[0].from,o=n[n.length-1].to;return{parsedPos:r,advance(){let a=bn;if(a){for(let h of n)a.tempSkipped.push(h);t&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,t]):t)}return this.parsedPos=o,new Ut(Be.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&e[0].from==0&&e[0].to>=t}static get(){return bn}};function Ef(s,t,e){return ur.applyChanges(s,[{fromA:t,toA:e,fromB:t,toB:e}])}let ka=class va{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new va(e)}static init(t){let e=Math.min(3e3,t.doc.length),i=Ow.create(t.facet(ln).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new va(i)}};Ze.state=wt.define({create:ka.init,update(s,t){for(let e of t.effects)if(e.is(Ze.setState))return e.value;return t.startState.facet(ln)!=t.state.facet(ln)?ka.init(t.state):s.apply(t)}});let vg=s=>{let t=setTimeout(()=>s(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(vg=s=>{let t=-1,e=setTimeout(()=>{t=requestIdleCallback(s,{timeout:500-100})},100);return()=>t<0?clearTimeout(e):cancelIdleCallback(t)});const Xo=typeof navigator<"u"&&(!((Yo=navigator.scheduling)===null||Yo===void 0)&&Yo.isInputPending)?()=>navigator.scheduling.isInputPending():null,bw=Ee.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(Ze.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(Ze.state);(e.tree!=e.context.tree||!e.context.isDone(t.doc.length))&&(this.working=vg(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:n}}=this.view,r=i.field(Ze.state);if(r.tree==r.context.tree&&r.context.isDone(n+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,t&&!Xo?Math.max(25,t.timeRemaining()-5):1e9),l=r.context.treeLen<n&&i.doc.length>n+1e3,a=r.context.work(()=>Xo&&Xo()||Date.now()>o,n+(l?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:Ze.setState.of(new ka(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(e=>Ce(this.view.state,e)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),ln=P.define({combine(s){return s.length?s[0]:null},enables:s=>[Ze.state,bw,L.contentAttributes.compute([s],t=>{let e=t.facet(s);return e&&e.name?{"data-language":e.name}:{}})]}),yw=P.define(),Oh=P.define({combine:s=>{if(!s.length)return" ";let t=s[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(s[0]));return t}});function Ar(s){let t=s.facet(Oh);return t.charCodeAt(0)==9?s.tabSize*t.length:t.length}function Tr(s,t){let e="",i=s.tabSize,n=s.facet(Oh)[0];if(n==" "){for(;t>=i;)e+=" ",t-=i;n=" "}for(let r=0;r<t;r++)e+=n;return e}function $g(s,t){s instanceof V&&(s=new ro(s));for(let i of s.state.facet(yw)){let n=i(s,t);if(n!==void 0)return n}let e=Ye(s.state);return e.length>=t?Sw(s,e,t):null}let ro=class{constructor(t,e={}){this.state=t,this.options=e,this.unit=Ar(t)}lineAt(t,e=1){let i=this.state.doc.lineAt(t),{simulateBreak:n,simulateDoubleBreak:r}=this.options;return n!=null&&n>=i.from&&n<=i.to?r&&n==t?{text:"",from:t}:(e<0?n<t:n<=t)?{text:i.text.slice(n-i.from),from:n}:{text:i.text.slice(0,n-i.from),from:i.from}:i}textAfterPos(t,e=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:i,from:n}=this.lineAt(t,e);return i.slice(t-n,Math.min(i.length,t+100-n))}column(t,e=1){let{text:i,from:n}=this.lineAt(t,e),r=this.countColumn(i,t-n),o=this.options.overrideIndentation?this.options.overrideIndentation(n):-1;return o>-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(t,e=t.length){return Ti(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:i,from:n}=this.lineAt(t,e),r=this.options.overrideIndentation;if(r){let o=r(n);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}};const ww=new G;function Sw(s,t,e){let i=t.resolveStack(e),n=i.node.enterUnfinishedNodesBefore(e);if(n!=i.node){let r=[];for(let o=n;o!=i.node;o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return Qg(i,s,e)}function Qg(s,t,e){for(let i=s;i;i=i.next){let n=kw(i.node);if(n)return n($w.create(t,e,i))}return 0}function xw(s){return s.pos==s.options.simulateBreak&&s.options.simulateDoubleBreak}function kw(s){let t=s.type.prop(ww);if(t)return t;let e=s.firstChild,i;if(e&&(i=e.type.prop(G.closedBy))){let n=s.lastChild,r=n&&i.indexOf(n.name)>-1;return o=>Cw(o,!0,1,void 0,r&&!xw(o)?n.from:void 0)}return s.parent==null?vw:null}function vw(){return 0}let $w=class Pg extends ro{constructor(t,e,i){super(t.state,t.options),this.base=t,this.pos=e,this.context=i}get node(){return this.context.node}static create(t,e,i){return new Pg(t,e,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(e.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Qw(i,t))break;e=this.state.doc.lineAt(i.from)}return this.lineIndent(e.from)}continue(){return Qg(this.context.next,this.base,this.pos)}};function Qw(s,t){for(let e=t;e;e=e.parent)if(s==e)return!0;return!1}function Pw(s){let t=s.node,e=t.childAfter(t.from),i=t.lastChild;if(!e)return null;let n=s.options.simulateBreak,r=s.state.doc.lineAt(e.from),o=n==null||n<=r.from?r.to:Math.min(r.to,n);for(let l=e.to;;){let a=t.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped){if(a.from>=o)return null;let h=/^ */.exec(r.text.slice(e.to-r.from))[0].length;return{from:e.from,to:e.to+h}}l=a.to}}function Cw(s,t,e,i,n){let r=s.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||n==s.pos+o,a=t?Pw(s):null;return a?l?s.column(a.from):s.column(a.to):s.baseIndent+(l?0:s.unit*e)}let bh=class Cg{constructor(t,e){this.specs=t;let i;function n(l){let a=At.newName();return(i||(i=Object.create(null)))["."+a]=l,a}const r=typeof e.all=="string"?e.all:e.all?n(e.all):void 0,o=e.scope;this.scope=o instanceof Ze?l=>l.prop(Dn)==o.data:o?l=>l==o:void 0,this.style=kg(t.map(l=>({tag:l.tag,class:l.class||n(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new At(i):null,this.themeType=e.themeType}static define(t,e){return new Cg(t,e||{})}};const $a=P.define(),Zg=P.define({combine(s){return s.length?[s[0]]:null}});function Lo(s){let t=s.facet($a);return t.length?t:s.facet(Zg)}function Zw(s,t){let e=[Tw],i;return s instanceof bh&&(s.module&&e.push(L.styleModule.of(s.module)),i=s.themeType),t!=null&&t.fallback?e.push(Zg.of(s)):i?e.push($a.computeN([L.darkTheme],n=>n.facet(L.darkTheme)==(i=="dark")?[s]:[])):e.push($a.of(s)),e}let Aw=class{constructor(t){this.markCache=Object.create(null),this.tree=Ye(t.state),this.decorations=this.buildDeco(t,Lo(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=Ye(t.state),i=Lo(t.state),n=i!=Lo(t.startState),{viewport:r}=t.view,o=t.changes.mapPos(this.decoratedTo,1);e.length<r.to&&!n&&e.type==this.tree.type&&o>=r.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(e!=this.tree||t.viewportChanged||n)&&(this.tree=e,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=r.to)}buildDeco(t,e){if(!e||!this.tree.length)return F.none;let i=new qe;for(let{from:n,to:r}of t.visibleRanges)uw(this.tree,e,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=F.mark({class:a})))},n,r);return i.finish()}};const Tw=pe.high(Ee.fromClass(Aw,{decorations:s=>s.decorations}));Q.meta,Q.link,Q.heading,Q.emphasis,Q.strong,Q.strikethrough,Q.keyword,Q.atom,Q.bool,Q.url,Q.contentSeparator,Q.labelName,Q.literal,Q.inserted,Q.string,Q.deleted,Q.regexp,Q.escape,Q.string,Q.variableName,Q.variableName,Q.typeName,Q.namespace,Q.className,Q.variableName,Q.macroName,Q.propertyName,Q.comment,Q.invalid;const Mw=1e4,Rw="()[]{}",Dw=new G;function Qa(s,t,e){let i=s.prop(t<0?G.openedBy:G.closedBy);if(i)return i;if(s.name.length==1){let n=e.indexOf(s.name);if(n>-1&&n%2==(t<0?1:0))return[e[n+t]]}return null}function Pa(s){let t=s.type.prop(Dw);return t?t(s.node):s}function Bi(s,t,e,i={}){let n=i.maxScanDistance||Mw,r=i.brackets||Rw,o=Ye(s),l=o.resolveInner(t,e);for(let a=l;a;a=a.parent){let h=Qa(a.type,e,r);if(h&&a.from<a.to){let c=Pa(a);if(c&&(e>0?t>=c.from&&t<c.to:t>c.from&&t<=c.to))return Ww(s,t,e,a,c,h,r)}}return Ew(s,t,e,o,l.type,n,r)}function Ww(s,t,e,i,n,r,o){let l=i.parent,a={from:n.from,to:n.to},h=0,c=l==null?void 0:l.cursor();if(c&&(e<0?c.childBefore(i.from):c.childAfter(i.to)))do if(e<0?c.to<=i.from:c.from>=i.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from<c.to){let f=Pa(c);return{start:a,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(Qa(c.type,e,o))h++;else if(Qa(c.type,-e,o)){if(h==0){let f=Pa(c);return{start:a,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}h--}}while(e<0?c.prevSibling():c.nextSibling());return{start:a,matched:!1}}function Ew(s,t,e,i,n,r,o){let l=e<0?s.sliceDoc(t-1,t):s.sliceDoc(t,t+1),a=o.indexOf(l);if(a<0||a%2==0!=e>0)return null;let h={from:e<0?t-1:t,to:e>0?t+1:t},c=s.doc.iterRange(t,e>0?s.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;e<0&&(u+=d.length);let p=t+u*e;for(let g=e>0?0:d.length-1,m=e>0?d.length:-1;g!=m;g+=e){let O=o.indexOf(d[g]);if(!(O<0||i.resolveInner(p+g,1).type!=n))if(O%2==0==e>0)f++;else{if(f==1)return{start:h,end:{from:p+g,to:p+g+1},matched:O>>1==a>>1};f--}}e>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}const Bw=Object.create(null),Bf=[Be.none],Yf=[],Xf=Object.create(null),Yw=Object.create(null);for(let[s,t]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"]])Yw[s]=Xw(Bw,t);function jo(s,t){Yf.indexOf(s)>-1||(Yf.push(s),console.warn(t))}function Xw(s,t){let e=[];for(let l of t.split(" ")){let a=[];for(let h of l.split(".")){let c=s[h]||Q[h];c?typeof c=="function"?a.length?a=a.map(c):jo(h,`Modifier ${h} used at start of tag`):a.length?jo(h,`Tag ${h} used as modifier`):a=Array.isArray(c)?c:[c]:jo(h,`Unknown highlighting tag ${h}`)}for(let h of a)e.push(h)}if(!e.length)return 0;let i=t.replace(/ /g,"_"),n=i+" "+e.map(l=>l.id),r=Xf[n];if(r)return r.id;let o=Xf[n]=Be.define({id:Bf.length,name:i,props:[cw({[i]:e})]});return Bf.push(o),o.id}kt.RTL,kt.LTR;const Lw=s=>{let{state:t}=s,e=t.doc.lineAt(t.selection.main.from),i=wh(s.state,e.from);return i.line?jw(s):i.block?Nw(s):!1};function yh(s,t){return({state:e,dispatch:i})=>{if(e.readOnly)return!1;let n=s(t,e);return n?(i(e.update(n)),!0):!1}}const jw=yh(zw,0),Vw=yh(Ag,0),Nw=yh((s,t)=>Ag(s,t,qw(t)),0);function wh(s,t){let e=s.languageDataAt("commentTokens",t);return e.length?e[0]:{}}const yn=50;function Iw(s,{open:t,close:e},i,n){let r=s.sliceDoc(i-yn,i),o=s.sliceDoc(n,n+yn),l=/\s*$/.exec(r)[0].length,a=/^\s*/.exec(o)[0].length,h=r.length-l;if(r.slice(h-t.length,h)==t&&o.slice(a,a+e.length)==e)return{open:{pos:i-l,margin:l&&1},close:{pos:n+a,margin:a&&1}};let c,f;n-i<=2*yn?c=f=s.sliceDoc(i,n):(c=s.sliceDoc(i,i+yn),f=s.sliceDoc(n-yn,n));let u=/^\s*/.exec(c)[0].length,d=/\s*$/.exec(f)[0].length,p=f.length-d-e.length;return c.slice(u,u+t.length)==t&&f.slice(p,p+e.length)==e?{open:{pos:i+u+t.length,margin:/\s/.test(c.charAt(u+t.length))?1:0},close:{pos:n-d-e.length,margin:/\s/.test(f.charAt(p-1))?1:0}}:null}function qw(s){let t=[];for(let e of s.selection.ranges){let i=s.doc.lineAt(e.from),n=e.to<=i.to?i:s.doc.lineAt(e.to);n.from>i.from&&n.from==e.to&&(n=e.to==i.to+1?i:s.doc.lineAt(e.to-1));let r=t.length-1;r>=0&&t[r].to>i.from?t[r].to=n.to:t.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:n.to})}return t}function Ag(s,t,e=t.selection.ranges){let i=e.map(r=>wh(t,r.from).block);if(!i.every(r=>r))return null;let n=e.map((r,o)=>Iw(t,i[o],r.from,r.to));if(s!=2&&!n.every(r=>r))return{changes:t.changes(e.map((r,o)=>n[o]?[]:[{from:r.from,insert:i[o].open+" "},{from:r.to,insert:" "+i[o].close}]))};if(s!=1&&n.some(r=>r)){let r=[];for(let o=0,l;o<n.length;o++)if(l=n[o]){let a=i[o],{open:h,close:c}=l;r.push({from:h.pos-a.open.length,to:h.pos+h.margin},{from:c.pos-c.margin,to:c.pos+a.close.length})}return{changes:r}}return null}function zw(s,t,e=t.selection.ranges){let i=[],n=-1;for(let{from:r,to:o}of e){let l=i.length,a=1e9,h=wh(t,r).line;if(h){for(let c=r;c<=o;){let f=t.doc.lineAt(c);if(f.from>n&&(r==o||o>f.from)){n=f.from;let u=/^\s*/.exec(f.text)[0].length,d=u==f.length,p=f.text.slice(u,u+h.length)==h?u:-1;u<f.text.length&&u<a&&(a=u),i.push({line:f,comment:p,token:h,indent:u,empty:d,single:!1})}c=f.to+1}if(a<1e9)for(let c=l;c<i.length;c++)i[c].indent<i[c].line.text.length&&(i[c].indent=a);i.length==l+1&&(i[l].single=!0)}}if(s!=2&&i.some(r=>r.comment<0&&(!r.empty||r.single))){let r=[];for(let{line:l,token:a,indent:h,empty:c,single:f}of i)(f||!c)&&r.push({from:l.from+h,insert:a+" "});let o=t.changes(r);return{changes:o,selection:t.selection.map(o,1)}}else if(s!=1&&i.some(r=>r.comment>=0)){let r=[];for(let{line:o,comment:l,token:a}of i)if(l>=0){let h=o.from+l,c=h+a.length;o.text[c-o.from]==" "&&c++,r.push({from:h,to:c})}return{changes:r}}return null}const Ca=se.define(),_w=se.define(),Gw=P.define(),Tg=P.define({combine(s){return Xe(s,{minDepth:100,newGroupDelay:500,joinToEvent:(t,e)=>e},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(t,e)=>(i,n)=>t(i,n)||e(i,n)})}}),Mg=wt.define({create(){return Ae.empty},update(s,t){let e=t.state.facet(Tg),i=t.annotation(Ca);if(i){let a=Vt.fromTransaction(t,i.selection),h=i.side,c=h==0?s.undone:s.done;return a?c=Mr(c,c.length,e.minDepth,a):c=Wg(c,t.startState.selection),new Ae(h==0?i.rest:c,h==0?c:i.rest)}let n=t.annotation(_w);if((n=="full"||n=="before")&&(s=s.isolate()),t.annotation(mt.addToHistory)===!1)return t.changes.empty?s:s.addMapping(t.changes.desc);let r=Vt.fromTransaction(t),o=t.annotation(mt.time),l=t.annotation(mt.userEvent);return r?s=s.addChanges(r,o,l,e,t):t.selection&&(s=s.addSelection(t.startState.selection,o,l,e.newGroupDelay)),(n=="full"||n=="after")&&(s=s.isolate()),s},toJSON(s){return{done:s.done.map(t=>t.toJSON()),undone:s.undone.map(t=>t.toJSON())}},fromJSON(s){return new Ae(s.done.map(Vt.fromJSON),s.undone.map(Vt.fromJSON))}});function Hw(s={}){return[Mg,Tg.of(s),L.domEventHandlers({beforeinput(t,e){let i=t.inputType=="historyUndo"?Rg:t.inputType=="historyRedo"?Za:null;return i?(t.preventDefault(),i(e)):!1}})]}function oo(s,t){return function({state:e,dispatch:i}){if(!t&&e.readOnly)return!1;let n=e.field(Mg,!1);if(!n)return!1;let r=n.pop(s,e,t);return r?(i(r),!0):!1}}const Rg=oo(0,!1),Za=oo(1,!1),Fw=oo(0,!0),Uw=oo(1,!0);class Vt{constructor(t,e,i,n,r){this.changes=t,this.effects=e,this.mapped=i,this.startSelection=n,this.selectionsAfter=r}setSelAfter(t){return new Vt(this.changes,this.effects,this.mapped,this.startSelection,t)}toJSON(){var t,e,i;return{changes:(t=this.changes)===null||t===void 0?void 0:t.toJSON(),mapped:(e=this.mapped)===null||e===void 0?void 0:e.toJSON(),startSelection:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(n=>n.toJSON())}}static fromJSON(t){return new Vt(t.changes&&gt.fromJSON(t.changes),[],t.mapped&&Me.fromJSON(t.mapped),t.startSelection&&S.fromJSON(t.startSelection),t.selectionsAfter.map(S.fromJSON))}static fromTransaction(t,e){let i=te;for(let n of t.startState.facet(Gw)){let r=n(t);r.length&&(i=i.concat(r))}return!i.length&&t.changes.empty?null:new Vt(t.changes.invert(t.startState.doc),i,void 0,e||t.startState.selection,te)}static selection(t){return new Vt(void 0,te,void 0,void 0,t)}}function Mr(s,t,e,i){let n=t+1>e+20?t-e-1:0,r=s.slice(n,t);return r.push(i),r}function Kw(s,t){let e=[],i=!1;return s.iterChangedRanges((n,r)=>e.push(n,r)),t.iterChangedRanges((n,r,o,l)=>{for(let a=0;a<e.length;){let h=e[a++],c=e[a++];l>=h&&o<=c&&(i=!0)}}),i}function Jw(s,t){return s.ranges.length==t.ranges.length&&s.ranges.filter((e,i)=>e.empty!=t.ranges[i].empty).length===0}function Dg(s,t){return s.length?t.length?s.concat(t):s:t}const te=[],tS=200;function Wg(s,t){if(s.length){let e=s[s.length-1],i=e.selectionsAfter.slice(Math.max(0,e.selectionsAfter.length-tS));return i.length&&i[i.length-1].eq(t)?s:(i.push(t),Mr(s,s.length-1,1e9,e.setSelAfter(i)))}else return[Vt.selection([t])]}function eS(s){let t=s[s.length-1],e=s.slice();return e[s.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),e}function Vo(s,t){if(!s.length)return s;let e=s.length,i=te;for(;e;){let n=iS(s[e-1],t,i);if(n.changes&&!n.changes.empty||n.effects.length){let r=s.slice(0,e);return r[e-1]=n,r}else t=n.mapped,e--,i=n.selectionsAfter}return i.length?[Vt.selection(i)]:te}function iS(s,t,e){let i=Dg(s.selectionsAfter.length?s.selectionsAfter.map(l=>l.map(t)):te,e);if(!s.changes)return Vt.selection(i);let n=s.changes.map(t),r=t.mapDesc(s.changes,!0),o=s.mapped?s.mapped.composeDesc(r):r;return new Vt(n,j.mapEffects(s.effects,t),o,s.startSelection.map(r),i)}const nS=/^(input\.type|delete)($|\.)/;class Ae{constructor(t,e,i=0,n=void 0){this.done=t,this.undone=e,this.prevTime=i,this.prevUserEvent=n}isolate(){return this.prevTime?new Ae(this.done,this.undone):this}addChanges(t,e,i,n,r){let o=this.done,l=o[o.length-1];return l&&l.changes&&!l.changes.empty&&t.changes&&(!i||nS.test(i))&&(!l.selectionsAfter.length&&e-this.prevTime<n.newGroupDelay&&n.joinToEvent(r,Kw(l.changes,t.changes))||i=="input.type.compose")?o=Mr(o,o.length-1,n.minDepth,new Vt(t.changes.compose(l.changes),Dg(j.mapEffects(t.effects,l.changes),l.effects),l.mapped,l.startSelection,te)):o=Mr(o,o.length,n.minDepth,t),new Ae(o,te,e,i)}addSelection(t,e,i,n){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:te;return r.length>0&&e-this.prevTime<n&&i==this.prevUserEvent&&i&&/^select($|\.)/.test(i)&&Jw(r[r.length-1],t)?this:new Ae(Wg(this.done,t),this.undone,e,i)}addMapping(t){return new Ae(Vo(this.done,t),Vo(this.undone,t),this.prevTime,this.prevUserEvent)}pop(t,e,i){let n=t==0?this.done:this.undone;if(n.length==0)return null;let r=n[n.length-1],o=r.selectionsAfter[0]||e.selection;if(i&&r.selectionsAfter.length)return e.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:Ca.of({side:t,rest:eS(n),selection:o}),userEvent:t==0?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let l=n.length==1?te:n.slice(0,n.length-1);return r.mapped&&(l=Vo(l,r.mapped)),e.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:Ca.of({side:t,rest:l,selection:o}),filter:!1,userEvent:t==0?"undo":"redo",scrollIntoView:!0})}else return null}}Ae.empty=new Ae(te,te);const sS=[{key:"Mod-z",run:Rg,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Za,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Za,preventDefault:!0},{key:"Mod-u",run:Fw,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Uw,preventDefault:!0}];function fn(s,t){return S.create(s.ranges.map(t),s.mainIndex)}function je(s,t){return s.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function ge({state:s,dispatch:t},e){let i=fn(s.selection,e);return i.eq(s.selection,!0)?!1:(t(je(s,i)),!0)}function lo(s,t){return S.cursor(t?s.to:s.from)}function Eg(s,t){return ge(s,e=>e.empty?s.moveByChar(e,t):lo(e,t))}function Rt(s){return s.textDirectionAt(s.state.selection.main.head)==kt.LTR}const Bg=s=>Eg(s,!Rt(s)),Yg=s=>Eg(s,Rt(s));function Xg(s,t){return ge(s,e=>e.empty?s.moveByGroup(e,t):lo(e,t))}const rS=s=>Xg(s,!Rt(s)),oS=s=>Xg(s,Rt(s));function lS(s,t,e){if(t.type.prop(e))return!0;let i=t.to-t.from;return i&&(i>2||/[^\s,.;:]/.test(s.sliceDoc(t.from,t.to)))||t.firstChild}function ao(s,t,e){let i=Ye(s).resolveInner(t.head),n=e?G.closedBy:G.openedBy;for(let a=t.head;;){let h=e?i.childAfter(a):i.childBefore(a);if(!h)break;lS(s,h,n)?i=h:a=e?h.to:h.from}let r=i.type.prop(n),o,l;return r&&(o=e?Bi(s,i.from,1):Bi(s,i.to,-1))&&o.matched?l=e?o.end.to:o.end.from:l=e?i.to:i.from,S.cursor(l,e?-1:1)}const aS=s=>ge(s,t=>ao(s.state,t,!Rt(s))),hS=s=>ge(s,t=>ao(s.state,t,Rt(s)));function Lg(s,t){return ge(s,e=>{if(!e.empty)return lo(e,t);let i=s.moveVertically(e,t);return i.head!=e.head?i:s.moveToLineBoundary(e,t)})}const jg=s=>Lg(s,!1),Vg=s=>Lg(s,!0);function Ng(s){let t=s.scrollDOM.clientHeight<s.scrollDOM.scrollHeight-2,e=0,i=0,n;if(t){for(let r of s.state.facet(L.scrollMargins)){let o=r(s);o!=null&&o.top&&(e=Math.max(o==null?void 0:o.top,e)),o!=null&&o.bottom&&(i=Math.max(o==null?void 0:o.bottom,i))}n=s.scrollDOM.clientHeight-e-i}else n=(s.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:e,marginBottom:i,selfScroll:t,height:Math.max(s.defaultLineHeight,n-5)}}function Ig(s,t){let e=Ng(s),{state:i}=s,n=fn(i.selection,o=>o.empty?s.moveVertically(o,t,e.height):lo(o,t));if(n.eq(i.selection))return!1;let r;if(e.selfScroll){let o=s.coordsAtPos(i.selection.main.head),l=s.scrollDOM.getBoundingClientRect(),a=l.top+e.marginTop,h=l.bottom-e.marginBottom;o&&o.top>a&&o.bottom<h&&(r=L.scrollIntoView(n.main.head,{y:"start",yMargin:o.top-a}))}return s.dispatch(je(i,n),{effects:r}),!0}const Lf=s=>Ig(s,!1),Aa=s=>Ig(s,!0);function pi(s,t,e){let i=s.lineBlockAt(t.head),n=s.moveToLineBoundary(t,e);if(n.head==t.head&&n.head!=(e?i.to:i.from)&&(n=s.moveToLineBoundary(t,e,!1)),!e&&n.head==i.from&&i.length){let r=/^\s*/.exec(s.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;r&&t.head!=i.from+r&&(n=S.cursor(i.from+r))}return n}const cS=s=>ge(s,t=>pi(s,t,!0)),fS=s=>ge(s,t=>pi(s,t,!1)),uS=s=>ge(s,t=>pi(s,t,!Rt(s))),dS=s=>ge(s,t=>pi(s,t,Rt(s))),pS=s=>ge(s,t=>S.cursor(s.lineBlockAt(t.head).from,1)),gS=s=>ge(s,t=>S.cursor(s.lineBlockAt(t.head).to,-1));function mS(s,t,e){let i=!1,n=fn(s.selection,r=>{let o=Bi(s,r.head,-1)||Bi(s,r.head,1)||r.head>0&&Bi(s,r.head-1,1)||r.head<s.doc.length&&Bi(s,r.head+1,-1);if(!o||!o.end)return r;i=!0;let l=o.start.from==r.head?o.end.to:o.end.from;return e?S.range(r.anchor,l):S.cursor(l)});return i?(t(je(s,n)),!0):!1}const OS=({state:s,dispatch:t})=>mS(s,t,!1);function re(s,t){let e=fn(s.state.selection,i=>{let n=t(i);return S.range(i.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)});return e.eq(s.state.selection)?!1:(s.dispatch(je(s.state,e)),!0)}function qg(s,t){return re(s,e=>s.moveByChar(e,t))}const zg=s=>qg(s,!Rt(s)),_g=s=>qg(s,Rt(s));function Gg(s,t){return re(s,e=>s.moveByGroup(e,t))}const bS=s=>Gg(s,!Rt(s)),yS=s=>Gg(s,Rt(s)),wS=s=>re(s,t=>ao(s.state,t,!Rt(s))),SS=s=>re(s,t=>ao(s.state,t,Rt(s)));function Hg(s,t){return re(s,e=>s.moveVertically(e,t))}const Fg=s=>Hg(s,!1),Ug=s=>Hg(s,!0);function Kg(s,t){return re(s,e=>s.moveVertically(e,t,Ng(s).height))}const jf=s=>Kg(s,!1),Vf=s=>Kg(s,!0),xS=s=>re(s,t=>pi(s,t,!0)),kS=s=>re(s,t=>pi(s,t,!1)),vS=s=>re(s,t=>pi(s,t,!Rt(s))),$S=s=>re(s,t=>pi(s,t,Rt(s))),QS=s=>re(s,t=>S.cursor(s.lineBlockAt(t.head).from)),PS=s=>re(s,t=>S.cursor(s.lineBlockAt(t.head).to)),Nf=({state:s,dispatch:t})=>(t(je(s,{anchor:0})),!0),If=({state:s,dispatch:t})=>(t(je(s,{anchor:s.doc.length})),!0),qf=({state:s,dispatch:t})=>(t(je(s,{anchor:s.selection.main.anchor,head:0})),!0),zf=({state:s,dispatch:t})=>(t(je(s,{anchor:s.selection.main.anchor,head:s.doc.length})),!0),CS=({state:s,dispatch:t})=>(t(s.update({selection:{anchor:0,head:s.doc.length},userEvent:"select"})),!0),ZS=({state:s,dispatch:t})=>{let e=ho(s).map(({from:i,to:n})=>S.range(i,Math.min(n+1,s.doc.length)));return t(s.update({selection:S.create(e),userEvent:"select"})),!0},AS=({state:s,dispatch:t})=>{let e=fn(s.selection,i=>{let n=Ye(s),r=n.resolveStack(i.from,1);if(i.empty){let o=n.resolveStack(i.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<i.from&&l.to>=i.to||l.to>i.to&&l.from<=i.from)&&o.next)return S.range(l.to,l.from)}return i});return e.eq(s.selection)?!1:(t(je(s,e)),!0)},TS=({state:s,dispatch:t})=>{let e=s.selection,i=null;return e.ranges.length>1?i=S.create([e.main]):e.main.empty||(i=S.create([S.cursor(e.main.head)])),i?(t(je(s,i)),!0):!1};function os(s,t){if(s.state.readOnly)return!1;let e="delete.selection",{state:i}=s,n=i.changeByRange(r=>{let{from:o,to:l}=r;if(o==l){let a=t(r);a<o?(e="delete.backward",a=Ys(s,a,!1)):a>o&&(e="delete.forward",a=Ys(s,a,!0)),o=Math.min(o,a),l=Math.max(l,a)}else o=Ys(s,o,!1),l=Ys(s,l,!0);return o==l?{range:r}:{changes:{from:o,to:l},range:S.cursor(o,o<r.head?-1:1)}});return n.changes.empty?!1:(s.dispatch(i.update(n,{scrollIntoView:!0,userEvent:e,effects:e=="delete.selection"?L.announce.of(i.phrase("Selection deleted")):void 0})),!0)}function Ys(s,t,e){if(s instanceof L)for(let i of s.state.facet(L.atomicRanges).map(n=>n(s)))i.between(t,t,(n,r)=>{n<t&&r>t&&(t=e?r:n)});return t}const Jg=(s,t,e)=>os(s,i=>{let n=i.from,{state:r}=s,o=r.doc.lineAt(n),l,a;if(e&&!t&&n>o.from&&n<o.from+200&&!/[^ \t]/.test(l=o.text.slice(0,n-o.from))){if(l[l.length-1]==" ")return n-1;let h=Ti(l,r.tabSize),c=h%Ar(r)||Ar(r);for(let f=0;f<c&&l[l.length-1-f]==" ";f++)n--;a=n}else a=ct(o.text,n-o.from,t,t)+o.from,a==n&&o.number!=(t?r.doc.lines:1)?a+=t?1:-1:!t&&/[\ufe00-\ufe0f]/.test(o.text.slice(a-o.from,n-o.from))&&(a=ct(o.text,a-o.from,!1,!1)+o.from);return a}),Ta=s=>Jg(s,!1,!0),tm=s=>Jg(s,!0,!1),em=(s,t)=>os(s,e=>{let i=e.head,{state:n}=s,r=n.doc.lineAt(i),o=n.charCategorizer(i);for(let l=null;;){if(i==(t?r.to:r.from)){i==e.head&&r.number!=(t?n.doc.lines:1)&&(i+=t?1:-1);break}let a=ct(r.text,i-r.from,t)+r.from,h=r.text.slice(Math.min(i,a)-r.from,Math.max(i,a)-r.from),c=o(h);if(l!=null&&c!=l)break;(h!=" "||i!=e.head)&&(l=c),i=a}return i}),im=s=>em(s,!1),MS=s=>em(s,!0),RS=s=>os(s,t=>{let e=s.lineBlockAt(t.head).to;return t.head<e?e:Math.min(s.state.doc.length,t.head+1)}),DS=s=>os(s,t=>{let e=s.moveToLineBoundary(t,!1).head;return t.head>e?e:Math.max(0,t.head-1)}),WS=s=>os(s,t=>{let e=s.moveToLineBoundary(t,!0).head;return t.head<e?e:Math.min(s.state.doc.length,t.head+1)}),ES=({state:s,dispatch:t})=>{if(s.readOnly)return!1;let e=s.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:q.of(["",""])},range:S.cursor(i.from)}));return t(s.update(e,{scrollIntoView:!0,userEvent:"input"})),!0},BS=({state:s,dispatch:t})=>{if(s.readOnly)return!1;let e=s.changeByRange(i=>{if(!i.empty||i.from==0||i.from==s.doc.length)return{range:i};let n=i.from,r=s.doc.lineAt(n),o=n==r.from?n-1:ct(r.text,n-r.from,!1)+r.from,l=n==r.to?n+1:ct(r.text,n-r.from,!0)+r.from;return{changes:{from:o,to:l,insert:s.doc.slice(n,l).append(s.doc.slice(o,n))},range:S.cursor(l)}});return e.changes.empty?!1:(t(s.update(e,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function ho(s){let t=[],e=-1;for(let i of s.selection.ranges){let n=s.doc.lineAt(i.from),r=s.doc.lineAt(i.to);if(!i.empty&&i.to==r.from&&(r=s.doc.lineAt(i.to-1)),e>=n.number){let o=t[t.length-1];o.to=r.to,o.ranges.push(i)}else t.push({from:n.from,to:r.to,ranges:[i]});e=r.number+1}return t}function nm(s,t,e){if(s.readOnly)return!1;let i=[],n=[];for(let r of ho(s)){if(e?r.to==s.doc.length:r.from==0)continue;let o=s.doc.lineAt(e?r.to+1:r.from-1),l=o.length+1;if(e){i.push({from:r.to,to:o.to},{from:r.from,insert:o.text+s.lineBreak});for(let a of r.ranges)n.push(S.range(Math.min(s.doc.length,a.anchor+l),Math.min(s.doc.length,a.head+l)))}else{i.push({from:o.from,to:r.from},{from:r.to,insert:s.lineBreak+o.text});for(let a of r.ranges)n.push(S.range(a.anchor-l,a.head-l))}}return i.length?(t(s.update({changes:i,scrollIntoView:!0,selection:S.create(n,s.selection.mainIndex),userEvent:"move.line"})),!0):!1}const YS=({state:s,dispatch:t})=>nm(s,t,!1),XS=({state:s,dispatch:t})=>nm(s,t,!0);function sm(s,t,e){if(s.readOnly)return!1;let i=[];for(let n of ho(s))e?i.push({from:n.from,insert:s.doc.slice(n.from,n.to)+s.lineBreak}):i.push({from:n.to,insert:s.lineBreak+s.doc.slice(n.from,n.to)});return t(s.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const LS=({state:s,dispatch:t})=>sm(s,t,!1),jS=({state:s,dispatch:t})=>sm(s,t,!0),VS=s=>{if(s.state.readOnly)return!1;let{state:t}=s,e=t.changes(ho(t).map(({from:n,to:r})=>(n>0?n--:r<t.doc.length&&r++,{from:n,to:r}))),i=fn(t.selection,n=>{let r;if(s.lineWrapping){let o=s.lineBlockAt(n.head),l=s.coordsAtPos(n.head,n.assoc||1);l&&(r=o.bottom+s.documentTop-l.bottom+s.defaultLineHeight/2)}return s.moveVertically(n,!0,r)}).map(e);return s.dispatch({changes:e,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function NS(s,t){if(/\(\)|\[\]|\{\}/.test(s.sliceDoc(t-1,t+1)))return{from:t,to:t};let e=Ye(s).resolveInner(t),i=e.childBefore(t),n=e.childAfter(t),r;return i&&n&&i.to<=t&&n.from>=t&&(r=i.type.prop(G.closedBy))&&r.indexOf(n.name)>-1&&s.doc.lineAt(i.to).from==s.doc.lineAt(n.from).from&&!/\S/.test(s.sliceDoc(i.to,n.from))?{from:i.to,to:n.from}:null}const _f=rm(!1),IS=rm(!0);function rm(s){return({state:t,dispatch:e})=>{if(t.readOnly)return!1;let i=t.changeByRange(n=>{let{from:r,to:o}=n,l=t.doc.lineAt(r),a=!s&&r==o&&NS(t,r);s&&(r=o=(o<=l.to?l:t.doc.lineAt(o)).to);let h=new ro(t,{simulateBreak:r,simulateDoubleBreak:!!a}),c=$g(h,r);for(c==null&&(c=Ti(/^\s*/.exec(t.doc.lineAt(r).text)[0],t.tabSize));o<l.to&&/\s/.test(l.text[o-l.from]);)o++;a?{from:r,to:o}=a:r>l.from&&r<l.from+100&&!/\S/.test(l.text.slice(0,r))&&(r=l.from);let f=["",Tr(t,c)];return a&&f.push(Tr(t,h.lineIndent(l.from,-1))),{changes:{from:r,to:o,insert:q.of(f)},range:S.cursor(r+1+f[1].length)}});return e(t.update(i,{scrollIntoView:!0,userEvent:"input"})),!0}}function Sh(s,t){let e=-1;return s.changeByRange(i=>{let n=[];for(let o=i.from;o<=i.to;){let l=s.doc.lineAt(o);l.number>e&&(i.empty||i.to>l.from)&&(t(l,n,i),e=l.number),o=l.to+1}let r=s.changes(n);return{changes:n,range:S.range(r.mapPos(i.anchor,1),r.mapPos(i.head,1))}})}const qS=({state:s,dispatch:t})=>{if(s.readOnly)return!1;let e=Object.create(null),i=new ro(s,{overrideIndentation:r=>{let o=e[r];return o??-1}}),n=Sh(s,(r,o,l)=>{let a=$g(i,r.from);if(a==null)return;/\S/.test(r.text)||(a=0);let h=/^\s*/.exec(r.text)[0],c=Tr(s,a);(h!=c||l.from<r.from+h.length)&&(e[r.from]=a,o.push({from:r.from,to:r.from+h.length,insert:c}))});return n.changes.empty||t(s.update(n,{userEvent:"indent"})),!0},om=({state:s,dispatch:t})=>s.readOnly?!1:(t(s.update(Sh(s,(e,i)=>{i.push({from:e.from,insert:s.facet(Oh)})}),{userEvent:"input.indent"})),!0),lm=({state:s,dispatch:t})=>s.readOnly?!1:(t(s.update(Sh(s,(e,i)=>{let n=/^\s*/.exec(e.text)[0];if(!n)return;let r=Ti(n,s.tabSize),o=0,l=Tr(s,Math.max(0,r-Ar(s)));for(;o<n.length&&o<l.length&&n.charCodeAt(o)==l.charCodeAt(o);)o++;i.push({from:e.from+o,to:e.from+n.length,insert:l.slice(o)})}),{userEvent:"delete.dedent"})),!0),zS=s=>(s.setTabFocusMode(),!0),_S=[{key:"Ctrl-b",run:Bg,shift:zg,preventDefault:!0},{key:"Ctrl-f",run:Yg,shift:_g},{key:"Ctrl-p",run:jg,shift:Fg},{key:"Ctrl-n",run:Vg,shift:Ug},{key:"Ctrl-a",run:pS,shift:QS},{key:"Ctrl-e",run:gS,shift:PS},{key:"Ctrl-d",run:tm},{key:"Ctrl-h",run:Ta},{key:"Ctrl-k",run:RS},{key:"Ctrl-Alt-h",run:im},{key:"Ctrl-o",run:ES},{key:"Ctrl-t",run:BS},{key:"Ctrl-v",run:Aa}],GS=[{key:"ArrowLeft",run:Bg,shift:zg,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:rS,shift:bS,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:uS,shift:vS,preventDefault:!0},{key:"ArrowRight",run:Yg,shift:_g,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:oS,shift:yS,preventDefault:!0},{mac:"Cmd-ArrowRight",run:dS,shift:$S,preventDefault:!0},{key:"ArrowUp",run:jg,shift:Fg,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Nf,shift:qf},{mac:"Ctrl-ArrowUp",run:Lf,shift:jf},{key:"ArrowDown",run:Vg,shift:Ug,preventDefault:!0},{mac:"Cmd-ArrowDown",run:If,shift:zf},{mac:"Ctrl-ArrowDown",run:Aa,shift:Vf},{key:"PageUp",run:Lf,shift:jf},{key:"PageDown",run:Aa,shift:Vf},{key:"Home",run:fS,shift:kS,preventDefault:!0},{key:"Mod-Home",run:Nf,shift:qf},{key:"End",run:cS,shift:xS,preventDefault:!0},{key:"Mod-End",run:If,shift:zf},{key:"Enter",run:_f,shift:_f},{key:"Mod-a",run:CS},{key:"Backspace",run:Ta,shift:Ta},{key:"Delete",run:tm},{key:"Mod-Backspace",mac:"Alt-Backspace",run:im},{key:"Mod-Delete",mac:"Alt-Delete",run:MS},{mac:"Mod-Backspace",run:DS},{mac:"Mod-Delete",run:WS}].concat(_S.map(s=>({mac:s.key,run:s.run,shift:s.shift}))),HS=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:aS,shift:wS},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:hS,shift:SS},{key:"Alt-ArrowUp",run:YS},{key:"Shift-Alt-ArrowUp",run:LS},{key:"Alt-ArrowDown",run:XS},{key:"Shift-Alt-ArrowDown",run:jS},{key:"Escape",run:TS},{key:"Mod-Enter",run:IS},{key:"Alt-l",mac:"Ctrl-l",run:ZS},{key:"Mod-i",run:AS,preventDefault:!0},{key:"Mod-[",run:lm},{key:"Mod-]",run:om},{key:"Mod-Alt-\\",run:qS},{key:"Shift-Mod-k",run:VS},{key:"Shift-Mod-\\",run:OS},{key:"Mod-/",run:Lw},{key:"Alt-A",run:Vw},{key:"Ctrl-m",mac:"Shift-Alt-m",run:zS}].concat(GS),FS={key:"Tab",run:om,shift:lm};function et(){var s=arguments[0];typeof s=="string"&&(s=document.createElement(s));var t=1,e=arguments[1];if(e&&typeof e=="object"&&e.nodeType==null&&!Array.isArray(e)){for(var i in e)if(Object.prototype.hasOwnProperty.call(e,i)){var n=e[i];typeof n=="string"?s.setAttribute(i,n):n!=null&&(s[i]=n)}t++}for(;t<arguments.length;t++)am(s,arguments[t]);return s}function am(s,t){if(typeof t=="string")s.appendChild(document.createTextNode(t));else if(t!=null)if(t.nodeType!=null)s.appendChild(t);else if(Array.isArray(t))for(var e=0;e<t.length;e++)am(s,t[e]);else throw new RangeError("Unsupported child node: "+t)}const Gf=typeof String.prototype.normalize=="function"?s=>s.normalize("NFKD"):s=>s;class an{constructor(t,e,i=0,n=t.length,r,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=t.iterRange(i,n),this.bufferStart=i,this.normalize=r?l=>r(Gf(l)):Gf,this.query=this.normalize(e)}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 xt(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let t=this.peek();if(t<0)return this.done=!0,this;let e=qa(t),i=this.bufferStart+this.bufferPos;this.bufferPos+=Gt(t);let n=this.normalize(e);for(let r=0,o=i;;r++){let l=n.charCodeAt(r),a=this.match(l,o,this.bufferPos+this.bufferStart);if(r==n.length-1){if(a)return this.value=a,this;break}o==i&&r<e.length&&e.charCodeAt(r)==l&&o++}}}match(t,e,i){let n=null;for(let r=0;r<this.matches.length;r+=2){let o=this.matches[r],l=!1;this.query.charCodeAt(o)==t&&(o==this.query.length-1?n={from:this.matches[r+1],to:i}:(this.matches[r]++,l=!0)),l||(this.matches.splice(r,2),r-=2)}return this.query.charCodeAt(0)==t&&(this.query.length==1?n={from:e,to:i}:this.matches.push(1,e)),n&&this.test&&!this.test(n.from,n.to,this.buffer,this.bufferStart)&&(n=null),n}}typeof Symbol<"u"&&(an.prototype[Symbol.iterator]=function(){return this});const hm={from:-1,to:-1,match:/.*/.exec("")},xh="gm"+(/x/.unicode==null?"":"u");class cm{constructor(t,e,i,n=0,r=t.length){if(this.text=t,this.to=r,this.curLine="",this.done=!1,this.value=hm,/\\[sWDnr]|\n|\r|\[\^/.test(e))return new fm(t,e,i,n,r);this.re=new RegExp(e,xh+(i!=null&&i.ignoreCase?"i":"")),this.test=i==null?void 0:i.test,this.iter=t.iter();let o=t.lineAt(n);this.curLineStart=o.from,this.matchPos=Rr(t,n),this.getLine(this.curLineStart)}getLine(t){this.iter.next(t),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.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 t=this.matchPos-this.curLineStart;;){this.re.lastIndex=t;let e=this.matchPos<=this.to&&this.re.exec(this.curLine);if(e){let i=this.curLineStart+e.index,n=i+e[0].length;if(this.matchPos=Rr(this.text,n+(i==n?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(i<n||i>this.value.to)&&(!this.test||this.test(i,n,e)))return this.value={from:i,to:n,match:e},this;t=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),t=0;else return this.done=!0,this}}}const No=new WeakMap;class zi{constructor(t,e){this.from=t,this.text=e}get to(){return this.from+this.text.length}static get(t,e,i){let n=No.get(t);if(!n||n.from>=i||n.to<=e){let l=new zi(e,t.sliceString(e,i));return No.set(t,l),l}if(n.from==e&&n.to==i)return n;let{text:r,from:o}=n;return o>e&&(r=t.sliceString(e,o)+r,o=e),n.to<i&&(r+=t.sliceString(n.to,i)),No.set(t,new zi(o,r)),new zi(e,r.slice(e-o,i-o))}}class fm{constructor(t,e,i,n,r){this.text=t,this.to=r,this.done=!1,this.value=hm,this.matchPos=Rr(t,n),this.re=new RegExp(e,xh+(i!=null&&i.ignoreCase?"i":"")),this.test=i==null?void 0:i.test,this.flat=zi.get(t,n,this.chunkEnd(n+5e3))}chunkEnd(t){return t>=this.to?this.to:this.text.lineAt(t).to}next(){for(;;){let t=this.re.lastIndex=this.matchPos-this.flat.from,e=this.re.exec(this.flat.text);if(e&&!e[0]&&e.index==t&&(this.re.lastIndex=t+1,e=this.re.exec(this.flat.text)),e){let i=this.flat.from+e.index,n=i+e[0].length;if((this.flat.to>=this.to||e.index+e[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,n,e)))return this.value={from:i,to:n,match:e},this.matchPos=Rr(this.text,n+(i==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=zi.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(cm.prototype[Symbol.iterator]=fm.prototype[Symbol.iterator]=function(){return this});function US(s){try{return new RegExp(s,xh),!0}catch{return!1}}function Rr(s,t){if(t>=s.length)return t;let e=s.lineAt(t),i;for(;t<e.to&&(i=e.text.charCodeAt(t-e.from))>=56320&&i<57344;)t++;return t}function Ma(s){let t=String(s.state.doc.lineAt(s.state.selection.main.head).number),e=et("input",{class:"cm-textfield",name:"line",value:t}),i=et("form",{class:"cm-gotoLine",onkeydown:r=>{r.keyCode==27?(r.preventDefault(),s.dispatch({effects:Dr.of(!1)}),s.focus()):r.keyCode==13&&(r.preventDefault(),n())},onsubmit:r=>{r.preventDefault(),n()}},et("label",s.state.phrase("Go to line"),": ",e)," ",et("button",{class:"cm-button",type:"submit"},s.state.phrase("go")));function n(){let r=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(e.value);if(!r)return;let{state:o}=s,l=o.doc.lineAt(o.selection.main.head),[,a,h,c,f]=r,u=c?+c.slice(1):0,d=h?+h:l.number;if(h&&f){let m=d/100;a&&(m=m*(a=="-"?-1:1)+l.number/o.doc.lines),d=Math.round(o.doc.lines*m)}else h&&a&&(d=d*(a=="-"?-1:1)+l.number);let p=o.doc.line(Math.max(1,Math.min(o.doc.lines,d))),g=S.cursor(p.from+Math.max(0,Math.min(u,p.length)));s.dispatch({effects:[Dr.of(!1),L.scrollIntoView(g.from,{y:"center"})],selection:g}),s.focus()}return{dom:i}}const Dr=j.define(),Hf=wt.define({create(){return!0},update(s,t){for(let e of t.effects)e.is(Dr)&&(s=e.value);return s},provide:s=>Pr.from(s,t=>t?Ma:null)}),KS=s=>{let t=Qr(s,Ma);if(!t){let e=[Dr.of(!0)];s.state.field(Hf,!1)==null&&e.push(j.appendConfig.of([Hf,JS])),s.dispatch({effects:e}),t=Qr(s,Ma)}return t&&t.dom.querySelector("input").select(),!0},JS=L.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),tx={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},um=P.define({combine(s){return Xe(s,tx,{highlightWordAroundCursor:(t,e)=>t||e,minSelectionLength:Math.min,maxMatches:Math.min})}});function ex(s){let t=[ox,rx];return s&&t.push(um.of(s)),t}const ix=F.mark({class:"cm-selectionMatch"}),nx=F.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Ff(s,t,e,i){return(e==0||s(t.sliceDoc(e-1,e))!=rt.Word)&&(i==t.doc.length||s(t.sliceDoc(i,i+1))!=rt.Word)}function sx(s,t,e,i){return s(t.sliceDoc(e,e+1))==rt.Word&&s(t.sliceDoc(i-1,i))==rt.Word}const rx=Ee.fromClass(class{constructor(s){this.decorations=this.getDeco(s)}update(s){(s.selectionSet||s.docChanged||s.viewportChanged)&&(this.decorations=this.getDeco(s.view))}getDeco(s){let t=s.state.facet(um),{state:e}=s,i=e.selection;if(i.ranges.length>1)return F.none;let n=i.main,r,o=null;if(n.empty){if(!t.highlightWordAroundCursor)return F.none;let a=e.wordAt(n.head);if(!a)return F.none;o=e.charCategorizer(n.head),r=e.sliceDoc(a.from,a.to)}else{let a=n.to-n.from;if(a<t.minSelectionLength||a>200)return F.none;if(t.wholeWords){if(r=e.sliceDoc(n.from,n.to),o=e.charCategorizer(n.head),!(Ff(o,e,n.from,n.to)&&sx(o,e,n.from,n.to)))return F.none}else if(r=e.sliceDoc(n.from,n.to),!r)return F.none}let l=[];for(let a of s.visibleRanges){let h=new an(e.doc,r,a.from,a.to);for(;!h.next().done;){let{from:c,to:f}=h.value;if((!o||Ff(o,e,c,f))&&(n.empty&&c<=n.from&&f>=n.to?l.push(nx.range(c,f)):(c>=n.to||f<=n.from)&&l.push(ix.range(c,f)),l.length>t.maxMatches))return F.none}}return F.set(l)}},{decorations:s=>s.decorations}),ox=L.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),lx=({state:s,dispatch:t})=>{let{selection:e}=s,i=S.create(e.ranges.map(n=>s.wordAt(n.head)||S.cursor(n.head)),e.mainIndex);return i.eq(e)?!1:(t(s.update({selection:i})),!0)};function ax(s,t){let{main:e,ranges:i}=s.selection,n=s.wordAt(e.head),r=n&&n.from==e.from&&n.to==e.to;for(let o=!1,l=new an(s.doc,t,i[i.length-1].to);;)if(l.next(),l.done){if(o)return null;l=new an(s.doc,t,0,Math.max(0,i[i.length-1].from-1)),o=!0}else{if(o&&i.some(a=>a.from==l.value.from))continue;if(r){let a=s.wordAt(l.value.from);if(!a||a.from!=l.value.from||a.to!=l.value.to)continue}return l.value}}const hx=({state:s,dispatch:t})=>{let{ranges:e}=s.selection;if(e.some(r=>r.from===r.to))return lx({state:s,dispatch:t});let i=s.sliceDoc(e[0].from,e[0].to);if(s.selection.ranges.some(r=>s.sliceDoc(r.from,r.to)!=i))return!1;let n=ax(s,i);return n?(t(s.update({selection:s.selection.addRange(S.range(n.from,n.to),!1),effects:L.scrollIntoView(n.to)})),!0):!1},un=P.define({combine(s){return Xe(s,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:t=>new Sx(t),scrollToMatch:t=>L.scrollIntoView(t)})}});class dm{constructor(t){this.search=t.search,this.caseSensitive=!!t.caseSensitive,this.literal=!!t.literal,this.regexp=!!t.regexp,this.replace=t.replace||"",this.valid=!!this.search&&(!this.regexp||US(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!t.wholeWord}unquote(t){return this.literal?t:t.replace(/\\([nrt\\])/g,(e,i)=>i=="n"?`
14
+ `:i=="r"?"\r":i=="t"?" ":"\\")}eq(t){return this.search==t.search&&this.replace==t.replace&&this.caseSensitive==t.caseSensitive&&this.regexp==t.regexp&&this.wholeWord==t.wholeWord}create(){return this.regexp?new dx(this):new fx(this)}getCursor(t,e=0,i){let n=t.doc?t:V.create({doc:t});return i==null&&(i=n.doc.length),this.regexp?Wi(this,n,e,i):Di(this,n,e,i)}}class pm{constructor(t){this.spec=t}}function Di(s,t,e,i){return new an(t.doc,s.unquoted,e,i,s.caseSensitive?void 0:n=>n.toLowerCase(),s.wholeWord?cx(t.doc,t.charCategorizer(t.selection.main.head)):void 0)}function cx(s,t){return(e,i,n,r)=>((r>e||r+n.length<i)&&(r=Math.max(0,e-2),n=s.sliceString(r,Math.min(s.length,i+2))),(t(Wr(n,e-r))!=rt.Word||t(Er(n,e-r))!=rt.Word)&&(t(Er(n,i-r))!=rt.Word||t(Wr(n,i-r))!=rt.Word))}class fx extends pm{constructor(t){super(t)}nextMatch(t,e,i){let n=Di(this.spec,t,i,t.doc.length).nextOverlapping();return n.done&&(n=Di(this.spec,t,0,e).nextOverlapping()),n.done?null:n.value}prevMatchInRange(t,e,i){for(let n=i;;){let r=Math.max(e,n-1e4-this.spec.unquoted.length),o=Di(this.spec,t,r,n),l=null;for(;!o.nextOverlapping().done;)l=o.value;if(l)return l;if(r==e)return null;n-=1e4}}prevMatch(t,e,i){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace)}matchAll(t,e){let i=Di(this.spec,t,0,t.doc.length),n=[];for(;!i.next().done;){if(n.length>=e)return null;n.push(i.value)}return n}highlight(t,e,i,n){let r=Di(this.spec,t,Math.max(0,e-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,t.doc.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}function Wi(s,t,e,i){return new cm(t.doc,s.search,{ignoreCase:!s.caseSensitive,test:s.wholeWord?ux(t.charCategorizer(t.selection.main.head)):void 0},e,i)}function Wr(s,t){return s.slice(ct(s,t,!1),t)}function Er(s,t){return s.slice(t,ct(s,t))}function ux(s){return(t,e,i)=>!i[0].length||(s(Wr(i.input,i.index))!=rt.Word||s(Er(i.input,i.index))!=rt.Word)&&(s(Er(i.input,i.index+i[0].length))!=rt.Word||s(Wr(i.input,i.index+i[0].length))!=rt.Word)}class dx extends pm{nextMatch(t,e,i){let n=Wi(this.spec,t,i,t.doc.length).next();return n.done&&(n=Wi(this.spec,t,0,e).next()),n.done?null:n.value}prevMatchInRange(t,e,i){for(let n=1;;n++){let r=Math.max(e,i-n*1e4),o=Wi(this.spec,t,r,i),l=null;for(;!o.next().done;)l=o.value;if(l&&(r==e||l.from>r+10))return l;if(r==e)return null}}prevMatch(t,e,i){return this.prevMatchInRange(t,0,e)||this.prevMatchInRange(t,i,t.doc.length)}getReplacement(t){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,(e,i)=>i=="$"?"$":i=="&"?t.match[0]:i!="0"&&+i<t.match.length?t.match[i]:e)}matchAll(t,e){let i=Wi(this.spec,t,0,t.doc.length),n=[];for(;!i.next().done;){if(n.length>=e)return null;n.push(i.value)}return n}highlight(t,e,i,n){let r=Wi(this.spec,t,Math.max(0,e-250),Math.min(i+250,t.doc.length));for(;!r.next().done;)n(r.value.from,r.value.to)}}const Un=j.define(),kh=j.define(),ai=wt.define({create(s){return new Io(Ra(s).create(),null)},update(s,t){for(let e of t.effects)e.is(Un)?s=new Io(e.value.create(),s.panel):e.is(kh)&&(s=new Io(s.query,e.value?vh:null));return s},provide:s=>Pr.from(s,t=>t.panel)});class Io{constructor(t,e){this.query=t,this.panel=e}}const px=F.mark({class:"cm-searchMatch"}),gx=F.mark({class:"cm-searchMatch cm-searchMatch-selected"}),mx=Ee.fromClass(class{constructor(s){this.view=s,this.decorations=this.highlight(s.state.field(ai))}update(s){let t=s.state.field(ai);(t!=s.startState.field(ai)||s.docChanged||s.selectionSet||s.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:s,panel:t}){if(!t||!s.spec.valid)return F.none;let{view:e}=this,i=new qe;for(let n=0,r=e.visibleRanges,o=r.length;n<o;n++){let{from:l,to:a}=r[n];for(;n<o-1&&a>r[n+1].from-2*250;)a=r[++n].to;s.highlight(e.state,l,a,(h,c)=>{let f=e.state.selection.ranges.some(u=>u.from==h&&u.to==c);i.add(h,c,f?gx:px)})}return i.finish()}},{decorations:s=>s.decorations});function ls(s){return t=>{let e=t.state.field(ai,!1);return e&&e.query.spec.valid?s(t,e):Om(t)}}const Br=ls((s,{query:t})=>{let{to:e}=s.state.selection.main,i=t.nextMatch(s.state,e,e);if(!i)return!1;let n=S.single(i.from,i.to),r=s.state.facet(un);return s.dispatch({selection:n,effects:[$h(s,i),r.scrollToMatch(n.main,s)],userEvent:"select.search"}),mm(s),!0}),Yr=ls((s,{query:t})=>{let{state:e}=s,{from:i}=e.selection.main,n=t.prevMatch(e,i,i);if(!n)return!1;let r=S.single(n.from,n.to),o=s.state.facet(un);return s.dispatch({selection:r,effects:[$h(s,n),o.scrollToMatch(r.main,s)],userEvent:"select.search"}),mm(s),!0}),Ox=ls((s,{query:t})=>{let e=t.matchAll(s.state,1e3);return!e||!e.length?!1:(s.dispatch({selection:S.create(e.map(i=>S.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),bx=({state:s,dispatch:t})=>{let e=s.selection;if(e.ranges.length>1||e.main.empty)return!1;let{from:i,to:n}=e.main,r=[],o=0;for(let l=new an(s.doc,s.sliceDoc(i,n));!l.next().done;){if(r.length>1e3)return!1;l.value.from==i&&(o=r.length),r.push(S.range(l.value.from,l.value.to))}return t(s.update({selection:S.create(r,o),userEvent:"select.search.matches"})),!0},Uf=ls((s,{query:t})=>{let{state:e}=s,{from:i,to:n}=e.selection.main;if(e.readOnly)return!1;let r=t.nextMatch(e,i,i);if(!r)return!1;let o=[],l,a,h=[];if(r.from==i&&r.to==n&&(a=e.toText(t.getReplacement(r)),o.push({from:r.from,to:r.to,insert:a}),r=t.nextMatch(e,r.from,r.to),h.push(L.announce.of(e.phrase("replaced match on line $",e.doc.lineAt(i).number)+"."))),r){let c=o.length==0||o[0].from>=r.to?0:r.to-r.from-a.length;l=S.single(r.from-c,r.to-c),h.push($h(s,r)),h.push(e.facet(un).scrollToMatch(l.main,s))}return s.dispatch({changes:o,selection:l,effects:h,userEvent:"input.replace"}),!0}),yx=ls((s,{query:t})=>{if(s.state.readOnly)return!1;let e=t.matchAll(s.state,1e9).map(n=>{let{from:r,to:o}=n;return{from:r,to:o,insert:t.getReplacement(n)}});if(!e.length)return!1;let i=s.state.phrase("replaced $ matches",e.length)+".";return s.dispatch({changes:e,effects:L.announce.of(i),userEvent:"input.replace.all"}),!0});function vh(s){return s.state.facet(un).createPanel(s)}function Ra(s,t){var e,i,n,r,o;let l=s.selection.main,a=l.empty||l.to>l.from+100?"":s.sliceDoc(l.from,l.to);if(t&&!a)return t;let h=s.facet(un);return new dm({search:((e=t==null?void 0:t.literal)!==null&&e!==void 0?e:h.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=t==null?void 0:t.caseSensitive)!==null&&i!==void 0?i:h.caseSensitive,literal:(n=t==null?void 0:t.literal)!==null&&n!==void 0?n:h.literal,regexp:(r=t==null?void 0:t.regexp)!==null&&r!==void 0?r:h.regexp,wholeWord:(o=t==null?void 0:t.wholeWord)!==null&&o!==void 0?o:h.wholeWord})}function gm(s){let t=Qr(s,vh);return t&&t.dom.querySelector("[main-field]")}function mm(s){let t=gm(s);t&&t==s.root.activeElement&&t.select()}const Om=s=>{let t=s.state.field(ai,!1);if(t&&t.panel){let e=gm(s);if(e&&e!=s.root.activeElement){let i=Ra(s.state,t.query.spec);i.valid&&s.dispatch({effects:Un.of(i)}),e.focus(),e.select()}}else s.dispatch({effects:[kh.of(!0),t?Un.of(Ra(s.state,t.query.spec)):j.appendConfig.of(kx)]});return!0},bm=s=>{let t=s.state.field(ai,!1);if(!t||!t.panel)return!1;let e=Qr(s,vh);return e&&e.dom.contains(s.root.activeElement)&&s.focus(),s.dispatch({effects:kh.of(!1)}),!0},wx=[{key:"Mod-f",run:Om,scope:"editor search-panel"},{key:"F3",run:Br,shift:Yr,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Br,shift:Yr,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:bm,scope:"editor search-panel"},{key:"Mod-Shift-l",run:bx},{key:"Mod-Alt-g",run:KS},{key:"Mod-d",run:hx,preventDefault:!0}];class Sx{constructor(t){this.view=t;let e=this.query=t.state.field(ai).query.spec;this.commit=this.commit.bind(this),this.searchField=et("input",{value:e.search,placeholder:qt(t,"Find"),"aria-label":qt(t,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=et("input",{value:e.replace,placeholder:qt(t,"Replace"),"aria-label":qt(t,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=et("input",{type:"checkbox",name:"case",form:"",checked:e.caseSensitive,onchange:this.commit}),this.reField=et("input",{type:"checkbox",name:"re",form:"",checked:e.regexp,onchange:this.commit}),this.wordField=et("input",{type:"checkbox",name:"word",form:"",checked:e.wholeWord,onchange:this.commit});function i(n,r,o){return et("button",{class:"cm-button",name:n,onclick:r,type:"button"},o)}this.dom=et("div",{onkeydown:n=>this.keydown(n),class:"cm-search"},[this.searchField,i("next",()=>Br(t),[qt(t,"next")]),i("prev",()=>Yr(t),[qt(t,"previous")]),i("select",()=>Ox(t),[qt(t,"all")]),et("label",null,[this.caseField,qt(t,"match case")]),et("label",null,[this.reField,qt(t,"regexp")]),et("label",null,[this.wordField,qt(t,"by word")]),...t.state.readOnly?[]:[et("br"),this.replaceField,i("replace",()=>Uf(t),[qt(t,"replace")]),i("replaceAll",()=>yx(t),[qt(t,"replace all")])],et("button",{name:"close",onclick:()=>bm(t),"aria-label":qt(t,"close"),type:"button"},["×"])])}commit(){let t=new dm({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});t.eq(this.query)||(this.query=t,this.view.dispatch({effects:Un.of(t)}))}keydown(t){zy(this.view,t,"search-panel")?t.preventDefault():t.keyCode==13&&t.target==this.searchField?(t.preventDefault(),(t.shiftKey?Yr:Br)(this.view)):t.keyCode==13&&t.target==this.replaceField&&(t.preventDefault(),Uf(this.view))}update(t){for(let e of t.transactions)for(let i of e.effects)i.is(Un)&&!i.value.eq(this.query)&&this.setQuery(i.value)}setQuery(t){this.query=t,this.searchField.value=t.search,this.replaceField.value=t.replace,this.caseField.checked=t.caseSensitive,this.reField.checked=t.regexp,this.wordField.checked=t.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(un).top}}function qt(s,t){return s.state.phrase(t)}const Xs=30,Ls=/[\s\.,:;?!]/;function $h(s,{from:t,to:e}){let i=s.state.doc.lineAt(t),n=s.state.doc.lineAt(e).to,r=Math.max(i.from,t-Xs),o=Math.min(n,e+Xs),l=s.state.sliceDoc(r,o);if(r!=i.from){for(let a=0;a<Xs;a++)if(!Ls.test(l[a+1])&&Ls.test(l[a])){l=l.slice(a);break}}if(o!=n){for(let a=l.length-1;a>l.length-Xs;a--)if(!Ls.test(l[a-1])&&Ls.test(l[a])){l=l.slice(0,a);break}}return L.announce.of(`${s.state.phrase("current match")}. ${l} ${s.state.phrase("on line")} ${i.number}.`)}const xx=L.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"}}),kx=[ai,pe.low(mx),xx],ym=1024;let vx=0;class qo{constructor(t,e){this.from=t,this.to=e}}class _{constructor(t={}){this.id=vx++,this.perNode=!!t.perNode,this.deserialize=t.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(t){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof t!="function"&&(t=It.match(t)),e=>{let i=t(e);return i===void 0?null:[this,i]}}}_.closedBy=new _({deserialize:s=>s.split(" ")});_.openedBy=new _({deserialize:s=>s.split(" ")});_.group=new _({deserialize:s=>s.split(" ")});_.isolate=new _({deserialize:s=>{if(s&&s!="rtl"&&s!="ltr"&&s!="auto")throw new RangeError("Invalid value for isolate: "+s);return s||"auto"}});_.contextHash=new _({perNode:!0});_.lookAhead=new _({perNode:!0});_.mounted=new _({perNode:!0});class Xr{constructor(t,e,i){this.tree=t,this.overlay=e,this.parser=i}static get(t){return t&&t.props&&t.props[_.mounted.id]}}const $x=Object.create(null);class It{constructor(t,e,i,n=0){this.name=t,this.props=e,this.id=i,this.flags=n}static define(t){let e=t.props&&t.props.length?Object.create(null):$x,i=(t.top?1:0)|(t.skipped?2:0)|(t.error?4:0)|(t.name==null?8:0),n=new It(t.name||"",e,t.id,i);if(t.props){for(let r of t.props)if(Array.isArray(r)||(r=r(n)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");e[r[0].id]=r[1]}}return n}prop(t){return this.props[t.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(t){if(typeof t=="string"){if(this.name==t)return!0;let e=this.prop(_.group);return e?e.indexOf(t)>-1:!1}return this.id==t}static match(t){let e=Object.create(null);for(let i in t)for(let n of i.split(" "))e[n]=t[i];return i=>{for(let n=i.prop(_.group),r=-1;r<(n?n.length:0);r++){let o=e[r<0?i.name:n[r]];if(o)return o}}}}It.none=new It("",Object.create(null),0,8);class Qh{constructor(t){this.types=t;for(let e=0;e<t.length;e++)if(t[e].id!=e)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...t){let e=[];for(let i of this.types){let n=null;for(let r of t){let o=r(i);o&&(n||(n=Object.assign({},i.props)),n[o[0].id]=o[1])}e.push(n?new It(i.name,n,i.id,i.flags):i)}return new Qh(e)}}const js=new WeakMap,Kf=new WeakMap;var yt;(function(s){s[s.ExcludeBuffers=1]="ExcludeBuffers",s[s.IncludeAnonymous=2]="IncludeAnonymous",s[s.IgnoreMounts=4]="IgnoreMounts",s[s.IgnoreOverlays=8]="IgnoreOverlays"})(yt||(yt={}));class bt{constructor(t,e,i,n,r){if(this.type=t,this.children=e,this.positions=i,this.length=n,this.props=null,r&&r.length){this.props=Object.create(null);for(let[o,l]of r)this.props[typeof o=="number"?o:o.id]=l}}toString(){let t=Xr.get(this);if(t&&!t.overlay)return t.tree.toString();let e="";for(let i of this.children){let n=i.toString();n&&(e&&(e+=","),e+=n)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(e.length?"("+e+")":""):e}cursor(t=0){return new Wa(this.topNode,t)}cursorAt(t,e=0,i=0){let n=js.get(this)||this.topNode,r=new Wa(n);return r.moveTo(t,e),js.set(this,r._tree),r}get topNode(){return new Nt(this,0,0,null)}resolve(t,e=0){let i=Kn(js.get(this)||this.topNode,t,e,!1);return js.set(this,i),i}resolveInner(t,e=0){let i=Kn(Kf.get(this)||this.topNode,t,e,!0);return Kf.set(this,i),i}resolveStack(t,e=0){return Cx(this,t,e)}iterate(t){let{enter:e,leave:i,from:n=0,to:r=this.length}=t,o=t.mode||0,l=(o&yt.IncludeAnonymous)>0;for(let a=this.cursor(o|yt.IncludeAnonymous);;){let h=!1;if(a.from<=r&&a.to>=n&&(!l&&a.type.isAnonymous||e(a)!==!1)){if(a.firstChild())continue;h=!0}for(;h&&i&&(l||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.parent())return;h=!0}}}prop(t){return t.perNode?this.props?this.props[t.id]:void 0:this.type.prop(t)}get propValues(){let t=[];if(this.props)for(let e in this.props)t.push([+e,this.props[e]]);return t}balance(t={}){return this.children.length<=8?this:Zh(It.none,this.children,this.positions,0,this.children.length,0,this.length,(e,i,n)=>new bt(this.type,e,i,n,this.propValues),t.makeTree||((e,i,n)=>new bt(It.none,e,i,n)))}static build(t){return Zx(t)}}bt.empty=new bt(It.none,[],[],0);class Ph{constructor(t,e){this.buffer=t,this.index=e}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Ph(this.buffer,this.index)}}class ui{constructor(t,e,i){this.buffer=t,this.length=e,this.set=i}get type(){return It.none}toString(){let t=[];for(let e=0;e<this.buffer.length;)t.push(this.childString(e)),e=this.buffer[e+3];return t.join(",")}childString(t){let e=this.buffer[t],i=this.buffer[t+3],n=this.set.types[e],r=n.name;if(/\W/.test(r)&&!n.isError&&(r=JSON.stringify(r)),t+=4,i==t)return r;let o=[];for(;t<i;)o.push(this.childString(t)),t=this.buffer[t+3];return r+"("+o.join(",")+")"}findChild(t,e,i,n,r){let{buffer:o}=this,l=-1;for(let a=t;a!=e&&!(wm(r,n,o[a+1],o[a+2])&&(l=a,i>0));a=o[a+3]);return l}slice(t,e,i){let n=this.buffer,r=new Uint16Array(e-t),o=0;for(let l=t,a=0;l<e;){r[a++]=n[l++],r[a++]=n[l++]-i;let h=r[a++]=n[l++]-i;r[a++]=n[l++]-t,o=Math.max(o,h)}return new ui(r,o,this.set)}}function wm(s,t,e,i){switch(s){case-2:return e<t;case-1:return i>=t&&e<t;case 0:return e<t&&i>t;case 1:return e<=t&&i>t;case 2:return i>t;case 4:return!0}}function Kn(s,t,e,i){for(var n;s.from==s.to||(e<1?s.from>=t:s.from>t)||(e>-1?s.to<=t:s.to<t);){let o=!i&&s instanceof Nt&&s.index<0?null:s.parent;if(!o)return s;s=o}let r=i?0:yt.IgnoreOverlays;if(i)for(let o=s,l=o.parent;l;o=l,l=o.parent)o instanceof Nt&&o.index<0&&((n=l.enter(t,e,r))===null||n===void 0?void 0:n.from)!=o.from&&(s=l);for(;;){let o=s.enter(t,e,r);if(!o)return s;s=o}}class Sm{cursor(t=0){return new Wa(this,t)}getChild(t,e=null,i=null){let n=Jf(this,t,e,i);return n.length?n[0]:null}getChildren(t,e=null,i=null){return Jf(this,t,e,i)}resolve(t,e=0){return Kn(this,t,e,!1)}resolveInner(t,e=0){return Kn(this,t,e,!0)}matchContext(t){return Da(this,t)}enterUnfinishedNodesBefore(t){let e=this.childBefore(t),i=this;for(;e;){let n=e.lastChild;if(!n||n.to!=e.to)break;n.type.isError&&n.from==n.to?(i=e,e=n.prevSibling):e=n}return i}get node(){return this}get next(){return this.parent}}class Nt extends Sm{constructor(t,e,i,n){super(),this._tree=t,this.from=e,this.index=i,this._parent=n}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(t,e,i,n,r=0){for(let o=this;;){for(let{children:l,positions:a}=o._tree,h=e>0?l.length:-1;t!=h;t+=e){let c=l[t],f=a[t]+o.from;if(wm(n,i,f,f+c.length)){if(c instanceof ui){if(r&yt.ExcludeBuffers)continue;let u=c.findChild(0,c.buffer.length,e,i-f,n);if(u>-1)return new Te(new Qx(o,c,t,f),null,u)}else if(r&yt.IncludeAnonymous||!c.type.isAnonymous||Ch(c)){let u;if(!(r&yt.IgnoreMounts)&&(u=Xr.get(c))&&!u.overlay)return new Nt(u.tree,f,t,o);let d=new Nt(c,f,t,o);return r&yt.IncludeAnonymous||!d.type.isAnonymous?d:d.nextChild(e<0?c.children.length-1:0,e,i,n)}}}if(r&yt.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?t=o.index+e:t=e<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(t){return this.nextChild(0,1,t,2)}childBefore(t){return this.nextChild(this._tree.children.length-1,-1,t,-2)}enter(t,e,i=0){let n;if(!(i&yt.IgnoreOverlays)&&(n=Xr.get(this._tree))&&n.overlay){let r=t-this.from;for(let{from:o,to:l}of n.overlay)if((e>0?o<=r:o<r)&&(e<0?l>=r:l>r))return new Nt(n.tree,n.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,t,e,i)}nextSignificantParent(){let t=this;for(;t.type.isAnonymous&&t._parent;)t=t._parent;return t}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 Jf(s,t,e,i){let n=s.cursor(),r=[];if(!n.firstChild())return r;if(e!=null){for(let o=!1;!o;)if(o=n.type.is(e),!n.nextSibling())return r}for(;;){if(i!=null&&n.type.is(i))return r;if(n.type.is(t)&&r.push(n.node),!n.nextSibling())return i==null?r:[]}}function Da(s,t,e=t.length-1){for(let i=s.parent;e>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(t[e]&&t[e]!=i.name)return!1;e--}}return!0}class Qx{constructor(t,e,i,n){this.parent=t,this.buffer=e,this.index=i,this.start=n}}class Te extends Sm{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(t,e,i){super(),this.context=t,this._parent=e,this.index=i,this.type=t.buffer.set.types[t.buffer.buffer[i]]}child(t,e,i){let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.context.start,i);return r<0?null:new Te(this.context,this,r)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(t){return this.child(1,t,2)}childBefore(t){return this.child(-1,t,-2)}enter(t,e,i=0){if(i&yt.ExcludeBuffers)return null;let{buffer:n}=this.context,r=n.findChild(this.index+4,n.buffer[this.index+3],e>0?1:-1,t-this.context.start,e);return r<0?null:new Te(this.context,this,r)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(t){return this._parent?null:this.context.parent.nextChild(this.context.index+t,t,0,4)}get nextSibling(){let{buffer:t}=this.context,e=t.buffer[this.index+3];return e<(this._parent?t.buffer[this._parent.index+3]:t.buffer.length)?new Te(this.context,this._parent,e):this.externalSibling(1)}get prevSibling(){let{buffer:t}=this.context,e=this._parent?this._parent.index+4:0;return this.index==e?this.externalSibling(-1):new Te(this.context,this._parent,t.findChild(e,this.index,-1,0,4))}get tree(){return null}toTree(){let t=[],e=[],{buffer:i}=this.context,n=this.index+4,r=i.buffer[this.index+3];if(r>n){let o=i.buffer[this.index+1];t.push(i.slice(n,r,o)),e.push(0)}return new bt(this.type,t,e,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function xm(s){if(!s.length)return null;let t=0,e=s[0];for(let r=1;r<s.length;r++){let o=s[r];(o.from>e.from||o.to<e.to)&&(e=o,t=r)}let i=e instanceof Nt&&e.index<0?null:e.parent,n=s.slice();return i?n[t]=i:n.splice(t,1),new Px(n,e)}class Px{constructor(t,e){this.heads=t,this.node=e}get next(){return xm(this.heads)}}function Cx(s,t,e){let i=s.resolveInner(t,e),n=null;for(let r=i instanceof Nt?i:i.context.parent;r;r=r.parent)if(r.index<0){let o=r.parent;(n||(n=[i])).push(o.resolve(t,e)),r=o}else{let o=Xr.get(r.tree);if(o&&o.overlay&&o.overlay[0].from<=t&&o.overlay[o.overlay.length-1].to>=t){let l=new Nt(o.tree,o.overlay[0].from+r.from,-1,r);(n||(n=[i])).push(Kn(l,t,e,!1))}}return n?xm(n):i}class Wa{get name(){return this.type.name}constructor(t,e=0){if(this.mode=e,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,t instanceof Nt)this.yieldNode(t);else{this._tree=t.context.parent,this.buffer=t.context;for(let i=t._parent;i;i=i._parent)this.stack.unshift(i.index);this.bufferNode=t,this.yieldBuf(t.index)}}yieldNode(t){return t?(this._tree=t,this.type=t.type,this.from=t.from,this.to=t.to,!0):!1}yieldBuf(t,e){this.index=t;let{start:i,buffer:n}=this.buffer;return this.type=e||n.set.types[n.buffer[t]],this.from=i+n.buffer[t+1],this.to=i+n.buffer[t+2],!0}yield(t){return t?t instanceof Nt?(this.buffer=null,this.yieldNode(t)):(this.buffer=t.context,this.yieldBuf(t.index,t.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(t,e,i){if(!this.buffer)return this.yield(this._tree.nextChild(t<0?this._tree._tree.children.length-1:0,t,e,i,this.mode));let{buffer:n}=this.buffer,r=n.findChild(this.index+4,n.buffer[this.index+3],t,e-this.buffer.start,i);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(t){return this.enterChild(1,t,2)}childBefore(t){return this.enterChild(-1,t,-2)}enter(t,e,i=this.mode){return this.buffer?i&yt.ExcludeBuffers?!1:this.enterChild(1,t,e):this.yield(this._tree.enter(t,e,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&yt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let t=this.mode&yt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(t)}sibling(t){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+t,t,0,4,this.mode)):!1;let{buffer:e}=this.buffer,i=this.stack.length-1;if(t<0){let n=i<0?0:this.stack[i]+4;if(this.index!=n)return this.yieldBuf(e.findChild(n,this.index,-1,0,4))}else{let n=e.buffer[this.index+3];if(n<(i<0?e.buffer.length:e.buffer[this.stack[i]+3]))return this.yieldBuf(n)}return i<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+t,t,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(t){let e,i,{buffer:n}=this;if(n){if(t>0){if(this.index<n.buffer.buffer.length)return!1}else for(let r=0;r<this.index;r++)if(n.buffer.buffer[r+3]<this.index)return!1;({index:e,parent:i}=n)}else({index:e,_parent:i}=this._tree);for(;i;{index:e,_parent:i}=i)if(e>-1)for(let r=e+t,o=t<0?-1:i._tree.children.length;r!=o;r+=t){let l=i._tree.children[r];if(this.mode&yt.IncludeAnonymous||l instanceof ui||!l.type.isAnonymous||Ch(l))return!1}return!0}move(t,e){if(e&&this.enterChild(t,0,4))return!0;for(;;){if(this.sibling(t))return!0;if(this.atLastNode(t)||!this.parent())return!1}}next(t=!0){return this.move(1,t)}prev(t=!0){return this.move(-1,t)}moveTo(t,e=0){for(;(this.from==this.to||(e<1?this.from>=t:this.from>t)||(e>-1?this.to<=t:this.to<t))&&this.parent(););for(;this.enterChild(1,t,e););return this}get node(){if(!this.buffer)return this._tree;let t=this.bufferNode,e=null,i=0;if(t&&t.context==this.buffer)t:for(let n=this.index,r=this.stack.length;r>=0;){for(let o=t;o;o=o._parent)if(o.index==n){if(n==this.index)return o;e=o,i=r+1;break t}n=this.stack[--r]}for(let n=i;n<this.stack.length;n++)e=new Te(this.buffer,e,this.stack[n]);return this.bufferNode=new Te(this.buffer,e,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(t,e){for(let i=0;;){let n=!1;if(this.type.isAnonymous||t(this)!==!1){if(this.firstChild()){i++;continue}this.type.isAnonymous||(n=!0)}for(;n&&e&&e(this),n=this.type.isAnonymous,!this.nextSibling();){if(!i)return;this.parent(),i--,n=!0}}}matchContext(t){if(!this.buffer)return Da(this.node,t);let{buffer:e}=this.buffer,{types:i}=e.set;for(let n=t.length-1,r=this.stack.length-1;n>=0;r--){if(r<0)return Da(this.node,t,n);let o=i[e.buffer[this.stack[r]]];if(!o.isAnonymous){if(t[n]&&t[n]!=o.name)return!1;n--}}return!0}}function Ch(s){return s.children.some(t=>t instanceof ui||!t.type.isAnonymous||Ch(t))}function Zx(s){var t;let{buffer:e,nodeSet:i,maxBufferLength:n=ym,reused:r=[],minRepeatType:o=i.types.length}=s,l=Array.isArray(e)?new Ph(e,e.length):e,a=i.types,h=0,c=0;function f(w,$,v,R,Z,D){let{id:A,start:C,end:Y,size:B}=l,N=c;for(;B<0;)if(l.next(),B==-1){let lt=r[A];v.push(lt),R.push(C-w);return}else if(B==-3){h=A;return}else if(B==-4){c=A;return}else throw new RangeError(`Unrecognized record size: ${B}`);let U=a[A],H,ot,it=C-w;if(Y-C<=n&&(ot=m(l.pos-$,Z))){let lt=new Uint16Array(ot.size-ot.skip),ft=l.pos-ot.size,ht=lt.length;for(;l.pos>ft;)ht=O(ot.start,lt,ht);H=new ui(lt,Y-ot.start,i),it=ot.start-w}else{let lt=l.pos-B;l.next();let ft=[],ht=[],St=A>=o?A:-1,Yt=0,oe=Y;for(;l.pos>lt;)St>=0&&l.id==St&&l.size>=0?(l.end<=oe-n&&(p(ft,ht,C,Yt,l.end,oe,St,N),Yt=ft.length,oe=l.end),l.next()):D>2500?u(C,lt,ft,ht):f(C,lt,ft,ht,St,D+1);if(St>=0&&Yt>0&&Yt<ft.length&&p(ft,ht,C,Yt,C,oe,St,N),ft.reverse(),ht.reverse(),St>-1&&Yt>0){let gi=d(U);H=Zh(U,ft,ht,0,ft.length,0,Y-C,gi,gi)}else H=g(U,ft,ht,Y-C,N-Y)}v.push(H),R.push(it)}function u(w,$,v,R){let Z=[],D=0,A=-1;for(;l.pos>$;){let{id:C,start:Y,end:B,size:N}=l;if(N>4)l.next();else{if(A>-1&&Y<A)break;A<0&&(A=B-n),Z.push(C,Y,B),D++,l.next()}}if(D){let C=new Uint16Array(D*4),Y=Z[Z.length-2];for(let B=Z.length-3,N=0;B>=0;B-=3)C[N++]=Z[B],C[N++]=Z[B+1]-Y,C[N++]=Z[B+2]-Y,C[N++]=N;v.push(new ui(C,Z[2]-Y,i)),R.push(Y-w)}}function d(w){return($,v,R)=>{let Z=0,D=$.length-1,A,C;if(D>=0&&(A=$[D])instanceof bt){if(!D&&A.type==w&&A.length==R)return A;(C=A.prop(_.lookAhead))&&(Z=v[D]+A.length+C)}return g(w,$,v,R,Z)}}function p(w,$,v,R,Z,D,A,C){let Y=[],B=[];for(;w.length>R;)Y.push(w.pop()),B.push($.pop()+v-Z);w.push(g(i.types[A],Y,B,D-Z,C-D)),$.push(Z-v)}function g(w,$,v,R,Z=0,D){if(h){let A=[_.contextHash,h];D=D?[A].concat(D):[A]}if(Z>25){let A=[_.lookAhead,Z];D=D?[A].concat(D):[A]}return new bt(w,$,v,R,D)}function m(w,$){let v=l.fork(),R=0,Z=0,D=0,A=v.end-n,C={size:0,start:0,skip:0};t:for(let Y=v.pos-w;v.pos>Y;){let B=v.size;if(v.id==$&&B>=0){C.size=R,C.start=Z,C.skip=D,D+=4,R+=4,v.next();continue}let N=v.pos-B;if(B<0||N<Y||v.start<A)break;let U=v.id>=o?4:0,H=v.start;for(v.next();v.pos>N;){if(v.size<0)if(v.size==-3)U+=4;else break t;else v.id>=o&&(U+=4);v.next()}Z=H,R+=B,D+=U}return($<0||R==w)&&(C.size=R,C.start=Z,C.skip=D),C.size>4?C:void 0}function O(w,$,v){let{id:R,start:Z,end:D,size:A}=l;if(l.next(),A>=0&&R<o){let C=v;if(A>4){let Y=l.pos-(A-4);for(;l.pos>Y;)v=O(w,$,v)}$[--v]=C,$[--v]=D-w,$[--v]=Z-w,$[--v]=R}else A==-3?h=R:A==-4&&(c=R);return v}let y=[],x=[];for(;l.pos>0;)f(s.start||0,s.bufferStart||0,y,x,-1,0);let k=(t=s.length)!==null&&t!==void 0?t:y.length?x[0]+y[0].length:0;return new bt(a[s.topID],y.reverse(),x.reverse(),k)}const tu=new WeakMap;function dr(s,t){if(!s.isAnonymous||t instanceof ui||t.type!=s)return 1;let e=tu.get(t);if(e==null){e=1;for(let i of t.children){if(i.type!=s||!(i instanceof bt)){e=1;break}e+=dr(s,i)}tu.set(t,e)}return e}function Zh(s,t,e,i,n,r,o,l,a){let h=0;for(let p=i;p<n;p++)h+=dr(s,t[p]);let c=Math.ceil(h*1.5/8),f=[],u=[];function d(p,g,m,O,y){for(let x=m;x<O;){let k=x,w=g[x],$=dr(s,p[x]);for(x++;x<O;x++){let v=dr(s,p[x]);if($+v>=c)break;$+=v}if(x==k+1){if($>c){let v=p[k];d(v.children,v.positions,0,v.children.length,g[k]+y);continue}f.push(p[k])}else{let v=g[x-1]+p[x-1].length-w;f.push(Zh(s,p,g,k,x,w,v,null,a))}u.push(w+y-r)}}return d(t,e,i,n,0),(l||a)(f,u,o)}class Ax{constructor(){this.map=new WeakMap}setBuffer(t,e,i){let n=this.map.get(t);n||this.map.set(t,n=new Map),n.set(e,i)}getBuffer(t,e){let i=this.map.get(t);return i&&i.get(e)}set(t,e){t instanceof Te?this.setBuffer(t.context.buffer,t.index,e):t instanceof Nt&&this.map.set(t.tree,e)}get(t){return t instanceof Te?this.getBuffer(t.context.buffer,t.index):t instanceof Nt?this.map.get(t.tree):void 0}cursorSet(t,e){t.buffer?this.setBuffer(t.buffer.buffer,t.index,e):this.map.set(t.tree,e)}cursorGet(t){return t.buffer?this.getBuffer(t.buffer.buffer,t.index):this.map.get(t.tree)}}class ki{constructor(t,e,i,n,r=!1,o=!1){this.from=t,this.to=e,this.tree=i,this.offset=n,this.open=(r?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(t,e=[],i=!1){let n=[new ki(0,t.length,t,0,!1,i)];for(let r of e)r.to>t.length&&n.push(r);return n}static applyChanges(t,e,i=128){if(!e.length)return t;let n=[],r=1,o=t.length?t[0]:null;for(let l=0,a=0,h=0;;l++){let c=l<e.length?e[l]:null,f=c?c.fromA:1e9;if(f-a>=i)for(;o&&o.from<f;){let u=o;if(a>=u.from||f<=u.to||h){let d=Math.max(u.from,a)-h,p=Math.min(u.to,f)-h;u=d>=p?null:new ki(d,p,u.tree,u.offset+h,l>0,!!c)}if(u&&n.push(u),o.to>f)break;o=r<t.length?t[r++]:null}if(!c)break;a=c.toA,h=c.toA-c.toB}return n}}class km{startParse(t,e,i){return typeof t=="string"&&(t=new Tx(t)),i=i?i.length?i.map(n=>new qo(n.from,n.to)):[new qo(0,0)]:[new qo(0,t.length)],this.createParse(t,e||[],i)}parse(t,e,i){let n=this.startParse(t,e,i);for(;;){let r=n.advance();if(r)return r}}}class Tx{constructor(t){this.string=t}get length(){return this.string.length}chunk(t){return this.string.slice(t)}get lineChunks(){return!1}read(t,e){return this.string.slice(t,e)}}new _({perNode:!0});let Mx=0;class $e{constructor(t,e,i){this.set=t,this.base=e,this.modified=i,this.id=Mx++}static define(t){if(t!=null&&t.base)throw new Error("Can not derive from a modified tag");let e=new $e([],null,[]);if(e.set.push(e),t)for(let i of t.set)e.set.push(i);return e}static defineModifier(){let t=new Lr;return e=>e.modified.indexOf(t)>-1?e:Lr.get(e.base||e,e.modified.concat(t).sort((i,n)=>i.id-n.id))}}let Rx=0;class Lr{constructor(){this.instances=[],this.id=Rx++}static get(t,e){if(!e.length)return t;let i=e[0].instances.find(l=>l.base==t&&Dx(e,l.modified));if(i)return i;let n=[],r=new $e(n,t,e);for(let l of e)l.instances.push(r);let o=Wx(e);for(let l of t.set)if(!l.modified.length)for(let a of o)n.push(Lr.get(l,a));return r}}function Dx(s,t){return s.length==t.length&&s.every((e,i)=>e==t[i])}function Wx(s){let t=[[]];for(let e=0;e<s.length;e++)for(let i=0,n=t.length;i<n;i++)t.push(t[i].concat(s[e]));return t.sort((e,i)=>i.length-e.length)}function vm(s){let t=Object.create(null);for(let e in s){let i=s[e];Array.isArray(i)||(i=[i]);for(let n of e.split(" "))if(n){let r=[],o=2,l=n;for(let f=0;;){if(l=="..."&&f>0&&f+3==n.length){o=1;break}let u=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(l);if(!u)throw new RangeError("Invalid path: "+n);if(r.push(u[0]=="*"?"":u[0][0]=='"'?JSON.parse(u[0]):u[0]),f+=u[0].length,f==n.length)break;let d=n[f++];if(f==n.length&&d=="!"){o=0;break}if(d!="/")throw new RangeError("Invalid path: "+n);l=n.slice(f)}let a=r.length-1,h=r[a];if(!h)throw new RangeError("Invalid path: "+n);let c=new jr(i,o,a>0?r.slice(0,a):null);t[h]=c.sort(t[h])}}return $m.add(t)}const $m=new _;class jr{constructor(t,e,i,n){this.tags=t,this.mode=e,this.context=i,this.next=n}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(t){return!t||t.depth<this.depth?(this.next=t,this):(t.next=this.sort(t.next),t)}get depth(){return this.context?this.context.length:0}}jr.empty=new jr([],2,null);function Qm(s,t){let e=Object.create(null);for(let r of s)if(!Array.isArray(r.tag))e[r.tag.id]=r.class;else for(let o of r.tag)e[o.id]=r.class;let{scope:i,all:n=null}=t||{};return{style:r=>{let o=n;for(let l of r)for(let a of l.set){let h=e[a.id];if(h){o=o?o+" "+h:h;break}}return o},scope:i}}function Ex(s,t){let e=null;for(let i of s){let n=i.style(t);n&&(e=e?e+" "+n:n)}return e}function Bx(s,t,e,i=0,n=s.length){let r=new Yx(i,Array.isArray(t)?t:[t],e);r.highlightRange(s.cursor(),i,n,"",r.highlighters),r.flush(n)}class Yx{constructor(t,e,i){this.at=t,this.highlighters=e,this.span=i,this.class=""}startSpan(t,e){e!=this.class&&(this.flush(t),t>this.at&&(this.at=t),this.class=e)}flush(t){t>this.at&&this.class&&this.span(this.at,t,this.class)}highlightRange(t,e,i,n,r){let{type:o,from:l,to:a}=t;if(l>=i||a<=e)return;o.isTop&&(r=this.highlighters.filter(d=>!d.scope||d.scope(o)));let h=n,c=Xx(t)||jr.empty,f=Ex(r,c.tags);if(f&&(h&&(h+=" "),h+=f,c.mode==1&&(n+=(n?" ":"")+f)),this.startSpan(Math.max(e,l),h),c.opaque)return;let u=t.tree&&t.tree.prop(_.mounted);if(u&&u.overlay){let d=t.node.enter(u.overlay[0].from+l,1),p=this.highlighters.filter(m=>!m.scope||m.scope(u.tree.type)),g=t.firstChild();for(let m=0,O=l;;m++){let y=m<u.overlay.length?u.overlay[m]:null,x=y?y.from+l:a,k=Math.max(e,O),w=Math.min(i,x);if(k<w&&g)for(;t.from<w&&(this.highlightRange(t,k,w,n,r),this.startSpan(Math.min(w,t.to),h),!(t.to>=x||!t.nextSibling())););if(!y||x>i)break;O=y.to+l,O>e&&(this.highlightRange(d.cursor(),Math.max(e,y.from+l),Math.min(i,O),"",p),this.startSpan(Math.min(i,O),h))}g&&t.parent()}else if(t.firstChild()){u&&(n="");do if(!(t.to<=e)){if(t.from>=i)break;this.highlightRange(t,e,i,n,r),this.startSpan(Math.min(i,t.to),h)}while(t.nextSibling());t.parent()}}}function Xx(s){let t=s.type.prop($m);for(;t&&t.context&&!s.matchContext(t.context);)t=t.next;return t||null}const M=$e.define,Vs=M(),Ke=M(),eu=M(Ke),iu=M(Ke),Je=M(),Ns=M(Je),zo=M(Je),ke=M(),Oi=M(ke),we=M(),Se=M(),Ea=M(),wn=M(Ea),Is=M(),b={comment:Vs,lineComment:M(Vs),blockComment:M(Vs),docComment:M(Vs),name:Ke,variableName:M(Ke),typeName:eu,tagName:M(eu),propertyName:iu,attributeName:M(iu),className:M(Ke),labelName:M(Ke),namespace:M(Ke),macroName:M(Ke),literal:Je,string:Ns,docString:M(Ns),character:M(Ns),attributeValue:M(Ns),number:zo,integer:M(zo),float:M(zo),bool:M(Je),regexp:M(Je),escape:M(Je),color:M(Je),url:M(Je),keyword:we,self:M(we),null:M(we),atom:M(we),unit:M(we),modifier:M(we),operatorKeyword:M(we),controlKeyword:M(we),definitionKeyword:M(we),moduleKeyword:M(we),operator:Se,derefOperator:M(Se),arithmeticOperator:M(Se),logicOperator:M(Se),bitwiseOperator:M(Se),compareOperator:M(Se),updateOperator:M(Se),definitionOperator:M(Se),typeOperator:M(Se),controlOperator:M(Se),punctuation:Ea,separator:M(Ea),bracket:wn,angleBracket:M(wn),squareBracket:M(wn),paren:M(wn),brace:M(wn),content:ke,heading:Oi,heading1:M(Oi),heading2:M(Oi),heading3:M(Oi),heading4:M(Oi),heading5:M(Oi),heading6:M(Oi),contentSeparator:M(ke),list:M(ke),quote:M(ke),emphasis:M(ke),strong:M(ke),link:M(ke),monospace:M(ke),strikethrough:M(ke),inserted:M(),deleted:M(),changed:M(),invalid:M(),meta:Is,documentMeta:M(Is),annotation:M(Is),processingInstruction:M(Is),definition:$e.defineModifier(),constant:$e.defineModifier(),function:$e.defineModifier(),standard:$e.defineModifier(),local:$e.defineModifier(),special:$e.defineModifier()};Qm([{tag:b.link,class:"tok-link"},{tag:b.heading,class:"tok-heading"},{tag:b.emphasis,class:"tok-emphasis"},{tag:b.strong,class:"tok-strong"},{tag:b.keyword,class:"tok-keyword"},{tag:b.atom,class:"tok-atom"},{tag:b.bool,class:"tok-bool"},{tag:b.url,class:"tok-url"},{tag:b.labelName,class:"tok-labelName"},{tag:b.inserted,class:"tok-inserted"},{tag:b.deleted,class:"tok-deleted"},{tag:b.literal,class:"tok-literal"},{tag:b.string,class:"tok-string"},{tag:b.number,class:"tok-number"},{tag:[b.regexp,b.escape,b.special(b.string)],class:"tok-string2"},{tag:b.variableName,class:"tok-variableName"},{tag:b.local(b.variableName),class:"tok-variableName tok-local"},{tag:b.definition(b.variableName),class:"tok-variableName tok-definition"},{tag:b.special(b.variableName),class:"tok-variableName2"},{tag:b.definition(b.propertyName),class:"tok-propertyName tok-definition"},{tag:b.typeName,class:"tok-typeName"},{tag:b.namespace,class:"tok-namespace"},{tag:b.className,class:"tok-className"},{tag:b.macroName,class:"tok-macroName"},{tag:b.propertyName,class:"tok-propertyName"},{tag:b.operator,class:"tok-operator"},{tag:b.comment,class:"tok-comment"},{tag:b.meta,class:"tok-meta"},{tag:b.invalid,class:"tok-invalid"},{tag:b.punctuation,class:"tok-punctuation"}]);var _o;const Yi=new _;function Pm(s){return P.define({combine:s?t=>t.concat(s):void 0})}const Ah=new _;class ae{constructor(t,e,i=[],n=""){this.data=t,this.name=n,V.prototype.hasOwnProperty("tree")||Object.defineProperty(V.prototype,"tree",{get(){return Mt(this)}}),this.parser=e,this.extension=[di.of(this),V.languageData.of((r,o,l)=>{let a=nu(r,o,l),h=a.type.prop(Yi);if(!h)return[];let c=r.facet(h),f=a.type.prop(Ah);if(f){let u=a.resolve(o-a.from,l);for(let d of f)if(d.test(u,r)){let p=r.facet(d.facet);return d.type=="replace"?p:p.concat(c)}}return c})].concat(i)}isActiveAt(t,e,i=-1){return nu(t,e,i).type.prop(Yi)==this.data}findRegions(t){let e=t.facet(di);if((e==null?void 0:e.data)==this.data)return[{from:0,to:t.doc.length}];if(!e||!e.allowsNesting)return[];let i=[],n=(r,o)=>{if(r.prop(Yi)==this.data){i.push({from:o,to:o+r.length});return}let l=r.prop(_.mounted);if(l){if(l.tree.prop(Yi)==this.data){if(l.overlay)for(let a of l.overlay)i.push({from:a.from+o,to:a.to+o});else i.push({from:o,to:o+r.length});return}else if(l.overlay){let a=i.length;if(n(l.tree,l.overlay[0].from+o),i.length>a)return}}for(let a=0;a<r.children.length;a++){let h=r.children[a];h instanceof bt&&n(h,r.positions[a]+o)}};return n(Mt(t),0),i}get allowsNesting(){return!0}}ae.setState=j.define();function nu(s,t,e){let i=s.facet(di),n=Mt(s).topNode;if(!i||i.allowsNesting)for(let r=n;r;r=r.enter(t,e,yt.ExcludeBuffers))r.type.isTop&&(n=r);return n}class Vr extends ae{constructor(t,e,i){super(t,e,[],i),this.parser=e}static define(t){let e=Pm(t.languageData);return new Vr(e,t.parser.configure({props:[Yi.add(i=>i.isTop?e:void 0)]}),t.name)}configure(t,e){return new Vr(this.data,this.parser.configure(t),e||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function Mt(s){let t=s.field(ae.state,!1);return t?t.tree:bt.empty}class Lx{constructor(t){this.doc=t,this.cursorPos=0,this.string="",this.cursor=t.iter()}get length(){return this.doc.length}syncTo(t){return this.string=this.cursor.next(t-this.cursorPos).value,this.cursorPos=t+this.string.length,this.cursorPos-this.string.length}chunk(t){return this.syncTo(t),this.string}get lineChunks(){return!0}read(t,e){let i=this.cursorPos-this.string.length;return t<i||e>=this.cursorPos?this.doc.sliceString(t,e):this.string.slice(t-i,e-i)}}let Sn=null;class Nr{constructor(t,e,i=[],n,r,o,l,a){this.parser=t,this.state=e,this.fragments=i,this.tree=n,this.treeLen=r,this.viewport=o,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(t,e,i){return new Nr(t,e,[],bt.empty,0,i,[],null)}startParse(){return this.parser.startParse(new Lx(this.state.doc),this.fragments)}work(t,e){return e!=null&&e>=this.state.doc.length&&(e=void 0),this.tree!=bt.empty&&this.isDone(e??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof t=="number"){let n=Date.now()+t;t=()=>Date.now()>n}for(this.parse||(this.parse=this.startParse()),e!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&e<this.state.doc.length&&this.parse.stopAt(e);;){let n=this.parse.advance();if(n)if(this.fragments=this.withoutTempSkipped(ki.addTree(n,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(i=this.parse.stoppedAt)!==null&&i!==void 0?i:this.state.doc.length,this.tree=n,this.parse=null,this.treeLen<(e??this.state.doc.length))this.parse=this.startParse();else return!0;if(t())return!1}})}takeTree(){let t,e;this.parse&&(t=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&this.parse.stopAt(t),this.withContext(()=>{for(;!(e=this.parse.advance()););}),this.treeLen=t,this.tree=e,this.fragments=this.withoutTempSkipped(ki.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(t){let e=Sn;Sn=this;try{return t()}finally{Sn=e}}withoutTempSkipped(t){for(let e;e=this.tempSkipped.pop();)t=su(t,e.from,e.to);return t}changes(t,e){let{fragments:i,tree:n,treeLen:r,viewport:o,skipped:l}=this;if(this.takeTree(),!t.empty){let a=[];if(t.iterChangedRanges((h,c,f,u)=>a.push({fromA:h,toA:c,fromB:f,toB:u})),i=ki.applyChanges(i,a),n=bt.empty,r=0,o={from:t.mapPos(o.from,-1),to:t.mapPos(o.to,1)},this.skipped.length){l=[];for(let h of this.skipped){let c=t.mapPos(h.from,1),f=t.mapPos(h.to,-1);c<f&&l.push({from:c,to:f})}}}return new Nr(this.parser,e,i,n,r,o,l,this.scheduleOn)}updateViewport(t){if(this.viewport.from==t.from&&this.viewport.to==t.to)return!1;this.viewport=t;let e=this.skipped.length;for(let i=0;i<this.skipped.length;i++){let{from:n,to:r}=this.skipped[i];n<t.to&&r>t.from&&(this.fragments=su(this.fragments,n,r),this.skipped.splice(i--,1))}return this.skipped.length>=e?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(t,e){this.skipped.push({from:t,to:e})}static getSkippingParser(t){return new class extends km{createParse(e,i,n){let r=n[0].from,o=n[n.length-1].to;return{parsedPos:r,advance(){let a=Sn;if(a){for(let h of n)a.tempSkipped.push(h);t&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,t]):t)}return this.parsedPos=o,new bt(It.none,[],[],o-r)},stoppedAt:null,stopAt(){}}}}}isDone(t){t=Math.min(t,this.state.doc.length);let e=this.fragments;return this.treeLen>=t&&e.length&&e[0].from==0&&e[0].to>=t}static get(){return Sn}}function su(s,t,e){return ki.applyChanges(s,[{fromA:t,toA:e,fromB:t,toB:e}])}class hn{constructor(t){this.context=t,this.tree=t.tree}apply(t){if(!t.docChanged&&this.tree==this.context.tree)return this;let e=this.context.changes(t.changes,t.state),i=this.context.treeLen==t.startState.doc.length?void 0:Math.max(t.changes.mapPos(this.context.treeLen),e.viewport.to);return e.work(20,i)||e.takeTree(),new hn(e)}static init(t){let e=Math.min(3e3,t.doc.length),i=Nr.create(t.facet(di).parser,t,{from:0,to:e});return i.work(20,e)||i.takeTree(),new hn(i)}}ae.state=wt.define({create:hn.init,update(s,t){for(let e of t.effects)if(e.is(ae.setState))return e.value;return t.startState.facet(di)!=t.state.facet(di)?hn.init(t.state):s.apply(t)}});let Cm=s=>{let t=setTimeout(()=>s(),500);return()=>clearTimeout(t)};typeof requestIdleCallback<"u"&&(Cm=s=>{let t=-1,e=setTimeout(()=>{t=requestIdleCallback(s,{timeout:500-100})},100);return()=>t<0?clearTimeout(e):cancelIdleCallback(t)});const Go=typeof navigator<"u"&&(!((_o=navigator.scheduling)===null||_o===void 0)&&_o.isInputPending)?()=>navigator.scheduling.isInputPending():null,jx=Tt.fromClass(class{constructor(t){this.view=t,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(t){let e=this.view.state.field(ae.state).context;(e.updateViewport(t.view.viewport)||this.view.viewport.to>e.treeLen)&&this.scheduleWork(),(t.docChanged||t.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(e)}scheduleWork(){if(this.working)return;let{state:t}=this.view,e=t.field(ae.state);(e.tree!=e.context.tree||!e.context.isDone(t.doc.length))&&(this.working=Cm(this.work))}work(t){this.working=null;let e=Date.now();if(this.chunkEnd<e&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=e+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:i,viewport:{to:n}}=this.view,r=i.field(ae.state);if(r.tree==r.context.tree&&r.context.isDone(n+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,t&&!Go?Math.max(25,t.timeRemaining()-5):1e9),l=r.context.treeLen<n&&i.doc.length>n+1e3,a=r.context.work(()=>Go&&Go()||Date.now()>o,n+(l?0:1e5));this.chunkBudget-=Date.now()-e,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:ae.setState.of(new hn(r.context))})),this.chunkBudget>0&&!(a&&!l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(t){t.scheduleOn&&(this.workScheduled++,t.scheduleOn.then(()=>this.scheduleWork()).catch(e=>ee(this.view.state,e)).then(()=>this.workScheduled--),t.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),di=P.define({combine(s){return s.length?s[0]:null},enables:s=>[ae.state,jx,X.contentAttributes.compute([s],t=>{let e=t.facet(s);return e&&e.name?{"data-language":e.name}:{}})]});class Vx{constructor(t,e=[]){this.language=t,this.support=e,this.extension=[t,e]}}const Nx=P.define(),co=P.define({combine:s=>{if(!s.length)return" ";let t=s[0];if(!t||/\S/.test(t)||Array.from(t).some(e=>e!=t[0]))throw new Error("Invalid indent unit: "+JSON.stringify(s[0]));return t}});function Ix(s){let t=s.facet(co);return t.charCodeAt(0)==9?s.tabSize*t.length:t.length}function qx(s,t){let e="",i=s.tabSize,n=s.facet(co)[0];if(n==" "){for(;t>=i;)e+=" ",t-=i;n=" "}for(let r=0;r<t;r++)e+=n;return e}function zx(s,t){s instanceof V&&(s=new Zm(s));for(let i of s.state.facet(Nx)){let n=i(s,t);if(n!==void 0)return n}let e=Mt(s.state);return e.length>=t?_x(s,e,t):null}class Zm{constructor(t,e={}){this.state=t,this.options=e,this.unit=Ix(t)}lineAt(t,e=1){let i=this.state.doc.lineAt(t),{simulateBreak:n,simulateDoubleBreak:r}=this.options;return n!=null&&n>=i.from&&n<=i.to?r&&n==t?{text:"",from:t}:(e<0?n<t:n<=t)?{text:i.text.slice(n-i.from),from:n}:{text:i.text.slice(0,n-i.from),from:i.from}:i}textAfterPos(t,e=1){if(this.options.simulateDoubleBreak&&t==this.options.simulateBreak)return"";let{text:i,from:n}=this.lineAt(t,e);return i.slice(t-n,Math.min(i.length,t+100-n))}column(t,e=1){let{text:i,from:n}=this.lineAt(t,e),r=this.countColumn(i,t-n),o=this.options.overrideIndentation?this.options.overrideIndentation(n):-1;return o>-1&&(r+=o-this.countColumn(i,i.search(/\S|$/))),r}countColumn(t,e=t.length){return Ti(t,this.state.tabSize,e)}lineIndent(t,e=1){let{text:i,from:n}=this.lineAt(t,e),r=this.options.overrideIndentation;if(r){let o=r(n);if(o>-1)return o}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Am=new _;function _x(s,t,e){let i=t.resolveStack(e),n=i.node.enterUnfinishedNodesBefore(e);if(n!=i.node){let r=[];for(let o=n;o!=i.node;o=o.parent)r.push(o);for(let o=r.length-1;o>=0;o--)i={node:r[o],next:i}}return Tm(i,s,e)}function Tm(s,t,e){for(let i=s;i;i=i.next){let n=Hx(i.node);if(n)return n(Th.create(t,e,i))}return 0}function Gx(s){return s.pos==s.options.simulateBreak&&s.options.simulateDoubleBreak}function Hx(s){let t=s.type.prop(Am);if(t)return t;let e=s.firstChild,i;if(e&&(i=e.type.prop(_.closedBy))){let n=s.lastChild,r=n&&i.indexOf(n.name)>-1;return o=>Mm(o,!0,1,void 0,r&&!Gx(o)?n.from:void 0)}return s.parent==null?Fx:null}function Fx(){return 0}class Th extends Zm{constructor(t,e,i){super(t.state,t.options),this.base=t,this.pos=e,this.context=i}get node(){return this.context.node}static create(t,e,i){return new Th(t,e,i)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(t){let e=this.state.doc.lineAt(t.from);for(;;){let i=t.resolve(e.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(Ux(i,t))break;e=this.state.doc.lineAt(i.from)}return this.lineIndent(e.from)}continue(){return Tm(this.context.next,this.base,this.pos)}}function Ux(s,t){for(let e=t;e;e=e.parent)if(s==e)return!0;return!1}function Kx(s){let t=s.node,e=t.childAfter(t.from),i=t.lastChild;if(!e)return null;let n=s.options.simulateBreak,r=s.state.doc.lineAt(e.from),o=n==null||n<=r.from?r.to:Math.min(r.to,n);for(let l=e.to;;){let a=t.childAfter(l);if(!a||a==i)return null;if(!a.type.isSkipped)return a.from<o?e:null;l=a.to}}function Jx({closing:s,align:t=!0,units:e=1}){return i=>Mm(i,t,e,s)}function Mm(s,t,e,i,n){let r=s.textAfter,o=r.match(/^\s*/)[0].length,l=i&&r.slice(o,o+i.length)==i||n==s.pos+o,a=t?Kx(s):null;return a?l?s.column(a.from):s.column(a.to):s.baseIndent+(l?0:s.unit*e)}const tk=s=>s.baseIndent;function Ho({except:s,units:t=1}={}){return e=>{let i=s&&s.test(e.textAfter);return e.baseIndent+(i?0:t*e.unit)}}const ek=200;function ik(){return V.transactionFilter.of(s=>{if(!s.docChanged||!s.isUserEvent("input.type")&&!s.isUserEvent("input.complete"))return s;let t=s.startState.languageDataAt("indentOnInput",s.startState.selection.main.head);if(!t.length)return s;let e=s.newDoc,{head:i}=s.newSelection.main,n=e.lineAt(i);if(i>n.from+ek)return s;let r=e.sliceString(n.from,i);if(!t.some(h=>h.test(r)))return s;let{state:o}=s,l=-1,a=[];for(let{head:h}of o.selection.ranges){let c=o.doc.lineAt(h);if(c.from==l)continue;l=c.from;let f=zx(o,c.from);if(f==null)continue;let u=/^\s*/.exec(c.text)[0],d=qx(o,f);u!=d&&a.push({from:c.from,to:c.from+u.length,insert:d})}return a.length?[s,{changes:a,sequential:!0}]:s})}const nk=P.define(),Rm=new _;function sk(s){let t=s.firstChild,e=s.lastChild;return t&&t.to<e.from?{from:t.to,to:e.type.isError?s.to:e.from}:null}function rk(s,t,e){let i=Mt(s);if(i.length<e)return null;let n=i.resolveStack(e,1),r=null;for(let o=n;o;o=o.next){let l=o.node;if(l.to<=e||l.from>e)continue;if(r&&l.from<t)break;let a=l.type.prop(Rm);if(a&&(l.to<i.length-50||i.length==s.doc.length||!ok(l))){let h=a(l,s);h&&h.from<=e&&h.from>=t&&h.to>e&&(r=h)}}return r}function ok(s){let t=s.lastChild;return t&&t.to==s.to&&t.type.isError}function Ir(s,t,e){for(let i of s.facet(nk)){let n=i(s,t,e);if(n)return n}return rk(s,t,e)}function Dm(s,t){let e=t.mapPos(s.from,1),i=t.mapPos(s.to,-1);return e>=i?void 0:{from:e,to:i}}const fo=j.define({map:Dm}),as=j.define({map:Dm});function Wm(s){let t=[];for(let{head:e}of s.state.selection.ranges)t.some(i=>i.from<=e&&i.to>=e)||t.push(s.lineBlockAt(e));return t}const Ai=wt.define({create(){return z.none},update(s,t){s=s.map(t.changes);for(let e of t.effects)if(e.is(fo)&&!lk(s,e.value.from,e.value.to)){let{preparePlaceholder:i}=t.state.facet(Mh),n=i?z.replace({widget:new pk(i(t.state,e.value))}):ru;s=s.update({add:[n.range(e.value.from,e.value.to)]})}else e.is(as)&&(s=s.update({filter:(i,n)=>e.value.from!=i||e.value.to!=n,filterFrom:e.value.from,filterTo:e.value.to}));if(t.selection){let e=!1,{head:i}=t.selection.main;s.between(i,i,(n,r)=>{n<i&&r>i&&(e=!0)}),e&&(s=s.update({filterFrom:i,filterTo:i,filter:(n,r)=>r<=i||n>=i}))}return s},provide:s=>X.decorations.from(s),toJSON(s,t){let e=[];return s.between(0,t.doc.length,(i,n)=>{e.push(i,n)}),e},fromJSON(s){if(!Array.isArray(s)||s.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let e=0;e<s.length;){let i=s[e++],n=s[e++];if(typeof i!="number"||typeof n!="number")throw new RangeError("Invalid JSON for fold state");t.push(ru.range(i,n))}return z.set(t,!0)}});function qr(s,t,e){var i;let n=null;return(i=s.field(Ai,!1))===null||i===void 0||i.between(t,e,(r,o)=>{(!n||n.from>r)&&(n={from:r,to:o})}),n}function lk(s,t,e){let i=!1;return s.between(t,t,(n,r)=>{n==t&&r==e&&(i=!0)}),i}function Em(s,t){return s.field(Ai,!1)?t:t.concat(j.appendConfig.of(Ym()))}const ak=s=>{for(let t of Wm(s)){let e=Ir(s.state,t.from,t.to);if(e)return s.dispatch({effects:Em(s.state,[fo.of(e),Bm(s,e)])}),!0}return!1},hk=s=>{if(!s.state.field(Ai,!1))return!1;let t=[];for(let e of Wm(s)){let i=qr(s.state,e.from,e.to);i&&t.push(as.of(i),Bm(s,i,!1))}return t.length&&s.dispatch({effects:t}),t.length>0};function Bm(s,t,e=!0){let i=s.state.doc.lineAt(t.from).number,n=s.state.doc.lineAt(t.to).number;return X.announce.of(`${s.state.phrase(e?"Folded lines":"Unfolded lines")} ${i} ${s.state.phrase("to")} ${n}.`)}const ck=s=>{let{state:t}=s,e=[];for(let i=0;i<t.doc.length;){let n=s.lineBlockAt(i),r=Ir(t,n.from,n.to);r&&e.push(fo.of(r)),i=(r?s.lineBlockAt(r.to):n).to+1}return e.length&&s.dispatch({effects:Em(s.state,e)}),!!e.length},fk=s=>{let t=s.state.field(Ai,!1);if(!t||!t.size)return!1;let e=[];return t.between(0,s.state.doc.length,(i,n)=>{e.push(as.of({from:i,to:n}))}),s.dispatch({effects:e}),!0},uk=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:ak},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:hk},{key:"Ctrl-Alt-[",run:ck},{key:"Ctrl-Alt-]",run:fk}],dk={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Mh=P.define({combine(s){return Xe(s,dk)}});function Ym(s){let t=[Ai,Ok];return s&&t.push(Mh.of(s)),t}function Xm(s,t){let{state:e}=s,i=e.facet(Mh),n=o=>{let l=s.lineBlockAt(s.posAtDOM(o.target)),a=qr(s.state,l.from,l.to);a&&s.dispatch({effects:as.of(a)}),o.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(s,n,t);let r=document.createElement("span");return r.textContent=i.placeholderText,r.setAttribute("aria-label",e.phrase("folded code")),r.title=e.phrase("unfold"),r.className="cm-foldPlaceholder",r.onclick=n,r}const ru=z.replace({widget:new class extends Le{toDOM(s){return Xm(s,null)}}});class pk extends Le{constructor(t){super(),this.value=t}eq(t){return this.value==t.value}toDOM(t){return Xm(t,this.value)}}const gk={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Fo extends Ge{constructor(t,e){super(),this.config=t,this.open=e}eq(t){return this.config==t.config&&this.open==t.open}toDOM(t){if(this.config.markerDOM)return this.config.markerDOM(this.open);let e=document.createElement("span");return e.textContent=this.open?this.config.openText:this.config.closedText,e.title=t.state.phrase(this.open?"Fold line":"Unfold line"),e}}function mk(s={}){let t=Object.assign(Object.assign({},gk),s),e=new Fo(t,!0),i=new Fo(t,!1),n=Tt.fromClass(class{constructor(o){this.from=o.viewport.from,this.markers=this.buildMarkers(o)}update(o){(o.docChanged||o.viewportChanged||o.startState.facet(di)!=o.state.facet(di)||o.startState.field(Ai,!1)!=o.state.field(Ai,!1)||Mt(o.startState)!=Mt(o.state)||t.foldingChanged(o))&&(this.markers=this.buildMarkers(o.view))}buildMarkers(o){let l=new qe;for(let a of o.viewportLineBlocks){let h=qr(o.state,a.from,a.to)?i:Ir(o.state,a.from,a.to)?e:null;h&&l.add(a.from,a.from,h)}return l.finish()}}),{domEventHandlers:r}=t;return[n,lb({class:"cm-foldGutter",markers(o){var l;return((l=o.plugin(n))===null||l===void 0?void 0:l.markers)||I.empty},initialSpacer(){return new Fo(t,!1)},domEventHandlers:Object.assign(Object.assign({},r),{click:(o,l,a)=>{if(r.click&&r.click(o,l,a))return!0;let h=qr(o.state,l.from,l.to);if(h)return o.dispatch({effects:as.of(h)}),!0;let c=Ir(o.state,l.from,l.to);return c?(o.dispatch({effects:fo.of(c)}),!0):!1}})}),Ym()]}const Ok=X.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"}});class hs{constructor(t,e){this.specs=t;let i;function n(l){let a=At.newName();return(i||(i=Object.create(null)))["."+a]=l,a}const r=typeof e.all=="string"?e.all:e.all?n(e.all):void 0,o=e.scope;this.scope=o instanceof ae?l=>l.prop(Yi)==o.data:o?l=>l==o:void 0,this.style=Qm(t.map(l=>({tag:l.tag,class:l.class||n(Object.assign({},l,{tag:null}))})),{all:r}).style,this.module=i?new At(i):null,this.themeType=e.themeType}static define(t,e){return new hs(t,e||{})}}const Ba=P.define(),Lm=P.define({combine(s){return s.length?[s[0]]:null}});function Uo(s){let t=s.facet(Ba);return t.length?t:s.facet(Lm)}function jm(s,t){let e=[yk],i;return s instanceof hs&&(s.module&&e.push(X.styleModule.of(s.module)),i=s.themeType),t!=null&&t.fallback?e.push(Lm.of(s)):i?e.push(Ba.computeN([X.darkTheme],n=>n.facet(X.darkTheme)==(i=="dark")?[s]:[])):e.push(Ba.of(s)),e}class bk{constructor(t){this.markCache=Object.create(null),this.tree=Mt(t.state),this.decorations=this.buildDeco(t,Uo(t.state)),this.decoratedTo=t.viewport.to}update(t){let e=Mt(t.state),i=Uo(t.state),n=i!=Uo(t.startState),{viewport:r}=t.view,o=t.changes.mapPos(this.decoratedTo,1);e.length<r.to&&!n&&e.type==this.tree.type&&o>=r.to?(this.decorations=this.decorations.map(t.changes),this.decoratedTo=o):(e!=this.tree||t.viewportChanged||n)&&(this.tree=e,this.decorations=this.buildDeco(t.view,i),this.decoratedTo=r.to)}buildDeco(t,e){if(!e||!this.tree.length)return z.none;let i=new qe;for(let{from:n,to:r}of t.visibleRanges)Bx(this.tree,e,(o,l,a)=>{i.add(o,l,this.markCache[a]||(this.markCache[a]=z.mark({class:a})))},n,r);return i.finish()}}const yk=pe.high(Tt.fromClass(bk,{decorations:s=>s.decorations})),wk=hs.define([{tag:b.meta,color:"#404740"},{tag:b.link,textDecoration:"underline"},{tag:b.heading,textDecoration:"underline",fontWeight:"bold"},{tag:b.emphasis,fontStyle:"italic"},{tag:b.strong,fontWeight:"bold"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:b.keyword,color:"#708"},{tag:[b.atom,b.bool,b.url,b.contentSeparator,b.labelName],color:"#219"},{tag:[b.literal,b.inserted],color:"#164"},{tag:[b.string,b.deleted],color:"#a11"},{tag:[b.regexp,b.escape,b.special(b.string)],color:"#e40"},{tag:b.definition(b.variableName),color:"#00f"},{tag:b.local(b.variableName),color:"#30a"},{tag:[b.typeName,b.namespace],color:"#085"},{tag:b.className,color:"#167"},{tag:[b.special(b.variableName),b.macroName],color:"#256"},{tag:b.definition(b.propertyName),color:"#00c"},{tag:b.comment,color:"#940"},{tag:b.invalid,color:"#f00"}]),Sk=X.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Vm=1e4,Nm="()[]{}",Im=P.define({combine(s){return Xe(s,{afterCursor:!0,brackets:Nm,maxScanDistance:Vm,renderMatch:vk})}}),xk=z.mark({class:"cm-matchingBracket"}),kk=z.mark({class:"cm-nonmatchingBracket"});function vk(s){let t=[],e=s.matched?xk:kk;return t.push(e.range(s.start.from,s.start.to)),s.end&&t.push(e.range(s.end.from,s.end.to)),t}const $k=wt.define({create(){return z.none},update(s,t){if(!t.docChanged&&!t.selection)return s;let e=[],i=t.state.facet(Im);for(let n of t.state.selection.ranges){if(!n.empty)continue;let r=qs(t.state,n.head,-1,i)||n.head>0&&qs(t.state,n.head-1,1,i)||i.afterCursor&&(qs(t.state,n.head,1,i)||n.head<t.state.doc.length&&qs(t.state,n.head+1,-1,i));r&&(e=e.concat(i.renderMatch(r,t.state)))}return z.set(e,!0)},provide:s=>X.decorations.from(s)}),Qk=[$k,Sk];function Pk(s={}){return[Im.of(s),Qk]}const Ck=new _;function Ya(s,t,e){let i=s.prop(t<0?_.openedBy:_.closedBy);if(i)return i;if(s.name.length==1){let n=e.indexOf(s.name);if(n>-1&&n%2==(t<0?1:0))return[e[n+t]]}return null}function Xa(s){let t=s.type.prop(Ck);return t?t(s.node):s}function qs(s,t,e,i={}){let n=i.maxScanDistance||Vm,r=i.brackets||Nm,o=Mt(s),l=o.resolveInner(t,e);for(let a=l;a;a=a.parent){let h=Ya(a.type,e,r);if(h&&a.from<a.to){let c=Xa(a);if(c&&(e>0?t>=c.from&&t<c.to:t>c.from&&t<=c.to))return Zk(s,t,e,a,c,h,r)}}return Ak(s,t,e,o,l.type,n,r)}function Zk(s,t,e,i,n,r,o){let l=i.parent,a={from:n.from,to:n.to},h=0,c=l==null?void 0:l.cursor();if(c&&(e<0?c.childBefore(i.from):c.childAfter(i.to)))do if(e<0?c.to<=i.from:c.from>=i.to){if(h==0&&r.indexOf(c.type.name)>-1&&c.from<c.to){let f=Xa(c);return{start:a,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(Ya(c.type,e,o))h++;else if(Ya(c.type,-e,o)){if(h==0){let f=Xa(c);return{start:a,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}h--}}while(e<0?c.prevSibling():c.nextSibling());return{start:a,matched:!1}}function Ak(s,t,e,i,n,r,o){let l=e<0?s.sliceDoc(t-1,t):s.sliceDoc(t,t+1),a=o.indexOf(l);if(a<0||a%2==0!=e>0)return null;let h={from:e<0?t-1:t,to:e>0?t+1:t},c=s.doc.iterRange(t,e>0?s.doc.length:0),f=0;for(let u=0;!c.next().done&&u<=r;){let d=c.value;e<0&&(u+=d.length);let p=t+u*e;for(let g=e>0?0:d.length-1,m=e>0?d.length:-1;g!=m;g+=e){let O=o.indexOf(d[g]);if(!(O<0||i.resolveInner(p+g,1).type!=n))if(O%2==0==e>0)f++;else{if(f==1)return{start:h,end:{from:p+g,to:p+g+1},matched:O>>1==a>>1};f--}}e>0&&(u+=d.length)}return c.done?{start:h,matched:!1}:null}const Tk=Object.create(null),ou=[It.none],lu=[],au=Object.create(null),Mk=Object.create(null);for(let[s,t]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"]])Mk[s]=Rk(Tk,t);function Ko(s,t){lu.indexOf(s)>-1||(lu.push(s),console.warn(t))}function Rk(s,t){let e=[];for(let l of t.split(" ")){let a=[];for(let h of l.split(".")){let c=s[h]||b[h];c?typeof c=="function"?a.length?a=a.map(c):Ko(h,`Modifier ${h} used at start of tag`):a.length?Ko(h,`Tag ${h} used as modifier`):a=Array.isArray(c)?c:[c]:Ko(h,`Unknown highlighting tag ${h}`)}for(let h of a)e.push(h)}if(!e.length)return 0;let i=t.replace(/ /g,"_"),n=i+" "+e.map(l=>l.id),r=au[n];if(r)return r.id;let o=au[n]=It.define({id:ou.length,name:i,props:[vm({[i]:e})]});return ou.push(o),o.id}at.RTL,at.LTR;class qm{constructor(t,e,i){this.state=t,this.pos=e,this.explicit=i,this.abortListeners=[]}tokenBefore(t){let e=Mt(this.state).resolveInner(this.pos,-1);for(;e&&t.indexOf(e.name)<0;)e=e.parent;return e?{from:e.from,to:this.pos,text:this.state.sliceDoc(e.from,this.pos),type:e.type}:null}matchBefore(t){let e=this.state.doc.lineAt(this.pos),i=Math.max(e.from,this.pos-250),n=e.text.slice(i-e.from,this.pos-e.from),r=n.search(zm(t,!1));return r<0?null:{from:i+r,to:this.pos,text:n.slice(r)}}get aborted(){return this.abortListeners==null}addEventListener(t,e){t=="abort"&&this.abortListeners&&this.abortListeners.push(e)}}function hu(s){let t=Object.keys(s).join(""),e=/\w/.test(t);return e&&(t=t.replace(/\w/g,"")),`[${e?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function Dk(s){let t=Object.create(null),e=Object.create(null);for(let{label:n}of s){t[n[0]]=!0;for(let r=1;r<n.length;r++)e[n[r]]=!0}let i=hu(t)+hu(e)+"*$";return[new RegExp("^"+i),new RegExp(i)]}function Wk(s){let t=s.map(n=>typeof n=="string"?{label:n}:n),[e,i]=t.every(n=>/^\w+$/.test(n.label))?[/\w*$/,/\w+$/]:Dk(t);return n=>{let r=n.matchBefore(i);return r||n.explicit?{from:r?r.from:n.pos,options:t,validFor:e}:null}}class cu{constructor(t,e,i,n){this.completion=t,this.source=e,this.match=i,this.score=n}}function hi(s){return s.selection.main.from}function zm(s,t){var e;let{source:i}=s,n=t&&i[0]!="^",r=i[i.length-1]!="$";return!n&&!r?s:new RegExp(`${n?"^":""}(?:${i})${r?"$":""}`,(e=s.flags)!==null&&e!==void 0?e:s.ignoreCase?"i":"")}const _m=se.define();function Ek(s,t,e,i){let{main:n}=s.selection,r=e-n.from,o=i-n.from;return Object.assign(Object.assign({},s.changeByRange(l=>l!=n&&e!=i&&s.sliceDoc(l.from+r,l.from+o)!=s.sliceDoc(e,i)?{range:l}:{changes:{from:l.from+r,to:i==n.from?l.to:l.from+o,insert:t},range:S.cursor(l.from+r+t.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const fu=new WeakMap;function Bk(s){if(!Array.isArray(s))return s;let t=fu.get(s);return t||fu.set(s,t=Wk(s)),t}const zr=j.define(),Jn=j.define();class Yk{constructor(t){this.pattern=t,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let e=0;e<t.length;){let i=xt(t,e),n=Gt(i);this.chars.push(i);let r=t.slice(e,e+n),o=r.toUpperCase();this.folded.push(xt(o==r?r.toLowerCase():o,0)),e+=n}this.astral=t.length!=this.chars.length}ret(t,e){return this.score=t,this.matched=e,this}match(t){if(this.pattern.length==0)return this.ret(-100,[]);if(t.length<this.pattern.length)return null;let{chars:e,folded:i,any:n,precise:r,byWord:o}=this;if(e.length==1){let y=xt(t,0),x=Gt(y),k=x==t.length?0:-100;if(y!=e[0])if(y==i[0])k+=-200;else return null;return this.ret(k,[0,x])}let l=t.indexOf(this.pattern);if(l==0)return this.ret(t.length==this.pattern.length?0:-100,[0,this.pattern.length]);let a=e.length,h=0;if(l<0){for(let y=0,x=Math.min(t.length,200);y<x&&h<a;){let k=xt(t,y);(k==e[h]||k==i[h])&&(n[h++]=y),y+=Gt(k)}if(h<a)return null}let c=0,f=0,u=!1,d=0,p=-1,g=-1,m=/[a-z]/.test(t),O=!0;for(let y=0,x=Math.min(t.length,200),k=0;y<x&&f<a;){let w=xt(t,y);l<0&&(c<a&&w==e[c]&&(r[c++]=y),d<a&&(w==e[d]||w==i[d]?(d==0&&(p=y),g=y+1,d++):d=0));let $,v=w<255?w>=48&&w<=57||w>=97&&w<=122?2:w>=65&&w<=90?1:0:($=qa(w))!=$.toLowerCase()?1:$!=$.toUpperCase()?2:0;(!y||v==1&&m||k==0&&v!=0)&&(e[f]==w||i[f]==w&&(u=!0)?o[f++]=y:o.length&&(O=!1)),k=v,y+=Gt(w)}return f==a&&o[0]==0&&O?this.result(-100+(u?-200:0),o,t):d==a&&p==0?this.ret(-200-t.length+(g==t.length?0:-100),[0,g]):l>-1?this.ret(-700-t.length,[l,l+this.pattern.length]):d==a?this.ret(-200+-700-t.length,[p,g]):f==a?this.result(-100+(u?-200:0)+-700+(O?0:-1100),o,t):e.length==2?null:this.result((n[0]?-700:0)+-200+-1100,n,t)}result(t,e,i){let n=[],r=0;for(let o of e){let l=o+(this.astral?Gt(xt(i,o)):1);r&&n[r-1]==o?n[r-1]=l:(n[r++]=o,n[r++]=l)}return this.ret(t-i.length,n)}}class Xk{constructor(t){this.pattern=t,this.matched=[],this.score=0,this.folded=t.toLowerCase()}match(t){if(t.length<this.pattern.length)return null;let e=t.slice(0,this.pattern.length),i=e==this.pattern?0:e.toLowerCase()==this.folded?-200:null;return i==null?null:(this.matched=[0,e.length],this.score=i+(t.length==this.pattern.length?0:-100),this)}}const Pt=P.define({combine(s){return Xe(s,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:Lk,filterStrict:!1,compareCompletions:(t,e)=>t.label.localeCompare(e.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(t,e)=>t&&e,closeOnBlur:(t,e)=>t&&e,icons:(t,e)=>t&&e,tooltipClass:(t,e)=>i=>uu(t(i),e(i)),optionClass:(t,e)=>i=>uu(t(i),e(i)),addToOptions:(t,e)=>t.concat(e),filterStrict:(t,e)=>t||e})}});function uu(s,t){return s?t?s+" "+t:s:t}function Lk(s,t,e,i,n,r){let o=s.textDirection==at.RTL,l=o,a=!1,h="top",c,f,u=t.left-n.left,d=n.right-t.right,p=i.right-i.left,g=i.bottom-i.top;if(l&&u<Math.min(p,d)?l=!1:!l&&d<Math.min(p,u)&&(l=!0),p<=(l?u:d))c=Math.max(n.top,Math.min(e.top,n.bottom-g))-t.top,f=Math.min(400,l?u:d);else{a=!0,f=Math.min(400,(o?t.right:n.right-t.left)-30);let y=n.bottom-t.bottom;y>=g||y>t.top?c=e.bottom-t.top:(h="bottom",c=t.bottom-e.top)}let m=(t.bottom-t.top)/r.offsetHeight,O=(t.right-t.left)/r.offsetWidth;return{style:`${h}: ${c/m}px; max-width: ${f/O}px`,class:"cm-completionInfo-"+(a?o?"left-narrow":"right-narrow":l?"left":"right")}}function jk(s){let t=s.addToOptions.slice();return s.icons&&t.push({render(e){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),e.type&&i.classList.add(...e.type.split(/\s+/g).map(n=>"cm-completionIcon-"+n)),i.setAttribute("aria-hidden","true"),i},position:20}),t.push({render(e,i,n,r){let o=document.createElement("span");o.className="cm-completionLabel";let l=e.displayLabel||e.label,a=0;for(let h=0;h<r.length;){let c=r[h++],f=r[h++];c>a&&o.appendChild(document.createTextNode(l.slice(a,c)));let u=o.appendChild(document.createElement("span"));u.appendChild(document.createTextNode(l.slice(c,f))),u.className="cm-completionMatchedText",a=f}return a<l.length&&o.appendChild(document.createTextNode(l.slice(a))),o},position:50},{render(e){if(!e.detail)return null;let i=document.createElement("span");return i.className="cm-completionDetail",i.textContent=e.detail,i},position:80}),t.sort((e,i)=>e.position-i.position).map(e=>e.render)}function Jo(s,t,e){if(s<=e)return{from:0,to:s};if(t<0&&(t=0),t<=s>>1){let n=Math.floor(t/e);return{from:n*e,to:(n+1)*e}}let i=Math.floor((s-t)/e);return{from:s-(i+1)*e,to:s-i*e}}class Vk{constructor(t,e,i){this.view=t,this.stateField=e,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let n=t.state.field(e),{options:r,selected:o}=n.open,l=t.state.facet(Pt);this.optionContent=jk(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=Jo(r.length,o,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(t.state),this.dom.addEventListener("mousedown",a=>{let{options:h}=t.state.field(e).open;for(let c=a.target,f;c&&c!=this.dom;c=c.parentNode)if(c.nodeName=="LI"&&(f=/-(\d+)$/.exec(c.id))&&+f[1]<h.length){this.applyCompletion(t,h[+f[1]]),a.preventDefault();return}}),this.dom.addEventListener("focusout",a=>{let h=t.state.field(this.stateField,!1);h&&h.tooltip&&t.state.facet(Pt).closeOnBlur&&a.relatedTarget!=t.contentDOM&&t.dispatch({effects:Jn.of(null)})}),this.showOptions(r,n.id)}mount(){this.updateSel()}showOptions(t,e){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(t,e,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(t){var e;let i=t.state.field(this.stateField),n=t.startState.field(this.stateField);if(this.updateTooltipClass(t.state),i!=n){let{options:r,selected:o,disabled:l}=i.open;(!n.open||n.open.options!=r)&&(this.range=Jo(r.length,o,t.state.facet(Pt).maxRenderedOptions),this.showOptions(r,i.id)),this.updateSel(),l!=((e=n.open)===null||e===void 0?void 0:e.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(t){let e=this.tooltipClass(t);if(e!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of e.split(" "))i&&this.dom.classList.add(i);this.currentClass=e}}positioned(t){this.space=t,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let t=this.view.state.field(this.stateField),e=t.open;if((e.selected>-1&&e.selected<this.range.from||e.selected>=this.range.to)&&(this.range=Jo(e.options.length,e.selected,this.view.state.facet(Pt).maxRenderedOptions),this.showOptions(e.options,t.id)),this.updateSelectedOption(e.selected)){this.destroyInfo();let{completion:i}=e.options[e.selected],{info:n}=i;if(!n)return;let r=typeof n=="string"?document.createTextNode(n):n(i);if(!r)return;"then"in r?r.then(o=>{o&&this.view.state.field(this.stateField,!1)==t&&this.addInfoPane(o,i)}).catch(o=>ee(this.view.state,o,"completion info")):this.addInfoPane(r,i)}}addInfoPane(t,e){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",t.nodeType!=null)i.appendChild(t),this.infoDestroy=null;else{let{dom:n,destroy:r}=t;i.appendChild(n),this.infoDestroy=r||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(t){let e=null;for(let i=this.list.firstChild,n=this.range.from;i;i=i.nextSibling,n++)i.nodeName!="LI"||!i.id?n--:n==t?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),e=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return e&&Ik(this.list,e),e}measureInfo(){let t=this.dom.querySelector("[aria-selected]");if(!t||!this.info)return null;let e=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),n=t.getBoundingClientRect(),r=this.space;if(!r){let o=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:o.innerWidth,bottom:o.innerHeight}}return n.top>Math.min(r.bottom,e.bottom)-10||n.bottom<Math.max(r.top,e.top)+10?null:this.view.state.facet(Pt).positionInfo(this.view,e,n,i,r,this.dom)}placeInfo(t){this.info&&(t?(t.style&&(this.info.style.cssText=t.style),this.info.className="cm-tooltip cm-completionInfo "+(t.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(t,e,i){const n=document.createElement("ul");n.id=e,n.setAttribute("role","listbox"),n.setAttribute("aria-expanded","true"),n.setAttribute("aria-label",this.view.state.phrase("Completions"));let r=null;for(let o=i.from;o<i.to;o++){let{completion:l,match:a}=t[o],{section:h}=l;if(h){let u=typeof h=="string"?h:h.name;if(u!=r&&(o>i.from||i.from==0))if(r=u,typeof h!="string"&&h.header)n.appendChild(h.header(h));else{let d=n.appendChild(document.createElement("completion-section"));d.textContent=u}}const c=n.appendChild(document.createElement("li"));c.id=e+"-"+o,c.setAttribute("role","option");let f=this.optionClass(l);f&&(c.className=f);for(let u of this.optionContent){let d=u(l,this.view.state,this.view,a);d&&c.appendChild(d)}}return i.from&&n.classList.add("cm-completionListIncompleteTop"),i.to<t.length&&n.classList.add("cm-completionListIncompleteBottom"),n}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function Nk(s,t){return e=>new Vk(e,s,t)}function Ik(s,t){let e=s.getBoundingClientRect(),i=t.getBoundingClientRect(),n=e.height/s.offsetHeight;i.top<e.top?s.scrollTop-=(e.top-i.top)/n:i.bottom>e.bottom&&(s.scrollTop+=(i.bottom-e.bottom)/n)}function du(s){return(s.boost||0)*100+(s.apply?10:0)+(s.info?5:0)+(s.type?1:0)}function qk(s,t){let e=[],i=null,n=h=>{e.push(h);let{section:c}=h.completion;if(c){i||(i=[]);let f=typeof c=="string"?c:c.name;i.some(u=>u.name==f)||i.push(typeof c=="string"?{name:f}:c)}},r=t.facet(Pt);for(let h of s)if(h.hasResult()){let c=h.result.getMatch;if(h.result.filter===!1)for(let f of h.result.options)n(new cu(f,h.source,c?c(f):[],1e9-e.length));else{let f=t.sliceDoc(h.from,h.to),u,d=r.filterStrict?new Xk(f):new Yk(f);for(let p of h.result.options)if(u=d.match(p.label)){let g=p.displayLabel?c?c(p,u.matched):[]:u.matched;n(new cu(p,h.source,g,u.score+(p.boost||0)))}}}if(i){let h=Object.create(null),c=0,f=(u,d)=>{var p,g;return((p=u.rank)!==null&&p!==void 0?p:1e9)-((g=d.rank)!==null&&g!==void 0?g:1e9)||(u.name<d.name?-1:1)};for(let u of i.sort(f))c-=1e5,h[u.name]=c;for(let u of e){let{section:d}=u.completion;d&&(u.score+=h[typeof d=="string"?d:d.name])}}let o=[],l=null,a=r.compareCompletions;for(let h of e.sort((c,f)=>f.score-c.score||a(c.completion,f.completion))){let c=h.completion;!l||l.label!=c.label||l.detail!=c.detail||l.type!=null&&c.type!=null&&l.type!=c.type||l.apply!=c.apply||l.boost!=c.boost?o.push(h):du(h.completion)>du(l)&&(o[o.length-1]=h),l=h.completion}return o}class Xi{constructor(t,e,i,n,r,o){this.options=t,this.attrs=e,this.tooltip=i,this.timestamp=n,this.selected=r,this.disabled=o}setSelected(t,e){return t==this.selected||t>=this.options.length?this:new Xi(this.options,pu(e,t),this.tooltip,this.timestamp,t,this.disabled)}static build(t,e,i,n,r){let o=qk(t,e);if(!o.length)return n&&t.some(a=>a.state==1)?new Xi(n.options,n.attrs,n.tooltip,n.timestamp,n.selected,!0):null;let l=e.facet(Pt).selectOnOpen?0:-1;if(n&&n.selected!=l&&n.selected!=-1){let a=n.options[n.selected].completion;for(let h=0;h<o.length;h++)if(o[h].completion==a){l=h;break}}return new Xi(o,pu(i,l),{pos:t.reduce((a,h)=>h.hasResult()?Math.min(a,h.from):a,1e8),create:Fk,above:r.aboveCursor},n?n.timestamp:Date.now(),l,!1)}map(t){return new Xi(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:t.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class _r{constructor(t,e,i){this.active=t,this.id=e,this.open=i}static start(){return new _r(Gk,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(t){let{state:e}=t,i=e.facet(Pt),r=(i.override||e.languageDataAt("autocomplete",hi(e)).map(Bk)).map(l=>(this.active.find(h=>h.source==l)||new Wt(l,this.active.some(h=>h.state!=0)?1:0)).update(t,i));r.length==this.active.length&&r.every((l,a)=>l==this.active[a])&&(r=this.active);let o=this.open;o&&t.docChanged&&(o=o.map(t.changes)),t.selection||r.some(l=>l.hasResult()&&t.changes.touchesRange(l.from,l.to))||!zk(r,this.active)?o=Xi.build(r,e,this.id,o,i):o&&o.disabled&&!r.some(l=>l.state==1)&&(o=null),!o&&r.every(l=>l.state!=1)&&r.some(l=>l.hasResult())&&(r=r.map(l=>l.hasResult()?new Wt(l.source,0):l));for(let l of t.effects)l.is(Hm)&&(o=o&&o.setSelected(l.value,this.id));return r==this.active&&o==this.open?this:new _r(r,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:_k}}function zk(s,t){if(s==t)return!0;for(let e=0,i=0;;){for(;e<s.length&&!s[e].hasResult;)e++;for(;i<t.length&&!t[i].hasResult;)i++;let n=e==s.length,r=i==t.length;if(n||r)return n==r;if(s[e++].result!=t[i++].result)return!1}}const _k={"aria-autocomplete":"list"};function pu(s,t){let e={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":s};return t>-1&&(e["aria-activedescendant"]=s+"-"+t),e}const Gk=[];function La(s,t){if(s.isUserEvent("input.complete")){let e=s.annotation(_m);if(e&&t.activateOnCompletion(e))return"input"}return s.isUserEvent("input.type")?"input":s.isUserEvent("delete.backward")?"delete":null}class Wt{constructor(t,e,i=-1){this.source=t,this.state=e,this.explicitPos=i}hasResult(){return!1}update(t,e){let i=La(t,e),n=this;i?n=n.handleUserEvent(t,i,e):t.docChanged?n=n.handleChange(t):t.selection&&n.state!=0&&(n=new Wt(n.source,0));for(let r of t.effects)if(r.is(zr))n=new Wt(n.source,1,r.value?hi(t.state):-1);else if(r.is(Jn))n=new Wt(n.source,0);else if(r.is(Gm))for(let o of r.value)o.source==n.source&&(n=o);return n}handleUserEvent(t,e,i){return e=="delete"||!i.activateOnTyping?this.map(t.changes):new Wt(this.source,1)}handleChange(t){return t.changes.touchesRange(hi(t.startState))?new Wt(this.source,0):this.map(t.changes)}map(t){return t.empty||this.explicitPos<0?this:new Wt(this.source,this.state,t.mapPos(this.explicitPos))}}class _i extends Wt{constructor(t,e,i,n,r){super(t,2,e),this.result=i,this.from=n,this.to=r}hasResult(){return!0}handleUserEvent(t,e,i){var n;let r=this.result;r.map&&!t.changes.empty&&(r=r.map(r,t.changes));let o=t.changes.mapPos(this.from),l=t.changes.mapPos(this.to,1),a=hi(t.state);if((this.explicitPos<0?a<=o:a<this.from)||a>l||!r||e=="delete"&&hi(t.startState)==this.from)return new Wt(this.source,e=="input"&&i.activateOnTyping?1:0);let h=this.explicitPos<0?-1:t.changes.mapPos(this.explicitPos);return Hk(r.validFor,t.state,o,l)?new _i(this.source,h,r,o,l):r.update&&(r=r.update(r,o,l,new qm(t.state,a,h>=0)))?new _i(this.source,h,r,r.from,(n=r.to)!==null&&n!==void 0?n:hi(t.state)):new Wt(this.source,1,h)}handleChange(t){return t.changes.touchesRange(this.from,this.to)?new Wt(this.source,0):this.map(t.changes)}map(t){return t.empty?this:(this.result.map?this.result.map(this.result,t):this.result)?new _i(this.source,this.explicitPos<0?-1:t.mapPos(this.explicitPos),this.result,t.mapPos(this.from),t.mapPos(this.to,1)):new Wt(this.source,0)}}function Hk(s,t,e,i){if(!s)return!1;let n=t.sliceDoc(e,i);return typeof s=="function"?s(n,e,i,t):zm(s,!0).test(n)}const Gm=j.define({map(s,t){return s.map(e=>e.map(t))}}),Hm=j.define(),jt=wt.define({create(){return _r.start()},update(s,t){return s.update(t)},provide:s=>[sh.from(s,t=>t.tooltip),X.contentAttributes.from(s,t=>t.attrs)]});function Rh(s,t){const e=t.completion.apply||t.completion.label;let i=s.state.field(jt).active.find(n=>n.source==t.source);return i instanceof _i?(typeof e=="string"?s.dispatch(Object.assign(Object.assign({},Ek(s.state,e,i.from,i.to)),{annotations:_m.of(t.completion)})):e(s,t.completion,i.from,i.to),!0):!1}const Fk=Nk(jt,Rh);function zs(s,t="option"){return e=>{let i=e.state.field(jt,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp<e.state.facet(Pt).interactionDelay)return!1;let n=1,r;t=="page"&&(r=dp(e,i.open.tooltip))&&(n=Math.max(2,Math.floor(r.dom.offsetHeight/r.dom.querySelector("li").offsetHeight)-1));let{length:o}=i.open.options,l=i.open.selected>-1?i.open.selected+n*(s?1:-1):s?0:o-1;return l<0?l=t=="page"?0:o-1:l>=o&&(l=t=="page"?o-1:0),e.dispatch({effects:Hm.of(l)}),!0}}const Uk=s=>{let t=s.state.field(jt,!1);return s.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestamp<s.state.facet(Pt).interactionDelay?!1:Rh(s,t.open.options[t.open.selected])},Kk=s=>s.state.field(jt,!1)?(s.dispatch({effects:zr.of(!0)}),!0):!1,Jk=s=>{let t=s.state.field(jt,!1);return!t||!t.active.some(e=>e.state!=0)?!1:(s.dispatch({effects:Jn.of(null)}),!0)};class tv{constructor(t,e){this.active=t,this.context=e,this.time=Date.now(),this.updates=[],this.done=void 0}}const ev=50,iv=1e3,nv=Tt.fromClass(class{constructor(s){this.view=s,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let t of s.state.field(jt).active)t.state==1&&this.startQuery(t)}update(s){let t=s.state.field(jt),e=s.state.facet(Pt);if(!s.selectionSet&&!s.docChanged&&s.startState.field(jt)==t)return;let i=s.transactions.some(r=>(r.selection||r.docChanged)&&!La(r,e));for(let r=0;r<this.running.length;r++){let o=this.running[r];if(i||o.updates.length+s.transactions.length>ev&&Date.now()-o.time>iv){for(let l of o.context.abortListeners)try{l()}catch(a){ee(this.view.state,a)}o.context.abortListeners=null,this.running.splice(r--,1)}else o.updates.push(...s.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),s.transactions.some(r=>r.effects.some(o=>o.is(zr)))&&(this.pendingStart=!0);let n=this.pendingStart?50:e.activateOnTypingDelay;if(this.debounceUpdate=t.active.some(r=>r.state==1&&!this.running.some(o=>o.active.source==r.source))?setTimeout(()=>this.startUpdate(),n):-1,this.composing!=0)for(let r of s.transactions)La(r,e)=="input"?this.composing=2:this.composing==2&&r.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:s}=this.view,t=s.field(jt);for(let e of t.active)e.state==1&&!this.running.some(i=>i.active.source==e.source)&&this.startQuery(e)}startQuery(s){let{state:t}=this.view,e=hi(t),i=new qm(t,e,s.explicitPos==e),n=new tv(s,i);this.running.push(n),Promise.resolve(s.source(i)).then(r=>{n.context.aborted||(n.done=r||null,this.scheduleAccept())},r=>{this.view.dispatch({effects:Jn.of(null)}),ee(this.view.state,r)})}scheduleAccept(){this.running.every(s=>s.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Pt).updateSyncTime))}accept(){var s;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],e=this.view.state.facet(Pt);for(let i=0;i<this.running.length;i++){let n=this.running[i];if(n.done===void 0)continue;if(this.running.splice(i--,1),n.done){let o=new _i(n.active.source,n.active.explicitPos,n.done,n.done.from,(s=n.done.to)!==null&&s!==void 0?s:hi(n.updates.length?n.updates[0].startState:this.view.state));for(let l of n.updates)o=o.update(l,e);if(o.hasResult()){t.push(o);continue}}let r=this.view.state.field(jt).active.find(o=>o.source==n.active.source);if(r&&r.state==1)if(n.done==null){let o=new Wt(n.active.source,0);for(let l of n.updates)o=o.update(l,e);o.state!=1&&t.push(o)}else this.startQuery(r)}t.length&&this.view.dispatch({effects:Gm.of(t)})}},{eventHandlers:{blur(s){let t=this.view.state.field(jt,!1);if(t&&t.tooltip&&this.view.state.facet(Pt).closeOnBlur){let e=t.open&&dp(this.view,t.open.tooltip);(!e||!e.dom.contains(s.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Jn.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:zr.of(!1)}),20),this.composing=0}}}),sv=typeof navigator=="object"&&/Win/.test(navigator.platform),rv=pe.highest(X.domEventHandlers({keydown(s,t){let e=t.state.field(jt,!1);if(!e||!e.open||e.open.disabled||e.open.selected<0||s.key.length>1||s.ctrlKey&&!(sv&&s.altKey)||s.metaKey)return!1;let i=e.open.options[e.open.selected],n=e.active.find(o=>o.source==i.source),r=i.completion.commitCharacters||n.result.commitCharacters;return r&&r.indexOf(s.key)>-1&&Rh(t,i),!1}})),ov=X.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:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".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:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}}),ts={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},xi=j.define({map(s,t){let e=t.mapPos(s,-1,ut.TrackAfter);return e??void 0}}),Dh=new class extends De{};Dh.startSide=1;Dh.endSide=-1;const Fm=wt.define({create(){return I.empty},update(s,t){if(s=s.map(t.changes),t.selection){let e=t.state.doc.lineAt(t.selection.main.head);s=s.update({filter:i=>i>=e.from&&i<=e.to})}for(let e of t.effects)e.is(xi)&&(s=s.update({add:[Dh.range(e.value,e.value+1)]}));return s}});function lv(){return[hv,Fm]}const tl="()[]{}<>";function Um(s){for(let t=0;t<tl.length;t+=2)if(tl.charCodeAt(t)==s)return tl.charAt(t+1);return qa(s<128?s:s+1)}function Km(s,t){return s.languageDataAt("closeBrackets",t)[0]||ts}const av=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),hv=X.inputHandler.of((s,t,e,i)=>{if((av?s.composing:s.compositionStarted)||s.state.readOnly)return!1;let n=s.state.selection.main;if(i.length>2||i.length==2&&Gt(xt(i,0))==1||t!=n.from||e!=n.to)return!1;let r=uv(s.state,i);return r?(s.dispatch(r),!0):!1}),cv=({state:s,dispatch:t})=>{if(s.readOnly)return!1;let i=Km(s,s.selection.main.head).brackets||ts.brackets,n=null,r=s.changeByRange(o=>{if(o.empty){let l=dv(s.doc,o.head);for(let a of i)if(a==l&&uo(s.doc,o.head)==Um(xt(a,0)))return{changes:{from:o.head-a.length,to:o.head+a.length},range:S.cursor(o.head-a.length)}}return{range:n=o}});return n||t(s.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!n},fv=[{key:"Backspace",run:cv}];function uv(s,t){let e=Km(s,s.selection.main.head),i=e.brackets||ts.brackets;for(let n of i){let r=Um(xt(n,0));if(t==n)return r==n?mv(s,n,i.indexOf(n+n+n)>-1,e):pv(s,n,r,e.before||ts.before);if(t==r&&Jm(s,s.selection.main.from))return gv(s,n,r)}return null}function Jm(s,t){let e=!1;return s.field(Fm).between(0,s.doc.length,i=>{i==t&&(e=!0)}),e}function uo(s,t){let e=s.sliceString(t,t+2);return e.slice(0,Gt(xt(e,0)))}function dv(s,t){let e=s.sliceString(t-2,t);return Gt(xt(e,0))==e.length?e:e.slice(1)}function pv(s,t,e,i){let n=null,r=s.changeByRange(o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:e,from:o.to}],effects:xi.of(o.to+t.length),range:S.range(o.anchor+t.length,o.head+t.length)};let l=uo(s.doc,o.head);return!l||/\s/.test(l)||i.indexOf(l)>-1?{changes:{insert:t+e,from:o.head},effects:xi.of(o.head+t.length),range:S.cursor(o.head+t.length)}:{range:n=o}});return n?null:s.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function gv(s,t,e){let i=null,n=s.changeByRange(r=>r.empty&&uo(s.doc,r.head)==e?{changes:{from:r.head,to:r.head+e.length,insert:e},range:S.cursor(r.head+e.length)}:i={range:r});return i?null:s.update(n,{scrollIntoView:!0,userEvent:"input.type"})}function mv(s,t,e,i){let n=i.stringPrefixes||ts.stringPrefixes,r=null,o=s.changeByRange(l=>{if(!l.empty)return{changes:[{insert:t,from:l.from},{insert:t,from:l.to}],effects:xi.of(l.to+t.length),range:S.range(l.anchor+t.length,l.head+t.length)};let a=l.head,h=uo(s.doc,a),c;if(h==t){if(gu(s,a))return{changes:{insert:t+t,from:a},effects:xi.of(a+t.length),range:S.cursor(a+t.length)};if(Jm(s,a)){let u=e&&s.sliceDoc(a,a+t.length*3)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+u.length,insert:u},range:S.cursor(a+u.length)}}}else{if(e&&s.sliceDoc(a-2*t.length,a)==t+t&&(c=mu(s,a-2*t.length,n))>-1&&gu(s,c))return{changes:{insert:t+t+t+t,from:a},effects:xi.of(a+t.length),range:S.cursor(a+t.length)};if(s.charCategorizer(a)(h)!=rt.Word&&mu(s,a,n)>-1&&!Ov(s,a,t,n))return{changes:{insert:t+t,from:a},effects:xi.of(a+t.length),range:S.cursor(a+t.length)}}return{range:r=l}});return r?null:s.update(o,{scrollIntoView:!0,userEvent:"input.type"})}function gu(s,t){let e=Mt(s).resolveInner(t+1);return e.parent&&e.from==t}function Ov(s,t,e,i){let n=Mt(s).resolveInner(t,-1),r=i.reduce((o,l)=>Math.max(o,l.length),0);for(let o=0;o<5;o++){let l=s.sliceDoc(n.from,Math.min(n.to,n.from+e.length+r)),a=l.indexOf(e);if(!a||a>-1&&i.indexOf(l.slice(0,a))>-1){let c=n.firstChild;for(;c&&c.from==n.from&&c.to-c.from>e.length+a;){if(s.sliceDoc(c.to-e.length,c.to)==e)return!1;c=c.firstChild}return!0}let h=n.to==t&&n.parent;if(!h)break;n=h}return!1}function mu(s,t,e){let i=s.charCategorizer(t);if(i(s.sliceDoc(t-1,t))!=rt.Word)return t;for(let n of e){let r=t-n.length;if(s.sliceDoc(r,t)==n&&i(s.sliceDoc(r-1,r))!=rt.Word)return r}return-1}function bv(s={}){return[rv,jt,Pt.of(s),nv,yv,ov]}const tO=[{key:"Ctrl-Space",run:Kk},{key:"Escape",run:Jk},{key:"ArrowDown",run:zs(!0)},{key:"ArrowUp",run:zs(!1)},{key:"PageDown",run:zs(!0,"page")},{key:"PageUp",run:zs(!1,"page")},{key:"Enter",run:Uk}],yv=pe.highest(is.computeN([Pt],s=>s.facet(Pt).defaultKeymap?[tO]:[]));class wv{constructor(t,e,i){this.from=t,this.to=e,this.diagnostic=i}}class yi{constructor(t,e,i){this.diagnostics=t,this.panel=e,this.selected=i}static init(t,e,i){let n=t,r=i.facet(nO).markerFilter;r&&(n=r(n,i));let o=z.set(n.map(l=>l.from==l.to||l.from==l.to-1&&i.doc.lineAt(l.from).to==l.from?z.widget({widget:new Zv(l),diagnostic:l}).range(l.from):z.mark({attributes:{class:"cm-lintRange cm-lintRange-"+l.severity+(l.markClass?" "+l.markClass:"")},diagnostic:l,inclusive:!0}).range(l.from,l.to)),!0);return new yi(o,e,cn(o))}}function cn(s,t=null,e=0){let i=null;return s.between(e,1e9,(n,r,{spec:o})=>{if(!(t&&o.diagnostic!=t))return i=new wv(n,r,o.diagnostic),!1}),i}function Sv(s,t){let e=s.startState.doc.lineAt(t.pos);return!!(s.effects.some(i=>i.is(eO))||s.changes.touchesRange(e.from,e.to))}function xv(s,t){return s.field(Kt,!1)?t:t.concat(j.appendConfig.of(Mv))}const eO=j.define(),Wh=j.define(),iO=j.define(),Kt=wt.define({create(){return new yi(z.none,null,null)},update(s,t){if(t.docChanged){let e=s.diagnostics.map(t.changes),i=null;if(s.selected){let n=t.changes.mapPos(s.selected.from,1);i=cn(e,s.selected.diagnostic,n)||cn(e,null,n)}s=new yi(e,s.panel,i)}for(let e of t.effects)e.is(eO)?s=yi.init(e.value,s.panel,t.state):e.is(Wh)?s=new yi(s.diagnostics,e.value?po.open:null,s.selected):e.is(iO)&&(s=new yi(s.diagnostics,s.panel,e.value));return s},provide:s=>[Gl.from(s,t=>t.panel),X.decorations.from(s,t=>t.diagnostics)]}),kv=z.mark({class:"cm-lintRange cm-lintRange-active",inclusive:!0});function vv(s,t,e){let{diagnostics:i}=s.state.field(Kt),n=[],r=2e8,o=0;i.between(t-(e<0?1:0),t+(e>0?1:0),(a,h,{spec:c})=>{t>=a&&t<=h&&(a==h||(t>a||e>0)&&(t<h||e<0))&&(n.push(c.diagnostic),r=Math.min(a,r),o=Math.max(h,o))});let l=s.state.facet(nO).tooltipFilter;return l&&(n=l(n,s.state)),n.length?{pos:r,end:o,above:s.state.doc.lineAt(r).to<o,create(){return{dom:$v(s,n)}}}:null}function $v(s,t){return et("ul",{class:"cm-tooltip-lint"},t.map(e=>rO(s,e,!1)))}const Qv=s=>{let t=s.state.field(Kt,!1);(!t||!t.panel)&&s.dispatch({effects:xv(s.state,[Wh.of(!0)])});let e=rb(s,po.open);return e&&e.dom.querySelector(".cm-panel-lint ul").focus(),!0},Ou=s=>{let t=s.state.field(Kt,!1);return!t||!t.panel?!1:(s.dispatch({effects:Wh.of(!1)}),!0)},Pv=s=>{let t=s.state.field(Kt,!1);if(!t)return!1;let e=s.state.selection.main,i=t.diagnostics.iter(e.to+1);return!i.value&&(i=t.diagnostics.iter(0),!i.value||i.from==e.from&&i.to==e.to)?!1:(s.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)},Cv=[{key:"Mod-Shift-m",run:Qv,preventDefault:!0},{key:"F8",run:Pv}],nO=P.define({combine(s){return Object.assign({sources:s.map(t=>t.source).filter(t=>t!=null)},Xe(s.map(t=>t.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(t,e)=>t?e?i=>t(i)||e(i):t:e}))}});function sO(s){let t=[];if(s)t:for(let{name:e}of s){for(let i=0;i<e.length;i++){let n=e[i];if(/[a-zA-Z]/.test(n)&&!t.some(r=>r.toLowerCase()==n.toLowerCase())){t.push(n);continue t}}t.push("")}return t}function rO(s,t,e){var i;let n=e?sO(t.actions):[];return et("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},et("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage():t.message),(i=t.actions)===null||i===void 0?void 0:i.map((r,o)=>{let l=!1,a=u=>{if(u.preventDefault(),l)return;l=!0;let d=cn(s.state.field(Kt).diagnostics,t);d&&r.apply(s,d.from,d.to)},{name:h}=r,c=n[o]?h.indexOf(n[o]):-1,f=c<0?h:[h.slice(0,c),et("u",h.slice(c,c+1)),h.slice(c+1)];return et("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${h}${c<0?"":` (access key "${n[o]})"`}.`},f)}),t.source&&et("div",{class:"cm-diagnosticSource"},t.source))}class Zv extends Le{constructor(t){super(),this.diagnostic=t}eq(t){return t.diagnostic==this.diagnostic}toDOM(){return et("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class bu{constructor(t,e){this.diagnostic=e,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=rO(t,e,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class po{constructor(t){this.view=t,this.items=[];let e=n=>{if(n.keyCode==27)Ou(this.view),this.view.focus();else if(n.keyCode==38||n.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(n.keyCode==40||n.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(n.keyCode==36)this.moveSelection(0);else if(n.keyCode==35)this.moveSelection(this.items.length-1);else if(n.keyCode==13)this.view.focus();else if(n.keyCode>=65&&n.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:r}=this.items[this.selectedIndex],o=sO(r.actions);for(let l=0;l<o.length;l++)if(o[l].toUpperCase().charCodeAt(0)==n.keyCode){let a=cn(this.view.state.field(Kt).diagnostics,r);a&&r.actions[l].apply(t,a.from,a.to)}}else return;n.preventDefault()},i=n=>{for(let r=0;r<this.items.length;r++)this.items[r].dom.contains(n.target)&&this.moveSelection(r)};this.list=et("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:e,onclick:i}),this.dom=et("div",{class:"cm-panel-lint"},this.list,et("button",{type:"button",name:"close","aria-label":this.view.state.phrase("close"),onclick:()=>Ou(this.view)},"×")),this.update()}get selectedIndex(){let t=this.view.state.field(Kt).selected;if(!t)return-1;for(let e=0;e<this.items.length;e++)if(this.items[e].diagnostic==t.diagnostic)return e;return-1}update(){let{diagnostics:t,selected:e}=this.view.state.field(Kt),i=0,n=!1,r=null;for(t.between(0,this.view.state.doc.length,(o,l,{spec:a})=>{let h=-1,c;for(let f=i;f<this.items.length;f++)if(this.items[f].diagnostic==a.diagnostic){h=f;break}h<0?(c=new bu(this.view,a.diagnostic),this.items.splice(i,0,c),n=!0):(c=this.items[h],h>i&&(this.items.splice(i,h-i),n=!0)),e&&c.diagnostic==e.diagnostic?c.dom.hasAttribute("aria-selected")||(c.dom.setAttribute("aria-selected","true"),r=c):c.dom.hasAttribute("aria-selected")&&c.dom.removeAttribute("aria-selected"),i++});i<this.items.length&&!(this.items.length==1&&this.items[0].diagnostic.from<0);)n=!0,this.items.pop();this.items.length==0&&(this.items.push(new bu(this.view,{from:-1,to:-1,severity:"info",message:this.view.state.phrase("No diagnostics")})),n=!0),r?(this.list.setAttribute("aria-activedescendant",r.id),this.view.requestMeasure({key:this,read:()=>({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:o,panel:l})=>{let a=l.height/this.list.offsetHeight;o.top<l.top?this.list.scrollTop-=(l.top-o.top)/a:o.bottom>l.bottom&&(this.list.scrollTop+=(o.bottom-l.bottom)/a)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),n&&this.sync()}sync(){let t=this.list.firstChild;function e(){let i=t;t=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;t!=i.dom;)e();t=i.dom.nextSibling}else this.list.insertBefore(i.dom,t);for(;t;)e()}moveSelection(t){if(this.selectedIndex<0)return;let e=this.view.state.field(Kt),i=cn(e.diagnostics,this.items[t].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:iO.of(i)})}static open(t){return new po(t)}}function Av(s,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" ${t}>${encodeURIComponent(s)}</svg>')`}function _s(s){return Av(`<path d="m0 2.5 l2 -1.5 l1 0 l2 1.5 l1 0" stroke="${s}" fill="none" stroke-width=".7"/>`,'width="6" height="3"')}const Tv=X.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:_s("#d11")},".cm-lintRange-warning":{backgroundImage:_s("orange")},".cm-lintRange-info":{backgroundImage:_s("#999")},".cm-lintRange-hint":{backgroundImage:_s("#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}}}),Mv=[Kt,X.decorations.compute([Kt],s=>{let{selected:t,panel:e}=s.field(Kt);return!t||!e||t.from==t.to?z.none:z.set([kv.range(t.from,t.to)])}),nb(vv,{hideOn:Sv}),Tv];var yu=function(t){t===void 0&&(t={});var{crosshairCursor:e=!1}=t,i=[];t.closeBracketsKeymap!==!1&&(i=i.concat(fv)),t.defaultKeymap!==!1&&(i=i.concat(HS)),t.searchKeymap!==!1&&(i=i.concat(wx)),t.historyKeymap!==!1&&(i=i.concat(sS)),t.foldKeymap!==!1&&(i=i.concat(uk)),t.completionKeymap!==!1&&(i=i.concat(tO)),t.lintKeymap!==!1&&(i=i.concat(Cv));var n=[];return t.lineNumbers!==!1&&n.push(db()),t.highlightActiveLineGutter!==!1&&n.push(mb()),t.highlightSpecialChars!==!1&&n.push(M1()),t.history!==!1&&n.push(Hw()),t.foldGutter!==!1&&n.push(mk()),t.drawSelection!==!1&&n.push(S1()),t.dropCursor!==!1&&n.push(Q1()),t.allowMultipleSelections!==!1&&n.push(V.allowMultipleSelections.of(!0)),t.indentOnInput!==!1&&n.push(ik()),t.syntaxHighlighting!==!1&&n.push(jm(wk,{fallback:!0})),t.bracketMatching!==!1&&n.push(Pk()),t.closeBrackets!==!1&&n.push(lv()),t.autocompletion!==!1&&n.push(bv()),t.rectangularSelection!==!1&&n.push(z1()),e!==!1&&n.push(H1()),t.highlightActiveLine!==!1&&n.push(Y1()),t.highlightSelectionMatches!==!1&&n.push(ex()),t.tabSize&&typeof t.tabSize=="number"&&n.push(co.of(" ".repeat(t.tabSize))),n.concat([is.of(i.flat())]).filter(Boolean)};const Rv="#e5c07b",wu="#e06c75",Dv="#56b6c2",Wv="#ffffff",pr="#abb2bf",ja="#7d8799",Ev="#61afef",Bv="#98c379",Su="#d19a66",Yv="#c678dd",Xv="#21252b",xu="#2c313a",ku="#282c34",el="#353a42",Lv="#3E4451",vu="#528bff",jv=L.theme({"&":{color:pr,backgroundColor:ku},".cm-content":{caretColor:vu},".cm-cursor, .cm-dropCursor":{borderLeftColor:vu},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:Lv},".cm-panels":{backgroundColor:Xv,color:pr},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:ku,color:ja,border:"none"},".cm-activeLineGutter":{backgroundColor:xu},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:el},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:el,borderBottomColor:el},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:xu,color:pr}}},{dark:!0}),Vv=bh.define([{tag:Q.keyword,color:Yv},{tag:[Q.name,Q.deleted,Q.character,Q.propertyName,Q.macroName],color:wu},{tag:[Q.function(Q.variableName),Q.labelName],color:Ev},{tag:[Q.color,Q.constant(Q.name),Q.standard(Q.name)],color:Su},{tag:[Q.definition(Q.name),Q.separator],color:pr},{tag:[Q.typeName,Q.className,Q.number,Q.changed,Q.annotation,Q.modifier,Q.self,Q.namespace],color:Rv},{tag:[Q.operator,Q.operatorKeyword,Q.url,Q.escape,Q.regexp,Q.link,Q.special(Q.string)],color:Dv},{tag:[Q.meta,Q.comment],color:ja},{tag:Q.strong,fontWeight:"bold"},{tag:Q.emphasis,fontStyle:"italic"},{tag:Q.strikethrough,textDecoration:"line-through"},{tag:Q.link,color:ja,textDecoration:"underline"},{tag:Q.heading,fontWeight:"bold",color:wu},{tag:[Q.atom,Q.bool,Q.special(Q.variableName)],color:Su},{tag:[Q.processingInstruction,Q.string,Q.inserted],color:Bv},{tag:Q.invalid,color:Wv}]),Nv=[jv,Zw(Vv)];var Iv=X.theme({"&":{backgroundColor:"#fff"}},{dark:!1}),qv=function(t){t===void 0&&(t={});var{indentWithTab:e=!0,editable:i=!0,readOnly:n=!1,theme:r="light",placeholder:o="",basicSetup:l=!0}=t,a=[];switch(e&&a.unshift(is.of([FS])),l&&(typeof l=="boolean"?a.unshift(yu()):a.unshift(yu(l))),o&&a.unshift(V1(o)),r){case"light":a.push(Iv);break;case"dark":a.push(Nv);break;case"none":break;default:a.push(r);break}return i===!1&&a.push(X.editable.of(!1)),n&&a.push(V.readOnly.of(!0)),[...a]},zv=s=>({line:s.state.doc.lineAt(s.state.selection.main.from),lineCount:s.state.doc.lines,lineBreak:s.state.lineBreak,length:s.state.doc.length,readOnly:s.state.readOnly,tabSize:s.state.tabSize,selection:s.state.selection,selectionAsSingle:s.state.selection.asSingle().main,ranges:s.state.selection.ranges,selectionCode:s.state.sliceDoc(s.state.selection.main.from,s.state.selection.main.to),selections:s.state.selection.ranges.map(t=>s.state.sliceDoc(t.from,t.to)),selectedText:s.state.selection.ranges.some(t=>!t.empty)}),$u=se.define(),_v=[];function Gv(s){var{value:t,selection:e,onChange:i,onStatistics:n,onCreateEditor:r,onUpdate:o,extensions:l=_v,autoFocus:a,theme:h="light",height:c=null,minHeight:f=null,maxHeight:u=null,width:d=null,minWidth:p=null,maxWidth:g=null,placeholder:m="",editable:O=!0,readOnly:y=!1,indentWithTab:x=!0,basicSetup:k=!0,root:w,initialState:$}=s,[v,R]=Jt.useState(),[Z,D]=Jt.useState(),[A,C]=Jt.useState(),Y=X.theme({"&":{height:c,minHeight:f,maxHeight:u,width:d,minWidth:p,maxWidth:g},"& .cm-scroller":{height:"100% !important"}}),B=X.updateListener.of(H=>{if(H.docChanged&&typeof i=="function"&&!H.transactions.some(lt=>lt.annotation($u))){var ot=H.state.doc,it=ot.toString();i(it,H)}n&&n(zv(H))}),N=qv({theme:h,editable:O,readOnly:y,placeholder:m,indentWithTab:x,basicSetup:k}),U=[B,Y,...N];return o&&typeof o=="function"&&U.push(X.updateListener.of(o)),U=U.concat(l),Jt.useEffect(()=>{if(v&&!A){var H={doc:t,selection:e,extensions:U},ot=$?V.fromJSON($.json,H,$.fields):V.create(H);if(C(ot),!Z){var it=new X({state:ot,parent:v,root:w});D(it),r&&r(it,ot)}}return()=>{Z&&(C(void 0),D(void 0))}},[v,A]),Jt.useEffect(()=>R(s.container),[s.container]),Jt.useEffect(()=>()=>{Z&&(Z.destroy(),D(void 0))},[Z]),Jt.useEffect(()=>{a&&Z&&Z.focus()},[a,Z]),Jt.useEffect(()=>{Z&&Z.dispatch({effects:j.reconfigure.of(U)})},[h,l,c,f,u,d,p,g,m,O,y,x,k,i,o]),Jt.useEffect(()=>{if(t!==void 0){var H=Z?Z.state.doc.toString():"";Z&&t!==H&&Z.dispatch({changes:{from:0,to:H.length,insert:t||""},annotations:[$u.of(!0)]})}},[t,Z]),{state:A,setState:C,view:Z,setView:D,container:v,setContainer:R}}var Hv=["className","value","selection","extensions","onChange","onStatistics","onCreateEditor","onUpdate","autoFocus","theme","height","minHeight","maxHeight","width","minWidth","maxWidth","basicSetup","placeholder","indentWithTab","editable","readOnly","root","initialState"],oO=Jt.forwardRef((s,t)=>{var{className:e,value:i="",selection:n,extensions:r=[],onChange:o,onStatistics:l,onCreateEditor:a,onUpdate:h,autoFocus:c,theme:f="light",height:u,minHeight:d,maxHeight:p,width:g,minWidth:m,maxWidth:O,basicSetup:y,placeholder:x,indentWithTab:k,editable:w,readOnly:$,root:v,initialState:R}=s,Z=yO(s,Hv),D=Jt.useRef(null),{state:A,view:C,container:Y}=Gv({container:D.current,root:v,value:i,autoFocus:c,theme:f,height:u,minHeight:d,maxHeight:p,width:g,minWidth:m,maxWidth:O,basicSetup:y,placeholder:x,indentWithTab:k,editable:w,readOnly:$,selection:n,onChange:o,onStatistics:l,onCreateEditor:a,onUpdate:h,extensions:r,initialState:R});if(Jt.useImperativeHandle(t,()=>({editor:D.current,state:A,view:C}),[D,Y,A,C]),typeof i!="string")throw new Error("value must be typeof string but got "+typeof i);var B=typeof f=="string"?"cm-theme-"+f:"cm-theme";return Yu.jsx("div",wO({ref:D,className:""+B+(e?" "+e:"")},Z))});oO.displayName="CodeMirror";const Fv=oO;class Gr{constructor(t,e,i,n,r,o,l,a,h,c=0,f){this.p=t,this.stack=e,this.state=i,this.reducePos=n,this.pos=r,this.score=o,this.buffer=l,this.bufferBase=a,this.curContext=h,this.lookAhead=c,this.parent=f}toString(){return`[${this.stack.filter((t,e)=>e%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(t,e,i=0){let n=t.parser.context;return new Gr(t,[],e,i,i,0,[],0,n?new Qu(n,n.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(t,e){this.stack.push(this.state,e,this.bufferBase+this.buffer.length),this.state=t}reduce(t){var e;let i=t>>19,n=t&65535,{parser:r}=this.p,o=r.dynamicPrecedence(n);if(o&&(this.score+=o),i==0){this.pushState(r.getGoto(this.state,n,!0),this.reducePos),n<r.minRepeatTerm&&this.storeNode(n,this.reducePos,this.reducePos,4,!0),this.reduceContext(n,this.reducePos);return}let l=this.stack.length-(i-1)*3-(t&262144?6:0),a=l?this.stack[l-2]:this.p.ranges[0].from,h=this.reducePos-a;h>=2e3&&!(!((e=this.p.parser.nodeSet.types[n])===null||e===void 0)&&e.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSize<h&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=a,this.p.lastBigReductionSize=h));let c=l?this.stack[l-1]:0,f=this.bufferBase+this.buffer.length-c;if(n<r.minRepeatTerm||t&131072){let u=r.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(n,a,u,f+4,!0)}if(t&262144)this.state=this.stack[l];else{let u=this.stack[l-3];this.state=r.getGoto(u,n,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(n,a)}storeNode(t,e,i,n=4,r=!1){if(t==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this,l=this.buffer.length;if(l==0&&o.parent&&(l=o.bufferBase-o.parent.bufferBase,o=o.parent),l>0&&o.buffer[l-4]==0&&o.buffer[l-1]>-1){if(e==i)return;if(o.buffer[l-2]>=e){o.buffer[l-2]=i;return}}}if(!r||this.pos==i)this.buffer.push(t,e,i,n);else{let o=this.buffer.length;if(o>0&&this.buffer[o-4]!=0)for(;o>0&&this.buffer[o-2]>i;)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,n>4&&(n-=4);this.buffer[o]=t,this.buffer[o+1]=e,this.buffer[o+2]=i,this.buffer[o+3]=n}}shift(t,e,i,n){if(t&131072)this.pushState(t&65535,this.pos);else if(t&262144)this.pos=n,this.shiftContext(e,i),e<=this.p.parser.maxNode&&this.buffer.push(e,i,n,4);else{let r=t,{parser:o}=this.p;(n>this.pos||e<=o.maxNode)&&(this.pos=n,o.stateFlag(r,1)||(this.reducePos=n)),this.pushState(r,i),this.shiftContext(e,i),e<=o.maxNode&&this.buffer.push(e,i,n,4)}}apply(t,e,i,n){t&65536?this.reduce(t):this.shift(t,e,i,n)}useNode(t,e){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=t)&&(this.p.reused.push(t),i++);let n=this.pos;this.reducePos=this.pos=n+t.length,this.pushState(e,n),this.buffer.push(i,n,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,t,this,this.p.stream.reset(this.pos-t.length)))}split(){let t=this,e=t.buffer.length;for(;e>0&&t.buffer[e-2]>t.reducePos;)e-=4;let i=t.buffer.slice(e),n=t.bufferBase+e;for(;t&&n==t.bufferBase;)t=t.parent;return new Gr(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,n,this.curContext,this.lookAhead,t)}recoverByDelete(t,e){let i=t<=this.p.parser.maxNode;i&&this.storeNode(t,this.pos,e,4),this.storeNode(0,this.pos,e,i?8:4),this.pos=this.reducePos=e,this.score-=190}canShift(t){for(let e=new Uv(this);;){let i=this.p.parser.stateSlot(e.state,4)||this.p.parser.hasAction(e.state,t);if(i==0)return!1;if(!(i&65536))return!0;e.reduce(i)}}recoverByInsert(t){if(this.stack.length>=300)return[];let e=this.p.parser.nextStates(this.state);if(e.length>8||this.stack.length>=120){let n=[];for(let r=0,o;r<e.length;r+=2)(o=e[r+1])!=this.state&&this.p.parser.hasAction(o,t)&&n.push(e[r],o);if(this.stack.length<120)for(let r=0;n.length<8&&r<e.length;r+=2){let o=e[r+1];n.some((l,a)=>a&1&&l==o)||n.push(e[r],o)}e=n}let i=[];for(let n=0;n<e.length&&i.length<4;n+=2){let r=e[n+1];if(r==this.state)continue;let o=this.split();o.pushState(r,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(e[n],this.pos),o.reducePos=this.pos,o.score-=200,i.push(o)}return i}forceReduce(){let{parser:t}=this.p,e=t.stateSlot(this.state,5);if(!(e&65536))return!1;if(!t.validAction(this.state,e)){let i=e>>19,n=e&65535,r=this.stack.length-i*3;if(r<0||t.getGoto(this.stack[r],n,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;e=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(e),!0}findForcedReduction(){let{parser:t}=this.p,e=[],i=(n,r)=>{if(!e.includes(n))return e.push(n),t.allActions(n,o=>{if(!(o&393216))if(o&65536){let l=(o>>19)-r;if(l>1){let a=o&65535,h=this.stack.length-l*3;if(h>=0&&t.getGoto(this.stack[h],a,!1)>=0)return l<<19|65536|a}}else{let l=i(o,r+1);if(l!=null)return l}})};return i(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:t}=this.p;return t.data[t.stateSlot(this.state,1)]==65535&&!t.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(t){if(this.state!=t.state||this.stack.length!=t.stack.length)return!1;for(let e=0;e<this.stack.length;e+=3)if(this.stack[e]!=t.stack[e])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(t){return this.p.parser.dialect.flags[t]}shiftContext(t,e){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,t,this,this.p.stream.reset(e)))}reduceContext(t,e){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,t,this,this.p.stream.reset(e)))}emitContext(){let t=this.buffer.length-1;(t<0||this.buffer[t]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let t=this.buffer.length-1;(t<0||this.buffer[t]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(t){if(t!=this.curContext.context){let e=new Qu(this.curContext.tracker,t);e.hash!=this.curContext.hash&&this.emitContext(),this.curContext=e}}setLookAhead(t){t>this.lookAhead&&(this.emitLookAhead(),this.lookAhead=t)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class Qu{constructor(t,e){this.tracker=t,this.context=e,this.hash=t.strict?t.hash(e):0}}class Uv{constructor(t){this.start=t,this.state=t.state,this.stack=t.stack,this.base=this.stack.length}reduce(t){let e=t&65535,i=t>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let n=this.start.p.parser.getGoto(this.stack[this.base-3],e,!0);this.state=n}}class Hr{constructor(t,e,i){this.stack=t,this.pos=e,this.index=i,this.buffer=t.buffer,this.index==0&&this.maybeNext()}static create(t,e=t.bufferBase+t.buffer.length){return new Hr(t,e,e-t.bufferBase)}maybeNext(){let t=this.stack.parent;t!=null&&(this.index=this.stack.bufferBase-t.bufferBase,this.stack=t,this.buffer=t.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new Hr(this.stack,this.pos,this.index)}}function Wn(s,t=Uint16Array){if(typeof s!="string")return s;let e=null;for(let i=0,n=0;i<s.length;){let r=0;for(;;){let o=s.charCodeAt(i++),l=!1;if(o==126){r=65535;break}o>=92&&o--,o>=34&&o--;let a=o-32;if(a>=46&&(a-=46,l=!0),r+=a,l)break;r*=46}e?e[n++]=r:e=new t(r)}return e}class gr{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const Pu=new gr;class Kv{constructor(t,e){this.input=t,this.ranges=e,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=Pu,this.rangeIndex=0,this.pos=this.chunkPos=e[0].from,this.range=e[0],this.end=e[e.length-1].to,this.readNext()}resolveOffset(t,e){let i=this.range,n=this.rangeIndex,r=this.pos+t;for(;r<i.from;){if(!n)return null;let o=this.ranges[--n];r-=i.from-o.to,i=o}for(;e<0?r>i.to:r>=i.to;){if(n==this.ranges.length-1)return null;let o=this.ranges[++n];r+=o.from-i.to,i=o}return r}clipPos(t){if(t>=this.range.from&&t<this.range.to)return t;for(let e of this.ranges)if(e.to>t)return Math.max(t,e.from);return this.end}peek(t){let e=this.chunkOff+t,i,n;if(e>=0&&e<this.chunk.length)i=this.pos+t,n=this.chunk.charCodeAt(e);else{let r=this.resolveOffset(t,1);if(r==null)return-1;if(i=r,i>=this.chunk2Pos&&i<this.chunk2Pos+this.chunk2.length)n=this.chunk2.charCodeAt(i-this.chunk2Pos);else{let o=this.rangeIndex,l=this.range;for(;l.to<=i;)l=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=i),i+this.chunk2.length>l.to&&(this.chunk2=this.chunk2.slice(0,l.to-i)),n=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),n}acceptToken(t,e=0){let i=e?this.resolveOffset(e,-1):this.pos;if(i==null||i<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=t,this.token.end=i}acceptTokenTo(t,e){this.token.value=t,this.token.end=e}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:t,chunkPos:e}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=t,this.chunk2Pos=e,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let t=this.input.chunk(this.pos),e=this.pos+t.length;this.chunk=e>this.range.to?t.slice(0,this.range.to-this.pos):t,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(t=1){for(this.chunkOff+=t;this.pos+t>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();t-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=t,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(t,e){if(e?(this.token=e,e.start=t,e.lookAhead=t+1,e.value=e.extended=-1):this.token=Pu,this.pos!=t){if(this.pos=t,t==this.end)return this.setDone(),this;for(;t<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;t>=this.range.to;)this.range=this.ranges[++this.rangeIndex];t>=this.chunkPos&&t<this.chunkPos+this.chunk.length?this.chunkOff=t-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(t,e){if(t>=this.chunkPos&&e<=this.chunkPos+this.chunk.length)return this.chunk.slice(t-this.chunkPos,e-this.chunkPos);if(t>=this.chunk2Pos&&e<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(t-this.chunk2Pos,e-this.chunk2Pos);if(t>=this.range.from&&e<=this.range.to)return this.input.read(t,e);let i="";for(let n of this.ranges){if(n.from>=e)break;n.to>t&&(i+=this.input.read(Math.max(n.from,t),Math.min(n.to,e)))}return i}}class Gi{constructor(t,e){this.data=t,this.id=e}token(t,e){let{parser:i}=e.p;lO(this.data,t,e,this.id,i.data,i.tokenPrecTable)}}Gi.prototype.contextual=Gi.prototype.fallback=Gi.prototype.extend=!1;class Va{constructor(t,e,i){this.precTable=e,this.elseToken=i,this.data=typeof t=="string"?Wn(t):t}token(t,e){let i=t.pos,n=0;for(;;){let r=t.next<0,o=t.resolveOffset(1,1);if(lO(this.data,t,e,0,this.data,this.precTable),t.token.value>-1)break;if(this.elseToken==null)return;if(r||n++,o==null)break;t.reset(o,t.token)}n&&(t.reset(i,t.token),t.acceptToken(this.elseToken,n))}}Va.prototype.contextual=Gi.prototype.fallback=Gi.prototype.extend=!1;class go{constructor(t,e={}){this.token=t,this.contextual=!!e.contextual,this.fallback=!!e.fallback,this.extend=!!e.extend}}function lO(s,t,e,i,n,r){let o=0,l=1<<i,{dialect:a}=e.p.parser;t:for(;l&s[o];){let h=s[o+1];for(let d=o+3;d<h;d+=2)if((s[d+1]&l)>0){let p=s[d];if(a.allows(p)&&(t.token.value==-1||t.token.value==p||Jv(p,t.token.value,n,r))){t.acceptToken(p);break}}let c=t.next,f=0,u=s[o+2];if(t.next<0&&u>f&&s[h+u*3-3]==65535){o=s[h+u*3-1];continue t}for(;f<u;){let d=f+u>>1,p=h+d+(d<<1),g=s[p],m=s[p+1]||65536;if(c<g)u=d;else if(c>=m)f=d+1;else{o=s[p+2],t.advance();continue t}}break}}function Cu(s,t,e){for(let i=t,n;(n=s[i])!=65535;i++)if(n==e)return i-t;return-1}function Jv(s,t,e,i){let n=Cu(e,i,t);return n<0||Cu(e,i,s)<n}const zt=typeof process<"u"&&process.env&&/\bparse\b/.test({}.LOG);let il=null;function Zu(s,t,e){let i=s.cursor(yt.IncludeAnonymous);for(i.moveTo(t);;)if(!(e<0?i.childBefore(t):i.childAfter(t)))for(;;){if((e<0?i.to<t:i.from>t)&&!i.type.isError)return e<0?Math.max(0,Math.min(i.to-1,t-25)):Math.min(s.length,Math.max(i.from+1,t+25));if(e<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return e<0?0:s.length}}class t${constructor(t,e){this.fragments=t,this.nodeSet=e,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let t=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(t){for(this.safeFrom=t.openStart?Zu(t.tree,t.from+t.offset,1)-t.offset:t.from,this.safeTo=t.openEnd?Zu(t.tree,t.to+t.offset,-1)-t.offset:t.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(t.tree),this.start.push(-t.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(t){if(t<this.nextStart)return null;for(;this.fragment&&this.safeTo<=t;)this.nextFragment();if(!this.fragment)return null;for(;;){let e=this.trees.length-1;if(e<0)return this.nextFragment(),null;let i=this.trees[e],n=this.index[e];if(n==i.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let r=i.children[n],o=this.start[e]+i.positions[n];if(o>t)return this.nextStart=o,null;if(r instanceof bt){if(o==t){if(o<this.safeFrom)return null;let l=o+r.length;if(l<=this.safeTo){let a=r.prop(_.lookAhead);if(!a||l+a<this.fragment.to)return r}}this.index[e]++,o+r.length>=Math.max(this.safeFrom,t)&&(this.trees.push(r),this.start.push(o),this.index.push(0))}else this.index[e]++,this.nextStart=o+r.length}}}class e${constructor(t,e){this.stream=e,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=t.tokenizers.map(i=>new gr)}getActions(t){let e=0,i=null,{parser:n}=t.p,{tokenizers:r}=n,o=n.stateSlot(t.state,3),l=t.curContext?t.curContext.hash:0,a=0;for(let h=0;h<r.length;h++){if(!(1<<h&o))continue;let c=r[h],f=this.tokens[h];if(!(i&&!c.fallback)&&((c.contextual||f.start!=t.pos||f.mask!=o||f.context!=l)&&(this.updateCachedToken(f,c,t),f.mask=o,f.context=l),f.lookAhead>f.end+25&&(a=Math.max(f.lookAhead,a)),f.value!=0)){let u=e;if(f.extended>-1&&(e=this.addActions(t,f.extended,f.end,e)),e=this.addActions(t,f.value,f.end,e),!c.extend&&(i=f,e>u))break}}for(;this.actions.length>e;)this.actions.pop();return a&&t.setLookAhead(a),!i&&t.pos==this.stream.end&&(i=new gr,i.value=t.p.parser.eofTerm,i.start=i.end=t.pos,e=this.addActions(t,i.value,i.end,e)),this.mainToken=i,this.actions}getMainToken(t){if(this.mainToken)return this.mainToken;let e=new gr,{pos:i,p:n}=t;return e.start=i,e.end=Math.min(i+1,n.stream.end),e.value=i==n.stream.end?n.parser.eofTerm:0,e}updateCachedToken(t,e,i){let n=this.stream.clipPos(i.pos);if(e.token(this.stream.reset(n,t),i),t.value>-1){let{parser:r}=i.p;for(let o=0;o<r.specialized.length;o++)if(r.specialized[o]==t.value){let l=r.specializers[o](this.stream.read(t.start,t.end),i);if(l>=0&&i.p.parser.dialect.allows(l>>1)){l&1?t.extended=l>>1:t.value=l>>1;break}}}else t.value=0,t.end=this.stream.clipPos(n+1)}putAction(t,e,i,n){for(let r=0;r<n;r+=3)if(this.actions[r]==t)return n;return this.actions[n++]=t,this.actions[n++]=e,this.actions[n++]=i,n}addActions(t,e,i,n){let{state:r}=t,{parser:o}=t.p,{data:l}=o;for(let a=0;a<2;a++)for(let h=o.stateSlot(r,a?2:1);;h+=3){if(l[h]==65535)if(l[h+1]==1)h=Ne(l,h+2);else{n==0&&l[h+1]==2&&(n=this.putAction(Ne(l,h+2),e,i,n));break}l[h]==e&&(n=this.putAction(Ne(l,h+1),e,i,n))}return n}}class i${constructor(t,e,i,n){this.parser=t,this.input=e,this.ranges=n,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new Kv(e,n),this.tokens=new e$(t,this.stream),this.topTerm=t.top[1];let{from:r}=n[0];this.stacks=[Gr.start(this,t.top[0],r)],this.fragments=i.length&&this.stream.end-r>t.bufferLength*4?new t$(i,t.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let t=this.stacks,e=this.minStackPos,i=this.stacks=[],n,r;if(this.bigReductionCount>300&&t.length==1){let[o]=t;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<t.length;o++){let l=t[o];for(;;){if(this.tokens.mainToken=null,l.pos>e)i.push(l);else{if(this.advanceStack(l,i,t))continue;{n||(n=[],r=[]),n.push(l);let a=this.tokens.getMainToken(l);r.push(a.value,a.end)}}break}}if(!i.length){let o=n&&r$(n);if(o)return zt&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw zt&&n&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+e);this.recovering||(this.recovering=5)}if(this.recovering&&n){let o=this.stoppedAt!=null&&n[0].pos>this.stoppedAt?n[0]:this.runRecovery(n,r,i);if(o)return zt&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(i.length>o)for(i.sort((l,a)=>a.score-l.score);i.length>o;)i.pop();i.some(l=>l.reducePos>e)&&this.recovering--}else if(i.length>1){t:for(let o=0;o<i.length-1;o++){let l=i[o];for(let a=o+1;a<i.length;a++){let h=i[a];if(l.sameState(h)||l.buffer.length>500&&h.buffer.length>500)if((l.score-h.score||l.buffer.length-h.buffer.length)>0)i.splice(a--,1);else{i.splice(o--,1);continue t}}}i.length>12&&i.splice(12,i.length-12)}this.minStackPos=i[0].pos;for(let o=1;o<i.length;o++)i[o].pos<this.minStackPos&&(this.minStackPos=i[o].pos);return null}stopAt(t){if(this.stoppedAt!=null&&this.stoppedAt<t)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=t}advanceStack(t,e,i){let n=t.pos,{parser:r}=this,o=zt?this.stackID(t)+" -> ":"";if(this.stoppedAt!=null&&n>this.stoppedAt)return t.forceReduce()?t:null;if(this.fragments){let h=t.curContext&&t.curContext.tracker.strict,c=h?t.curContext.hash:0;for(let f=this.fragments.nodeAt(n);f;){let u=this.parser.nodeSet.types[f.type.id]==f.type?r.getGoto(t.state,f.type.id):-1;if(u>-1&&f.length&&(!h||(f.prop(_.contextHash)||0)==c))return t.useNode(f,u),zt&&console.log(o+this.stackID(t)+` (via reuse of ${r.getName(f.type.id)})`),!0;if(!(f instanceof bt)||f.children.length==0||f.positions[0]>0)break;let d=f.children[0];if(d instanceof bt&&f.positions[0]==0)f=d;else break}}let l=r.stateSlot(t.state,4);if(l>0)return t.reduce(l),zt&&console.log(o+this.stackID(t)+` (via always-reduce ${r.getName(l&65535)})`),!0;if(t.stack.length>=8400)for(;t.stack.length>6e3&&t.forceReduce(););let a=this.tokens.getActions(t);for(let h=0;h<a.length;){let c=a[h++],f=a[h++],u=a[h++],d=h==a.length||!i,p=d?t:t.split(),g=this.tokens.mainToken;if(p.apply(c,f,g?g.start:p.pos,u),zt&&console.log(o+this.stackID(p)+` (via ${c&65536?`reduce of ${r.getName(c&65535)}`:"shift"} for ${r.getName(f)} @ ${n}${p==t?"":", split"})`),d)return!0;p.pos>n?e.push(p):i.push(p)}return!1}advanceFully(t,e){let i=t.pos;for(;;){if(!this.advanceStack(t,null,null))return!1;if(t.pos>i)return Au(t,e),!0}}runRecovery(t,e,i){let n=null,r=!1;for(let o=0;o<t.length;o++){let l=t[o],a=e[o<<1],h=e[(o<<1)+1],c=zt?this.stackID(l)+" -> ":"";if(l.deadEnd&&(r||(r=!0,l.restart(),zt&&console.log(c+this.stackID(l)+" (restarted)"),this.advanceFully(l,i))))continue;let f=l.split(),u=c;for(let d=0;f.forceReduce()&&d<10&&(zt&&console.log(u+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,i));d++)zt&&(u=this.stackID(f)+" -> ");for(let d of l.recoverByInsert(a))zt&&console.log(c+this.stackID(d)+" (via recover-insert)"),this.advanceFully(d,i);this.stream.end>l.pos?(h==l.pos&&(h++,a=0),l.recoverByDelete(a,h),zt&&console.log(c+this.stackID(l)+` (via recover-delete ${this.parser.getName(a)})`),Au(l,i)):(!n||n.score<l.score)&&(n=l)}return n}stackToTree(t){return t.close(),bt.build({buffer:Hr.create(t),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:t.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(t){let e=(il||(il=new WeakMap)).get(t);return e||il.set(t,e=String.fromCodePoint(this.nextStackID++)),e+t}}function Au(s,t){for(let e=0;e<t.length;e++){let i=t[e];if(i.pos==s.pos&&i.sameState(s)){t[e].score<s.score&&(t[e]=s);return}}t.push(s)}class n${constructor(t,e,i){this.source=t,this.flags=e,this.disabled=i}allows(t){return!this.disabled||this.disabled[t]==0}}const nl=s=>s;class s${constructor(t){this.start=t.start,this.shift=t.shift||nl,this.reduce=t.reduce||nl,this.reuse=t.reuse||nl,this.hash=t.hash||(()=>0),this.strict=t.strict!==!1}}class Fr extends km{constructor(t){if(super(),this.wrappers=[],t.version!=14)throw new RangeError(`Parser version (${t.version}) doesn't match runtime version (14)`);let e=t.nodeNames.split(" ");this.minRepeatTerm=e.length;for(let l=0;l<t.repeatNodeCount;l++)e.push("");let i=Object.keys(t.topRules).map(l=>t.topRules[l][1]),n=[];for(let l=0;l<e.length;l++)n.push([]);function r(l,a,h){n[l].push([a,a.deserialize(String(h))])}if(t.nodeProps)for(let l of t.nodeProps){let a=l[0];typeof a=="string"&&(a=_[a]);for(let h=1;h<l.length;){let c=l[h++];if(c>=0)r(c,a,l[h++]);else{let f=l[h+-c];for(let u=-c;u>0;u--)r(l[h++],a,f);h++}}}this.nodeSet=new Qh(e.map((l,a)=>It.define({name:a>=this.minRepeatTerm?void 0:l,id:a,props:n[a],top:i.indexOf(a)>-1,error:a==0,skipped:t.skippedNodes&&t.skippedNodes.indexOf(a)>-1}))),t.propSources&&(this.nodeSet=this.nodeSet.extend(...t.propSources)),this.strict=!1,this.bufferLength=ym;let o=Wn(t.tokenData);this.context=t.context,this.specializerSpecs=t.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l<this.specializerSpecs.length;l++)this.specialized[l]=this.specializerSpecs[l].term;this.specializers=this.specializerSpecs.map(Tu),this.states=Wn(t.states,Uint32Array),this.data=Wn(t.stateData),this.goto=Wn(t.goto),this.maxTerm=t.maxTerm,this.tokenizers=t.tokenizers.map(l=>typeof l=="number"?new Gi(o,l):l),this.topRules=t.topRules,this.dialects=t.dialects||{},this.dynamicPrecedences=t.dynamicPrecedences||null,this.tokenPrecTable=t.tokenPrec,this.termNames=t.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(t,e,i){let n=new i$(this,t,e,i);for(let r of this.wrappers)n=r(n,t,e,i);return n}getGoto(t,e,i=!1){let n=this.goto;if(e>=n[0])return-1;for(let r=n[e+1];;){let o=n[r++],l=o&1,a=n[r++];if(l&&i)return a;for(let h=r+(o>>1);r<h;r++)if(n[r]==t)return a;if(l)return-1}}hasAction(t,e){let i=this.data;for(let n=0;n<2;n++)for(let r=this.stateSlot(t,n?2:1),o;;r+=3){if((o=i[r])==65535)if(i[r+1]==1)o=i[r=Ne(i,r+2)];else{if(i[r+1]==2)return Ne(i,r+2);break}if(o==e||o==0)return Ne(i,r+1)}return 0}stateSlot(t,e){return this.states[t*6+e]}stateFlag(t,e){return(this.stateSlot(t,0)&e)>0}validAction(t,e){return!!this.allActions(t,i=>i==e?!0:null)}allActions(t,e){let i=this.stateSlot(t,4),n=i?e(i):void 0;for(let r=this.stateSlot(t,1);n==null;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=Ne(this.data,r+2);else break;n=e(Ne(this.data,r+1))}return n}nextStates(t){let e=[];for(let i=this.stateSlot(t,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Ne(this.data,i+2);else break;if(!(this.data[i+2]&1)){let n=this.data[i+1];e.some((r,o)=>o&1&&r==n)||e.push(this.data[i],n)}}return e}configure(t){let e=Object.assign(Object.create(Fr.prototype),this);if(t.props&&(e.nodeSet=this.nodeSet.extend(...t.props)),t.top){let i=this.topRules[t.top];if(!i)throw new RangeError(`Invalid top rule name ${t.top}`);e.top=i}return t.tokenizers&&(e.tokenizers=this.tokenizers.map(i=>{let n=t.tokenizers.find(r=>r.from==i);return n?n.to:i})),t.specializers&&(e.specializers=this.specializers.slice(),e.specializerSpecs=this.specializerSpecs.map((i,n)=>{let r=t.specializers.find(l=>l.from==i.external);if(!r)return i;let o=Object.assign(Object.assign({},i),{external:r.to});return e.specializers[n]=Tu(o),o})),t.contextTracker&&(e.context=t.contextTracker),t.dialect&&(e.dialect=this.parseDialect(t.dialect)),t.strict!=null&&(e.strict=t.strict),t.wrap&&(e.wrappers=e.wrappers.concat(t.wrap)),t.bufferLength!=null&&(e.bufferLength=t.bufferLength),e}hasWrappers(){return this.wrappers.length>0}getName(t){return this.termNames?this.termNames[t]:String(t<=this.maxNode&&this.nodeSet.types[t].name||t)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(t){let e=this.dynamicPrecedences;return e==null?0:e[t]||0}parseDialect(t){let e=Object.keys(this.dialects),i=e.map(()=>!1);if(t)for(let r of t.split(" ")){let o=e.indexOf(r);o>=0&&(i[o]=!0)}let n=null;for(let r=0;r<e.length;r++)if(!i[r])for(let o=this.dialects[e[r]],l;(l=this.data[o++])!=65535;)(n||(n=new Uint8Array(this.maxTerm+1)))[l]=1;return new n$(t,i,n)}static deserialize(t){return new Fr(t)}}function Ne(s,t){return s[t]|s[t+1]<<16}function r$(s){let t=null;for(let e of s){let i=e.p.stoppedAt;(e.pos==e.p.stream.end||i!=null&&e.pos>i)&&e.p.parser.stateFlag(e.state,2)&&(!t||t.score<e.score)&&(t=e)}return t}function Tu(s){if(s.external){let t=s.extend?1:0;return(e,i)=>s.external(e,i)<<1|t}return s.get}const o$=309,Mu=1,l$=2,a$=3,h$=310,c$=312,f$=313,u$=4,d$=5,p$=0,Na=[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],aO=125,g$=59,Ia=47,m$=42,O$=43,b$=45,y$=60,w$=44,S$=new s$({start:!1,shift(s,t){return t==u$||t==d$||t==c$?s:t==f$},strict:!1}),x$=new go((s,t)=>{let{next:e}=s;(e==aO||e==-1||t.context)&&s.acceptToken(h$)},{contextual:!0,fallback:!0}),k$=new go((s,t)=>{let{next:e}=s,i;Na.indexOf(e)>-1||e==Ia&&((i=s.peek(1))==Ia||i==m$)||e!=aO&&e!=g$&&e!=-1&&!t.context&&s.acceptToken(o$)},{contextual:!0}),v$=new go((s,t)=>{let{next:e}=s;if((e==O$||e==b$)&&(s.advance(),e==s.next)){s.advance();let i=!t.context&&t.canShift(Mu);s.acceptToken(i?Mu:l$)}},{contextual:!0});function sl(s,t){return s>=65&&s<=90||s>=97&&s<=122||s==95||s>=192||!t&&s>=48&&s<=57}const $$=new go((s,t)=>{if(s.next!=y$||!t.dialectEnabled(p$)||(s.advance(),s.next==Ia))return;let e=0;for(;Na.indexOf(s.next)>-1;)s.advance(),e++;if(sl(s.next,!0)){for(s.advance(),e++;sl(s.next,!1);)s.advance(),e++;for(;Na.indexOf(s.next)>-1;)s.advance(),e++;if(s.next==w$)return;for(let i=0;;i++){if(i==7){if(!sl(s.next,!0))return;break}if(s.next!="extends".charCodeAt(i))break;s.advance(),e++}}s.acceptToken(a$,-e)}),Q$=vm({"get set async static":b.modifier,"for while do if else switch try catch finally return throw break continue default case":b.controlKeyword,"in of await yield void typeof delete instanceof":b.operatorKeyword,"let var const using function class extends":b.definitionKeyword,"import export from":b.moduleKeyword,"with debugger as new":b.keyword,TemplateString:b.special(b.string),super:b.atom,BooleanLiteral:b.bool,this:b.self,null:b.null,Star:b.modifier,VariableName:b.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":b.function(b.variableName),VariableDefinition:b.definition(b.variableName),Label:b.labelName,PropertyName:b.propertyName,PrivatePropertyName:b.special(b.propertyName),"CallExpression/MemberExpression/PropertyName":b.function(b.propertyName),"FunctionDeclaration/VariableDefinition":b.function(b.definition(b.variableName)),"ClassDeclaration/VariableDefinition":b.definition(b.className),PropertyDefinition:b.definition(b.propertyName),PrivatePropertyDefinition:b.definition(b.special(b.propertyName)),UpdateOp:b.updateOperator,"LineComment Hashbang":b.lineComment,BlockComment:b.blockComment,Number:b.number,String:b.string,Escape:b.escape,ArithOp:b.arithmeticOperator,LogicOp:b.logicOperator,BitOp:b.bitwiseOperator,CompareOp:b.compareOperator,RegExp:b.regexp,Equals:b.definitionOperator,Arrow:b.function(b.punctuation),": Spread":b.punctuation,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace,"InterpolationStart InterpolationEnd":b.special(b.brace),".":b.derefOperator,", ;":b.separator,"@":b.meta,TypeName:b.typeName,TypeDefinition:b.definition(b.typeName),"type enum interface implements namespace module declare":b.definitionKeyword,"abstract global Privacy readonly override":b.modifier,"is keyof unique infer":b.operatorKeyword,JSXAttributeValue:b.attributeValue,JSXText:b.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":b.angleBracket,"JSXIdentifier JSXNameSpacedName":b.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":b.attributeName,"JSXBuiltin/JSXIdentifier":b.standard(b.tagName)}),P$={__proto__:null,export:18,as:23,from:31,default:34,async:39,function:40,extends:52,this:56,true:64,false:64,null:76,void:80,typeof:84,super:102,new:136,delete:152,yield:161,await:165,class:170,public:227,private:227,protected:227,readonly:229,instanceof:248,satisfies:251,in:252,const:254,import:286,keyof:339,unique:343,infer:349,is:385,abstract:405,implements:407,type:409,let:412,var:414,using:417,interface:423,enum:427,namespace:433,module:435,declare:439,global:443,for:462,of:471,while:474,with:478,do:482,if:486,else:488,switch:492,case:498,try:504,catch:508,finally:512,return:516,throw:520,break:524,continue:528,debugger:532},C$={__proto__:null,async:123,get:125,set:127,declare:187,public:189,private:189,protected:189,static:191,abstract:193,override:195,readonly:201,accessor:203,new:389},Z$={__proto__:null,"<":143},A$=Fr.deserialize({version:14,states:"$<UO%TQ^OOO%[Q^OOO'_Q`OOP(lOWOOO*zQ08SO'#ChO+RO!bO'#CiO+aO#tO'#CiO+oO?MpO'#D^O.QQ^O'#DdO.bQ^O'#DoO%[Q^O'#DyO0fQ^O'#EROOQ07b'#EZ'#EZO1PQWO'#EWOOQO'#El'#ElOOQO'#Ie'#IeO1XQWO'#GmO1dQWO'#EkO1iQWO'#EkO3kQ08SO'#JiO6[Q08SO'#JjO6xQWO'#FZO6}Q&jO'#FqOOQ07b'#Fc'#FcO7YO,YO'#FcO7hQ7[O'#FxO9UQWO'#FwOOQ07b'#Jj'#JjOOQ07`'#Ji'#JiO9ZQWO'#GqOOQU'#KU'#KUO9fQWO'#IRO9kQ07hO'#ISOOQU'#JW'#JWOOQU'#IW'#IWQ`Q^OOO`Q^OOO%[Q^O'#DqO9sQ^O'#D}O9zQ^O'#EPO9aQWO'#GmO:RQ7[O'#CnO:aQWO'#EjO:lQWO'#EuO:qQ7[O'#FbO;`QWO'#GmOOQO'#KV'#KVO;eQWO'#KVO;sQWO'#GuO;sQWO'#GvO;sQWO'#GxO9aQWO'#G{O<jQWO'#HOO>RQWO'#CdO>cQWO'#H[O>kQWO'#HbO>kQWO'#HdO`Q^O'#HfO>kQWO'#HhO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:lQ3a:mQ3b:nQ3c:oQ3d:pQ3e:qQ3f:rQ3g:sQ3h:tQ3i:uQ3j:vQ3k.sQ3n:{Q3o;YQ3t:wQ4k0aQ4s0qQ6U;ZQ6[2mQ6a2sQ6o3ZQ6p;[Q6y;^Q6z;eQ7r5WQ8a6SQ8e6]Q8n;fQ8t;oQ8u;pQ9k8gQ9{9WQ:S9iQ:e#RR<P<]R#ZWR'U!eY!tQ'Z-Y1[5]S'Q!e-QQ'f!rS'p!u!xS'r!y5_S,}'R'YS-i'g'hQ-k'iQ2b-WR2p-jR(t#wR(w#xQ!fQT-X'Z-Y]!qQ!r'Z-Y1[5]Q#o]R'd:dT#jZ%bS#iZ%bS%hm,dU(a#g#h#kS-}(b(cQ.R(dQ0c+TQ2u.OU2v.P.Q.SS6c2w2xR8h6d`#]W#V#Y%e'}(W+Q-xr#fZm#g#h#k%b(b(c(d+T.O.P.Q.S2w2x6dQ1q,dQ2X,zQ6Q2PQ8`6RT;w'S+RT#`W%eS#_W%eS(O#V(WS(T#Y+QS-P'S+RT-s'}-xT'X!e%fQ$kfR)s$pT)h$k)iR3r.zT*X$x*ZR*a${Q0g+]Q2z.ZQ5`1^Q6h3OQ7z5cQ8k6gQ9Y7yQ9l8jQ9}9[Q:V9nQ:[:OR:_:WnqOXst!Z#c%j&m&o&p&r,h,m1w1zQ&g!VR,]&dtmOXst!U!V!Z#c%j&d&m&o&p&r,h,m1w1zR,d&jT%im,dR1W+|R,[&bQ&Q|R+t&RR+j%{T&k!W&nT&l!W&nT1y,m1z",nodeNames:"⚠ ArithOp ArithOp JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList 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 : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression 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 in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression 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 KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate 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:371,context:S$,nodeProps:[["isolate",-8,4,5,13,33,35,48,50,52,""],["group",-26,8,16,18,65,201,205,209,210,212,215,218,228,230,236,238,240,242,245,251,257,259,261,263,265,267,268,"Statement",-32,12,13,28,31,32,38,48,51,52,54,59,67,75,79,81,83,84,106,107,116,117,134,137,139,140,141,142,144,145,164,165,167,"Expression",-23,27,29,33,37,39,41,168,170,172,173,175,176,177,179,180,181,183,184,185,195,197,199,200,"Type",-3,87,99,105,"ClassItem"],["openedBy",22,"<",34,"InterpolationStart",53,"[",57,"{",72,"(",157,"JSXStartCloseTag"],["closedBy",23,">",36,"InterpolationEnd",47,"]",58,"}",73,")",162,"JSXEndTag"]],propSources:[Q$],skippedNodes:[0,4,5,271],repeatNodeCount:37,tokenData:"$Fj(CSR!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#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Ns!`!a$#_!a!b$(l!b!c$,k!c!}Er!}#O$-u#O#P$/P#P#Q$4h#Q#R$5r#R#SEr#S#T$7P#T#o$8Z#o#p$<k#p#q$=a#q#r$>q#r#s$?}#s$f%Z$f$g+g$g#BYEr#BY#BZ$AX#BZ$ISEr$IS$I_$AX$I_$I|Er$I|$I}$Dd$I}$JO$Dd$JO$JTEr$JT$JU$AX$JU$KVEr$KV$KW$AX$KW&FUEr&FU&FV$AX&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AX?HUOEr(n%d_$f&j(Op(R!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$f&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$f&j(R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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(Z~~",141,332),new Va("j~RQYZXz{^~^O'x~~aP!P!Qd~iO'y~~",25,315)],topRules:{Script:[0,6],SingleExpression:[1,269],SingleClassItem:[2,270]},dialects:{jsx:0,ts:14614},dynamicPrecedences:{69:1,79:1,81:1,165:1,193:1},specialized:[{term:319,get:s=>P$[s]||-1},{term:334,get:s=>C$[s]||-1},{term:70,get:s=>Z$[s]||-1}],tokenPrec:14638});function Ru(s){let t=Object.keys(s).join(""),e=/\w/.test(t);return e&&(t=t.replace(/\w/g,"")),`[${e?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function T$(s){let t=Object.create(null),e=Object.create(null);for(let{label:n}of s){t[n[0]]=!0;for(let r=1;r<n.length;r++)e[n[r]]=!0}let i=Ru(t)+Ru(e)+"*$";return[new RegExp("^"+i),new RegExp(i)]}function M$(s){let t=s.map(n=>typeof n=="string"?{label:n}:n),[e,i]=t.every(n=>/^\w+$/.test(n.label))?[/\w*$/,/\w+$/]:T$(t);return n=>{let r=n.matchBefore(i);return r||n.explicit?{from:r?r.from:n.pos,options:t,validFor:e}:null}}function R$(s,t){return e=>{for(let i=Mt(e.state).resolveInner(e.pos,-1);i;i=i.parent){if(s.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return t(e)}}const D$=se.define(),W$=X.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:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box"},".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:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class E${constructor(t,e,i,n){this.field=t,this.line=e,this.from=i,this.to=n}}class Eh{constructor(t,e,i){this.field=t,this.from=e,this.to=i}map(t){let e=t.mapPos(this.from,-1,ut.TrackDel),i=t.mapPos(this.to,1,ut.TrackDel);return e==null||i==null?null:new Eh(this.field,e,i)}}class Bh{constructor(t,e){this.lines=t,this.fieldPositions=e}instantiate(t,e){let i=[],n=[e],r=t.doc.lineAt(e),o=/^\s*/.exec(r.text)[0];for(let a of this.lines){if(i.length){let h=o,c=/^\t*/.exec(a)[0].length;for(let f=0;f<c;f++)h+=t.facet(co);n.push(e+h.length-c),a=h+a.slice(c)}i.push(a),e+=a.length+1}let l=this.fieldPositions.map(a=>new Eh(a.field,n[a.line]+a.from,n[a.line]+a.to));return{text:i,ranges:l}}static parse(t){let e=[],i=[],n=[],r;for(let o of t.split(/\r\n?|\n/)){for(;r=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(o);){let l=r[1]?+r[1]:null,a=r[2]||r[3]||"",h=-1;for(let c=0;c<e.length;c++)(l!=null?e[c].seq==l:a&&e[c].name==a)&&(h=c);if(h<0){let c=0;for(;c<e.length&&(l==null||e[c].seq!=null&&e[c].seq<l);)c++;e.splice(c,0,{seq:l,name:a}),h=c;for(let f of n)f.field>=h&&f.field++}n.push(new E$(h,i.length,r.index,r.index+a.length)),o=o.slice(0,r.index)+a+o.slice(r.index+r[0].length)}for(let l;l=/\\([{}])/.exec(o);){o=o.slice(0,l.index)+l[1]+o.slice(l.index+l[0].length);for(let a of n)a.line==i.length&&a.from>l.index&&(a.from--,a.to--)}i.push(o)}return new Bh(i,n)}}let B$=z.widget({widget:new class extends Le{toDOM(){let s=document.createElement("span");return s.className="cm-snippetFieldPosition",s}ignoreEvent(){return!1}}}),Y$=z.mark({class:"cm-snippetField"});class dn{constructor(t,e){this.ranges=t,this.active=e,this.deco=z.set(t.map(i=>(i.from==i.to?B$:Y$).range(i.from,i.to)))}map(t){let e=[];for(let i of this.ranges){let n=i.map(t);if(!n)return null;e.push(n)}return new dn(e,this.active)}selectionInsideField(t){return t.ranges.every(e=>this.ranges.some(i=>i.field==this.active&&i.from<=e.from&&i.to>=e.to))}}const cs=j.define({map(s,t){return s&&s.map(t)}}),X$=j.define(),es=wt.define({create(){return null},update(s,t){for(let e of t.effects){if(e.is(cs))return e.value;if(e.is(X$)&&s)return new dn(s.ranges,e.value)}return s&&t.docChanged&&(s=s.map(t.changes)),s&&t.selection&&!s.selectionInsideField(t.selection)&&(s=null),s},provide:s=>X.decorations.from(s,t=>t?t.deco:z.none)});function Yh(s,t){return S.create(s.filter(e=>e.field==t).map(e=>S.range(e.from,e.to)))}function L$(s){let t=Bh.parse(s);return(e,i,n,r)=>{let{text:o,ranges:l}=t.instantiate(e.state,n),a={changes:{from:n,to:r,insert:q.of(o)},scrollIntoView:!0,annotations:i?[D$.of(i),mt.userEvent.of("input.complete")]:void 0};if(l.length&&(a.selection=Yh(l,0)),l.some(h=>h.field>0)){let h=new dn(l,0),c=a.effects=[cs.of(h)];e.state.field(es,!1)===void 0&&c.push(j.appendConfig.of([es,q$,z$,W$]))}e.dispatch(e.state.update(a))}}function hO(s){return({state:t,dispatch:e})=>{let i=t.field(es,!1);if(!i||s<0&&i.active==0)return!1;let n=i.active+s,r=s>0&&!i.ranges.some(o=>o.field==n+s);return e(t.update({selection:Yh(i.ranges,n),effects:cs.of(r?null:new dn(i.ranges,n)),scrollIntoView:!0})),!0}}const j$=({state:s,dispatch:t})=>s.field(es,!1)?(t(s.update({effects:cs.of(null)})),!0):!1,V$=hO(1),N$=hO(-1),I$=[{key:"Tab",run:V$,shift:N$},{key:"Escape",run:j$}],Du=P.define({combine(s){return s.length?s[0]:I$}}),q$=pe.highest(is.compute([Du],s=>s.facet(Du)));function Xt(s,t){return Object.assign(Object.assign({},t),{apply:L$(s)})}const z$=X.domEventHandlers({mousedown(s,t){let e=t.state.field(es,!1),i;if(!e||(i=t.posAtCoords({x:s.clientX,y:s.clientY}))==null)return!1;let n=e.ranges.find(r=>r.from<=i&&r.to>=i);return!n||n.field==e.active?!1:(t.dispatch({selection:Yh(e.ranges,n.field),effects:cs.of(e.ranges.some(r=>r.field>n.field)?new dn(e.ranges,n.field):null),scrollIntoView:!0}),!0)}}),cO=new class extends De{};cO.startSide=1;cO.endSide=-1;const fO=[Xt("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Xt("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Xt("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Xt("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Xt("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Xt(`try {
15
+ \${}
16
+ } catch (\${error}) {
17
+ \${}
18
+ }`,{label:"try",detail:"/ catch block",type:"keyword"}),Xt("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),Xt(`if (\${}) {
19
+ \${}
20
+ } else {
21
+ \${}
22
+ }`,{label:"if",detail:"/ else block",type:"keyword"}),Xt(`class \${name} {
23
+ constructor(\${params}) {
24
+ \${}
25
+ }
26
+ }`,{label:"class",detail:"definition",type:"keyword"}),Xt('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Xt('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],_$=fO.concat([Xt("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Xt("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Xt("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),Wu=new Ax,uO=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function xn(s){return(t,e)=>{let i=t.node.getChild("VariableDefinition");return i&&e(i,s),!0}}const G$=["FunctionDeclaration"],H$={FunctionDeclaration:xn("function"),ClassDeclaration:xn("class"),ClassExpression:()=>!0,EnumDeclaration:xn("constant"),TypeAliasDeclaration:xn("type"),NamespaceDeclaration:xn("namespace"),VariableDefinition(s,t){s.matchContext(G$)||t(s,"variable")},TypeDefinition(s,t){t(s,"type")},__proto__:null};function dO(s,t){let e=Wu.get(t);if(e)return e;let i=[],n=!0;function r(o,l){let a=s.sliceString(o.from,o.to);i.push({label:a,type:l})}return t.cursor(yt.IncludeAnonymous).iterate(o=>{if(n)n=!1;else if(o.name){let l=H$[o.name];if(l&&l(o,r)||uO.has(o.name))return!1}else if(o.to-o.from>8192){for(let l of dO(s,o.node))i.push(l);return!1}}),Wu.set(t,i),i}const Eu=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,pO=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function F$(s){let t=Mt(s.state).resolveInner(s.pos,-1);if(pO.indexOf(t.name)>-1)return null;let e=t.name=="VariableName"||t.to-t.from<20&&Eu.test(s.state.sliceDoc(t.from,t.to));if(!e&&!s.explicit)return null;let i=[];for(let n=t;n;n=n.parent)uO.has(n.name)&&(i=i.concat(dO(s.state.doc,n)));return{options:i,from:e?t.from:s.pos,validFor:Eu}}const vi=Vr.define({name:"javascript",parser:A$.configure({props:[Am.add({IfStatement:Ho({except:/^\s*({|else\b)/}),TryStatement:Ho({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:tk,SwitchBody:s=>{let t=s.textAfter,e=/^\s*\}/.test(t),i=/^\s*(case|default)\b/.test(t);return s.baseIndent+(e?0:i?1:2)*s.unit},Block:Jx({closing:"}"}),ArrowFunction:s=>s.baseIndent+s.unit,"TemplateString BlockComment":()=>null,"Statement Property":Ho({except:/^{/}),JSXElement(s){let t=/^\s*<\//.test(s.textAfter);return s.lineIndent(s.node.from)+(t?0:s.unit)},JSXEscape(s){let t=/\s*\}/.test(s.textAfter);return s.lineIndent(s.node.from)+(t?0:s.unit)},"JSXOpenTag JSXSelfClosingTag"(s){return s.column(s.node.from)+s.unit}}),Rm.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":sk,BlockComment(s){return{from:s.from+2,to:s.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),gO={test:s=>/^JSX/.test(s.name),facet:Pm({commentTokens:{block:{open:"{/*",close:"*/}"}}})},U$=vi.configure({dialect:"ts"},"typescript"),K$=vi.configure({dialect:"jsx",props:[Ah.add(s=>s.isTop?[gO]:void 0)]}),J$=vi.configure({dialect:"jsx ts",props:[Ah.add(s=>s.isTop?[gO]:void 0)]},"typescript");let mO=s=>({label:s,type:"keyword"});const OO="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(mO),tQ=OO.concat(["declare","implements","private","protected","public"].map(mO));function eQ(s={}){let t=s.jsx?s.typescript?J$:K$:s.typescript?U$:vi,e=s.typescript?_$.concat(tQ):fO.concat(OO);return new Vx(t,[vi.data.of({autocomplete:R$(pO,M$(e))}),vi.data.of({autocomplete:F$}),s.jsx?sQ:[]])}function iQ(s){for(;;){if(s.name=="JSXOpenTag"||s.name=="JSXSelfClosingTag"||s.name=="JSXFragmentTag")return s;if(s.name=="JSXEscape"||!s.parent)return null;s=s.parent}}function Bu(s,t,e=s.length){for(let i=t==null?void 0:t.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return s.sliceString(i.from,Math.min(i.to,e));return""}const nQ=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),sQ=X.inputHandler.of((s,t,e,i,n)=>{if((nQ?s.composing:s.compositionStarted)||s.state.readOnly||t!=e||i!=">"&&i!="/"||!vi.isActiveAt(s.state,t,-1))return!1;let r=n(),{state:o}=r,l=o.changeByRange(a=>{var h;let{head:c}=a,f=Mt(o).resolveInner(c-1,-1),u;if(f.name=="JSXStartTag"&&(f=f.parent),!(o.doc.sliceString(c-1,c)!=i||f.name=="JSXAttributeValue"&&f.to>c)){if(i==">"&&f.name=="JSXFragmentTag")return{range:a,changes:{from:c,insert:"</>"}};if(i=="/"&&f.name=="JSXStartCloseTag"){let d=f.parent,p=d.parent;if(p&&d.from==c-2&&((u=Bu(o.doc,p.firstChild,c))||((h=p.firstChild)===null||h===void 0?void 0:h.name)=="JSXFragmentTag")){let g=`${u}>`;return{range:S.cursor(c+g.length,-1),changes:{from:c,insert:g}}}}else if(i==">"){let d=iQ(f);if(d&&d.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(c,c+2))&&(u=Bu(o.doc,d,c)))return{range:a,changes:{from:c,insert:`</${u}>`}}}}return{range:a}});return l.changes.empty?!1:(s.dispatch([r,o.update(l,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var bO=s=>{var{theme:t,settings:e={},styles:i=[]}=s,n={".cm-gutters":{}},r={};e.background&&(r.backgroundColor=e.background),e.backgroundImage&&(r.backgroundImage=e.backgroundImage),e.foreground&&(r.color=e.foreground),e.fontSize&&(r.fontSize=e.fontSize),(e.background||e.foreground)&&(n["&"]=r),e.fontFamily&&(n["&.cm-editor .cm-scroller"]={fontFamily:e.fontFamily}),e.gutterBackground&&(n[".cm-gutters"].backgroundColor=e.gutterBackground),e.gutterForeground&&(n[".cm-gutters"].color=e.gutterForeground),e.gutterBorder&&(n[".cm-gutters"].borderRightColor=e.gutterBorder),e.caret&&(n[".cm-content"]={caretColor:e.caret},n[".cm-cursor, .cm-dropCursor"]={borderLeftColor:e.caret});var o={};e.gutterActiveForeground&&(o.color=e.gutterActiveForeground),e.lineHighlight&&(n[".cm-activeLine"]={backgroundColor:e.lineHighlight},o.backgroundColor=e.lineHighlight),n[".cm-activeLineGutter"]=o,e.selection&&(n["&.cm-focused .cm-selectionBackground, & .cm-line::selection, & .cm-selectionLayer .cm-selectionBackground, .cm-content ::selection"]={background:e.selection+" !important"}),e.selectionMatch&&(n["& .cm-selectionMatch"]={backgroundColor:e.selectionMatch});var l=X.theme(n,{dark:t==="dark"}),a=hs.define(i),h=[l,jm(a)];return h},rQ={background:"#fff",foreground:"#24292e",selection:"#BBDFFF",selectionMatch:"#BBDFFF",gutterBackground:"#fff",gutterForeground:"#6e7781"},oQ=[{tag:[b.standard(b.tagName),b.tagName],color:"#116329"},{tag:[b.comment,b.bracket],color:"#6a737d"},{tag:[b.className,b.propertyName],color:"#6f42c1"},{tag:[b.variableName,b.attributeName,b.number,b.operator],color:"#005cc5"},{tag:[b.keyword,b.typeName,b.typeOperator,b.typeName],color:"#d73a49"},{tag:[b.string,b.meta,b.regexp],color:"#032f62"},{tag:[b.name,b.quote],color:"#22863a"},{tag:[b.heading,b.strong],color:"#24292e",fontWeight:"bold"},{tag:[b.emphasis],color:"#24292e",fontStyle:"italic"},{tag:[b.deleted],color:"#b31d28",backgroundColor:"ffeef0"},{tag:[b.atom,b.bool,b.special(b.variableName)],color:"#e36209"},{tag:[b.url,b.escape,b.regexp,b.link],color:"#032f62"},{tag:b.link,textDecoration:"underline"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:b.invalid,color:"#cb2431"}],lQ=s=>{var{theme:t="light",settings:e={},styles:i=[]}=s||{};return bO({theme:t,settings:Xu({},rQ,e),styles:[...oQ,...i]})},aQ=lQ(),hQ={background:"#0d1117",foreground:"#c9d1d9",caret:"#c9d1d9",selection:"#003d73",selectionMatch:"#003d73",lineHighlight:"#36334280"},cQ=[{tag:[b.standard(b.tagName),b.tagName],color:"#7ee787"},{tag:[b.comment,b.bracket],color:"#8b949e"},{tag:[b.className,b.propertyName],color:"#d2a8ff"},{tag:[b.variableName,b.attributeName,b.number,b.operator],color:"#79c0ff"},{tag:[b.keyword,b.typeName,b.typeOperator,b.typeName],color:"#ff7b72"},{tag:[b.string,b.meta,b.regexp],color:"#a5d6ff"},{tag:[b.name,b.quote],color:"#7ee787"},{tag:[b.heading,b.strong],color:"#d2a8ff",fontWeight:"bold"},{tag:[b.emphasis],color:"#d2a8ff",fontStyle:"italic"},{tag:[b.deleted],color:"#ffdcd7",backgroundColor:"ffeef0"},{tag:[b.atom,b.bool,b.special(b.variableName)],color:"#ffab70"},{tag:b.link,textDecoration:"underline"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:b.invalid,color:"#f97583"}],fQ=s=>{var{theme:t="dark",settings:e={},styles:i=[]}=s||{};return bO({theme:t,settings:Xu({},hQ,e),styles:[...cQ,...i]})},uQ=fQ();function lP(s){const t=s.theme=="light"?aQ:uQ;return Yu.jsx(Fv,{value:s.value,onChange:s.onChange,extensions:[eQ({jsx:!0})],theme:t})}export{lP as default};