@limetech/lime-elements 37.0.0-next.1 → 37.1.0-dev.1

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 (334) hide show
  1. package/dist/cjs/{checkbox.template-234f4813.js → checkbox.template-df6fc114.js} +5 -5
  2. package/dist/cjs/checkbox.template-df6fc114.js.map +1 -0
  3. package/dist/cjs/{index-aafa56ee.js → index-38eb64b5.js} +14 -1
  4. package/dist/cjs/index-38eb64b5.js.map +1 -0
  5. package/dist/cjs/lime-elements.cjs.js +2 -2
  6. package/dist/cjs/limel-action-bar-item_2.cjs.entry.js +10 -2
  7. package/dist/cjs/limel-action-bar-item_2.cjs.entry.js.map +1 -1
  8. package/dist/cjs/limel-action-bar.cjs.entry.js +1 -1
  9. package/dist/cjs/limel-action-bar.cjs.entry.js.map +1 -1
  10. package/dist/cjs/limel-badge.cjs.entry.js +1 -1
  11. package/dist/cjs/limel-banner.cjs.entry.js +1 -1
  12. package/dist/cjs/limel-button-group.cjs.entry.js +2 -2
  13. package/dist/cjs/limel-button.cjs.entry.js +9 -1
  14. package/dist/cjs/limel-button.cjs.entry.js.map +1 -1
  15. package/dist/cjs/limel-callout.cjs.entry.js +1 -1
  16. package/dist/cjs/limel-checkbox.cjs.entry.js +5 -4
  17. package/dist/cjs/limel-checkbox.cjs.entry.js.map +1 -1
  18. package/dist/cjs/limel-chip-set.cjs.entry.js +1 -1
  19. package/dist/cjs/limel-circular-progress_2.cjs.entry.js +1 -1
  20. package/dist/cjs/limel-code-editor.cjs.entry.js +1 -1
  21. package/dist/cjs/limel-collapsible-section.cjs.entry.js +11 -1
  22. package/dist/cjs/limel-collapsible-section.cjs.entry.js.map +1 -1
  23. package/dist/cjs/limel-color-picker-palette.cjs.entry.js +3 -3
  24. package/dist/cjs/limel-color-picker-palette.cjs.entry.js.map +1 -1
  25. package/dist/cjs/limel-color-picker.cjs.entry.js +3 -3
  26. package/dist/cjs/limel-color-picker.cjs.entry.js.map +1 -1
  27. package/dist/cjs/limel-config.cjs.entry.js +1 -1
  28. package/dist/cjs/limel-date-picker.cjs.entry.js +2 -2
  29. package/dist/cjs/limel-dialog.cjs.entry.js +2 -2
  30. package/dist/cjs/limel-dock-button.cjs.entry.js +2 -2
  31. package/dist/cjs/limel-dock.cjs.entry.js +1 -1
  32. package/dist/cjs/limel-file.cjs.entry.js +2 -2
  33. package/dist/cjs/limel-flatpickr-adapter.cjs.entry.js +1 -1
  34. package/dist/cjs/limel-flex-container.cjs.entry.js +1 -1
  35. package/dist/cjs/limel-form.cjs.entry.js +15 -3
  36. package/dist/cjs/limel-form.cjs.entry.js.map +1 -1
  37. package/dist/cjs/limel-grid.cjs.entry.js +1 -1
  38. package/dist/cjs/limel-header.cjs.entry.js +1 -1
  39. package/dist/cjs/limel-helper-line.cjs.entry.js +1 -1
  40. package/dist/cjs/limel-icon-button.cjs.entry.js +8 -1
  41. package/dist/cjs/limel-icon-button.cjs.entry.js.map +1 -1
  42. package/dist/cjs/limel-icon.cjs.entry.js +91 -9
  43. package/dist/cjs/limel-icon.cjs.entry.js.map +1 -1
  44. package/dist/cjs/limel-info-tile.cjs.entry.js +1 -1
  45. package/dist/cjs/limel-input-field.cjs.entry.js +11 -11
  46. package/dist/cjs/limel-input-field.cjs.entry.js.map +1 -1
  47. package/dist/cjs/limel-list_2.cjs.entry.js +2 -2
  48. package/dist/cjs/limel-menu_2.cjs.entry.js +2 -2
  49. package/dist/cjs/limel-picker.cjs.entry.js +2 -2
  50. package/dist/cjs/limel-popover_2.cjs.entry.js +2 -2
  51. package/dist/cjs/limel-portal.cjs.entry.js +1 -1
  52. package/dist/cjs/limel-progress-flow-item.cjs.entry.js +1 -1
  53. package/dist/cjs/limel-progress-flow.cjs.entry.js +1 -1
  54. package/dist/cjs/limel-select.cjs.entry.js +2 -2
  55. package/dist/cjs/limel-shortcut.cjs.entry.js +1 -1
  56. package/dist/cjs/limel-slider.cjs.entry.js +138 -129
  57. package/dist/cjs/limel-slider.cjs.entry.js.map +1 -1
  58. package/dist/cjs/limel-snackbar.cjs.entry.js +1 -1
  59. package/dist/cjs/limel-spinner.cjs.entry.js +1 -1
  60. package/dist/cjs/limel-split-button.cjs.entry.js +1 -1
  61. package/dist/cjs/limel-switch.cjs.entry.js +25 -12
  62. package/dist/cjs/limel-switch.cjs.entry.js.map +1 -1
  63. package/dist/cjs/limel-tab-bar.cjs.entry.js +1 -1
  64. package/dist/cjs/limel-tab-panel.cjs.entry.js +1 -1
  65. package/dist/cjs/limel-table.cjs.entry.js +1 -1
  66. package/dist/cjs/limel-tooltip_2.cjs.entry.js +2 -2
  67. package/dist/cjs/loader.cjs.js +2 -2
  68. package/dist/cjs/makeEnterClickable-aa2ed75b.js +68 -0
  69. package/dist/cjs/makeEnterClickable-aa2ed75b.js.map +1 -0
  70. package/dist/cjs/{random-string-4c3b7f1c.js → random-string-c8445652.js} +10 -2
  71. package/dist/cjs/random-string-c8445652.js.map +1 -0
  72. package/dist/collection/components/action-bar/action-bar-item/action-bar-item.js +9 -1
  73. package/dist/collection/components/action-bar/action-bar-item/action-bar-item.js.map +1 -1
  74. package/dist/collection/components/action-bar/action-bar.js +0 -1
  75. package/dist/collection/components/action-bar/action-bar.js.map +1 -1
  76. package/dist/collection/components/button/button.js +8 -0
  77. package/dist/collection/components/button/button.js.map +1 -1
  78. package/dist/collection/components/checkbox/checkbox.js +18 -1
  79. package/dist/collection/components/checkbox/checkbox.js.map +1 -1
  80. package/dist/collection/components/checkbox/checkbox.template.js +3 -3
  81. package/dist/collection/components/checkbox/checkbox.template.js.map +1 -1
  82. package/dist/collection/components/collapsible-section/collapsible-section.js +11 -1
  83. package/dist/collection/components/collapsible-section/collapsible-section.js.map +1 -1
  84. package/dist/collection/components/color-picker/color-picker-palette.css +46 -21
  85. package/dist/collection/components/color-picker/color-picker-palette.js +1 -1
  86. package/dist/collection/components/color-picker/color-picker-palette.js.map +1 -1
  87. package/dist/collection/components/color-picker/color-picker.css +29 -21
  88. package/dist/collection/components/color-picker/color-picker.js +1 -1
  89. package/dist/collection/components/color-picker/color-picker.js.map +1 -1
  90. package/dist/collection/components/form/fields/schema-field.js +13 -1
  91. package/dist/collection/components/form/fields/schema-field.js.map +1 -1
  92. package/dist/collection/components/icon/icon.js +1 -1
  93. package/dist/collection/components/icon/icon.js.map +1 -1
  94. package/dist/collection/components/icon-button/icon-button.js +7 -0
  95. package/dist/collection/components/icon-button/icon-button.js.map +1 -1
  96. package/dist/collection/components/input-field/input-field.js +9 -9
  97. package/dist/collection/components/input-field/input-field.js.map +1 -1
  98. package/dist/collection/components/slider/slider.js +140 -131
  99. package/dist/collection/components/slider/slider.js.map +1 -1
  100. package/dist/collection/components/switch/switch.css +22 -1
  101. package/dist/collection/components/switch/switch.js +50 -10
  102. package/dist/collection/components/switch/switch.js.map +1 -1
  103. package/dist/collection/global/{icon-cache.js → icon-cache/cache-storage-icon-cache.js} +4 -9
  104. package/dist/collection/global/icon-cache/cache-storage-icon-cache.js.map +1 -0
  105. package/dist/collection/global/icon-cache/factory.js +16 -0
  106. package/dist/collection/global/icon-cache/factory.js.map +1 -0
  107. package/dist/collection/global/icon-cache/in-memory-icon-cache.js +73 -0
  108. package/dist/collection/global/icon-cache/in-memory-icon-cache.js.map +1 -0
  109. package/dist/collection/util/makeEnterClickable.js +61 -0
  110. package/dist/collection/util/makeEnterClickable.js.map +1 -0
  111. package/dist/collection/util/random-string.js +9 -1
  112. package/dist/collection/util/random-string.js.map +1 -1
  113. package/dist/esm/{checkbox.template-c838ee7b.js → checkbox.template-c2d0fa10.js} +5 -5
  114. package/dist/esm/checkbox.template-c2d0fa10.js.map +1 -0
  115. package/dist/esm/{index-9bd6d7c6.js → index-232e9616.js} +14 -2
  116. package/dist/{lime-elements/p-c8818b66.js.map → esm/index-232e9616.js.map} +1 -1
  117. package/dist/esm/lime-elements.js +3 -3
  118. package/dist/esm/limel-action-bar-item_2.entry.js +10 -2
  119. package/dist/esm/limel-action-bar-item_2.entry.js.map +1 -1
  120. package/dist/esm/limel-action-bar.entry.js +1 -1
  121. package/dist/esm/limel-action-bar.entry.js.map +1 -1
  122. package/dist/esm/limel-badge.entry.js +1 -1
  123. package/dist/esm/limel-banner.entry.js +1 -1
  124. package/dist/esm/limel-button-group.entry.js +2 -2
  125. package/dist/esm/limel-button.entry.js +9 -1
  126. package/dist/esm/limel-button.entry.js.map +1 -1
  127. package/dist/esm/limel-callout.entry.js +1 -1
  128. package/dist/esm/limel-checkbox.entry.js +5 -4
  129. package/dist/esm/limel-checkbox.entry.js.map +1 -1
  130. package/dist/esm/limel-chip-set.entry.js +1 -1
  131. package/dist/esm/limel-circular-progress_2.entry.js +1 -1
  132. package/dist/esm/limel-code-editor.entry.js +1 -1
  133. package/dist/esm/limel-collapsible-section.entry.js +11 -1
  134. package/dist/esm/limel-collapsible-section.entry.js.map +1 -1
  135. package/dist/esm/limel-color-picker-palette.entry.js +3 -3
  136. package/dist/esm/limel-color-picker-palette.entry.js.map +1 -1
  137. package/dist/esm/limel-color-picker.entry.js +3 -3
  138. package/dist/esm/limel-color-picker.entry.js.map +1 -1
  139. package/dist/esm/limel-config.entry.js +1 -1
  140. package/dist/esm/limel-date-picker.entry.js +2 -2
  141. package/dist/esm/limel-dialog.entry.js +2 -2
  142. package/dist/esm/limel-dock-button.entry.js +2 -2
  143. package/dist/esm/limel-dock.entry.js +1 -1
  144. package/dist/esm/limel-file.entry.js +2 -2
  145. package/dist/esm/limel-flatpickr-adapter.entry.js +1 -1
  146. package/dist/esm/limel-flex-container.entry.js +1 -1
  147. package/dist/esm/limel-form.entry.js +15 -3
  148. package/dist/esm/limel-form.entry.js.map +1 -1
  149. package/dist/esm/limel-grid.entry.js +1 -1
  150. package/dist/esm/limel-header.entry.js +1 -1
  151. package/dist/esm/limel-helper-line.entry.js +1 -1
  152. package/dist/esm/limel-icon-button.entry.js +8 -1
  153. package/dist/esm/limel-icon-button.entry.js.map +1 -1
  154. package/dist/esm/limel-icon.entry.js +91 -9
  155. package/dist/esm/limel-icon.entry.js.map +1 -1
  156. package/dist/esm/limel-info-tile.entry.js +1 -1
  157. package/dist/esm/limel-input-field.entry.js +11 -11
  158. package/dist/esm/limel-input-field.entry.js.map +1 -1
  159. package/dist/esm/limel-list_2.entry.js +2 -2
  160. package/dist/esm/limel-menu_2.entry.js +2 -2
  161. package/dist/esm/limel-picker.entry.js +2 -2
  162. package/dist/esm/limel-popover_2.entry.js +2 -2
  163. package/dist/esm/limel-portal.entry.js +1 -1
  164. package/dist/esm/limel-progress-flow-item.entry.js +1 -1
  165. package/dist/esm/limel-progress-flow.entry.js +1 -1
  166. package/dist/esm/limel-select.entry.js +2 -2
  167. package/dist/esm/limel-shortcut.entry.js +1 -1
  168. package/dist/esm/limel-slider.entry.js +138 -129
  169. package/dist/esm/limel-slider.entry.js.map +1 -1
  170. package/dist/esm/limel-snackbar.entry.js +1 -1
  171. package/dist/esm/limel-spinner.entry.js +1 -1
  172. package/dist/esm/limel-split-button.entry.js +1 -1
  173. package/dist/esm/limel-switch.entry.js +25 -12
  174. package/dist/esm/limel-switch.entry.js.map +1 -1
  175. package/dist/esm/limel-tab-bar.entry.js +1 -1
  176. package/dist/esm/limel-tab-panel.entry.js +1 -1
  177. package/dist/esm/limel-table.entry.js +1 -1
  178. package/dist/esm/limel-tooltip_2.entry.js +2 -2
  179. package/dist/esm/loader.js +3 -3
  180. package/dist/esm/makeEnterClickable-b5ad939a.js +65 -0
  181. package/dist/esm/makeEnterClickable-b5ad939a.js.map +1 -0
  182. package/dist/esm/{random-string-2246b81e.js → random-string-812b1c35.js} +10 -2
  183. package/dist/esm/random-string-812b1c35.js.map +1 -0
  184. package/dist/lime-elements/lime-elements.esm.js +1 -1
  185. package/dist/lime-elements/lime-elements.esm.js.map +1 -1
  186. package/dist/lime-elements/{p-9aab2892.entry.js → p-095e03af.entry.js} +2 -2
  187. package/dist/lime-elements/{p-e0fa49ca.entry.js → p-0d823554.entry.js} +2 -2
  188. package/dist/lime-elements/p-0d823554.entry.js.map +1 -0
  189. package/dist/lime-elements/{p-40b7d717.entry.js → p-0edcca0b.entry.js} +2 -2
  190. package/dist/lime-elements/{p-ca9b383b.entry.js → p-1754c5ae.entry.js} +2 -2
  191. package/dist/lime-elements/{p-a3bea367.entry.js → p-1bdc524d.entry.js} +2 -2
  192. package/dist/lime-elements/{p-c8818b66.js → p-3075aa67.js} +3 -3
  193. package/dist/lime-elements/p-3075aa67.js.map +1 -0
  194. package/dist/lime-elements/{p-13ed01eb.entry.js → p-32127a17.entry.js} +2 -2
  195. package/dist/lime-elements/{p-2565927b.entry.js → p-378bb196.entry.js} +3 -3
  196. package/dist/lime-elements/{p-2565927b.entry.js.map → p-378bb196.entry.js.map} +1 -1
  197. package/dist/lime-elements/p-3ccdc4a3.js +2 -0
  198. package/dist/lime-elements/p-3ccdc4a3.js.map +1 -0
  199. package/dist/lime-elements/{p-17ac8cca.entry.js → p-42f06b16.entry.js} +2 -2
  200. package/dist/lime-elements/{p-8b339748.entry.js → p-455edb30.entry.js} +2 -2
  201. package/dist/lime-elements/p-4607900f.entry.js +2 -0
  202. package/dist/lime-elements/p-4607900f.entry.js.map +1 -0
  203. package/dist/lime-elements/{p-9fe3bc64.entry.js → p-4a04ede1.entry.js} +2 -2
  204. package/dist/lime-elements/{p-a8714655.entry.js → p-4fc7e0df.entry.js} +2 -2
  205. package/dist/lime-elements/p-5235c79f.entry.js +2 -0
  206. package/dist/lime-elements/p-5235c79f.entry.js.map +1 -0
  207. package/dist/lime-elements/{p-1a80da5e.entry.js → p-550cae4a.entry.js} +2 -2
  208. package/dist/lime-elements/{p-623d09d9.entry.js → p-552fd521.entry.js} +2 -2
  209. package/dist/lime-elements/{p-42a24572.entry.js → p-55dcbc35.entry.js} +2 -2
  210. package/dist/lime-elements/{p-30df2bb6.entry.js → p-5afea754.entry.js} +2 -2
  211. package/dist/lime-elements/{p-c647b197.entry.js → p-5fb4402e.entry.js} +2 -2
  212. package/dist/lime-elements/{p-3670f018.entry.js → p-6762616d.entry.js} +2 -2
  213. package/dist/lime-elements/{p-d7c39d02.entry.js → p-6f09978e.entry.js} +8 -8
  214. package/dist/lime-elements/p-6f09978e.entry.js.map +1 -0
  215. package/dist/lime-elements/p-6f2fad3a.entry.js +2 -0
  216. package/dist/lime-elements/p-6f2fad3a.entry.js.map +1 -0
  217. package/dist/lime-elements/{p-2b0c6ccd.entry.js → p-7972528a.entry.js} +2 -2
  218. package/dist/lime-elements/p-7cfc8998.js +2 -0
  219. package/dist/lime-elements/p-7cfc8998.js.map +1 -0
  220. package/dist/lime-elements/{p-a40e05c3.entry.js → p-7d159ddf.entry.js} +2 -2
  221. package/dist/lime-elements/{p-6b952164.entry.js → p-8d44ea19.entry.js} +2 -2
  222. package/dist/lime-elements/{p-848437f8.entry.js → p-94cb40fb.entry.js} +2 -2
  223. package/dist/lime-elements/{p-795079c9.entry.js → p-95ed1b9b.entry.js} +2 -2
  224. package/dist/lime-elements/{p-d228fd62.entry.js → p-9a5745e5.entry.js} +2 -2
  225. package/dist/lime-elements/{p-4114c214.entry.js → p-9c1db0e7.entry.js} +2 -2
  226. package/dist/lime-elements/{p-55a09930.entry.js → p-9f5250a0.entry.js} +2 -2
  227. package/dist/lime-elements/{p-d07f1a1f.entry.js → p-add09e7d.entry.js} +2 -2
  228. package/dist/lime-elements/{p-e59e0040.entry.js → p-af374a0c.entry.js} +2 -2
  229. package/dist/lime-elements/{p-648d9057.entry.js → p-b3ff8fef.entry.js} +2 -2
  230. package/dist/lime-elements/{p-715d3252.entry.js → p-b70f517e.entry.js} +2 -2
  231. package/dist/lime-elements/{p-da25e94d.entry.js → p-b714596f.entry.js} +2 -2
  232. package/dist/lime-elements/p-b714596f.entry.js.map +1 -0
  233. package/dist/lime-elements/{p-753f500b.entry.js → p-b897fe1f.entry.js} +2 -2
  234. package/dist/lime-elements/{p-2359d139.entry.js → p-b9698f79.entry.js} +2 -2
  235. package/dist/lime-elements/{p-5b374246.entry.js → p-bc23beb6.entry.js} +2 -2
  236. package/dist/lime-elements/{p-f1d9723a.entry.js → p-bd62071d.entry.js} +2 -2
  237. package/dist/lime-elements/{p-4ed75a11.entry.js → p-c6f8ea40.entry.js} +6 -6
  238. package/dist/lime-elements/p-c6f8ea40.entry.js.map +1 -0
  239. package/dist/lime-elements/p-c9bdda85.js +2 -0
  240. package/dist/lime-elements/p-c9bdda85.js.map +1 -0
  241. package/dist/lime-elements/{p-b8ed25b3.entry.js → p-ce1fca54.entry.js} +2 -2
  242. package/dist/lime-elements/p-ce1fca54.entry.js.map +1 -0
  243. package/dist/lime-elements/{p-a11a971e.entry.js → p-cf61ac34.entry.js} +2 -2
  244. package/dist/lime-elements/{p-9e78a21c.entry.js → p-d419c102.entry.js} +3 -3
  245. package/dist/lime-elements/{p-9e78a21c.entry.js.map → p-d419c102.entry.js.map} +1 -1
  246. package/dist/lime-elements/{p-7a3f58cd.entry.js → p-dd14b927.entry.js} +2 -2
  247. package/dist/lime-elements/p-e0a0065f.entry.js +2 -0
  248. package/dist/lime-elements/p-e0a0065f.entry.js.map +1 -0
  249. package/dist/lime-elements/{p-2118b9ae.entry.js → p-eae4f1ed.entry.js} +2 -2
  250. package/dist/lime-elements/p-ee887c40.entry.js +2 -0
  251. package/dist/lime-elements/p-ee887c40.entry.js.map +1 -0
  252. package/dist/lime-elements/{p-461b5f85.entry.js → p-f1b0951f.entry.js} +5 -5
  253. package/dist/lime-elements/p-f1b0951f.entry.js.map +1 -0
  254. package/dist/lime-elements/p-f4ff7ecc.entry.js +2 -0
  255. package/dist/lime-elements/p-f4ff7ecc.entry.js.map +1 -0
  256. package/dist/types/components/action-bar/action-bar-item/action-bar-item.d.ts +3 -0
  257. package/dist/types/components/action-bar/action-bar.d.ts +0 -1
  258. package/dist/types/components/button/button.d.ts +3 -0
  259. package/dist/types/components/checkbox/checkbox.d.ts +17 -0
  260. package/dist/types/components/checkbox/checkbox.template.d.ts +1 -0
  261. package/dist/types/components/collapsible-section/collapsible-section.d.ts +3 -0
  262. package/dist/types/components/icon-button/icon-button.d.ts +2 -0
  263. package/dist/types/components/input-field/input-field.d.ts +2 -0
  264. package/dist/types/components/slider/slider.d.ts +13 -11
  265. package/dist/types/components/switch/switch.d.ts +19 -1
  266. package/dist/types/components.d.ts +92 -8
  267. package/dist/types/global/{icon-cache.d.ts → icon-cache/cache-storage-icon-cache.d.ts} +2 -4
  268. package/dist/types/global/icon-cache/factory.d.ts +4 -0
  269. package/dist/types/global/icon-cache/in-memory-icon-cache.d.ts +15 -0
  270. package/dist/types/util/makeEnterClickable.d.ts +7 -0
  271. package/package.json +11 -11
  272. package/dist/cjs/checkbox.template-234f4813.js.map +0 -1
  273. package/dist/cjs/index-aafa56ee.js.map +0 -1
  274. package/dist/cjs/random-string-4c3b7f1c.js.map +0 -1
  275. package/dist/collection/global/icon-cache.js.map +0 -1
  276. package/dist/esm/checkbox.template-c838ee7b.js.map +0 -1
  277. package/dist/esm/index-9bd6d7c6.js.map +0 -1
  278. package/dist/esm/random-string-2246b81e.js.map +0 -1
  279. package/dist/lime-elements/p-0137d2fb.entry.js +0 -2
  280. package/dist/lime-elements/p-0137d2fb.entry.js.map +0 -1
  281. package/dist/lime-elements/p-1dc042e5.entry.js +0 -2
  282. package/dist/lime-elements/p-1dc042e5.entry.js.map +0 -1
  283. package/dist/lime-elements/p-28da3c47.entry.js +0 -2
  284. package/dist/lime-elements/p-28da3c47.entry.js.map +0 -1
  285. package/dist/lime-elements/p-461b5f85.entry.js.map +0 -1
  286. package/dist/lime-elements/p-4ed75a11.entry.js.map +0 -1
  287. package/dist/lime-elements/p-5b6d2d55.js +0 -2
  288. package/dist/lime-elements/p-5b6d2d55.js.map +0 -1
  289. package/dist/lime-elements/p-63111b62.entry.js +0 -2
  290. package/dist/lime-elements/p-63111b62.entry.js.map +0 -1
  291. package/dist/lime-elements/p-6c094f3f.js +0 -2
  292. package/dist/lime-elements/p-6c094f3f.js.map +0 -1
  293. package/dist/lime-elements/p-896043d6.entry.js +0 -2
  294. package/dist/lime-elements/p-896043d6.entry.js.map +0 -1
  295. package/dist/lime-elements/p-b8ed25b3.entry.js.map +0 -1
  296. package/dist/lime-elements/p-d7c39d02.entry.js.map +0 -1
  297. package/dist/lime-elements/p-da25e94d.entry.js.map +0 -1
  298. package/dist/lime-elements/p-e0fa49ca.entry.js.map +0 -1
  299. package/dist/lime-elements/p-fb799569.entry.js +0 -2
  300. package/dist/lime-elements/p-fb799569.entry.js.map +0 -1
  301. /package/dist/lime-elements/{p-9aab2892.entry.js.map → p-095e03af.entry.js.map} +0 -0
  302. /package/dist/lime-elements/{p-40b7d717.entry.js.map → p-0edcca0b.entry.js.map} +0 -0
  303. /package/dist/lime-elements/{p-ca9b383b.entry.js.map → p-1754c5ae.entry.js.map} +0 -0
  304. /package/dist/lime-elements/{p-a3bea367.entry.js.map → p-1bdc524d.entry.js.map} +0 -0
  305. /package/dist/lime-elements/{p-13ed01eb.entry.js.map → p-32127a17.entry.js.map} +0 -0
  306. /package/dist/lime-elements/{p-17ac8cca.entry.js.map → p-42f06b16.entry.js.map} +0 -0
  307. /package/dist/lime-elements/{p-8b339748.entry.js.map → p-455edb30.entry.js.map} +0 -0
  308. /package/dist/lime-elements/{p-9fe3bc64.entry.js.map → p-4a04ede1.entry.js.map} +0 -0
  309. /package/dist/lime-elements/{p-a8714655.entry.js.map → p-4fc7e0df.entry.js.map} +0 -0
  310. /package/dist/lime-elements/{p-1a80da5e.entry.js.map → p-550cae4a.entry.js.map} +0 -0
  311. /package/dist/lime-elements/{p-623d09d9.entry.js.map → p-552fd521.entry.js.map} +0 -0
  312. /package/dist/lime-elements/{p-42a24572.entry.js.map → p-55dcbc35.entry.js.map} +0 -0
  313. /package/dist/lime-elements/{p-30df2bb6.entry.js.map → p-5afea754.entry.js.map} +0 -0
  314. /package/dist/lime-elements/{p-c647b197.entry.js.map → p-5fb4402e.entry.js.map} +0 -0
  315. /package/dist/lime-elements/{p-3670f018.entry.js.map → p-6762616d.entry.js.map} +0 -0
  316. /package/dist/lime-elements/{p-2b0c6ccd.entry.js.map → p-7972528a.entry.js.map} +0 -0
  317. /package/dist/lime-elements/{p-a40e05c3.entry.js.map → p-7d159ddf.entry.js.map} +0 -0
  318. /package/dist/lime-elements/{p-6b952164.entry.js.map → p-8d44ea19.entry.js.map} +0 -0
  319. /package/dist/lime-elements/{p-848437f8.entry.js.map → p-94cb40fb.entry.js.map} +0 -0
  320. /package/dist/lime-elements/{p-795079c9.entry.js.map → p-95ed1b9b.entry.js.map} +0 -0
  321. /package/dist/lime-elements/{p-d228fd62.entry.js.map → p-9a5745e5.entry.js.map} +0 -0
  322. /package/dist/lime-elements/{p-4114c214.entry.js.map → p-9c1db0e7.entry.js.map} +0 -0
  323. /package/dist/lime-elements/{p-55a09930.entry.js.map → p-9f5250a0.entry.js.map} +0 -0
  324. /package/dist/lime-elements/{p-d07f1a1f.entry.js.map → p-add09e7d.entry.js.map} +0 -0
  325. /package/dist/lime-elements/{p-e59e0040.entry.js.map → p-af374a0c.entry.js.map} +0 -0
  326. /package/dist/lime-elements/{p-648d9057.entry.js.map → p-b3ff8fef.entry.js.map} +0 -0
  327. /package/dist/lime-elements/{p-715d3252.entry.js.map → p-b70f517e.entry.js.map} +0 -0
  328. /package/dist/lime-elements/{p-753f500b.entry.js.map → p-b897fe1f.entry.js.map} +0 -0
  329. /package/dist/lime-elements/{p-2359d139.entry.js.map → p-b9698f79.entry.js.map} +0 -0
  330. /package/dist/lime-elements/{p-5b374246.entry.js.map → p-bc23beb6.entry.js.map} +0 -0
  331. /package/dist/lime-elements/{p-f1d9723a.entry.js.map → p-bd62071d.entry.js.map} +0 -0
  332. /package/dist/lime-elements/{p-a11a971e.entry.js.map → p-cf61ac34.entry.js.map} +0 -0
  333. /package/dist/lime-elements/{p-7a3f58cd.entry.js.map → p-dd14b927.entry.js.map} +0 -0
  334. /package/dist/lime-elements/{p-2118b9ae.entry.js.map → p-eae4f1ed.entry.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{r,c as t,h as i,g as e}from"./p-c8818b66.js";import{c as n,a as o}from"./p-eab67c09.js";var u=n((function(r,t){(function(t,i){r.exports=i()})(o,(function(){var r=navigator.userAgent;var t=navigator.platform;var i=/gecko\/\d/i.test(r);var e=/MSIE \d/.test(r);var n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(r);var o=/Edge\/(\d+)/.exec(r);var u=e||n||o;var f=u&&(e?document.documentMode||6:+(o||n)[1]);var a=!o&&/WebKit\//.test(r);var l=a&&/Qt\/\d+\.\d+/.test(r);var s=!o&&/Chrome\/(\d+)/.exec(r);var c=s&&+s[1];var v=/Opera\//.test(r);var h=/Apple Computer/.test(navigator.vendor);var d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(r);var m=/PhantomJS/.test(r);var p=h&&(/Mobile\/\w+/.test(r)||navigator.maxTouchPoints>2);var g=/Android/.test(r);var b=p||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(r);var w=p||/Mac/.test(t);var k=/\bCrOS\b/.test(r);var C=/win/i.test(t);var M=v&&r.match(/Version\/(\d*\.\d*)/);if(M){M=Number(M[1])}if(M&&M>=15){v=false;a=true}var A=w&&(l||v&&(M==null||M<12.11));var y=i||u&&f>=9;function x(r){return new RegExp("(^|\\s)"+r+"(?:$|\\s)\\s*")}var L=function(r,t){var i=r.className;var e=x(t).exec(i);if(e){var n=i.slice(e.index+e[0].length);r.className=i.slice(0,e.index)+(n?e[1]+n:"")}};function S(r){for(var t=r.childNodes.length;t>0;--t){r.removeChild(r.firstChild)}return r}function N(r,t){return S(r).appendChild(t)}function E(r,t,i,e){var n=document.createElement(r);if(i){n.className=i}if(e){n.style.cssText=e}if(typeof t=="string"){n.appendChild(document.createTextNode(t))}else if(t){for(var o=0;o<t.length;++o){n.appendChild(t[o])}}return n}function D(r,t,i,e){var n=E(r,t,i,e);n.setAttribute("role","presentation");return n}var T;if(document.createRange){T=function(r,t,i,e){var n=document.createRange();n.setEnd(e||r,i);n.setStart(r,t);return n}}else{T=function(r,t,i){var e=document.body.createTextRange();try{e.moveToElementText(r.parentNode)}catch(r){return e}e.collapse(true);e.moveEnd("character",i);e.moveStart("character",t);return e}}function I(r,t){if(t.nodeType==3){t=t.parentNode}if(r.contains){return r.contains(t)}do{if(t.nodeType==11){t=t.host}if(t==r){return true}}while(t=t.parentNode)}function O(r){var t;try{t=r.activeElement}catch(i){t=r.body||null}while(t&&t.shadowRoot&&t.shadowRoot.activeElement){t=t.shadowRoot.activeElement}return t}function R(r,t){var i=r.className;if(!x(t).test(i)){r.className+=(i?" ":"")+t}}function B(r,t){var i=r.split(" ");for(var e=0;e<i.length;e++){if(i[e]&&!x(i[e]).test(t)){t+=" "+i[e]}}return t}var U=function(r){r.select()};if(p){U=function(r){r.selectionStart=0;r.selectionEnd=r.value.length}}else if(u){U=function(r){try{r.select()}catch(r){}}}function z(r){return r.display.wrapper.ownerDocument}function j(r){return z(r).defaultView}function W(r){var t=Array.prototype.slice.call(arguments,1);return function(){return r.apply(null,t)}}function F(r,t,i){if(!t){t={}}for(var e in r){if(r.hasOwnProperty(e)&&(i!==false||!t.hasOwnProperty(e))){t[e]=r[e]}}return t}function P(r,t,i,e,n){if(t==null){t=r.search(/[^\s\u00a0]/);if(t==-1){t=r.length}}for(var o=e||0,u=n||0;;){var f=r.indexOf("\t",o);if(f<0||f>=t){return u+(t-o)}u+=f-o;u+=i-u%i;o=f+1}}var G=function(){this.id=null;this.f=null;this.time=0;this.handler=W(this.onTimeout,this)};G.prototype.onTimeout=function(r){r.id=0;if(r.time<=+new Date){r.f()}else{setTimeout(r.handler,r.time-+new Date)}};G.prototype.set=function(r,t){this.f=t;var i=+new Date+r;if(!this.id||i<this.time){clearTimeout(this.id);this.id=setTimeout(this.handler,r);this.time=i}};function H(r,t){for(var i=0;i<r.length;++i){if(r[i]==t){return i}}return-1}var V=50;var $={toString:function(){return"CodeMirror.Pass"}};var _={scroll:false},Q={origin:"*mouse"},J={origin:"+move"};function K(r,t,i){for(var e=0,n=0;;){var o=r.indexOf("\t",e);if(o==-1){o=r.length}var u=o-e;if(o==r.length||n+u>=t){return e+Math.min(u,t-n)}n+=o-e;n+=i-n%i;e=o+1;if(n>=t){return e}}}var Y=[""];function X(r){while(Y.length<=r){Y.push(q(Y)+" ")}return Y[r]}function q(r){return r[r.length-1]}function Z(r,t){var i=[];for(var e=0;e<r.length;e++){i[e]=t(r[e],e)}return i}function rr(r,t,i){var e=0,n=i(t);while(e<r.length&&i(r[e])<=n){e++}r.splice(e,0,t)}function tr(){}function ir(r,t){var i;if(Object.create){i=Object.create(r)}else{tr.prototype=r;i=new tr}if(t){F(t,i)}return i}var er=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function nr(r){return/\w/.test(r)||r>"€"&&(r.toUpperCase()!=r.toLowerCase()||er.test(r))}function or(r,t){if(!t){return nr(r)}if(t.source.indexOf("\\w")>-1&&nr(r)){return true}return t.test(r)}function ur(r){for(var t in r){if(r.hasOwnProperty(t)&&r[t]){return false}}return true}var fr=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ar(r){return r.charCodeAt(0)>=768&&fr.test(r)}function lr(r,t,i){while((i<0?t>0:t<r.length)&&ar(r.charAt(t))){t+=i}return t}function sr(r,t,i){var e=t>i?-1:1;for(;;){if(t==i){return t}var n=(t+i)/2,o=e<0?Math.ceil(n):Math.floor(n);if(o==t){return r(o)?t:i}if(r(o)){i=o}else{t=o+e}}}function cr(r,t,i,e){if(!r){return e(t,i,"ltr",0)}var n=false;for(var o=0;o<r.length;++o){var u=r[o];if(u.from<i&&u.to>t||t==i&&u.to==t){e(Math.max(u.from,t),Math.min(u.to,i),u.level==1?"rtl":"ltr",o);n=true}}if(!n){e(t,i,"ltr")}}var vr=null;function hr(r,t,i){var e;vr=null;for(var n=0;n<r.length;++n){var o=r[n];if(o.from<t&&o.to>t){return n}if(o.to==t){if(o.from!=o.to&&i=="before"){e=n}else{vr=n}}if(o.from==t){if(o.from!=o.to&&i!="before"){e=n}else{vr=n}}}return e!=null?e:vr}var dr=function(){var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";var t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(i){if(i<=247){return r.charAt(i)}else if(1424<=i&&i<=1524){return"R"}else if(1536<=i&&i<=1785){return t.charAt(i-1536)}else if(1774<=i&&i<=2220){return"r"}else if(8192<=i&&i<=8203){return"w"}else if(i==8204){return"b"}else{return"L"}}var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;var n=/[stwN]/,o=/[LRr]/,u=/[Lb1n]/,f=/[1n]/;function a(r,t,i){this.level=r;this.from=t;this.to=i}return function(r,t){var l=t=="ltr"?"L":"R";if(r.length==0||t=="ltr"&&!e.test(r)){return false}var s=r.length,c=[];for(var v=0;v<s;++v){c.push(i(r.charCodeAt(v)))}for(var h=0,d=l;h<s;++h){var m=c[h];if(m=="m"){c[h]=d}else{d=m}}for(var p=0,g=l;p<s;++p){var b=c[p];if(b=="1"&&g=="r"){c[p]="n"}else if(o.test(b)){g=b;if(b=="r"){c[p]="R"}}}for(var w=1,k=c[0];w<s-1;++w){var C=c[w];if(C=="+"&&k=="1"&&c[w+1]=="1"){c[w]="1"}else if(C==","&&k==c[w+1]&&(k=="1"||k=="n")){c[w]=k}k=C}for(var M=0;M<s;++M){var A=c[M];if(A==","){c[M]="N"}else if(A=="%"){var y=void 0;for(y=M+1;y<s&&c[y]=="%";++y){}var x=M&&c[M-1]=="!"||y<s&&c[y]=="1"?"1":"N";for(var L=M;L<y;++L){c[L]=x}M=y-1}}for(var S=0,N=l;S<s;++S){var E=c[S];if(N=="L"&&E=="1"){c[S]="L"}else if(o.test(E)){N=E}}for(var D=0;D<s;++D){if(n.test(c[D])){var T=void 0;for(T=D+1;T<s&&n.test(c[T]);++T){}var I=(D?c[D-1]:l)=="L";var O=(T<s?c[T]:l)=="L";var R=I==O?I?"L":"R":l;for(var B=D;B<T;++B){c[B]=R}D=T-1}}var U=[],z;for(var j=0;j<s;){if(u.test(c[j])){var W=j;for(++j;j<s&&u.test(c[j]);++j){}U.push(new a(0,W,j))}else{var F=j,P=U.length,G=t=="rtl"?1:0;for(++j;j<s&&c[j]!="L";++j){}for(var H=F;H<j;){if(f.test(c[H])){if(F<H){U.splice(P,0,new a(1,F,H));P+=G}var V=H;for(++H;H<j&&f.test(c[H]);++H){}U.splice(P,0,new a(2,V,H));P+=G;F=H}else{++H}}if(F<j){U.splice(P,0,new a(1,F,j))}}}if(t=="ltr"){if(U[0].level==1&&(z=r.match(/^\s+/))){U[0].from=z[0].length;U.unshift(new a(0,0,z[0].length))}if(q(U).level==1&&(z=r.match(/\s+$/))){q(U).to-=z[0].length;U.push(new a(0,s-z[0].length,s))}}return t=="rtl"?U.reverse():U}}();function mr(r,t){var i=r.order;if(i==null){i=r.order=dr(r.text,t)}return i}var pr=[];var gr=function(r,t,i){if(r.addEventListener){r.addEventListener(t,i,false)}else if(r.attachEvent){r.attachEvent("on"+t,i)}else{var e=r._handlers||(r._handlers={});e[t]=(e[t]||pr).concat(i)}};function br(r,t){return r._handlers&&r._handlers[t]||pr}function wr(r,t,i){if(r.removeEventListener){r.removeEventListener(t,i,false)}else if(r.detachEvent){r.detachEvent("on"+t,i)}else{var e=r._handlers,n=e&&e[t];if(n){var o=H(n,i);if(o>-1){e[t]=n.slice(0,o).concat(n.slice(o+1))}}}}function kr(r,t){var i=br(r,t);if(!i.length){return}var e=Array.prototype.slice.call(arguments,2);for(var n=0;n<i.length;++n){i[n].apply(null,e)}}function Cr(r,t,i){if(typeof t=="string"){t={type:t,preventDefault:function(){this.defaultPrevented=true}}}kr(r,i||t.type,r,t);return Sr(t)||t.codemirrorIgnore}function Mr(r){var t=r._handlers&&r._handlers.cursorActivity;if(!t){return}var i=r.curOp.cursorActivityHandlers||(r.curOp.cursorActivityHandlers=[]);for(var e=0;e<t.length;++e){if(H(i,t[e])==-1){i.push(t[e])}}}function Ar(r,t){return br(r,t).length>0}function yr(r){r.prototype.on=function(r,t){gr(this,r,t)};r.prototype.off=function(r,t){wr(this,r,t)}}function xr(r){if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}}function Lr(r){if(r.stopPropagation){r.stopPropagation()}else{r.cancelBubble=true}}function Sr(r){return r.defaultPrevented!=null?r.defaultPrevented:r.returnValue==false}function Nr(r){xr(r);Lr(r)}function Er(r){return r.target||r.srcElement}function Dr(r){var t=r.which;if(t==null){if(r.button&1){t=1}else if(r.button&2){t=3}else if(r.button&4){t=2}}if(w&&r.ctrlKey&&t==1){t=3}return t}var Tr=function(){if(u&&f<9){return false}var r=E("div");return"draggable"in r||"dragDrop"in r}();var Ir;function Or(r){if(Ir==null){var t=E("span","​");N(r,E("span",[t,document.createTextNode("x")]));if(r.firstChild.offsetHeight!=0){Ir=t.offsetWidth<=1&&t.offsetHeight>2&&!(u&&f<8)}}var i=Ir?E("span","​"):E("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");i.setAttribute("cm-text","");return i}var Rr;function Br(r){if(Rr!=null){return Rr}var t=N(r,document.createTextNode("AخA"));var i=T(t,0,1).getBoundingClientRect();var e=T(t,1,2).getBoundingClientRect();S(r);if(!i||i.left==i.right){return false}return Rr=e.right-i.right<3}var Ur="\n\nb".split(/\n/).length!=3?function(r){var t=0,i=[],e=r.length;while(t<=e){var n=r.indexOf("\n",t);if(n==-1){n=r.length}var o=r.slice(t,r.charAt(n-1)=="\r"?n-1:n);var u=o.indexOf("\r");if(u!=-1){i.push(o.slice(0,u));t+=u+1}else{i.push(o);t=n+1}}return i}:function(r){return r.split(/\r\n?|\n/)};var zr=window.getSelection?function(r){try{return r.selectionStart!=r.selectionEnd}catch(r){return false}}:function(r){var t;try{t=r.ownerDocument.selection.createRange()}catch(r){}if(!t||t.parentElement()!=r){return false}return t.compareEndPoints("StartToEnd",t)!=0};var jr=function(){var r=E("div");if("oncopy"in r){return true}r.setAttribute("oncopy","return;");return typeof r.oncopy=="function"}();var Wr=null;function Fr(r){if(Wr!=null){return Wr}var t=N(r,E("span","x"));var i=t.getBoundingClientRect();var e=T(t,0,1).getBoundingClientRect();return Wr=Math.abs(i.left-e.left)>1}var Pr={},Gr={};function Hr(r,t){if(arguments.length>2){t.dependencies=Array.prototype.slice.call(arguments,2)}Pr[r]=t}function Vr(r,t){Gr[r]=t}function $r(r){if(typeof r=="string"&&Gr.hasOwnProperty(r)){r=Gr[r]}else if(r&&typeof r.name=="string"&&Gr.hasOwnProperty(r.name)){var t=Gr[r.name];if(typeof t=="string"){t={name:t}}r=ir(t,r);r.name=t.name}else if(typeof r=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(r)){return $r("application/xml")}else if(typeof r=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(r)){return $r("application/json")}if(typeof r=="string"){return{name:r}}else{return r||{name:"null"}}}function _r(r,t){t=$r(t);var i=Pr[t.name];if(!i){return _r(r,"text/plain")}var e=i(r,t);if(Qr.hasOwnProperty(t.name)){var n=Qr[t.name];for(var o in n){if(!n.hasOwnProperty(o)){continue}if(e.hasOwnProperty(o)){e["_"+o]=e[o]}e[o]=n[o]}}e.name=t.name;if(t.helperType){e.helperType=t.helperType}if(t.modeProps){for(var u in t.modeProps){e[u]=t.modeProps[u]}}return e}var Qr={};function Jr(r,t){var i=Qr.hasOwnProperty(r)?Qr[r]:Qr[r]={};F(t,i)}function Kr(r,t){if(t===true){return t}if(r.copyState){return r.copyState(t)}var i={};for(var e in t){var n=t[e];if(n instanceof Array){n=n.concat([])}i[e]=n}return i}function Yr(r,t){var i;while(r.innerMode){i=r.innerMode(t);if(!i||i.mode==r){break}t=i.state;r=i.mode}return i||{mode:r,state:t}}function Xr(r,t,i){return r.startState?r.startState(t,i):true}var qr=function(r,t,i){this.pos=this.start=0;this.string=r;this.tabSize=t||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0;this.lineOracle=i};qr.prototype.eol=function(){return this.pos>=this.string.length};qr.prototype.sol=function(){return this.pos==this.lineStart};qr.prototype.peek=function(){return this.string.charAt(this.pos)||undefined};qr.prototype.next=function(){if(this.pos<this.string.length){return this.string.charAt(this.pos++)}};qr.prototype.eat=function(r){var t=this.string.charAt(this.pos);var i;if(typeof r=="string"){i=t==r}else{i=t&&(r.test?r.test(t):r(t))}if(i){++this.pos;return t}};qr.prototype.eatWhile=function(r){var t=this.pos;while(this.eat(r)){}return this.pos>t};qr.prototype.eatSpace=function(){var r=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos}return this.pos>r};qr.prototype.skipToEnd=function(){this.pos=this.string.length};qr.prototype.skipTo=function(r){var t=this.string.indexOf(r,this.pos);if(t>-1){this.pos=t;return true}};qr.prototype.backUp=function(r){this.pos-=r};qr.prototype.column=function(){if(this.lastColumnPos<this.start){this.lastColumnValue=P(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start}return this.lastColumnValue-(this.lineStart?P(this.string,this.lineStart,this.tabSize):0)};qr.prototype.indentation=function(){return P(this.string,null,this.tabSize)-(this.lineStart?P(this.string,this.lineStart,this.tabSize):0)};qr.prototype.match=function(r,t,i){if(typeof r=="string"){var e=function(r){return i?r.toLowerCase():r};var n=this.string.substr(this.pos,r.length);if(e(n)==e(r)){if(t!==false){this.pos+=r.length}return true}}else{var o=this.string.slice(this.pos).match(r);if(o&&o.index>0){return null}if(o&&t!==false){this.pos+=o[0].length}return o}};qr.prototype.current=function(){return this.string.slice(this.start,this.pos)};qr.prototype.hideFirstChars=function(r,t){this.lineStart+=r;try{return t()}finally{this.lineStart-=r}};qr.prototype.lookAhead=function(r){var t=this.lineOracle;return t&&t.lookAhead(r)};qr.prototype.baseToken=function(){var r=this.lineOracle;return r&&r.baseToken(this.pos)};function Zr(r,t){t-=r.first;if(t<0||t>=r.size){throw new Error("There is no line "+(t+r.first)+" in the document.")}var i=r;while(!i.lines){for(var e=0;;++e){var n=i.children[e],o=n.chunkSize();if(t<o){i=n;break}t-=o}}return i.lines[t]}function rt(r,t,i){var e=[],n=t.line;r.iter(t.line,i.line+1,(function(r){var o=r.text;if(n==i.line){o=o.slice(0,i.ch)}if(n==t.line){o=o.slice(t.ch)}e.push(o);++n}));return e}function tt(r,t,i){var e=[];r.iter(t,i,(function(r){e.push(r.text)}));return e}function it(r,t){var i=t-r.height;if(i){for(var e=r;e;e=e.parent){e.height+=i}}}function et(r){if(r.parent==null){return null}var t=r.parent,i=H(t.lines,r);for(var e=t.parent;e;t=e,e=e.parent){for(var n=0;;++n){if(e.children[n]==t){break}i+=e.children[n].chunkSize()}}return i+t.first}function nt(r,t){var i=r.first;r:do{for(var e=0;e<r.children.length;++e){var n=r.children[e],o=n.height;if(t<o){r=n;continue r}t-=o;i+=n.chunkSize()}return i}while(!r.lines);var u=0;for(;u<r.lines.length;++u){var f=r.lines[u],a=f.height;if(t<a){break}t-=a}return i+u}function ot(r,t){return t>=r.first&&t<r.first+r.size}function ut(r,t){return String(r.lineNumberFormatter(t+r.firstLineNumber))}function ft(r,t,i){if(i===void 0)i=null;if(!(this instanceof ft)){return new ft(r,t,i)}this.line=r;this.ch=t;this.sticky=i}function at(r,t){return r.line-t.line||r.ch-t.ch}function lt(r,t){return r.sticky==t.sticky&&at(r,t)==0}function st(r){return ft(r.line,r.ch)}function ct(r,t){return at(r,t)<0?t:r}function vt(r,t){return at(r,t)<0?r:t}function ht(r,t){return Math.max(r.first,Math.min(t,r.first+r.size-1))}function dt(r,t){if(t.line<r.first){return ft(r.first,0)}var i=r.first+r.size-1;if(t.line>i){return ft(i,Zr(r,i).text.length)}return mt(t,Zr(r,t.line).text.length)}function mt(r,t){var i=r.ch;if(i==null||i>t){return ft(r.line,t)}else if(i<0){return ft(r.line,0)}else{return r}}function pt(r,t){var i=[];for(var e=0;e<t.length;e++){i[e]=dt(r,t[e])}return i}var gt=function(r,t){this.state=r;this.lookAhead=t};var bt=function(r,t,i,e){this.state=t;this.doc=r;this.line=i;this.maxLookAhead=e||0;this.baseTokens=null;this.baseTokenPos=1};bt.prototype.lookAhead=function(r){var t=this.doc.getLine(this.line+r);if(t!=null&&r>this.maxLookAhead){this.maxLookAhead=r}return t};bt.prototype.baseToken=function(r){if(!this.baseTokens){return null}while(this.baseTokens[this.baseTokenPos]<=r){this.baseTokenPos+=2}var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-r}};bt.prototype.nextLine=function(){this.line++;if(this.maxLookAhead>0){this.maxLookAhead--}};bt.fromSaved=function(r,t,i){if(t instanceof gt){return new bt(r,Kr(r.mode,t.state),i,t.lookAhead)}else{return new bt(r,Kr(r.mode,t),i)}};bt.prototype.save=function(r){var t=r!==false?Kr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new gt(t,this.maxLookAhead):t};function wt(r,t,i,e){var n=[r.state.modeGen],o={};Nt(r,t.text,r.doc.mode,i,(function(r,t){return n.push(r,t)}),o,e);var u=i.state;var f=function(e){i.baseTokens=n;var f=r.state.overlays[e],a=1,l=0;i.state=true;Nt(r,t.text,f.mode,i,(function(r,t){var i=a;while(l<r){var e=n[a];if(e>r){n.splice(a,1,r,n[a+1],e)}a+=2;l=Math.min(r,e)}if(!t){return}if(f.opaque){n.splice(i,a-i,r,"overlay "+t);a=i+2}else{for(;i<a;i+=2){var o=n[i+1];n[i+1]=(o?o+" ":"")+"overlay "+t}}}),o);i.state=u;i.baseTokens=null;i.baseTokenPos=1};for(var a=0;a<r.state.overlays.length;++a)f(a);return{styles:n,classes:o.bgClass||o.textClass?o:null}}function kt(r,t,i){if(!t.styles||t.styles[0]!=r.state.modeGen){var e=Ct(r,et(t));var n=t.text.length>r.options.maxHighlightLength&&Kr(r.doc.mode,e.state);var o=wt(r,t,e);if(n){e.state=n}t.stateAfter=e.save(!n);t.styles=o.styles;if(o.classes){t.styleClasses=o.classes}else if(t.styleClasses){t.styleClasses=null}if(i===r.doc.highlightFrontier){r.doc.modeFrontier=Math.max(r.doc.modeFrontier,++r.doc.highlightFrontier)}}return t.styles}function Ct(r,t,i){var e=r.doc,n=r.display;if(!e.mode.startState){return new bt(e,true,t)}var o=Et(r,t,i);var u=o>e.first&&Zr(e,o-1).stateAfter;var f=u?bt.fromSaved(e,u,o):new bt(e,Xr(e.mode),o);e.iter(o,t,(function(i){Mt(r,i.text,f);var e=f.line;i.stateAfter=e==t-1||e%5==0||e>=n.viewFrom&&e<n.viewTo?f.save():null;f.nextLine()}));if(i){e.modeFrontier=f.line}return f}function Mt(r,t,i,e){var n=r.doc.mode;var o=new qr(t,r.options.tabSize,i);o.start=o.pos=e||0;if(t==""){At(n,i.state)}while(!o.eol()){yt(n,o,i.state);o.start=o.pos}}function At(r,t){if(r.blankLine){return r.blankLine(t)}if(!r.innerMode){return}var i=Yr(r,t);if(i.mode.blankLine){return i.mode.blankLine(i.state)}}function yt(r,t,i,e){for(var n=0;n<10;n++){if(e){e[0]=Yr(r,i).mode}var o=r.token(t,i);if(t.pos>t.start){return o}}throw new Error("Mode "+r.name+" failed to advance stream.")}var xt=function(r,t,i){this.start=r.start;this.end=r.pos;this.string=r.current();this.type=t||null;this.state=i};function Lt(r,t,i,e){var n=r.doc,o=n.mode,u;t=dt(n,t);var f=Zr(n,t.line),a=Ct(r,t.line,i);var l=new qr(f.text,r.options.tabSize,a),s;if(e){s=[]}while((e||l.pos<t.ch)&&!l.eol()){l.start=l.pos;u=yt(o,l,a.state);if(e){s.push(new xt(l,u,Kr(n.mode,a.state)))}}return e?s:new xt(l,u,a.state)}function St(r,t){if(r){for(;;){var i=r.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i){break}r=r.slice(0,i.index)+r.slice(i.index+i[0].length);var e=i[1]?"bgClass":"textClass";if(t[e]==null){t[e]=i[2]}else if(!new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[e])){t[e]+=" "+i[2]}}}return r}function Nt(r,t,i,e,n,o,u){var f=i.flattenSpans;if(f==null){f=r.options.flattenSpans}var a=0,l=null;var s=new qr(t,r.options.tabSize,e),c;var v=r.options.addModeClass&&[null];if(t==""){St(At(i,e.state),o)}while(!s.eol()){if(s.pos>r.options.maxHighlightLength){f=false;if(u){Mt(r,t,e,s.pos)}s.pos=t.length;c=null}else{c=St(yt(i,s,e.state,v),o)}if(v){var h=v[0].name;if(h){c="m-"+(c?h+" "+c:h)}}if(!f||l!=c){while(a<s.start){a=Math.min(s.start,a+5e3);n(a,l)}l=c}s.start=s.pos}while(a<s.pos){var d=Math.min(s.pos,a+5e3);n(d,l);a=d}}function Et(r,t,i){var e,n,o=r.doc;var u=i?-1:t-(r.doc.mode.innerMode?1e3:100);for(var f=t;f>u;--f){if(f<=o.first){return o.first}var a=Zr(o,f-1),l=a.stateAfter;if(l&&(!i||f+(l instanceof gt?l.lookAhead:0)<=o.modeFrontier)){return f}var s=P(a.text,null,r.options.tabSize);if(n==null||e>s){n=f-1;e=s}}return n}function Dt(r,t){r.modeFrontier=Math.min(r.modeFrontier,t);if(r.highlightFrontier<t-10){return}var i=r.first;for(var e=t-1;e>i;e--){var n=Zr(r,e).stateAfter;if(n&&(!(n instanceof gt)||e+n.lookAhead<t)){i=e+1;break}}r.highlightFrontier=Math.min(r.highlightFrontier,i)}var Tt=false,It=false;function Ot(){Tt=true}function Rt(){It=true}function Bt(r,t,i){this.marker=r;this.from=t;this.to=i}function Ut(r,t){if(r){for(var i=0;i<r.length;++i){var e=r[i];if(e.marker==t){return e}}}}function zt(r,t){var i;for(var e=0;e<r.length;++e){if(r[e]!=t){(i||(i=[])).push(r[e])}}return i}function jt(r,t,i){var e=i&&window.WeakSet&&(i.markedSpans||(i.markedSpans=new WeakSet));if(e&&r.markedSpans&&e.has(r.markedSpans)){r.markedSpans.push(t)}else{r.markedSpans=r.markedSpans?r.markedSpans.concat([t]):[t];if(e){e.add(r.markedSpans)}}t.marker.attachLine(r)}function Wt(r,t,i){var e;if(r){for(var n=0;n<r.length;++n){var o=r[n],u=o.marker;var f=o.from==null||(u.inclusiveLeft?o.from<=t:o.from<t);if(f||o.from==t&&u.type=="bookmark"&&(!i||!o.marker.insertLeft)){var a=o.to==null||(u.inclusiveRight?o.to>=t:o.to>t);(e||(e=[])).push(new Bt(u,o.from,a?null:o.to))}}}return e}function Ft(r,t,i){var e;if(r){for(var n=0;n<r.length;++n){var o=r[n],u=o.marker;var f=o.to==null||(u.inclusiveRight?o.to>=t:o.to>t);if(f||o.from==t&&u.type=="bookmark"&&(!i||o.marker.insertLeft)){var a=o.from==null||(u.inclusiveLeft?o.from<=t:o.from<t);(e||(e=[])).push(new Bt(u,a?null:o.from-t,o.to==null?null:o.to-t))}}}return e}function Pt(r,t){if(t.full){return null}var i=ot(r,t.from.line)&&Zr(r,t.from.line).markedSpans;var e=ot(r,t.to.line)&&Zr(r,t.to.line).markedSpans;if(!i&&!e){return null}var n=t.from.ch,o=t.to.ch,u=at(t.from,t.to)==0;var f=Wt(i,n,u);var a=Ft(e,o,u);var l=t.text.length==1,s=q(t.text).length+(l?n:0);if(f){for(var c=0;c<f.length;++c){var v=f[c];if(v.to==null){var h=Ut(a,v.marker);if(!h){v.to=n}else if(l){v.to=h.to==null?null:h.to+s}}}}if(a){for(var d=0;d<a.length;++d){var m=a[d];if(m.to!=null){m.to+=s}if(m.from==null){var p=Ut(f,m.marker);if(!p){m.from=s;if(l){(f||(f=[])).push(m)}}}else{m.from+=s;if(l){(f||(f=[])).push(m)}}}}if(f){f=Gt(f)}if(a&&a!=f){a=Gt(a)}var g=[f];if(!l){var b=t.text.length-2,w;if(b>0&&f){for(var k=0;k<f.length;++k){if(f[k].to==null){(w||(w=[])).push(new Bt(f[k].marker,null,null))}}}for(var C=0;C<b;++C){g.push(w)}g.push(a)}return g}function Gt(r){for(var t=0;t<r.length;++t){var i=r[t];if(i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==false){r.splice(t--,1)}}if(!r.length){return null}return r}function Ht(r,t,i){var e=null;r.iter(t.line,i.line+1,(function(r){if(r.markedSpans){for(var t=0;t<r.markedSpans.length;++t){var i=r.markedSpans[t].marker;if(i.readOnly&&(!e||H(e,i)==-1)){(e||(e=[])).push(i)}}}}));if(!e){return null}var n=[{from:t,to:i}];for(var o=0;o<e.length;++o){var u=e[o],f=u.find(0);for(var a=0;a<n.length;++a){var l=n[a];if(at(l.to,f.from)<0||at(l.from,f.to)>0){continue}var s=[a,1],c=at(l.from,f.from),v=at(l.to,f.to);if(c<0||!u.inclusiveLeft&&!c){s.push({from:l.from,to:f.from})}if(v>0||!u.inclusiveRight&&!v){s.push({from:f.to,to:l.to})}n.splice.apply(n,s);a+=s.length-3}}return n}function Vt(r){var t=r.markedSpans;if(!t){return}for(var i=0;i<t.length;++i){t[i].marker.detachLine(r)}r.markedSpans=null}function $t(r,t){if(!t){return}for(var i=0;i<t.length;++i){t[i].marker.attachLine(r)}r.markedSpans=t}function _t(r){return r.inclusiveLeft?-1:0}function Qt(r){return r.inclusiveRight?1:0}function Jt(r,t){var i=r.lines.length-t.lines.length;if(i!=0){return i}var e=r.find(),n=t.find();var o=at(e.from,n.from)||_t(r)-_t(t);if(o){return-o}var u=at(e.to,n.to)||Qt(r)-Qt(t);if(u){return u}return t.id-r.id}function Kt(r,t){var i=It&&r.markedSpans,e;if(i){for(var n=void 0,o=0;o<i.length;++o){n=i[o];if(n.marker.collapsed&&(t?n.from:n.to)==null&&(!e||Jt(e,n.marker)<0)){e=n.marker}}}return e}function Yt(r){return Kt(r,true)}function Xt(r){return Kt(r,false)}function qt(r,t){var i=It&&r.markedSpans,e;if(i){for(var n=0;n<i.length;++n){var o=i[n];if(o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!e||Jt(e,o.marker)<0)){e=o.marker}}}return e}function Zt(r,t,i,e,n){var o=Zr(r,t);var u=It&&o.markedSpans;if(u){for(var f=0;f<u.length;++f){var a=u[f];if(!a.marker.collapsed){continue}var l=a.marker.find(0);var s=at(l.from,i)||_t(a.marker)-_t(n);var c=at(l.to,e)||Qt(a.marker)-Qt(n);if(s>=0&&c<=0||s<=0&&c>=0){continue}if(s<=0&&(a.marker.inclusiveRight&&n.inclusiveLeft?at(l.to,i)>=0:at(l.to,i)>0)||s>=0&&(a.marker.inclusiveRight&&n.inclusiveLeft?at(l.from,e)<=0:at(l.from,e)<0)){return true}}}}function ri(r){var t;while(t=Yt(r)){r=t.find(-1,true).line}return r}function ti(r){var t;while(t=Xt(r)){r=t.find(1,true).line}return r}function ii(r){var t,i;while(t=Xt(r)){r=t.find(1,true).line;(i||(i=[])).push(r)}return i}function ei(r,t){var i=Zr(r,t),e=ri(i);if(i==e){return t}return et(e)}function ni(r,t){if(t>r.lastLine()){return t}var i=Zr(r,t),e;if(!oi(r,i)){return t}while(e=Xt(i)){i=e.find(1,true).line}return et(i)+1}function oi(r,t){var i=It&&t.markedSpans;if(i){for(var e=void 0,n=0;n<i.length;++n){e=i[n];if(!e.marker.collapsed){continue}if(e.from==null){return true}if(e.marker.widgetNode){continue}if(e.from==0&&e.marker.inclusiveLeft&&ui(r,t,e)){return true}}}}function ui(r,t,i){if(i.to==null){var e=i.marker.find(1,true);return ui(r,e.line,Ut(e.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length){return true}for(var n=void 0,o=0;o<t.markedSpans.length;++o){n=t.markedSpans[o];if(n.marker.collapsed&&!n.marker.widgetNode&&n.from==i.to&&(n.to==null||n.to!=i.from)&&(n.marker.inclusiveLeft||i.marker.inclusiveRight)&&ui(r,t,n)){return true}}}function fi(r){r=ri(r);var t=0,i=r.parent;for(var e=0;e<i.lines.length;++e){var n=i.lines[e];if(n==r){break}else{t+=n.height}}for(var o=i.parent;o;i=o,o=i.parent){for(var u=0;u<o.children.length;++u){var f=o.children[u];if(f==i){break}else{t+=f.height}}}return t}function ai(r){if(r.height==0){return 0}var t=r.text.length,i,e=r;while(i=Yt(e)){var n=i.find(0,true);e=n.from.line;t+=n.from.ch-n.to.ch}e=r;while(i=Xt(e)){var o=i.find(0,true);t-=e.text.length-o.from.ch;e=o.to.line;t+=e.text.length-o.to.ch}return t}function li(r){var t=r.display,i=r.doc;t.maxLine=Zr(i,i.first);t.maxLineLength=ai(t.maxLine);t.maxLineChanged=true;i.iter((function(r){var i=ai(r);if(i>t.maxLineLength){t.maxLineLength=i;t.maxLine=r}}))}var si=function(r,t,i){this.text=r;$t(this,t);this.height=i?i(this):1};si.prototype.lineNo=function(){return et(this)};yr(si);function ci(r,t,i,e){r.text=t;if(r.stateAfter){r.stateAfter=null}if(r.styles){r.styles=null}if(r.order!=null){r.order=null}Vt(r);$t(r,i);var n=e?e(r):1;if(n!=r.height){it(r,n)}}function vi(r){r.parent=null;Vt(r)}var hi={},di={};function mi(r,t){if(!r||/^\s*$/.test(r)){return null}var i=t.addModeClass?di:hi;return i[r]||(i[r]=r.replace(/\S+/g,"cm-$&"))}function pi(r,t){var i=D("span",null,null,a?"padding-right: .1px":null);var e={pre:D("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:r,trailingSpace:false,splitSpaces:r.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var o=n?t.rest[n-1]:t.line,u=void 0;e.pos=0;e.addToken=bi;if(Br(r.display.measure)&&(u=mr(o,r.doc.direction))){e.addToken=ki(e.addToken,u)}e.map=[];var f=t!=r.display.externalMeasured&&et(o);Mi(o,e,kt(r,o,f));if(o.styleClasses){if(o.styleClasses.bgClass){e.bgClass=B(o.styleClasses.bgClass,e.bgClass||"")}if(o.styleClasses.textClass){e.textClass=B(o.styleClasses.textClass,e.textClass||"")}}if(e.map.length==0){e.map.push(0,0,e.content.appendChild(Or(r.display.measure)))}if(n==0){t.measure.map=e.map;t.measure.cache={}}else{(t.measure.maps||(t.measure.maps=[])).push(e.map);(t.measure.caches||(t.measure.caches=[])).push({})}}if(a){var l=e.content.lastChild;if(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab")){e.content.className="cm-tab-wrap-hack"}}kr(r,"renderLine",r,t.line,e.pre);if(e.pre.className){e.textClass=B(e.pre.className,e.textClass||"")}return e}function gi(r){var t=E("span","•","cm-invalidchar");t.title="\\u"+r.charCodeAt(0).toString(16);t.setAttribute("aria-label",t.title);return t}function bi(r,t,i,e,n,o,a){if(!t){return}var l=r.splitSpaces?wi(t,r.trailingSpace):t;var s=r.cm.state.specialChars,c=false;var v;if(!s.test(t)){r.col+=t.length;v=document.createTextNode(l);r.map.push(r.pos,r.pos+t.length,v);if(u&&f<9){c=true}r.pos+=t.length}else{v=document.createDocumentFragment();var h=0;while(true){s.lastIndex=h;var d=s.exec(t);var m=d?d.index-h:t.length-h;if(m){var p=document.createTextNode(l.slice(h,h+m));if(u&&f<9){v.appendChild(E("span",[p]))}else{v.appendChild(p)}r.map.push(r.pos,r.pos+m,p);r.col+=m;r.pos+=m}if(!d){break}h+=m+1;var g=void 0;if(d[0]=="\t"){var b=r.cm.options.tabSize,w=b-r.col%b;g=v.appendChild(E("span",X(w),"cm-tab"));g.setAttribute("role","presentation");g.setAttribute("cm-text","\t");r.col+=w}else if(d[0]=="\r"||d[0]=="\n"){g=v.appendChild(E("span",d[0]=="\r"?"␍":"␤","cm-invalidchar"));g.setAttribute("cm-text",d[0]);r.col+=1}else{g=r.cm.options.specialCharPlaceholder(d[0]);g.setAttribute("cm-text",d[0]);if(u&&f<9){v.appendChild(E("span",[g]))}else{v.appendChild(g)}r.col+=1}r.map.push(r.pos,r.pos+1,g);r.pos++}}r.trailingSpace=l.charCodeAt(t.length-1)==32;if(i||e||n||c||o||a){var k=i||"";if(e){k+=e}if(n){k+=n}var C=E("span",[v],k,o);if(a){for(var M in a){if(a.hasOwnProperty(M)&&M!="style"&&M!="class"){C.setAttribute(M,a[M])}}}return r.content.appendChild(C)}r.content.appendChild(v)}function wi(r,t){if(r.length>1&&!/ /.test(r)){return r}var i=t,e="";for(var n=0;n<r.length;n++){var o=r.charAt(n);if(o==" "&&i&&(n==r.length-1||r.charCodeAt(n+1)==32)){o=" "}e+=o;i=o==" "}return e}function ki(r,t){return function(i,e,n,o,u,f,a){n=n?n+" cm-force-border":"cm-force-border";var l=i.pos,s=l+e.length;for(;;){var c=void 0;for(var v=0;v<t.length;v++){c=t[v];if(c.to>l&&c.from<=l){break}}if(c.to>=s){return r(i,e,n,o,u,f,a)}r(i,e.slice(0,c.to-l),n,o,null,f,a);o=null;e=e.slice(c.to-l);l=c.to}}}function Ci(r,t,i,e){var n=!e&&i.widgetNode;if(n){r.map.push(r.pos,r.pos+t,n)}if(!e&&r.cm.display.input.needsContentAttribute){if(!n){n=r.content.appendChild(document.createElement("span"))}n.setAttribute("cm-marker",i.id)}if(n){r.cm.display.input.setUneditable(n);r.content.appendChild(n)}r.pos+=t;r.trailingSpace=false}function Mi(r,t,i){var e=r.markedSpans,n=r.text,o=0;if(!e){for(var u=1;u<i.length;u+=2){t.addToken(t,n.slice(o,o=i[u]),mi(i[u+1],t.cm.options))}return}var f=n.length,a=0,l=1,s="",c,v;var h=0,d,m,p,g,b;for(;;){if(h==a){d=m=p=v="";b=null;g=null;h=Infinity;var w=[],k=void 0;for(var C=0;C<e.length;++C){var M=e[C],A=M.marker;if(A.type=="bookmark"&&M.from==a&&A.widgetNode){w.push(A)}else if(M.from<=a&&(M.to==null||M.to>a||A.collapsed&&M.to==a&&M.from==a)){if(M.to!=null&&M.to!=a&&h>M.to){h=M.to;m=""}if(A.className){d+=" "+A.className}if(A.css){v=(v?v+";":"")+A.css}if(A.startStyle&&M.from==a){p+=" "+A.startStyle}if(A.endStyle&&M.to==h){(k||(k=[])).push(A.endStyle,M.to)}if(A.title){(b||(b={})).title=A.title}if(A.attributes){for(var y in A.attributes){(b||(b={}))[y]=A.attributes[y]}}if(A.collapsed&&(!g||Jt(g.marker,A)<0)){g=M}}else if(M.from>a&&h>M.from){h=M.from}}if(k){for(var x=0;x<k.length;x+=2){if(k[x+1]==h){m+=" "+k[x]}}}if(!g||g.from==a){for(var L=0;L<w.length;++L){Ci(t,0,w[L])}}if(g&&(g.from||0)==a){Ci(t,(g.to==null?f+1:g.to)-a,g.marker,g.from==null);if(g.to==null){return}if(g.to==a){g=false}}}if(a>=f){break}var S=Math.min(f,h);while(true){if(s){var N=a+s.length;if(!g){var E=N>S?s.slice(0,S-a):s;t.addToken(t,E,c?c+d:d,p,a+E.length==h?m:"",v,b)}if(N>=S){s=s.slice(S-a);a=S;break}a=N;p=""}s=n.slice(o,o=i[l++]);c=mi(i[l++],t.cm.options)}}}function Ai(r,t,i){this.line=t;this.rest=ii(t);this.size=this.rest?et(q(this.rest))-i+1:1;this.node=this.text=null;this.hidden=oi(r,t)}function yi(r,t,i){var e=[],n;for(var o=t;o<i;o=n){var u=new Ai(r.doc,Zr(r.doc,o),o);n=o+u.size;e.push(u)}return e}var xi=null;function Li(r){if(xi){xi.ops.push(r)}else{r.ownsGroup=xi={ops:[r],delayedCallbacks:[]}}}function Si(r){var t=r.delayedCallbacks,i=0;do{for(;i<t.length;i++){t[i].call(null)}for(var e=0;e<r.ops.length;e++){var n=r.ops[e];if(n.cursorActivityHandlers){while(n.cursorActivityCalled<n.cursorActivityHandlers.length){n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}}}}while(i<t.length)}function Ni(r,t){var i=r.ownsGroup;if(!i){return}try{Si(i)}finally{xi=null;t(i)}}var Ei=null;function Di(r,t){var i=br(r,t);if(!i.length){return}var e=Array.prototype.slice.call(arguments,2),n;if(xi){n=xi.delayedCallbacks}else if(Ei){n=Ei}else{n=Ei=[];setTimeout(Ti,0)}var o=function(r){n.push((function(){return i[r].apply(null,e)}))};for(var u=0;u<i.length;++u)o(u)}function Ti(){var r=Ei;Ei=null;for(var t=0;t<r.length;++t){r[t]()}}function Ii(r,t,i,e){for(var n=0;n<t.changes.length;n++){var o=t.changes[n];if(o=="text"){Ui(r,t)}else if(o=="gutter"){ji(r,t,i,e)}else if(o=="class"){zi(r,t)}else if(o=="widget"){Wi(r,t,e)}}t.changes=null}function Oi(r){if(r.node==r.text){r.node=E("div",null,null,"position: relative");if(r.text.parentNode){r.text.parentNode.replaceChild(r.node,r.text)}r.node.appendChild(r.text);if(u&&f<8){r.node.style.zIndex=2}}return r.node}function Ri(r,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i){i+=" CodeMirror-linebackground"}if(t.background){if(i){t.background.className=i}else{t.background.parentNode.removeChild(t.background);t.background=null}}else if(i){var e=Oi(t);t.background=e.insertBefore(E("div",null,i),e.firstChild);r.display.input.setUneditable(t.background)}}function Bi(r,t){var i=r.display.externalMeasured;if(i&&i.line==t.line){r.display.externalMeasured=null;t.measure=i.measure;return i.built}return pi(r,t)}function Ui(r,t){var i=t.text.className;var e=Bi(r,t);if(t.text==t.node){t.node=e.pre}t.text.parentNode.replaceChild(e.pre,t.text);t.text=e.pre;if(e.bgClass!=t.bgClass||e.textClass!=t.textClass){t.bgClass=e.bgClass;t.textClass=e.textClass;zi(r,t)}else if(i){t.text.className=i}}function zi(r,t){Ri(r,t);if(t.line.wrapClass){Oi(t).className=t.line.wrapClass}else if(t.node!=t.text){t.node.className=""}var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function ji(r,t,i,e){if(t.gutter){t.node.removeChild(t.gutter);t.gutter=null}if(t.gutterBackground){t.node.removeChild(t.gutterBackground);t.gutterBackground=null}if(t.line.gutterClass){var n=Oi(t);t.gutterBackground=E("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(r.options.fixedGutter?e.fixedPos:-e.gutterTotalWidth)+"px; width: "+e.gutterTotalWidth+"px");r.display.input.setUneditable(t.gutterBackground);n.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(r.options.lineNumbers||o){var u=Oi(t);var f=t.gutter=E("div",null,"CodeMirror-gutter-wrapper","left: "+(r.options.fixedGutter?e.fixedPos:-e.gutterTotalWidth)+"px");f.setAttribute("aria-hidden","true");r.display.input.setUneditable(f);u.insertBefore(f,t.text);if(t.line.gutterClass){f.className+=" "+t.line.gutterClass}if(r.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])){t.lineNumber=f.appendChild(E("div",ut(r.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+e.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+r.display.lineNumInnerWidth+"px"))}if(o){for(var a=0;a<r.display.gutterSpecs.length;++a){var l=r.display.gutterSpecs[a].className,s=o.hasOwnProperty(l)&&o[l];if(s){f.appendChild(E("div",[s],"CodeMirror-gutter-elt","left: "+e.gutterLeft[l]+"px; width: "+e.gutterWidth[l]+"px"))}}}}}function Wi(r,t,i){if(t.alignable){t.alignable=null}var e=x("CodeMirror-linewidget");for(var n=t.node.firstChild,o=void 0;n;n=o){o=n.nextSibling;if(e.test(n.className)){t.node.removeChild(n)}}Pi(r,t,i)}function Fi(r,t,i,e){var n=Bi(r,t);t.text=t.node=n.pre;if(n.bgClass){t.bgClass=n.bgClass}if(n.textClass){t.textClass=n.textClass}zi(r,t);ji(r,t,i,e);Pi(r,t,e);return t.node}function Pi(r,t,i){Gi(r,t.line,t,i,true);if(t.rest){for(var e=0;e<t.rest.length;e++){Gi(r,t.rest[e],t,i,false)}}}function Gi(r,t,i,e,n){if(!t.widgets){return}var o=Oi(i);for(var u=0,f=t.widgets;u<f.length;++u){var a=f[u],l=E("div",[a.node],"CodeMirror-linewidget"+(a.className?" "+a.className:""));if(!a.handleMouseEvents){l.setAttribute("cm-ignore-events","true")}Hi(a,l,i,e);r.display.input.setUneditable(l);if(n&&a.above){o.insertBefore(l,i.gutter||i.text)}else{o.appendChild(l)}Di(a,"redraw")}}function Hi(r,t,i,e){if(r.noHScroll){(i.alignable||(i.alignable=[])).push(t);var n=e.wrapperWidth;t.style.left=e.fixedPos+"px";if(!r.coverGutter){n-=e.gutterTotalWidth;t.style.paddingLeft=e.gutterTotalWidth+"px"}t.style.width=n+"px"}if(r.coverGutter){t.style.zIndex=5;t.style.position="relative";if(!r.noHScroll){t.style.marginLeft=-e.gutterTotalWidth+"px"}}}function Vi(r){if(r.height!=null){return r.height}var t=r.doc.cm;if(!t){return 0}if(!I(document.body,r.node)){var i="position: relative;";if(r.coverGutter){i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"}if(r.noHScroll){i+="width: "+t.display.wrapper.clientWidth+"px;"}N(t.display.measure,E("div",[r.node],null,i))}return r.height=r.node.parentNode.offsetHeight}function $i(r,t){for(var i=Er(t);i!=r.wrapper;i=i.parentNode){if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==r.sizer&&i!=r.mover){return true}}}function _i(r){return r.lineSpace.offsetTop}function Qi(r){return r.mover.offsetHeight-r.lineSpace.offsetHeight}function Ji(r){if(r.cachedPaddingH){return r.cachedPaddingH}var t=N(r.measure,E("pre","x","CodeMirror-line-like"));var i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle;var e={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};if(!isNaN(e.left)&&!isNaN(e.right)){r.cachedPaddingH=e}return e}function Ki(r){return V-r.display.nativeBarWidth}function Yi(r){return r.display.scroller.clientWidth-Ki(r)-r.display.barWidth}function Xi(r){return r.display.scroller.clientHeight-Ki(r)-r.display.barHeight}function qi(r,t,i){var e=r.options.lineWrapping;var n=e&&Yi(r);if(!t.measure.heights||e&&t.measure.width!=n){var o=t.measure.heights=[];if(e){t.measure.width=n;var u=t.text.firstChild.getClientRects();for(var f=0;f<u.length-1;f++){var a=u[f],l=u[f+1];if(Math.abs(a.bottom-l.bottom)>2){o.push((a.bottom+l.top)/2-i.top)}}}o.push(i.bottom-i.top)}}function Zi(r,t,i){if(r.line==t){return{map:r.measure.map,cache:r.measure.cache}}if(r.rest){for(var e=0;e<r.rest.length;e++){if(r.rest[e]==t){return{map:r.measure.maps[e],cache:r.measure.caches[e]}}}for(var n=0;n<r.rest.length;n++){if(et(r.rest[n])>i){return{map:r.measure.maps[n],cache:r.measure.caches[n],before:true}}}}}function re(r,t){t=ri(t);var i=et(t);var e=r.display.externalMeasured=new Ai(r.doc,t,i);e.lineN=i;var n=e.built=pi(r,e);e.text=n.pre;N(r.display.lineMeasure,n.pre);return e}function te(r,t,i,e){return ne(r,ee(r,t),i,e)}function ie(r,t){if(t>=r.display.viewFrom&&t<r.display.viewTo){return r.display.view[ze(r,t)]}var i=r.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size){return i}}function ee(r,t){var i=et(t);var e=ie(r,i);if(e&&!e.text){e=null}else if(e&&e.changes){Ii(r,e,i,Ie(r));r.curOp.forceUpdate=true}if(!e){e=re(r,t)}var n=Zi(e,t,i);return{line:t,view:e,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:false}}function ne(r,t,i,e,n){if(t.before){i=-1}var o=i+(e||""),u;if(t.cache.hasOwnProperty(o)){u=t.cache[o]}else{if(!t.rect){t.rect=t.view.text.getBoundingClientRect()}if(!t.hasHeights){qi(r,t.view,t.rect);t.hasHeights=true}u=ae(r,t,i,e);if(!u.bogus){t.cache[o]=u}}return{left:u.left,right:u.right,top:n?u.rtop:u.top,bottom:n?u.rbottom:u.bottom}}var oe={left:0,right:0,top:0,bottom:0};function ue(r,t,i){var e,n,o,u,f,a;for(var l=0;l<r.length;l+=3){f=r[l];a=r[l+1];if(t<f){n=0;o=1;u="left"}else if(t<a){n=t-f;o=n+1}else if(l==r.length-3||t==a&&r[l+3]>t){o=a-f;n=o-1;if(t>=a){u="right"}}if(n!=null){e=r[l+2];if(f==a&&i==(e.insertLeft?"left":"right")){u=i}if(i=="left"&&n==0){while(l&&r[l-2]==r[l-3]&&r[l-1].insertLeft){e=r[(l-=3)+2];u="left"}}if(i=="right"&&n==a-f){while(l<r.length-3&&r[l+3]==r[l+4]&&!r[l+5].insertLeft){e=r[(l+=3)+2];u="right"}}break}}return{node:e,start:n,end:o,collapse:u,coverStart:f,coverEnd:a}}function fe(r,t){var i=oe;if(t=="left"){for(var e=0;e<r.length;e++){if((i=r[e]).left!=i.right){break}}}else{for(var n=r.length-1;n>=0;n--){if((i=r[n]).left!=i.right){break}}}return i}function ae(r,t,i,e){var n=ue(t.map,i,e);var o=n.node,a=n.start,l=n.end,s=n.collapse;var c;if(o.nodeType==3){for(var v=0;v<4;v++){while(a&&ar(t.line.text.charAt(n.coverStart+a))){--a}while(n.coverStart+l<n.coverEnd&&ar(t.line.text.charAt(n.coverStart+l))){++l}if(u&&f<9&&a==0&&l==n.coverEnd-n.coverStart){c=o.parentNode.getBoundingClientRect()}else{c=fe(T(o,a,l).getClientRects(),e)}if(c.left||c.right||a==0){break}l=a;a=a-1;s="right"}if(u&&f<11){c=le(r.display.measure,c)}}else{if(a>0){s=e="right"}var h;if(r.options.lineWrapping&&(h=o.getClientRects()).length>1){c=h[e=="right"?h.length-1:0]}else{c=o.getBoundingClientRect()}}if(u&&f<9&&!a&&(!c||!c.left&&!c.right)){var d=o.parentNode.getClientRects()[0];if(d){c={left:d.left,right:d.left+Te(r.display),top:d.top,bottom:d.bottom}}else{c=oe}}var m=c.top-t.rect.top,p=c.bottom-t.rect.top;var g=(m+p)/2;var b=t.view.measure.heights;var w=0;for(;w<b.length-1;w++){if(g<b[w]){break}}var k=w?b[w-1]:0,C=b[w];var M={left:(s=="right"?c.right:c.left)-t.rect.left,right:(s=="left"?c.left:c.right)-t.rect.left,top:k,bottom:C};if(!c.left&&!c.right){M.bogus=true}if(!r.options.singleCursorHeightPerLine){M.rtop=m;M.rbottom=p}return M}function le(r,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Fr(r)){return t}var i=screen.logicalXDPI/screen.deviceXDPI;var e=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*e,bottom:t.bottom*e}}function se(r){if(r.measure){r.measure.cache={};r.measure.heights=null;if(r.rest){for(var t=0;t<r.rest.length;t++){r.measure.caches[t]={}}}}}function ce(r){r.display.externalMeasure=null;S(r.display.lineMeasure);for(var t=0;t<r.display.view.length;t++){se(r.display.view[t])}}function ve(r){ce(r);r.display.cachedCharWidth=r.display.cachedTextHeight=r.display.cachedPaddingH=null;if(!r.options.lineWrapping){r.display.maxLineChanged=true}r.display.lineNumChars=null}function he(r){if(s&&g){return-(r.body.getBoundingClientRect().left-parseInt(getComputedStyle(r.body).marginLeft))}return r.defaultView.pageXOffset||(r.documentElement||r.body).scrollLeft}function de(r){if(s&&g){return-(r.body.getBoundingClientRect().top-parseInt(getComputedStyle(r.body).marginTop))}return r.defaultView.pageYOffset||(r.documentElement||r.body).scrollTop}function me(r){var t=ri(r);var i=t.widgets;var e=0;if(i){for(var n=0;n<i.length;++n){if(i[n].above){e+=Vi(i[n])}}}return e}function pe(r,t,i,e,n){if(!n){var o=me(t);i.top+=o;i.bottom+=o}if(e=="line"){return i}if(!e){e="local"}var u=fi(t);if(e=="local"){u+=_i(r.display)}else{u-=r.display.viewOffset}if(e=="page"||e=="window"){var f=r.display.lineSpace.getBoundingClientRect();u+=f.top+(e=="window"?0:de(z(r)));var a=f.left+(e=="window"?0:he(z(r)));i.left+=a;i.right+=a}i.top+=u;i.bottom+=u;return i}function ge(r,t,i){if(i=="div"){return t}var e=t.left,n=t.top;if(i=="page"){e-=he(z(r));n-=de(z(r))}else if(i=="local"||!i){var o=r.display.sizer.getBoundingClientRect();e+=o.left;n+=o.top}var u=r.display.lineSpace.getBoundingClientRect();return{left:e-u.left,top:n-u.top}}function be(r,t,i,e,n){if(!e){e=Zr(r.doc,t.line)}return pe(r,e,te(r,e,t.ch,n),i)}function we(r,t,i,e,n,o){e=e||Zr(r.doc,t.line);if(!n){n=ee(r,e)}function u(t,u){var f=ne(r,n,t,u?"right":"left",o);if(u){f.left=f.right}else{f.right=f.left}return pe(r,e,f,i)}var f=mr(e,r.doc.direction),a=t.ch,l=t.sticky;if(a>=e.text.length){a=e.text.length;l="before"}else if(a<=0){a=0;l="after"}if(!f){return u(l=="before"?a-1:a,l=="before")}function s(r,t,i){var e=f[t],n=e.level==1;return u(i?r-1:r,n!=i)}var c=hr(f,a,l);var v=vr;var h=s(a,c,l=="before");if(v!=null){h.other=s(a,v,l!="before")}return h}function ke(r,t){var i=0;t=dt(r.doc,t);if(!r.options.lineWrapping){i=Te(r.display)*t.ch}var e=Zr(r.doc,t.line);var n=fi(e)+_i(r.display);return{left:i,right:i,top:n,bottom:n+e.height}}function Ce(r,t,i,e,n){var o=ft(r,t,i);o.xRel=n;if(e){o.outside=e}return o}function Me(r,t,i){var e=r.doc;i+=r.display.viewOffset;if(i<0){return Ce(e.first,0,null,-1,-1)}var n=nt(e,i),o=e.first+e.size-1;if(n>o){return Ce(e.first+e.size-1,Zr(e,o).text.length,null,1,1)}if(t<0){t=0}var u=Zr(e,n);for(;;){var f=Le(r,u,n,t,i);var a=qt(u,f.ch+(f.xRel>0||f.outside>0?1:0));if(!a){return f}var l=a.find(1);if(l.line==n){return l}u=Zr(e,n=l.line)}}function Ae(r,t,i,e){e-=me(t);var n=t.text.length;var o=sr((function(t){return ne(r,i,t-1).bottom<=e}),n,0);n=sr((function(t){return ne(r,i,t).top>e}),o,n);return{begin:o,end:n}}function ye(r,t,i,e){if(!i){i=ee(r,t)}var n=pe(r,t,ne(r,i,e),"line").top;return Ae(r,t,i,n)}function xe(r,t,i,e){return r.bottom<=i?false:r.top>i?true:(e?r.left:r.right)>t}function Le(r,t,i,e,n){n-=fi(t);var o=ee(r,t);var u=me(t);var f=0,a=t.text.length,l=true;var s=mr(t,r.doc.direction);if(s){var c=(r.options.lineWrapping?Ne:Se)(r,t,i,o,s,e,n);l=c.level!=1;f=l?c.from:c.to-1;a=l?c.to:c.from-1}var v=null,h=null;var d=sr((function(t){var i=ne(r,o,t);i.top+=u;i.bottom+=u;if(!xe(i,e,n,false)){return false}if(i.top<=n&&i.left<=e){v=t;h=i}return true}),f,a);var m,p,g=false;if(h){var b=e-h.left<h.right-e,w=b==l;d=v+(w?0:1);p=w?"after":"before";m=b?h.left:h.right}else{if(!l&&(d==a||d==f)){d++}p=d==0?"after":d==t.text.length?"before":ne(r,o,d-(l?1:0)).bottom+u<=n==l?"after":"before";var k=we(r,ft(i,d,p),"line",t,o);m=k.left;g=n<k.top?-1:n>=k.bottom?1:0}d=lr(t.text,d,1);return Ce(i,d,p,g,e-m)}function Se(r,t,i,e,n,o,u){var f=sr((function(f){var a=n[f],l=a.level!=1;return xe(we(r,ft(i,l?a.to:a.from,l?"before":"after"),"line",t,e),o,u,true)}),0,n.length-1);var a=n[f];if(f>0){var l=a.level!=1;var s=we(r,ft(i,l?a.from:a.to,l?"after":"before"),"line",t,e);if(xe(s,o,u,true)&&s.top>u){a=n[f-1]}}return a}function Ne(r,t,i,e,n,o,u){var f=Ae(r,t,e,u);var a=f.begin;var l=f.end;if(/\s/.test(t.text.charAt(l-1))){l--}var s=null,c=null;for(var v=0;v<n.length;v++){var h=n[v];if(h.from>=l||h.to<=a){continue}var d=h.level!=1;var m=ne(r,e,d?Math.min(l,h.to)-1:Math.max(a,h.from)).right;var p=m<o?o-m+1e9:m-o;if(!s||c>p){s=h;c=p}}if(!s){s=n[n.length-1]}if(s.from<a){s={from:a,to:s.to,level:s.level}}if(s.to>l){s={from:s.from,to:l,level:s.level}}return s}var Ee;function De(r){if(r.cachedTextHeight!=null){return r.cachedTextHeight}if(Ee==null){Ee=E("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t){Ee.appendChild(document.createTextNode("x"));Ee.appendChild(E("br"))}Ee.appendChild(document.createTextNode("x"))}N(r.measure,Ee);var i=Ee.offsetHeight/50;if(i>3){r.cachedTextHeight=i}S(r.measure);return i||1}function Te(r){if(r.cachedCharWidth!=null){return r.cachedCharWidth}var t=E("span","xxxxxxxxxx");var i=E("pre",[t],"CodeMirror-line-like");N(r.measure,i);var e=t.getBoundingClientRect(),n=(e.right-e.left)/10;if(n>2){r.cachedCharWidth=n}return n||10}function Ie(r){var t=r.display,i={},e={};var n=t.gutters.clientLeft;for(var o=t.gutters.firstChild,u=0;o;o=o.nextSibling,++u){var f=r.display.gutterSpecs[u].className;i[f]=o.offsetLeft+o.clientLeft+n;e[f]=o.clientWidth}return{fixedPos:Oe(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:e,wrapperWidth:t.wrapper.clientWidth}}function Oe(r){return r.scroller.getBoundingClientRect().left-r.sizer.getBoundingClientRect().left}function Re(r){var t=De(r.display),i=r.options.lineWrapping;var e=i&&Math.max(5,r.display.scroller.clientWidth/Te(r.display)-3);return function(n){if(oi(r.doc,n)){return 0}var o=0;if(n.widgets){for(var u=0;u<n.widgets.length;u++){if(n.widgets[u].height){o+=n.widgets[u].height}}}if(i){return o+(Math.ceil(n.text.length/e)||1)*t}else{return o+t}}}function Be(r){var t=r.doc,i=Re(r);t.iter((function(r){var t=i(r);if(t!=r.height){it(r,t)}}))}function Ue(r,t,i,e){var n=r.display;if(!i&&Er(t).getAttribute("cm-not-content")=="true"){return null}var o,u,f=n.lineSpace.getBoundingClientRect();try{o=t.clientX-f.left;u=t.clientY-f.top}catch(r){return null}var a=Me(r,o,u),l;if(e&&a.xRel>0&&(l=Zr(r.doc,a.line).text).length==a.ch){var s=P(l,l.length,r.options.tabSize)-l.length;a=ft(a.line,Math.max(0,Math.round((o-Ji(r.display).left)/Te(r.display))-s))}return a}function ze(r,t){if(t>=r.display.viewTo){return null}t-=r.display.viewFrom;if(t<0){return null}var i=r.display.view;for(var e=0;e<i.length;e++){t-=i[e].size;if(t<0){return e}}}function je(r,t,i,e){if(t==null){t=r.doc.first}if(i==null){i=r.doc.first+r.doc.size}if(!e){e=0}var n=r.display;if(e&&i<n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>t)){n.updateLineNumbers=t}r.curOp.viewChanged=true;if(t>=n.viewTo){if(It&&ei(r.doc,t)<n.viewTo){Fe(r)}}else if(i<=n.viewFrom){if(It&&ni(r.doc,i+e)>n.viewFrom){Fe(r)}else{n.viewFrom+=e;n.viewTo+=e}}else if(t<=n.viewFrom&&i>=n.viewTo){Fe(r)}else if(t<=n.viewFrom){var o=Pe(r,i,i+e,1);if(o){n.view=n.view.slice(o.index);n.viewFrom=o.lineN;n.viewTo+=e}else{Fe(r)}}else if(i>=n.viewTo){var u=Pe(r,t,t,-1);if(u){n.view=n.view.slice(0,u.index);n.viewTo=u.lineN}else{Fe(r)}}else{var f=Pe(r,t,t,-1);var a=Pe(r,i,i+e,1);if(f&&a){n.view=n.view.slice(0,f.index).concat(yi(r,f.lineN,a.lineN)).concat(n.view.slice(a.index));n.viewTo+=e}else{Fe(r)}}var l=n.externalMeasured;if(l){if(i<l.lineN){l.lineN+=e}else if(t<l.lineN+l.size){n.externalMeasured=null}}}function We(r,t,i){r.curOp.viewChanged=true;var e=r.display,n=r.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size){e.externalMeasured=null}if(t<e.viewFrom||t>=e.viewTo){return}var o=e.view[ze(r,t)];if(o.node==null){return}var u=o.changes||(o.changes=[]);if(H(u,i)==-1){u.push(i)}}function Fe(r){r.display.viewFrom=r.display.viewTo=r.doc.first;r.display.view=[];r.display.viewOffset=0}function Pe(r,t,i,e){var n=ze(r,t),o,u=r.display.view;if(!It||i==r.doc.first+r.doc.size){return{index:n,lineN:i}}var f=r.display.viewFrom;for(var a=0;a<n;a++){f+=u[a].size}if(f!=t){if(e>0){if(n==u.length-1){return null}o=f+u[n].size-t;n++}else{o=f-t}t+=o;i+=o}while(ei(r.doc,i)!=i){if(n==(e<0?0:u.length-1)){return null}i+=e*u[n-(e<0?1:0)].size;n+=e}return{index:n,lineN:i}}function Ge(r,t,i){var e=r.display,n=e.view;if(n.length==0||t>=e.viewTo||i<=e.viewFrom){e.view=yi(r,t,i);e.viewFrom=t}else{if(e.viewFrom>t){e.view=yi(r,t,e.viewFrom).concat(e.view)}else if(e.viewFrom<t){e.view=e.view.slice(ze(r,t))}e.viewFrom=t;if(e.viewTo<i){e.view=e.view.concat(yi(r,e.viewTo,i))}else if(e.viewTo>i){e.view=e.view.slice(0,ze(r,i))}}e.viewTo=i}function He(r){var t=r.display.view,i=0;for(var e=0;e<t.length;e++){var n=t[e];if(!n.hidden&&(!n.node||n.changes)){++i}}return i}function Ve(r){r.display.input.showSelection(r.display.input.prepareSelection())}function $e(r,t){if(t===void 0)t=true;var i=r.doc,e={};var n=e.cursors=document.createDocumentFragment();var o=e.selection=document.createDocumentFragment();var u=r.options.$customCursor;if(u){t=true}for(var f=0;f<i.sel.ranges.length;f++){if(!t&&f==i.sel.primIndex){continue}var a=i.sel.ranges[f];if(a.from().line>=r.display.viewTo||a.to().line<r.display.viewFrom){continue}var l=a.empty();if(u){var s=u(r,a);if(s){_e(r,s,n)}}else if(l||r.options.showCursorWhenSelecting){_e(r,a.head,n)}if(!l){Je(r,a,o)}}return e}function _e(r,t,i){var e=we(r,t,"div",null,null,!r.options.singleCursorHeightPerLine);var n=i.appendChild(E("div"," ","CodeMirror-cursor"));n.style.left=e.left+"px";n.style.top=e.top+"px";n.style.height=Math.max(0,e.bottom-e.top)*r.options.cursorHeight+"px";if(/\bcm-fat-cursor\b/.test(r.getWrapperElement().className)){var o=be(r,t,"div",null,null);var u=o.right-o.left;n.style.width=(u>0?u:r.defaultCharWidth())+"px"}if(e.other){var f=i.appendChild(E("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));f.style.display="";f.style.left=e.other.left+"px";f.style.top=e.other.top+"px";f.style.height=(e.other.bottom-e.other.top)*.85+"px"}}function Qe(r,t){return r.top-t.top||r.left-t.left}function Je(r,t,i){var e=r.display,n=r.doc;var o=document.createDocumentFragment();var u=Ji(r.display),f=u.left;var a=Math.max(e.sizerWidth,Yi(r)-e.sizer.offsetLeft)-u.right;var l=n.direction=="ltr";function s(r,t,i,e){if(t<0){t=0}t=Math.round(t);e=Math.round(e);o.appendChild(E("div",null,"CodeMirror-selected","position: absolute; left: "+r+"px;\n top: "+t+"px; width: "+(i==null?a-r:i)+"px;\n height: "+(e-t)+"px"))}function c(t,i,e){var o=Zr(n,t);var u=o.text.length;var c,v;function h(i,e){return be(r,ft(t,i),"div",o,e)}function d(t,i,e){var n=ye(r,o,null,t);var u=i=="ltr"==(e=="after")?"left":"right";var f=e=="after"?n.begin:n.end-(/\s/.test(o.text.charAt(n.end-1))?2:1);return h(f,u)[u]}var m=mr(o,n.direction);cr(m,i||0,e==null?u:e,(function(r,t,n,o){var p=n=="ltr";var g=h(r,p?"left":"right");var b=h(t-1,p?"right":"left");var w=i==null&&r==0,k=e==null&&t==u;var C=o==0,M=!m||o==m.length-1;if(b.top-g.top<=3){var A=(l?w:k)&&C;var y=(l?k:w)&&M;var x=A?f:(p?g:b).left;var L=y?a:(p?b:g).right;s(x,g.top,L-x,g.bottom)}else{var S,N,E,D;if(p){S=l&&w&&C?f:g.left;N=l?a:d(r,n,"before");E=l?f:d(t,n,"after");D=l&&k&&M?a:b.right}else{S=!l?f:d(r,n,"before");N=!l&&w&&C?a:g.right;E=!l&&k&&M?f:b.left;D=!l?a:d(t,n,"after")}s(S,g.top,N-S,g.bottom);if(g.bottom<b.top){s(f,g.bottom,null,b.top)}s(E,b.top,D-E,b.bottom)}if(!c||Qe(g,c)<0){c=g}if(Qe(b,c)<0){c=b}if(!v||Qe(g,v)<0){v=g}if(Qe(b,v)<0){v=b}}));return{start:c,end:v}}var v=t.from(),h=t.to();if(v.line==h.line){c(v.line,v.ch,h.ch)}else{var d=Zr(n,v.line),m=Zr(n,h.line);var p=ri(d)==ri(m);var g=c(v.line,v.ch,p?d.text.length+1:null).end;var b=c(h.line,p?0:null,h.ch).start;if(p){if(g.top<b.top-2){s(g.right,g.top,null,g.bottom);s(f,b.top,b.left,b.bottom)}else{s(g.right,g.top,b.left-g.right,g.bottom)}}if(g.bottom<b.top){s(f,g.bottom,null,b.top)}}i.appendChild(o)}function Ke(r){if(!r.state.focused){return}var t=r.display;clearInterval(t.blinker);var i=true;t.cursorDiv.style.visibility="";if(r.options.cursorBlinkRate>0){t.blinker=setInterval((function(){if(!r.hasFocus()){Ze(r)}t.cursorDiv.style.visibility=(i=!i)?"":"hidden"}),r.options.cursorBlinkRate)}else if(r.options.cursorBlinkRate<0){t.cursorDiv.style.visibility="hidden"}}function Ye(r){if(!r.hasFocus()){r.display.input.focus();if(!r.state.focused){qe(r)}}}function Xe(r){r.state.delayingBlurEvent=true;setTimeout((function(){if(r.state.delayingBlurEvent){r.state.delayingBlurEvent=false;if(r.state.focused){Ze(r)}}}),100)}function qe(r,t){if(r.state.delayingBlurEvent&&!r.state.draggingText){r.state.delayingBlurEvent=false}if(r.options.readOnly=="nocursor"){return}if(!r.state.focused){kr(r,"focus",r,t);r.state.focused=true;R(r.display.wrapper,"CodeMirror-focused");if(!r.curOp&&r.display.selForContextMenu!=r.doc.sel){r.display.input.reset();if(a){setTimeout((function(){return r.display.input.reset(true)}),20)}}r.display.input.receivedFocus()}Ke(r)}function Ze(r,t){if(r.state.delayingBlurEvent){return}if(r.state.focused){kr(r,"blur",r,t);r.state.focused=false;L(r.display.wrapper,"CodeMirror-focused")}clearInterval(r.display.blinker);setTimeout((function(){if(!r.state.focused){r.display.shift=false}}),150)}function rn(r){var t=r.display;var i=t.lineDiv.offsetTop;var e=Math.max(0,t.scroller.getBoundingClientRect().top);var n=t.lineDiv.getBoundingClientRect().top;var o=0;for(var a=0;a<t.view.length;a++){var l=t.view[a],s=r.options.lineWrapping;var c=void 0,v=0;if(l.hidden){continue}n+=l.line.height;if(u&&f<8){var h=l.node.offsetTop+l.node.offsetHeight;c=h-i;i=h}else{var d=l.node.getBoundingClientRect();c=d.bottom-d.top;if(!s&&l.text.firstChild){v=l.text.firstChild.getBoundingClientRect().right-d.left-1}}var m=l.line.height-c;if(m>.005||m<-.005){if(n<e){o-=m}it(l.line,c);tn(l.line);if(l.rest){for(var p=0;p<l.rest.length;p++){tn(l.rest[p])}}}if(v>r.display.sizerWidth){var g=Math.ceil(v/Te(r.display));if(g>r.display.maxLineLength){r.display.maxLineLength=g;r.display.maxLine=l.line;r.display.maxLineChanged=true}}}if(Math.abs(o)>2){t.scroller.scrollTop+=o}}function tn(r){if(r.widgets){for(var t=0;t<r.widgets.length;++t){var i=r.widgets[t],e=i.node.parentNode;if(e){i.height=e.offsetHeight}}}}function en(r,t,i){var e=i&&i.top!=null?Math.max(0,i.top):r.scroller.scrollTop;e=Math.floor(e-_i(r));var n=i&&i.bottom!=null?i.bottom:e+r.wrapper.clientHeight;var o=nt(t,e),u=nt(t,n);if(i&&i.ensure){var f=i.ensure.from.line,a=i.ensure.to.line;if(f<o){o=f;u=nt(t,fi(Zr(t,f))+r.wrapper.clientHeight)}else if(Math.min(a,t.lastLine())>=u){o=nt(t,fi(Zr(t,a))-r.wrapper.clientHeight);u=a}}return{from:o,to:Math.max(u,o+1)}}function nn(r,t){if(Cr(r,"scrollCursorIntoView")){return}var i=r.display,e=i.sizer.getBoundingClientRect(),n=null;var o=i.wrapper.ownerDocument;if(t.top+e.top<0){n=true}else if(t.bottom+e.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)){n=false}if(n!=null&&!m){var u=E("div","​",null,"position: absolute;\n top: "+(t.top-i.viewOffset-_i(r.display))+"px;\n height: "+(t.bottom-t.top+Ki(r)+i.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");r.display.lineSpace.appendChild(u);u.scrollIntoView(n);r.display.lineSpace.removeChild(u)}}function on(r,t,i,e){if(e==null){e=0}var n;if(!r.options.lineWrapping&&t==i){i=t.sticky=="before"?ft(t.line,t.ch+1,"before"):t;t=t.ch?ft(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t}for(var o=0;o<5;o++){var u=false;var f=we(r,t);var a=!i||i==t?f:we(r,i);n={left:Math.min(f.left,a.left),top:Math.min(f.top,a.top)-e,right:Math.max(f.left,a.left),bottom:Math.max(f.bottom,a.bottom)+e};var l=fn(r,n);var s=r.doc.scrollTop,c=r.doc.scrollLeft;if(l.scrollTop!=null){dn(r,l.scrollTop);if(Math.abs(r.doc.scrollTop-s)>1){u=true}}if(l.scrollLeft!=null){pn(r,l.scrollLeft);if(Math.abs(r.doc.scrollLeft-c)>1){u=true}}if(!u){break}}return n}function un(r,t){var i=fn(r,t);if(i.scrollTop!=null){dn(r,i.scrollTop)}if(i.scrollLeft!=null){pn(r,i.scrollLeft)}}function fn(r,t){var i=r.display,e=De(r.display);if(t.top<0){t.top=0}var n=r.curOp&&r.curOp.scrollTop!=null?r.curOp.scrollTop:i.scroller.scrollTop;var o=Xi(r),u={};if(t.bottom-t.top>o){t.bottom=t.top+o}var f=r.doc.height+Qi(i);var a=t.top<e,l=t.bottom>f-e;if(t.top<n){u.scrollTop=a?0:t.top}else if(t.bottom>n+o){var s=Math.min(t.top,(l?f:t.bottom)-o);if(s!=n){u.scrollTop=s}}var c=r.options.fixedGutter?0:i.gutters.offsetWidth;var v=r.curOp&&r.curOp.scrollLeft!=null?r.curOp.scrollLeft:i.scroller.scrollLeft-c;var h=Yi(r)-i.gutters.offsetWidth;var d=t.right-t.left>h;if(d){t.right=t.left+h}if(t.left<10){u.scrollLeft=0}else if(t.left<v){u.scrollLeft=Math.max(0,t.left+c-(d?0:10))}else if(t.right>h+v-3){u.scrollLeft=t.right+(d?0:10)-h}return u}function an(r,t){if(t==null){return}vn(r);r.curOp.scrollTop=(r.curOp.scrollTop==null?r.doc.scrollTop:r.curOp.scrollTop)+t}function ln(r){vn(r);var t=r.getCursor();r.curOp.scrollToPos={from:t,to:t,margin:r.options.cursorScrollMargin}}function sn(r,t,i){if(t!=null||i!=null){vn(r)}if(t!=null){r.curOp.scrollLeft=t}if(i!=null){r.curOp.scrollTop=i}}function cn(r,t){vn(r);r.curOp.scrollToPos=t}function vn(r){var t=r.curOp.scrollToPos;if(t){r.curOp.scrollToPos=null;var i=ke(r,t.from),e=ke(r,t.to);hn(r,i,e,t.margin)}}function hn(r,t,i,e){var n=fn(r,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-e,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+e});sn(r,n.scrollLeft,n.scrollTop)}function dn(r,t){if(Math.abs(r.doc.scrollTop-t)<2){return}if(!i){$n(r,{top:t})}mn(r,t,true);if(i){$n(r)}zn(r,100)}function mn(r,t,i){t=Math.max(0,Math.min(r.display.scroller.scrollHeight-r.display.scroller.clientHeight,t));if(r.display.scroller.scrollTop==t&&!i){return}r.doc.scrollTop=t;r.display.scrollbars.setScrollTop(t);if(r.display.scroller.scrollTop!=t){r.display.scroller.scrollTop=t}}function pn(r,t,i,e){t=Math.max(0,Math.min(t,r.display.scroller.scrollWidth-r.display.scroller.clientWidth));if((i?t==r.doc.scrollLeft:Math.abs(r.doc.scrollLeft-t)<2)&&!e){return}r.doc.scrollLeft=t;Kn(r);if(r.display.scroller.scrollLeft!=t){r.display.scroller.scrollLeft=t}r.display.scrollbars.setScrollLeft(t)}function gn(r){var t=r.display,i=t.gutters.offsetWidth;var e=Math.round(r.doc.height+Qi(r.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:r.options.fixedGutter?i:0,docHeight:e,scrollHeight:e+Ki(r)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var bn=function(r,t,i){this.cm=i;var e=this.vert=E("div",[E("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");var n=this.horiz=E("div",[E("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e.tabIndex=n.tabIndex=-1;r(e);r(n);gr(e,"scroll",(function(){if(e.clientHeight){t(e.scrollTop,"vertical")}}));gr(n,"scroll",(function(){if(n.clientWidth){t(n.scrollLeft,"horizontal")}}));this.checkedZeroWidth=false;if(u&&f<8){this.horiz.style.minHeight=this.vert.style.minWidth="18px"}};bn.prototype.update=function(r){var t=r.scrollWidth>r.clientWidth+1;var i=r.scrollHeight>r.clientHeight+1;var e=r.nativeBarWidth;if(i){this.vert.style.display="block";this.vert.style.bottom=t?e+"px":"0";var n=r.viewHeight-(t?e:0);this.vert.firstChild.style.height=Math.max(0,r.scrollHeight-r.clientHeight+n)+"px"}else{this.vert.scrollTop=0;this.vert.style.display="";this.vert.firstChild.style.height="0"}if(t){this.horiz.style.display="block";this.horiz.style.right=i?e+"px":"0";this.horiz.style.left=r.barLeft+"px";var o=r.viewWidth-r.barLeft-(i?e:0);this.horiz.firstChild.style.width=Math.max(0,r.scrollWidth-r.clientWidth+o)+"px"}else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"}if(!this.checkedZeroWidth&&r.clientHeight>0){if(e==0){this.zeroWidthHack()}this.checkedZeroWidth=true}return{right:i?e:0,bottom:t?e:0}};bn.prototype.setScrollLeft=function(r){if(this.horiz.scrollLeft!=r){this.horiz.scrollLeft=r}if(this.disableHoriz){this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")}};bn.prototype.setScrollTop=function(r){if(this.vert.scrollTop!=r){this.vert.scrollTop=r}if(this.disableVert){this.enableZeroWidthBar(this.vert,this.disableVert,"vert")}};bn.prototype.zeroWidthHack=function(){var r=w&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=r;this.horiz.style.visibility=this.vert.style.visibility="hidden";this.disableHoriz=new G;this.disableVert=new G};bn.prototype.enableZeroWidthBar=function(r,t,i){r.style.visibility="";function e(){var n=r.getBoundingClientRect();var o=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);if(o!=r){r.style.visibility="hidden"}else{t.set(1e3,e)}}t.set(1e3,e)};bn.prototype.clear=function(){var r=this.horiz.parentNode;r.removeChild(this.horiz);r.removeChild(this.vert)};var wn=function(){};wn.prototype.update=function(){return{bottom:0,right:0}};wn.prototype.setScrollLeft=function(){};wn.prototype.setScrollTop=function(){};wn.prototype.clear=function(){};function kn(r,t){if(!t){t=gn(r)}var i=r.display.barWidth,e=r.display.barHeight;Cn(r,t);for(var n=0;n<4&&i!=r.display.barWidth||e!=r.display.barHeight;n++){if(i!=r.display.barWidth&&r.options.lineWrapping){rn(r)}Cn(r,gn(r));i=r.display.barWidth;e=r.display.barHeight}}function Cn(r,t){var i=r.display;var e=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=e.right)+"px";i.sizer.style.paddingBottom=(i.barHeight=e.bottom)+"px";i.heightForcer.style.borderBottom=e.bottom+"px solid transparent";if(e.right&&e.bottom){i.scrollbarFiller.style.display="block";i.scrollbarFiller.style.height=e.bottom+"px";i.scrollbarFiller.style.width=e.right+"px"}else{i.scrollbarFiller.style.display=""}if(e.bottom&&r.options.coverGutterNextToScrollbar&&r.options.fixedGutter){i.gutterFiller.style.display="block";i.gutterFiller.style.height=e.bottom+"px";i.gutterFiller.style.width=t.gutterWidth+"px"}else{i.gutterFiller.style.display=""}}var Mn={native:bn,null:wn};function An(r){if(r.display.scrollbars){r.display.scrollbars.clear();if(r.display.scrollbars.addClass){L(r.display.wrapper,r.display.scrollbars.addClass)}}r.display.scrollbars=new Mn[r.options.scrollbarStyle]((function(t){r.display.wrapper.insertBefore(t,r.display.scrollbarFiller);gr(t,"mousedown",(function(){if(r.state.focused){setTimeout((function(){return r.display.input.focus()}),0)}}));t.setAttribute("cm-not-content","true")}),(function(t,i){if(i=="horizontal"){pn(r,t)}else{dn(r,t)}}),r);if(r.display.scrollbars.addClass){R(r.display.wrapper,r.display.scrollbars.addClass)}}var yn=0;function xn(r){r.curOp={cm:r,viewChanged:false,startHeight:r.doc.height,forceUpdate:false,updateInput:0,typing:false,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:false,updateMaxLine:false,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:false,id:++yn,markArrays:null};Li(r.curOp)}function Ln(r){var t=r.curOp;if(t){Ni(t,(function(r){for(var t=0;t<r.ops.length;t++){r.ops[t].cm.curOp=null}Sn(r)}))}}function Sn(r){var t=r.ops;for(var i=0;i<t.length;i++){Nn(t[i])}for(var e=0;e<t.length;e++){En(t[e])}for(var n=0;n<t.length;n++){Dn(t[n])}for(var o=0;o<t.length;o++){Tn(t[o])}for(var u=0;u<t.length;u++){In(t[u])}}function Nn(r){var t=r.cm,i=t.display;Fn(t);if(r.updateMaxLine){li(t)}r.mustUpdate=r.viewChanged||r.forceUpdate||r.scrollTop!=null||r.scrollToPos&&(r.scrollToPos.from.line<i.viewFrom||r.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping;r.update=r.mustUpdate&&new Wn(t,r.mustUpdate&&{top:r.scrollTop,ensure:r.scrollToPos},r.forceUpdate)}function En(r){r.updatedDisplay=r.mustUpdate&&Hn(r.cm,r.update)}function Dn(r){var t=r.cm,i=t.display;if(r.updatedDisplay){rn(t)}r.barMeasure=gn(t);if(i.maxLineChanged&&!t.options.lineWrapping){r.adjustWidthTo=te(t,i.maxLine,i.maxLine.text.length).left+3;t.display.sizerWidth=r.adjustWidthTo;r.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+r.adjustWidthTo+Ki(t)+t.display.barWidth);r.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+r.adjustWidthTo-Yi(t))}if(r.updatedDisplay||r.selectionChanged){r.preparedSelection=i.input.prepareSelection()}}function Tn(r){var t=r.cm;if(r.adjustWidthTo!=null){t.display.sizer.style.minWidth=r.adjustWidthTo+"px";if(r.maxScrollLeft<t.doc.scrollLeft){pn(t,Math.min(t.display.scroller.scrollLeft,r.maxScrollLeft),true)}t.display.maxLineChanged=false}var i=r.focus&&r.focus==O(z(t));if(r.preparedSelection){t.display.input.showSelection(r.preparedSelection,i)}if(r.updatedDisplay||r.startHeight!=t.doc.height){kn(t,r.barMeasure)}if(r.updatedDisplay){Jn(t,r.barMeasure)}if(r.selectionChanged){Ke(t)}if(t.state.focused&&r.updateInput){t.display.input.reset(r.typing)}if(i){Ye(r.cm)}}function In(r){var t=r.cm,i=t.display,e=t.doc;if(r.updatedDisplay){Vn(t,r.update)}if(i.wheelStartX!=null&&(r.scrollTop!=null||r.scrollLeft!=null||r.scrollToPos)){i.wheelStartX=i.wheelStartY=null}if(r.scrollTop!=null){mn(t,r.scrollTop,r.forceScroll)}if(r.scrollLeft!=null){pn(t,r.scrollLeft,true,true)}if(r.scrollToPos){var n=on(t,dt(e,r.scrollToPos.from),dt(e,r.scrollToPos.to),r.scrollToPos.margin);nn(t,n)}var o=r.maybeHiddenMarkers,u=r.maybeUnhiddenMarkers;if(o){for(var f=0;f<o.length;++f){if(!o[f].lines.length){kr(o[f],"hide")}}}if(u){for(var a=0;a<u.length;++a){if(u[a].lines.length){kr(u[a],"unhide")}}}if(i.wrapper.offsetHeight){e.scrollTop=t.display.scroller.scrollTop}if(r.changeObjs){kr(t,"changes",t,r.changeObjs)}if(r.update){r.update.finish()}}function On(r,t){if(r.curOp){return t()}xn(r);try{return t()}finally{Ln(r)}}function Rn(r,t){return function(){if(r.curOp){return t.apply(r,arguments)}xn(r);try{return t.apply(r,arguments)}finally{Ln(r)}}}function Bn(r){return function(){if(this.curOp){return r.apply(this,arguments)}xn(this);try{return r.apply(this,arguments)}finally{Ln(this)}}}function Un(r){return function(){var t=this.cm;if(!t||t.curOp){return r.apply(this,arguments)}xn(t);try{return r.apply(this,arguments)}finally{Ln(t)}}}function zn(r,t){if(r.doc.highlightFrontier<r.display.viewTo){r.state.highlight.set(t,W(jn,r))}}function jn(r){var t=r.doc;if(t.highlightFrontier>=r.display.viewTo){return}var i=+new Date+r.options.workTime;var e=Ct(r,t.highlightFrontier);var n=[];t.iter(e.line,Math.min(t.first+t.size,r.display.viewTo+500),(function(o){if(e.line>=r.display.viewFrom){var u=o.styles;var f=o.text.length>r.options.maxHighlightLength?Kr(t.mode,e.state):null;var a=wt(r,o,e,true);if(f){e.state=f}o.styles=a.styles;var l=o.styleClasses,s=a.classes;if(s){o.styleClasses=s}else if(l){o.styleClasses=null}var c=!u||u.length!=o.styles.length||l!=s&&(!l||!s||l.bgClass!=s.bgClass||l.textClass!=s.textClass);for(var v=0;!c&&v<u.length;++v){c=u[v]!=o.styles[v]}if(c){n.push(e.line)}o.stateAfter=e.save();e.nextLine()}else{if(o.text.length<=r.options.maxHighlightLength){Mt(r,o.text,e)}o.stateAfter=e.line%5==0?e.save():null;e.nextLine()}if(+new Date>i){zn(r,r.options.workDelay);return true}}));t.highlightFrontier=e.line;t.modeFrontier=Math.max(t.modeFrontier,e.line);if(n.length){On(r,(function(){for(var t=0;t<n.length;t++){We(r,n[t],"text")}}))}}var Wn=function(r,t,i){var e=r.display;this.viewport=t;this.visible=en(e,r.doc,t);this.editorIsHidden=!e.wrapper.offsetWidth;this.wrapperHeight=e.wrapper.clientHeight;this.wrapperWidth=e.wrapper.clientWidth;this.oldDisplayWidth=Yi(r);this.force=i;this.dims=Ie(r);this.events=[]};Wn.prototype.signal=function(r,t){if(Ar(r,t)){this.events.push(arguments)}};Wn.prototype.finish=function(){for(var r=0;r<this.events.length;r++){kr.apply(null,this.events[r])}};function Fn(r){var t=r.display;if(!t.scrollbarsClipped&&t.scroller.offsetWidth){t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth;t.heightForcer.style.height=Ki(r)+"px";t.sizer.style.marginBottom=-t.nativeBarWidth+"px";t.sizer.style.borderRightWidth=Ki(r)+"px";t.scrollbarsClipped=true}}function Pn(r){if(r.hasFocus()){return null}var t=O(z(r));if(!t||!I(r.display.lineDiv,t)){return null}var i={activeElt:t};if(window.getSelection){var e=j(r).getSelection();if(e.anchorNode&&e.extend&&I(r.display.lineDiv,e.anchorNode)){i.anchorNode=e.anchorNode;i.anchorOffset=e.anchorOffset;i.focusNode=e.focusNode;i.focusOffset=e.focusOffset}}return i}function Gn(r){if(!r||!r.activeElt||r.activeElt==O(r.activeElt.ownerDocument)){return}r.activeElt.focus();if(!/^(INPUT|TEXTAREA)$/.test(r.activeElt.nodeName)&&r.anchorNode&&I(document.body,r.anchorNode)&&I(document.body,r.focusNode)){var t=r.activeElt.ownerDocument;var i=t.defaultView.getSelection(),e=t.createRange();e.setEnd(r.anchorNode,r.anchorOffset);e.collapse(false);i.removeAllRanges();i.addRange(e);i.extend(r.focusNode,r.focusOffset)}}function Hn(r,t){var i=r.display,e=r.doc;if(t.editorIsHidden){Fe(r);return false}if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&He(r)==0){return false}if(Yn(r)){Fe(r);t.dims=Ie(r)}var n=e.first+e.size;var o=Math.max(t.visible.from-r.options.viewportMargin,e.first);var u=Math.min(n,t.visible.to+r.options.viewportMargin);if(i.viewFrom<o&&o-i.viewFrom<20){o=Math.max(e.first,i.viewFrom)}if(i.viewTo>u&&i.viewTo-u<20){u=Math.min(n,i.viewTo)}if(It){o=ei(r.doc,o);u=ni(r.doc,u)}var f=o!=i.viewFrom||u!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Ge(r,o,u);i.viewOffset=fi(Zr(r.doc,i.viewFrom));r.display.mover.style.top=i.viewOffset+"px";var a=He(r);if(!f&&a==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)){return false}var l=Pn(r);if(a>4){i.lineDiv.style.display="none"}_n(r,i.updateLineNumbers,t.dims);if(a>4){i.lineDiv.style.display=""}i.renderedView=i.view;Gn(l);S(i.cursorDiv);S(i.selectionDiv);i.gutters.style.height=i.sizer.style.minHeight=0;if(f){i.lastWrapHeight=t.wrapperHeight;i.lastWrapWidth=t.wrapperWidth;zn(r,400)}i.updateLineNumbers=null;return true}function Vn(r,t){var i=t.viewport;for(var e=true;;e=false){if(!e||!r.options.lineWrapping||t.oldDisplayWidth==Yi(r)){if(i&&i.top!=null){i={top:Math.min(r.doc.height+Qi(r.display)-Xi(r),i.top)}}t.visible=en(r.display,r.doc,i);if(t.visible.from>=r.display.viewFrom&&t.visible.to<=r.display.viewTo){break}}else if(e){t.visible=en(r.display,r.doc,i)}if(!Hn(r,t)){break}rn(r);var n=gn(r);Ve(r);kn(r,n);Jn(r,n);t.force=false}t.signal(r,"update",r);if(r.display.viewFrom!=r.display.reportedViewFrom||r.display.viewTo!=r.display.reportedViewTo){t.signal(r,"viewportChange",r,r.display.viewFrom,r.display.viewTo);r.display.reportedViewFrom=r.display.viewFrom;r.display.reportedViewTo=r.display.viewTo}}function $n(r,t){var i=new Wn(r,t);if(Hn(r,i)){rn(r);Vn(r,i);var e=gn(r);Ve(r);kn(r,e);Jn(r,e);i.finish()}}function _n(r,t,i){var e=r.display,n=r.options.lineNumbers;var o=e.lineDiv,u=o.firstChild;function f(t){var i=t.nextSibling;if(a&&w&&r.display.currentWheelTarget==t){t.style.display="none"}else{t.parentNode.removeChild(t)}return i}var l=e.view,s=e.viewFrom;for(var c=0;c<l.length;c++){var v=l[c];if(v.hidden);else if(!v.node||v.node.parentNode!=o){var h=Fi(r,v,s,i);o.insertBefore(h,u)}else{while(u!=v.node){u=f(u)}var d=n&&t!=null&&t<=s&&v.lineNumber;if(v.changes){if(H(v.changes,"gutter")>-1){d=false}Ii(r,v,s,i)}if(d){S(v.lineNumber);v.lineNumber.appendChild(document.createTextNode(ut(r.options,s)))}u=v.node.nextSibling}s+=v.size}while(u){u=f(u)}}function Qn(r){var t=r.gutters.offsetWidth;r.sizer.style.marginLeft=t+"px";Di(r,"gutterChanged",r)}function Jn(r,t){r.display.sizer.style.minHeight=t.docHeight+"px";r.display.heightForcer.style.top=t.docHeight+"px";r.display.gutters.style.height=t.docHeight+r.display.barHeight+Ki(r)+"px"}function Kn(r){var t=r.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!r.options.fixedGutter)){return}var e=Oe(t)-t.scroller.scrollLeft+r.doc.scrollLeft;var n=t.gutters.offsetWidth,o=e+"px";for(var u=0;u<i.length;u++){if(!i[u].hidden){if(r.options.fixedGutter){if(i[u].gutter){i[u].gutter.style.left=o}if(i[u].gutterBackground){i[u].gutterBackground.style.left=o}}var f=i[u].alignable;if(f){for(var a=0;a<f.length;a++){f[a].style.left=o}}}}if(r.options.fixedGutter){t.gutters.style.left=e+n+"px"}}function Yn(r){if(!r.options.lineNumbers){return false}var t=r.doc,i=ut(r.options,t.first+t.size-1),e=r.display;if(i.length!=e.lineNumChars){var n=e.measure.appendChild(E("div",[E("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt"));var o=n.firstChild.offsetWidth,u=n.offsetWidth-o;e.lineGutter.style.width="";e.lineNumInnerWidth=Math.max(o,e.lineGutter.offsetWidth-u)+1;e.lineNumWidth=e.lineNumInnerWidth+u;e.lineNumChars=e.lineNumInnerWidth?i.length:-1;e.lineGutter.style.width=e.lineNumWidth+"px";Qn(r.display);return true}return false}function Xn(r,t){var i=[],e=false;for(var n=0;n<r.length;n++){var o=r[n],u=null;if(typeof o!="string"){u=o.style;o=o.className}if(o=="CodeMirror-linenumbers"){if(!t){continue}else{e=true}}i.push({className:o,style:u})}if(t&&!e){i.push({className:"CodeMirror-linenumbers",style:null})}return i}function qn(r){var t=r.gutters,i=r.gutterSpecs;S(t);r.lineGutter=null;for(var e=0;e<i.length;++e){var n=i[e];var o=n.className;var u=n.style;var f=t.appendChild(E("div",null,"CodeMirror-gutter "+o));if(u){f.style.cssText=u}if(o=="CodeMirror-linenumbers"){r.lineGutter=f;f.style.width=(r.lineNumWidth||1)+"px"}}t.style.display=i.length?"":"none";Qn(r)}function Zn(r){qn(r.display);je(r);Kn(r)}function ro(r,t,e,n){var o=this;this.input=e;o.scrollbarFiller=E("div",null,"CodeMirror-scrollbar-filler");o.scrollbarFiller.setAttribute("cm-not-content","true");o.gutterFiller=E("div",null,"CodeMirror-gutter-filler");o.gutterFiller.setAttribute("cm-not-content","true");o.lineDiv=D("div",null,"CodeMirror-code");o.selectionDiv=E("div",null,null,"position: relative; z-index: 1");o.cursorDiv=E("div",null,"CodeMirror-cursors");o.measure=E("div",null,"CodeMirror-measure");o.lineMeasure=E("div",null,"CodeMirror-measure");o.lineSpace=D("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var l=D("div",[o.lineSpace],"CodeMirror-lines");o.mover=E("div",[l],null,"position: relative");o.sizer=E("div",[o.mover],"CodeMirror-sizer");o.sizerWidth=null;o.heightForcer=E("div",null,null,"position: absolute; height: "+V+"px; width: 1px;");o.gutters=E("div",null,"CodeMirror-gutters");o.lineGutter=null;o.scroller=E("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll");o.scroller.setAttribute("tabIndex","-1");o.wrapper=E("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror");if(s&&c>=105){o.wrapper.style.clipPath="inset(0px)"}o.wrapper.setAttribute("translate","no");if(u&&f<8){o.gutters.style.zIndex=-1;o.scroller.style.paddingRight=0}if(!a&&!(i&&b)){o.scroller.draggable=true}if(r){if(r.appendChild){r.appendChild(o.wrapper)}else{r(o.wrapper)}}o.viewFrom=o.viewTo=t.first;o.reportedViewFrom=o.reportedViewTo=t.first;o.view=[];o.renderedView=null;o.externalMeasured=null;o.viewOffset=0;o.lastWrapHeight=o.lastWrapWidth=0;o.updateLineNumbers=null;o.nativeBarWidth=o.barHeight=o.barWidth=0;o.scrollbarsClipped=false;o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null;o.alignWidgets=false;o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null;o.maxLine=null;o.maxLineLength=0;o.maxLineChanged=false;o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null;o.shift=false;o.selForContextMenu=null;o.activeTouch=null;o.gutterSpecs=Xn(n.gutters,n.lineNumbers);qn(o);e.init(o)}var to=0,io=null;if(u){io=-.53}else if(i){io=15}else if(s){io=-.7}else if(h){io=-1/3}function eo(r){var t=r.wheelDeltaX,i=r.wheelDeltaY;if(t==null&&r.detail&&r.axis==r.HORIZONTAL_AXIS){t=r.detail}if(i==null&&r.detail&&r.axis==r.VERTICAL_AXIS){i=r.detail}else if(i==null){i=r.wheelDelta}return{x:t,y:i}}function no(r){var t=eo(r);t.x*=io;t.y*=io;return t}function oo(r,t){if(s&&c==102){if(r.display.chromeScrollHack==null){r.display.sizer.style.pointerEvents="none"}else{clearTimeout(r.display.chromeScrollHack)}r.display.chromeScrollHack=setTimeout((function(){r.display.chromeScrollHack=null;r.display.sizer.style.pointerEvents=""}),100)}var e=eo(t),n=e.x,o=e.y;var u=io;if(t.deltaMode===0){n=t.deltaX;o=t.deltaY;u=1}var f=r.display,l=f.scroller;var h=l.scrollWidth>l.clientWidth;var d=l.scrollHeight>l.clientHeight;if(!(n&&h||o&&d)){return}if(o&&w&&a){r:for(var m=t.target,p=f.view;m!=l;m=m.parentNode){for(var g=0;g<p.length;g++){if(p[g].node==m){r.display.currentWheelTarget=m;break r}}}}if(n&&!i&&!v&&u!=null){if(o&&d){dn(r,Math.max(0,l.scrollTop+o*u))}pn(r,Math.max(0,l.scrollLeft+n*u));if(!o||o&&d){xr(t)}f.wheelStartX=null;return}if(o&&u!=null){var b=o*u;var k=r.doc.scrollTop,C=k+f.wrapper.clientHeight;if(b<0){k=Math.max(0,k+b-50)}else{C=Math.min(r.doc.height,C+b+50)}$n(r,{top:k,bottom:C})}if(to<20&&t.deltaMode!==0){if(f.wheelStartX==null){f.wheelStartX=l.scrollLeft;f.wheelStartY=l.scrollTop;f.wheelDX=n;f.wheelDY=o;setTimeout((function(){if(f.wheelStartX==null){return}var r=l.scrollLeft-f.wheelStartX;var t=l.scrollTop-f.wheelStartY;var i=t&&f.wheelDY&&t/f.wheelDY||r&&f.wheelDX&&r/f.wheelDX;f.wheelStartX=f.wheelStartY=null;if(!i){return}io=(io*to+i)/(to+1);++to}),200)}else{f.wheelDX+=n;f.wheelDY+=o}}}var uo=function(r,t){this.ranges=r;this.primIndex=t};uo.prototype.primary=function(){return this.ranges[this.primIndex]};uo.prototype.equals=function(r){if(r==this){return true}if(r.primIndex!=this.primIndex||r.ranges.length!=this.ranges.length){return false}for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],e=r.ranges[t];if(!lt(i.anchor,e.anchor)||!lt(i.head,e.head)){return false}}return true};uo.prototype.deepCopy=function(){var r=[];for(var t=0;t<this.ranges.length;t++){r[t]=new fo(st(this.ranges[t].anchor),st(this.ranges[t].head))}return new uo(r,this.primIndex)};uo.prototype.somethingSelected=function(){for(var r=0;r<this.ranges.length;r++){if(!this.ranges[r].empty()){return true}}return false};uo.prototype.contains=function(r,t){if(!t){t=r}for(var i=0;i<this.ranges.length;i++){var e=this.ranges[i];if(at(t,e.from())>=0&&at(r,e.to())<=0){return i}}return-1};var fo=function(r,t){this.anchor=r;this.head=t};fo.prototype.from=function(){return vt(this.anchor,this.head)};fo.prototype.to=function(){return ct(this.anchor,this.head)};fo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ao(r,t,i){var e=r&&r.options.selectionsMayTouch;var n=t[i];t.sort((function(r,t){return at(r.from(),t.from())}));i=H(t,n);for(var o=1;o<t.length;o++){var u=t[o],f=t[o-1];var a=at(f.to(),u.from());if(e&&!u.empty()?a>0:a>=0){var l=vt(f.from(),u.from()),s=ct(f.to(),u.to());var c=f.empty()?u.from()==u.head:f.from()==f.head;if(o<=i){--i}t.splice(--o,2,new fo(c?s:l,c?l:s))}}return new uo(t,i)}function lo(r,t){return new uo([new fo(r,t||r)],0)}function so(r){if(!r.text){return r.to}return ft(r.from.line+r.text.length-1,q(r.text).length+(r.text.length==1?r.from.ch:0))}function co(r,t){if(at(r,t.from)<0){return r}if(at(r,t.to)<=0){return so(t)}var i=r.line+t.text.length-(t.to.line-t.from.line)-1,e=r.ch;if(r.line==t.to.line){e+=so(t).ch-t.to.ch}return ft(i,e)}function vo(r,t){var i=[];for(var e=0;e<r.sel.ranges.length;e++){var n=r.sel.ranges[e];i.push(new fo(co(n.anchor,t),co(n.head,t)))}return ao(r.cm,i,r.sel.primIndex)}function ho(r,t,i){if(r.line==t.line){return ft(i.line,r.ch-t.ch+i.ch)}else{return ft(i.line+(r.line-t.line),r.ch)}}function mo(r,t,i){var e=[];var n=ft(r.first,0),o=n;for(var u=0;u<t.length;u++){var f=t[u];var a=ho(f.from,n,o);var l=ho(so(f),n,o);n=f.to;o=l;if(i=="around"){var s=r.sel.ranges[u],c=at(s.head,s.anchor)<0;e[u]=new fo(c?l:a,c?a:l)}else{e[u]=new fo(a,a)}}return new uo(e,r.sel.primIndex)}function po(r){r.doc.mode=_r(r.options,r.doc.modeOption);go(r)}function go(r){r.doc.iter((function(r){if(r.stateAfter){r.stateAfter=null}if(r.styles){r.styles=null}}));r.doc.modeFrontier=r.doc.highlightFrontier=r.doc.first;zn(r,100);r.state.modeGen++;if(r.curOp){je(r)}}function bo(r,t){return t.from.ch==0&&t.to.ch==0&&q(t.text)==""&&(!r.cm||r.cm.options.wholeLineUpdateBefore)}function wo(r,t,i,e){function n(r){return i?i[r]:null}function o(r,i,n){ci(r,i,n,e);Di(r,"change",r,t)}function u(r,t){var i=[];for(var o=r;o<t;++o){i.push(new si(l[o],n(o),e))}return i}var f=t.from,a=t.to,l=t.text;var s=Zr(r,f.line),c=Zr(r,a.line);var v=q(l),h=n(l.length-1),d=a.line-f.line;if(t.full){r.insert(0,u(0,l.length));r.remove(l.length,r.size-l.length)}else if(bo(r,t)){var m=u(0,l.length-1);o(c,c.text,h);if(d){r.remove(f.line,d)}if(m.length){r.insert(f.line,m)}}else if(s==c){if(l.length==1){o(s,s.text.slice(0,f.ch)+v+s.text.slice(a.ch),h)}else{var p=u(1,l.length-1);p.push(new si(v+s.text.slice(a.ch),h,e));o(s,s.text.slice(0,f.ch)+l[0],n(0));r.insert(f.line+1,p)}}else if(l.length==1){o(s,s.text.slice(0,f.ch)+l[0]+c.text.slice(a.ch),n(0));r.remove(f.line+1,d)}else{o(s,s.text.slice(0,f.ch)+l[0],n(0));o(c,v+c.text.slice(a.ch),h);var g=u(1,l.length-1);if(d>1){r.remove(f.line+1,d-1)}r.insert(f.line+1,g)}Di(r,"change",r,t)}function ko(r,t,i){function e(r,n,o){if(r.linked){for(var u=0;u<r.linked.length;++u){var f=r.linked[u];if(f.doc==n){continue}var a=o&&f.sharedHist;if(i&&!a){continue}t(f.doc,a);e(f.doc,r,a)}}}e(r,null,true)}function Co(r,t){if(t.cm){throw new Error("This document is already in use.")}r.doc=t;t.cm=r;Be(r);po(r);Mo(r);r.options.direction=t.direction;if(!r.options.lineWrapping){li(r)}r.options.mode=t.modeOption;je(r)}function Mo(r){(r.doc.direction=="rtl"?R:L)(r.display.lineDiv,"CodeMirror-rtl")}function Ao(r){On(r,(function(){Mo(r);je(r)}))}function yo(r){this.done=[];this.undone=[];this.undoDepth=r?r.undoDepth:Infinity;this.lastModTime=this.lastSelTime=0;this.lastOp=this.lastSelOp=null;this.lastOrigin=this.lastSelOrigin=null;this.generation=this.maxGeneration=r?r.maxGeneration:1}function xo(r,t){var i={from:st(t.from),to:so(t),text:rt(r,t.from,t.to)};Io(r,i,t.from.line,t.to.line+1);ko(r,(function(r){return Io(r,i,t.from.line,t.to.line+1)}),true);return i}function Lo(r){while(r.length){var t=q(r);if(t.ranges){r.pop()}else{break}}}function So(r,t){if(t){Lo(r.done);return q(r.done)}else if(r.done.length&&!q(r.done).ranges){return q(r.done)}else if(r.done.length>1&&!r.done[r.done.length-2].ranges){r.done.pop();return q(r.done)}}function No(r,t,i,e){var n=r.history;n.undone.length=0;var o=+new Date,u;var f;if((n.lastOp==e||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>o-(r.cm?r.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(u=So(n,n.lastOp==e))){f=q(u.changes);if(at(t.from,t.to)==0&&at(t.from,f.to)==0){f.to=so(t)}else{u.changes.push(xo(r,t))}}else{var a=q(n.done);if(!a||!a.ranges){To(r.sel,n.done)}u={changes:[xo(r,t)],generation:n.generation};n.done.push(u);while(n.done.length>n.undoDepth){n.done.shift();if(!n.done[0].ranges){n.done.shift()}}}n.done.push(i);n.generation=++n.maxGeneration;n.lastModTime=n.lastSelTime=o;n.lastOp=n.lastSelOp=e;n.lastOrigin=n.lastSelOrigin=t.origin;if(!f){kr(r,"historyAdded")}}function Eo(r,t,i,e){var n=t.charAt(0);return n=="*"||n=="+"&&i.ranges.length==e.ranges.length&&i.somethingSelected()==e.somethingSelected()&&new Date-r.history.lastSelTime<=(r.cm?r.cm.options.historyEventDelay:500)}function Do(r,t,i,e){var n=r.history,o=e&&e.origin;if(i==n.lastSelOp||o&&n.lastSelOrigin==o&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==o||Eo(r,o,q(n.done),t))){n.done[n.done.length-1]=t}else{To(t,n.done)}n.lastSelTime=+new Date;n.lastSelOrigin=o;n.lastSelOp=i;if(e&&e.clearRedo!==false){Lo(n.undone)}}function To(r,t){var i=q(t);if(!(i&&i.ranges&&i.equals(r))){t.push(r)}}function Io(r,t,i,e){var n=t["spans_"+r.id],o=0;r.iter(Math.max(r.first,i),Math.min(r.first+r.size,e),(function(i){if(i.markedSpans){(n||(n=t["spans_"+r.id]={}))[o]=i.markedSpans}++o}))}function Oo(r){if(!r){return null}var t;for(var i=0;i<r.length;++i){if(r[i].marker.explicitlyCleared){if(!t){t=r.slice(0,i)}}else if(t){t.push(r[i])}}return!t?r:t.length?t:null}function Ro(r,t){var i=t["spans_"+r.id];if(!i){return null}var e=[];for(var n=0;n<t.text.length;++n){e.push(Oo(i[n]))}return e}function Bo(r,t){var i=Ro(r,t);var e=Pt(r,t);if(!i){return e}if(!e){return i}for(var n=0;n<i.length;++n){var o=i[n],u=e[n];if(o&&u){r:for(var f=0;f<u.length;++f){var a=u[f];for(var l=0;l<o.length;++l){if(o[l].marker==a.marker){continue r}}o.push(a)}}else if(u){i[n]=u}}return i}function Uo(r,t,i){var e=[];for(var n=0;n<r.length;++n){var o=r[n];if(o.ranges){e.push(i?uo.prototype.deepCopy.call(o):o);continue}var u=o.changes,f=[];e.push({changes:f});for(var a=0;a<u.length;++a){var l=u[a],s=void 0;f.push({from:l.from,to:l.to,text:l.text});if(t){for(var c in l){if(s=c.match(/^spans_(\d+)$/)){if(H(t,Number(s[1]))>-1){q(f)[c]=l[c];delete l[c]}}}}}}return e}function zo(r,t,i,e){if(e){var n=r.anchor;if(i){var o=at(t,n)<0;if(o!=at(i,n)<0){n=t;t=i}else if(o!=at(t,i)<0){t=i}}return new fo(n,t)}else{return new fo(i||t,t)}}function jo(r,t,i,e,n){if(n==null){n=r.cm&&(r.cm.display.shift||r.extend)}Vo(r,new uo([zo(r.sel.primary(),t,i,n)],0),e)}function Wo(r,t,i){var e=[];var n=r.cm&&(r.cm.display.shift||r.extend);for(var o=0;o<r.sel.ranges.length;o++){e[o]=zo(r.sel.ranges[o],t[o],null,n)}var u=ao(r.cm,e,r.sel.primIndex);Vo(r,u,i)}function Fo(r,t,i,e){var n=r.sel.ranges.slice(0);n[t]=i;Vo(r,ao(r.cm,n,r.sel.primIndex),e)}function Po(r,t,i,e){Vo(r,lo(t,i),e)}function Go(r,t,i){var e={ranges:t.ranges,update:function(t){this.ranges=[];for(var i=0;i<t.length;i++){this.ranges[i]=new fo(dt(r,t[i].anchor),dt(r,t[i].head))}},origin:i&&i.origin};kr(r,"beforeSelectionChange",r,e);if(r.cm){kr(r.cm,"beforeSelectionChange",r.cm,e)}if(e.ranges!=t.ranges){return ao(r.cm,e.ranges,e.ranges.length-1)}else{return t}}function Ho(r,t,i){var e=r.history.done,n=q(e);if(n&&n.ranges){e[e.length-1]=t;$o(r,t,i)}else{Vo(r,t,i)}}function Vo(r,t,i){$o(r,t,i);Do(r,r.sel,r.cm?r.cm.curOp.id:NaN,i)}function $o(r,t,i){if(Ar(r,"beforeSelectionChange")||r.cm&&Ar(r.cm,"beforeSelectionChange")){t=Go(r,t,i)}var e=i&&i.bias||(at(t.primary().head,r.sel.primary().head)<0?-1:1);_o(r,Jo(r,t,e,true));if(!(i&&i.scroll===false)&&r.cm&&r.cm.getOption("readOnly")!="nocursor"){ln(r.cm)}}function _o(r,t){if(t.equals(r.sel)){return}r.sel=t;if(r.cm){r.cm.curOp.updateInput=1;r.cm.curOp.selectionChanged=true;Mr(r.cm)}Di(r,"cursorActivity",r)}function Qo(r){_o(r,Jo(r,r.sel,null,false))}function Jo(r,t,i,e){var n;for(var o=0;o<t.ranges.length;o++){var u=t.ranges[o];var f=t.ranges.length==r.sel.ranges.length&&r.sel.ranges[o];var a=Yo(r,u.anchor,f&&f.anchor,i,e);var l=u.head==u.anchor?a:Yo(r,u.head,f&&f.head,i,e);if(n||a!=u.anchor||l!=u.head){if(!n){n=t.ranges.slice(0,o)}n[o]=new fo(a,l)}}return n?ao(r.cm,n,t.primIndex):t}function Ko(r,t,i,e,n){var o=Zr(r,t.line);if(o.markedSpans){for(var u=0;u<o.markedSpans.length;++u){var f=o.markedSpans[u],a=f.marker;var l="selectLeft"in a?!a.selectLeft:a.inclusiveLeft;var s="selectRight"in a?!a.selectRight:a.inclusiveRight;if((f.from==null||(l?f.from<=t.ch:f.from<t.ch))&&(f.to==null||(s?f.to>=t.ch:f.to>t.ch))){if(n){kr(a,"beforeCursorEnter");if(a.explicitlyCleared){if(!o.markedSpans){break}else{--u;continue}}}if(!a.atomic){continue}if(i){var c=a.find(e<0?1:-1),v=void 0;if(e<0?s:l){c=Xo(r,c,-e,c&&c.line==t.line?o:null)}if(c&&c.line==t.line&&(v=at(c,i))&&(e<0?v<0:v>0)){return Ko(r,c,t,e,n)}}var h=a.find(e<0?-1:1);if(e<0?l:s){h=Xo(r,h,e,h.line==t.line?o:null)}return h?Ko(r,h,t,e,n):null}}}return t}function Yo(r,t,i,e,n){var o=e||1;var u=Ko(r,t,i,o,n)||!n&&Ko(r,t,i,o,true)||Ko(r,t,i,-o,n)||!n&&Ko(r,t,i,-o,true);if(!u){r.cantEdit=true;return ft(r.first,0)}return u}function Xo(r,t,i,e){if(i<0&&t.ch==0){if(t.line>r.first){return dt(r,ft(t.line-1))}else{return null}}else if(i>0&&t.ch==(e||Zr(r,t.line)).text.length){if(t.line<r.first+r.size-1){return ft(t.line+1,0)}else{return null}}else{return new ft(t.line,t.ch+i)}}function qo(r){r.setSelection(ft(r.firstLine(),0),ft(r.lastLine()),_)}function Zo(r,t,i){var e={canceled:false,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return e.canceled=true}};if(i){e.update=function(t,i,n,o){if(t){e.from=dt(r,t)}if(i){e.to=dt(r,i)}if(n){e.text=n}if(o!==undefined){e.origin=o}}}kr(r,"beforeChange",r,e);if(r.cm){kr(r.cm,"beforeChange",r.cm,e)}if(e.canceled){if(r.cm){r.cm.curOp.updateInput=2}return null}return{from:e.from,to:e.to,text:e.text,origin:e.origin}}function ru(r,t,i){if(r.cm){if(!r.cm.curOp){return Rn(r.cm,ru)(r,t,i)}if(r.cm.state.suppressEdits){return}}if(Ar(r,"beforeChange")||r.cm&&Ar(r.cm,"beforeChange")){t=Zo(r,t,true);if(!t){return}}var e=Tt&&!i&&Ht(r,t.from,t.to);if(e){for(var n=e.length-1;n>=0;--n){tu(r,{from:e[n].from,to:e[n].to,text:n?[""]:t.text,origin:t.origin})}}else{tu(r,t)}}function tu(r,t){if(t.text.length==1&&t.text[0]==""&&at(t.from,t.to)==0){return}var i=vo(r,t);No(r,t,i,r.cm?r.cm.curOp.id:NaN);nu(r,t,i,Pt(r,t));var e=[];ko(r,(function(r,i){if(!i&&H(e,r.history)==-1){lu(r.history,t);e.push(r.history)}nu(r,t,null,Pt(r,t))}))}function iu(r,t,i){var e=r.cm&&r.cm.state.suppressEdits;if(e&&!i){return}var n=r.history,o,u=r.sel;var f=t=="undo"?n.done:n.undone,a=t=="undo"?n.undone:n.done;var l=0;for(;l<f.length;l++){o=f[l];if(i?o.ranges&&!o.equals(r.sel):!o.ranges){break}}if(l==f.length){return}n.lastOrigin=n.lastSelOrigin=null;for(;;){o=f.pop();if(o.ranges){To(o,a);if(i&&!o.equals(r.sel)){Vo(r,o,{clearRedo:false});return}u=o}else if(e){f.push(o);return}else{break}}var s=[];To(u,a);a.push({changes:s,generation:n.generation});n.generation=o.generation||++n.maxGeneration;var c=Ar(r,"beforeChange")||r.cm&&Ar(r.cm,"beforeChange");var v=function(i){var e=o.changes[i];e.origin=t;if(c&&!Zo(r,e,false)){f.length=0;return{}}s.push(xo(r,e));var n=i?vo(r,e):q(f);nu(r,e,n,Bo(r,e));if(!i&&r.cm){r.cm.scrollIntoView({from:e.from,to:so(e)})}var u=[];ko(r,(function(r,t){if(!t&&H(u,r.history)==-1){lu(r.history,e);u.push(r.history)}nu(r,e,null,Bo(r,e))}))};for(var h=o.changes.length-1;h>=0;--h){var d=v(h);if(d)return d.v}}function eu(r,t){if(t==0){return}r.first+=t;r.sel=new uo(Z(r.sel.ranges,(function(r){return new fo(ft(r.anchor.line+t,r.anchor.ch),ft(r.head.line+t,r.head.ch))})),r.sel.primIndex);if(r.cm){je(r.cm,r.first,r.first-t,t);for(var i=r.cm.display,e=i.viewFrom;e<i.viewTo;e++){We(r.cm,e,"gutter")}}}function nu(r,t,i,e){if(r.cm&&!r.cm.curOp){return Rn(r.cm,nu)(r,t,i,e)}if(t.to.line<r.first){eu(r,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>r.lastLine()){return}if(t.from.line<r.first){var n=t.text.length-1-(r.first-t.from.line);eu(r,n);t={from:ft(r.first,0),to:ft(t.to.line+n,t.to.ch),text:[q(t.text)],origin:t.origin}}var o=r.lastLine();if(t.to.line>o){t={from:t.from,to:ft(o,Zr(r,o).text.length),text:[t.text[0]],origin:t.origin}}t.removed=rt(r,t.from,t.to);if(!i){i=vo(r,t)}if(r.cm){ou(r.cm,t,e)}else{wo(r,t,e)}$o(r,i,_);if(r.cantEdit&&Yo(r,ft(r.firstLine(),0))){r.cantEdit=false}}function ou(r,t,i){var e=r.doc,n=r.display,o=t.from,u=t.to;var f=false,a=o.line;if(!r.options.lineWrapping){a=et(ri(Zr(e,o.line)));e.iter(a,u.line+1,(function(r){if(r==n.maxLine){f=true;return true}}))}if(e.sel.contains(t.from,t.to)>-1){Mr(r)}wo(e,t,i,Re(r));if(!r.options.lineWrapping){e.iter(a,o.line+t.text.length,(function(r){var t=ai(r);if(t>n.maxLineLength){n.maxLine=r;n.maxLineLength=t;n.maxLineChanged=true;f=false}}));if(f){r.curOp.updateMaxLine=true}}Dt(e,o.line);zn(r,400);var l=t.text.length-(u.line-o.line)-1;if(t.full){je(r)}else if(o.line==u.line&&t.text.length==1&&!bo(r.doc,t)){We(r,o.line,"text")}else{je(r,o.line,u.line+1,l)}var s=Ar(r,"changes"),c=Ar(r,"change");if(c||s){var v={from:o,to:u,text:t.text,removed:t.removed,origin:t.origin};if(c){Di(r,"change",r,v)}if(s){(r.curOp.changeObjs||(r.curOp.changeObjs=[])).push(v)}}r.display.selForContextMenu=null}function uu(r,t,i,e,n){var o;if(!e){e=i}if(at(e,i)<0){o=[e,i],i=o[0],e=o[1]}if(typeof t=="string"){t=r.splitLines(t)}ru(r,{from:i,to:e,text:t,origin:n})}function fu(r,t,i,e){if(i<r.line){r.line+=e}else if(t<r.line){r.line=t;r.ch=0}}function au(r,t,i,e){for(var n=0;n<r.length;++n){var o=r[n],u=true;if(o.ranges){if(!o.copied){o=r[n]=o.deepCopy();o.copied=true}for(var f=0;f<o.ranges.length;f++){fu(o.ranges[f].anchor,t,i,e);fu(o.ranges[f].head,t,i,e)}continue}for(var a=0;a<o.changes.length;++a){var l=o.changes[a];if(i<l.from.line){l.from=ft(l.from.line+e,l.from.ch);l.to=ft(l.to.line+e,l.to.ch)}else if(t<=l.to.line){u=false;break}}if(!u){r.splice(0,n+1);n=0}}}function lu(r,t){var i=t.from.line,e=t.to.line,n=t.text.length-(e-i)-1;au(r.done,i,e,n);au(r.undone,i,e,n)}function su(r,t,i,e){var n=t,o=t;if(typeof t=="number"){o=Zr(r,ht(r,t))}else{n=et(t)}if(n==null){return null}if(e(o,n)&&r.cm){We(r.cm,n,i)}return o}function cu(r){this.lines=r;this.parent=null;var t=0;for(var i=0;i<r.length;++i){r[i].parent=this;t+=r[i].height}this.height=t}cu.prototype={chunkSize:function(){return this.lines.length},removeInner:function(r,t){for(var i=r,e=r+t;i<e;++i){var n=this.lines[i];this.height-=n.height;vi(n);Di(n,"delete")}this.lines.splice(r,t)},collapse:function(r){r.push.apply(r,this.lines)},insertInner:function(r,t,i){this.height+=i;this.lines=this.lines.slice(0,r).concat(t).concat(this.lines.slice(r));for(var e=0;e<t.length;++e){t[e].parent=this}},iterN:function(r,t,i){for(var e=r+t;r<e;++r){if(i(this.lines[r])){return true}}}};function vu(r){this.children=r;var t=0,i=0;for(var e=0;e<r.length;++e){var n=r[e];t+=n.chunkSize();i+=n.height;n.parent=this}this.size=t;this.height=i;this.parent=null}vu.prototype={chunkSize:function(){return this.size},removeInner:function(r,t){this.size-=t;for(var i=0;i<this.children.length;++i){var e=this.children[i],n=e.chunkSize();if(r<n){var o=Math.min(t,n-r),u=e.height;e.removeInner(r,o);this.height-=u-e.height;if(n==o){this.children.splice(i--,1);e.parent=null}if((t-=o)==0){break}r=0}else{r-=n}}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof cu))){var f=[];this.collapse(f);this.children=[new cu(f)];this.children[0].parent=this}},collapse:function(r){for(var t=0;t<this.children.length;++t){this.children[t].collapse(r)}},insertInner:function(r,t,i){this.size+=t.length;this.height+=i;for(var e=0;e<this.children.length;++e){var n=this.children[e],o=n.chunkSize();if(r<=o){n.insertInner(r,t,i);if(n.lines&&n.lines.length>50){var u=n.lines.length%25+25;for(var f=u;f<n.lines.length;){var a=new cu(n.lines.slice(f,f+=25));n.height-=a.height;this.children.splice(++e,0,a);a.parent=this}n.lines=n.lines.slice(0,u);this.maybeSpill()}break}r-=o}},maybeSpill:function(){if(this.children.length<=10){return}var r=this;do{var t=r.children.splice(r.children.length-5,5);var i=new vu(t);if(!r.parent){var e=new vu(r.children);e.parent=r;r.children=[e,i];r=e}else{r.size-=i.size;r.height-=i.height;var n=H(r.parent.children,r);r.parent.children.splice(n+1,0,i)}i.parent=r.parent}while(r.children.length>10);r.parent.maybeSpill()},iterN:function(r,t,i){for(var e=0;e<this.children.length;++e){var n=this.children[e],o=n.chunkSize();if(r<o){var u=Math.min(t,o-r);if(n.iterN(r,u,i)){return true}if((t-=u)==0){break}r=0}else{r-=o}}}};var hu=function(r,t,i){if(i){for(var e in i){if(i.hasOwnProperty(e)){this[e]=i[e]}}}this.doc=r;this.node=t};hu.prototype.clear=function(){var r=this.doc.cm,t=this.line.widgets,i=this.line,e=et(i);if(e==null||!t){return}for(var n=0;n<t.length;++n){if(t[n]==this){t.splice(n--,1)}}if(!t.length){i.widgets=null}var o=Vi(this);it(i,Math.max(0,i.height-o));if(r){On(r,(function(){du(r,i,-o);We(r,e,"widget")}));Di(r,"lineWidgetCleared",r,this,e)}};hu.prototype.changed=function(){var r=this;var t=this.height,i=this.doc.cm,e=this.line;this.height=null;var n=Vi(this)-t;if(!n){return}if(!oi(this.doc,e)){it(e,e.height+n)}if(i){On(i,(function(){i.curOp.forceUpdate=true;du(i,e,n);Di(i,"lineWidgetChanged",i,r,et(e))}))}};yr(hu);function du(r,t,i){if(fi(t)<(r.curOp&&r.curOp.scrollTop||r.doc.scrollTop)){an(r,i)}}function mu(r,t,i,e){var n=new hu(r,i,e);var o=r.cm;if(o&&n.noHScroll){o.display.alignWidgets=true}su(r,t,"widget",(function(t){var i=t.widgets||(t.widgets=[]);if(n.insertAt==null){i.push(n)}else{i.splice(Math.min(i.length,Math.max(0,n.insertAt)),0,n)}n.line=t;if(o&&!oi(r,t)){var e=fi(t)<r.scrollTop;it(t,t.height+Vi(n));if(e){an(o,n.height)}o.curOp.forceUpdate=true}return true}));if(o){Di(o,"lineWidgetAdded",o,n,typeof t=="number"?t:et(t))}return n}var pu=0;var gu=function(r,t){this.lines=[];this.type=t;this.doc=r;this.id=++pu};gu.prototype.clear=function(){if(this.explicitlyCleared){return}var r=this.doc.cm,t=r&&!r.curOp;if(t){xn(r)}if(Ar(this,"clear")){var i=this.find();if(i){Di(this,"clear",i.from,i.to)}}var e=null,n=null;for(var o=0;o<this.lines.length;++o){var u=this.lines[o];var f=Ut(u.markedSpans,this);if(r&&!this.collapsed){We(r,et(u),"text")}else if(r){if(f.to!=null){n=et(u)}if(f.from!=null){e=et(u)}}u.markedSpans=zt(u.markedSpans,f);if(f.from==null&&this.collapsed&&!oi(this.doc,u)&&r){it(u,De(r.display))}}if(r&&this.collapsed&&!r.options.lineWrapping){for(var a=0;a<this.lines.length;++a){var l=ri(this.lines[a]),s=ai(l);if(s>r.display.maxLineLength){r.display.maxLine=l;r.display.maxLineLength=s;r.display.maxLineChanged=true}}}if(e!=null&&r&&this.collapsed){je(r,e,n+1)}this.lines.length=0;this.explicitlyCleared=true;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=false;if(r){Qo(r.doc)}}if(r){Di(r,"markerCleared",r,this,e,n)}if(t){Ln(r)}if(this.parent){this.parent.clear()}};gu.prototype.find=function(r,t){if(r==null&&this.type=="bookmark"){r=1}var i,e;for(var n=0;n<this.lines.length;++n){var o=this.lines[n];var u=Ut(o.markedSpans,this);if(u.from!=null){i=ft(t?o:et(o),u.from);if(r==-1){return i}}if(u.to!=null){e=ft(t?o:et(o),u.to);if(r==1){return e}}}return i&&{from:i,to:e}};gu.prototype.changed=function(){var r=this;var t=this.find(-1,true),i=this,e=this.doc.cm;if(!t||!e){return}On(e,(function(){var n=t.line,o=et(t.line);var u=ie(e,o);if(u){se(u);e.curOp.selectionChanged=e.curOp.forceUpdate=true}e.curOp.updateMaxLine=true;if(!oi(i.doc,n)&&i.height!=null){var f=i.height;i.height=null;var a=Vi(i)-f;if(a){it(n,n.height+a)}}Di(e,"markerChanged",e,r)}))};gu.prototype.attachLine=function(r){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;if(!t.maybeHiddenMarkers||H(t.maybeHiddenMarkers,this)==-1){(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}}this.lines.push(r)};gu.prototype.detachLine=function(r){this.lines.splice(H(this.lines,r),1);if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};yr(gu);function bu(r,t,i,e,n){if(e&&e.shared){return ku(r,t,i,e,n)}if(r.cm&&!r.cm.curOp){return Rn(r.cm,bu)(r,t,i,e,n)}var o=new gu(r,n),u=at(t,i);if(e){F(e,o,false)}if(u>0||u==0&&o.clearWhenEmpty!==false){return o}if(o.replacedWith){o.collapsed=true;o.widgetNode=D("span",[o.replacedWith],"CodeMirror-widget");if(!e.handleMouseEvents){o.widgetNode.setAttribute("cm-ignore-events","true")}if(e.insertLeft){o.widgetNode.insertLeft=true}}if(o.collapsed){if(Zt(r,t.line,t,i,o)||t.line!=i.line&&Zt(r,i.line,t,i,o)){throw new Error("Inserting collapsed marker partially overlapping an existing one")}Rt()}if(o.addToHistory){No(r,{from:t,to:i,origin:"markText"},r.sel,NaN)}var f=t.line,a=r.cm,l;r.iter(f,i.line+1,(function(e){if(a&&o.collapsed&&!a.options.lineWrapping&&ri(e)==a.display.maxLine){l=true}if(o.collapsed&&f!=t.line){it(e,0)}jt(e,new Bt(o,f==t.line?t.ch:null,f==i.line?i.ch:null),r.cm&&r.cm.curOp);++f}));if(o.collapsed){r.iter(t.line,i.line+1,(function(t){if(oi(r,t)){it(t,0)}}))}if(o.clearOnEnter){gr(o,"beforeCursorEnter",(function(){return o.clear()}))}if(o.readOnly){Ot();if(r.history.done.length||r.history.undone.length){r.clearHistory()}}if(o.collapsed){o.id=++pu;o.atomic=true}if(a){if(l){a.curOp.updateMaxLine=true}if(o.collapsed){je(a,t.line,i.line+1)}else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title){for(var s=t.line;s<=i.line;s++){We(a,s,"text")}}if(o.atomic){Qo(a.doc)}Di(a,"markerAdded",a,o)}return o}var wu=function(r,t){this.markers=r;this.primary=t;for(var i=0;i<r.length;++i){r[i].parent=this}};wu.prototype.clear=function(){if(this.explicitlyCleared){return}this.explicitlyCleared=true;for(var r=0;r<this.markers.length;++r){this.markers[r].clear()}Di(this,"clear")};wu.prototype.find=function(r,t){return this.primary.find(r,t)};yr(wu);function ku(r,t,i,e,n){e=F(e);e.shared=false;var o=[bu(r,t,i,e,n)],u=o[0];var f=e.widgetNode;ko(r,(function(r){if(f){e.widgetNode=f.cloneNode(true)}o.push(bu(r,dt(r,t),dt(r,i),e,n));for(var a=0;a<r.linked.length;++a){if(r.linked[a].isParent){return}}u=q(o)}));return new wu(o,u)}function Cu(r){return r.findMarks(ft(r.first,0),r.clipPos(ft(r.lastLine())),(function(r){return r.parent}))}function Mu(r,t){for(var i=0;i<t.length;i++){var e=t[i],n=e.find();var o=r.clipPos(n.from),u=r.clipPos(n.to);if(at(o,u)){var f=bu(r,o,u,e.primary,e.primary.type);e.markers.push(f);f.parent=e}}}function Au(r){var t=function(t){var i=r[t],e=[i.primary.doc];ko(i.primary.doc,(function(r){return e.push(r)}));for(var n=0;n<i.markers.length;n++){var o=i.markers[n];if(H(e,o.doc)==-1){o.parent=null;i.markers.splice(n--,1)}}};for(var i=0;i<r.length;i++)t(i)}var yu=0;var xu=function(r,t,i,e,n){if(!(this instanceof xu)){return new xu(r,t,i,e,n)}if(i==null){i=0}vu.call(this,[new cu([new si("",null)])]);this.first=i;this.scrollTop=this.scrollLeft=0;this.cantEdit=false;this.cleanGeneration=1;this.modeFrontier=this.highlightFrontier=i;var o=ft(i,0);this.sel=lo(o);this.history=new yo(null);this.id=++yu;this.modeOption=t;this.lineSep=e;this.direction=n=="rtl"?"rtl":"ltr";this.extend=false;if(typeof r=="string"){r=this.splitLines(r)}wo(this,{from:o,to:o,text:r});Vo(this,lo(o),_)};xu.prototype=ir(vu.prototype,{constructor:xu,iter:function(r,t,i){if(i){this.iterN(r-this.first,t-r,i)}else{this.iterN(this.first,this.first+this.size,r)}},insert:function(r,t){var i=0;for(var e=0;e<t.length;++e){i+=t[e].height}this.insertInner(r-this.first,t,i)},remove:function(r,t){this.removeInner(r-this.first,t)},getValue:function(r){var t=tt(this,this.first,this.first+this.size);if(r===false){return t}return t.join(r||this.lineSeparator())},setValue:Un((function(r){var t=ft(this.first,0),i=this.first+this.size-1;ru(this,{from:t,to:ft(i,Zr(this,i).text.length),text:this.splitLines(r),origin:"setValue",full:true},true);if(this.cm){sn(this.cm,0,0)}Vo(this,lo(t),_)})),replaceRange:function(r,t,i,e){t=dt(this,t);i=i?dt(this,i):t;uu(this,r,t,i,e)},getRange:function(r,t,i){var e=rt(this,dt(this,r),dt(this,t));if(i===false){return e}if(i===""){return e.join("")}return e.join(i||this.lineSeparator())},getLine:function(r){var t=this.getLineHandle(r);return t&&t.text},getLineHandle:function(r){if(ot(this,r)){return Zr(this,r)}},getLineNumber:function(r){return et(r)},getLineHandleVisualStart:function(r){if(typeof r=="number"){r=Zr(this,r)}return ri(r)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(r){return dt(this,r)},getCursor:function(r){var t=this.sel.primary(),i;if(r==null||r=="head"){i=t.head}else if(r=="anchor"){i=t.anchor}else if(r=="end"||r=="to"||r===false){i=t.to()}else{i=t.from()}return i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Un((function(r,t,i){Po(this,dt(this,typeof r=="number"?ft(r,t||0):r),null,i)})),setSelection:Un((function(r,t,i){Po(this,dt(this,r),dt(this,t||r),i)})),extendSelection:Un((function(r,t,i){jo(this,dt(this,r),t&&dt(this,t),i)})),extendSelections:Un((function(r,t){Wo(this,pt(this,r),t)})),extendSelectionsBy:Un((function(r,t){var i=Z(this.sel.ranges,r);Wo(this,pt(this,i),t)})),setSelections:Un((function(r,t,i){if(!r.length){return}var e=[];for(var n=0;n<r.length;n++){e[n]=new fo(dt(this,r[n].anchor),dt(this,r[n].head||r[n].anchor))}if(t==null){t=Math.min(r.length-1,this.sel.primIndex)}Vo(this,ao(this.cm,e,t),i)})),addSelection:Un((function(r,t,i){var e=this.sel.ranges.slice(0);e.push(new fo(dt(this,r),dt(this,t||r)));Vo(this,ao(this.cm,e,e.length-1),i)})),getSelection:function(r){var t=this.sel.ranges,i;for(var e=0;e<t.length;e++){var n=rt(this,t[e].from(),t[e].to());i=i?i.concat(n):n}if(r===false){return i}else{return i.join(r||this.lineSeparator())}},getSelections:function(r){var t=[],i=this.sel.ranges;for(var e=0;e<i.length;e++){var n=rt(this,i[e].from(),i[e].to());if(r!==false){n=n.join(r||this.lineSeparator())}t[e]=n}return t},replaceSelection:function(r,t,i){var e=[];for(var n=0;n<this.sel.ranges.length;n++){e[n]=r}this.replaceSelections(e,t,i||"+input")},replaceSelections:Un((function(r,t,i){var e=[],n=this.sel;for(var o=0;o<n.ranges.length;o++){var u=n.ranges[o];e[o]={from:u.from(),to:u.to(),text:this.splitLines(r[o]),origin:i}}var f=t&&t!="end"&&mo(this,e,t);for(var a=e.length-1;a>=0;a--){ru(this,e[a])}if(f){Ho(this,f)}else if(this.cm){ln(this.cm)}})),undo:Un((function(){iu(this,"undo")})),redo:Un((function(){iu(this,"redo")})),undoSelection:Un((function(){iu(this,"undo",true)})),redoSelection:Un((function(){iu(this,"redo",true)})),setExtending:function(r){this.extend=r},getExtending:function(){return this.extend},historySize:function(){var r=this.history,t=0,i=0;for(var e=0;e<r.done.length;e++){if(!r.done[e].ranges){++t}}for(var n=0;n<r.undone.length;n++){if(!r.undone[n].ranges){++i}}return{undo:t,redo:i}},clearHistory:function(){var r=this;this.history=new yo(this.history);ko(this,(function(t){return t.history=r.history}),true)},markClean:function(){this.cleanGeneration=this.changeGeneration(true)},changeGeneration:function(r){if(r){this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null}return this.history.generation},isClean:function(r){return this.history.generation==(r||this.cleanGeneration)},getHistory:function(){return{done:Uo(this.history.done),undone:Uo(this.history.undone)}},setHistory:function(r){var t=this.history=new yo(this.history);t.done=Uo(r.done.slice(0),null,true);t.undone=Uo(r.undone.slice(0),null,true)},setGutterMarker:Un((function(r,t,i){return su(this,r,"gutter",(function(r){var e=r.gutterMarkers||(r.gutterMarkers={});e[t]=i;if(!i&&ur(e)){r.gutterMarkers=null}return true}))})),clearGutter:Un((function(r){var t=this;this.iter((function(i){if(i.gutterMarkers&&i.gutterMarkers[r]){su(t,i,"gutter",(function(){i.gutterMarkers[r]=null;if(ur(i.gutterMarkers)){i.gutterMarkers=null}return true}))}}))})),lineInfo:function(r){var t;if(typeof r=="number"){if(!ot(this,r)){return null}t=r;r=Zr(this,r);if(!r){return null}}else{t=et(r);if(t==null){return null}}return{line:t,handle:r,text:r.text,gutterMarkers:r.gutterMarkers,textClass:r.textClass,bgClass:r.bgClass,wrapClass:r.wrapClass,widgets:r.widgets}},addLineClass:Un((function(r,t,i){return su(this,r,t=="gutter"?"gutter":"class",(function(r){var e=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[e]){r[e]=i}else if(x(i).test(r[e])){return false}else{r[e]+=" "+i}return true}))})),removeLineClass:Un((function(r,t,i){return su(this,r,t=="gutter"?"gutter":"class",(function(r){var e=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";var n=r[e];if(!n){return false}else if(i==null){r[e]=null}else{var o=n.match(x(i));if(!o){return false}var u=o.index+o[0].length;r[e]=n.slice(0,o.index)+(!o.index||u==n.length?"":" ")+n.slice(u)||null}return true}))})),addLineWidget:Un((function(r,t,i){return mu(this,r,t,i)})),removeLineWidget:function(r){r.clear()},markText:function(r,t,i){return bu(this,dt(this,r),dt(this,t),i,i&&i.type||"range")},setBookmark:function(r,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:false,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};r=dt(this,r);return bu(this,r,r,i,"bookmark")},findMarksAt:function(r){r=dt(this,r);var t=[],i=Zr(this,r.line).markedSpans;if(i){for(var e=0;e<i.length;++e){var n=i[e];if((n.from==null||n.from<=r.ch)&&(n.to==null||n.to>=r.ch)){t.push(n.marker.parent||n.marker)}}}return t},findMarks:function(r,t,i){r=dt(this,r);t=dt(this,t);var e=[],n=r.line;this.iter(r.line,t.line+1,(function(o){var u=o.markedSpans;if(u){for(var f=0;f<u.length;f++){var a=u[f];if(!(a.to!=null&&n==r.line&&r.ch>=a.to||a.from==null&&n!=r.line||a.from!=null&&n==t.line&&a.from>=t.ch)&&(!i||i(a.marker))){e.push(a.marker.parent||a.marker)}}}++n}));return e},getAllMarks:function(){var r=[];this.iter((function(t){var i=t.markedSpans;if(i){for(var e=0;e<i.length;++e){if(i[e].from!=null){r.push(i[e].marker)}}}}));return r},posFromIndex:function(r){var t,i=this.first,e=this.lineSeparator().length;this.iter((function(n){var o=n.text.length+e;if(o>r){t=r;return true}r-=o;++i}));return dt(this,ft(i,t))},indexFromPos:function(r){r=dt(this,r);var t=r.ch;if(r.line<this.first||r.ch<0){return 0}var i=this.lineSeparator().length;this.iter(this.first,r.line,(function(r){t+=r.text.length+i}));return t},copy:function(r){var t=new xu(tt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);t.scrollTop=this.scrollTop;t.scrollLeft=this.scrollLeft;t.sel=this.sel;t.extend=false;if(r){t.history.undoDepth=this.history.undoDepth;t.setHistory(this.getHistory())}return t},linkedDoc:function(r){if(!r){r={}}var t=this.first,i=this.first+this.size;if(r.from!=null&&r.from>t){t=r.from}if(r.to!=null&&r.to<i){i=r.to}var e=new xu(tt(this,t,i),r.mode||this.modeOption,t,this.lineSep,this.direction);if(r.sharedHist){e.history=this.history}(this.linked||(this.linked=[])).push({doc:e,sharedHist:r.sharedHist});e.linked=[{doc:this,isParent:true,sharedHist:r.sharedHist}];Mu(e,Cu(this));return e},unlinkDoc:function(r){if(r instanceof Ff){r=r.doc}if(this.linked){for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=r){continue}this.linked.splice(t,1);r.unlinkDoc(this);Au(Cu(this));break}}if(r.history==this.history){var e=[r.id];ko(r,(function(r){return e.push(r.id)}),true);r.history=new yo(null);r.history.done=Uo(this.history.done,e);r.history.undone=Uo(this.history.undone,e)}},iterLinkedDocs:function(r){ko(this,r)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(r){if(this.lineSep){return r.split(this.lineSep)}return Ur(r)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Un((function(r){if(r!="rtl"){r="ltr"}if(r==this.direction){return}this.direction=r;this.iter((function(r){return r.order=null}));if(this.cm){Ao(this.cm)}}))});xu.prototype.eachLine=xu.prototype.iter;var Lu=0;function Su(r){var t=this;Du(t);if(Cr(t,r)||$i(t.display,r)){return}xr(r);if(u){Lu=+new Date}var i=Ue(t,r,true),e=r.dataTransfer.files;if(!i||t.isReadOnly()){return}if(e&&e.length&&window.FileReader&&window.File){var n=e.length,o=Array(n),f=0;var a=function(){if(++f==n){Rn(t,(function(){i=dt(t.doc,i);var r={from:i,to:i,text:t.doc.splitLines(o.filter((function(r){return r!=null})).join(t.doc.lineSeparator())),origin:"paste"};ru(t.doc,r);Ho(t.doc,lo(dt(t.doc,i),dt(t.doc,so(r))))}))()}};var l=function(r,i){if(t.options.allowDropFileTypes&&H(t.options.allowDropFileTypes,r.type)==-1){a();return}var e=new FileReader;e.onerror=function(){return a()};e.onload=function(){var r=e.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(r)){a();return}o[i]=r;a()};e.readAsText(r)};for(var s=0;s<e.length;s++){l(e[s],s)}}else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(r);setTimeout((function(){return t.display.input.focus()}),20);return}try{var c=r.dataTransfer.getData("Text");if(c){var v;if(t.state.draggingText&&!t.state.draggingText.copy){v=t.listSelections()}$o(t.doc,lo(i,i));if(v){for(var h=0;h<v.length;++h){uu(t.doc,"",v[h].anchor,v[h].head,"drag")}}t.replaceSelection(c,"around","paste");t.display.input.focus()}}catch(r){}}}function Nu(r,t){if(u&&(!r.state.draggingText||+new Date-Lu<100)){Nr(t);return}if(Cr(r,t)||$i(r.display,t)){return}t.dataTransfer.setData("Text",r.getSelection());t.dataTransfer.effectAllowed="copyMove";if(t.dataTransfer.setDragImage&&!h){var i=E("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(v){i.width=i.height=1;r.display.wrapper.appendChild(i);i._top=i.offsetTop}t.dataTransfer.setDragImage(i,0,0);if(v){i.parentNode.removeChild(i)}}}function Eu(r,t){var i=Ue(r,t);if(!i){return}var e=document.createDocumentFragment();_e(r,i,e);if(!r.display.dragCursor){r.display.dragCursor=E("div",null,"CodeMirror-cursors CodeMirror-dragcursors");r.display.lineSpace.insertBefore(r.display.dragCursor,r.display.cursorDiv)}N(r.display.dragCursor,e)}function Du(r){if(r.display.dragCursor){r.display.lineSpace.removeChild(r.display.dragCursor);r.display.dragCursor=null}}function Tu(r){if(!document.getElementsByClassName){return}var t=document.getElementsByClassName("CodeMirror"),i=[];for(var e=0;e<t.length;e++){var n=t[e].CodeMirror;if(n){i.push(n)}}if(i.length){i[0].operation((function(){for(var t=0;t<i.length;t++){r(i[t])}}))}}var Iu=false;function Ou(){if(Iu){return}Ru();Iu=true}function Ru(){var r;gr(window,"resize",(function(){if(r==null){r=setTimeout((function(){r=null;Tu(Bu)}),100)}}));gr(window,"blur",(function(){return Tu(Ze)}))}function Bu(r){var t=r.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null;t.scrollbarsClipped=false;r.setSize()}var Uu={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};for(var zu=0;zu<10;zu++){Uu[zu+48]=Uu[zu+96]=String(zu)}for(var ju=65;ju<=90;ju++){Uu[ju]=String.fromCharCode(ju)}for(var Wu=1;Wu<=12;Wu++){Uu[Wu+111]=Uu[Wu+63235]="F"+Wu}var Fu={};Fu.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"};Fu.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"};Fu.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"};Fu.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]};Fu["default"]=w?Fu.macDefault:Fu.pcDefault;function Pu(r){var t=r.split(/-(?!$)/);r=t[t.length-1];var i,e,n,o;for(var u=0;u<t.length-1;u++){var f=t[u];if(/^(cmd|meta|m)$/i.test(f)){o=true}else if(/^a(lt)?$/i.test(f)){i=true}else if(/^(c|ctrl|control)$/i.test(f)){e=true}else if(/^s(hift)?$/i.test(f)){n=true}else{throw new Error("Unrecognized modifier name: "+f)}}if(i){r="Alt-"+r}if(e){r="Ctrl-"+r}if(o){r="Cmd-"+r}if(n){r="Shift-"+r}return r}function Gu(r){var t={};for(var i in r){if(r.hasOwnProperty(i)){var e=r[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i)){continue}if(e=="..."){delete r[i];continue}var n=Z(i.split(" "),Pu);for(var o=0;o<n.length;o++){var u=void 0,f=void 0;if(o==n.length-1){f=n.join(" ");u=e}else{f=n.slice(0,o+1).join(" ");u="..."}var a=t[f];if(!a){t[f]=u}else if(a!=u){throw new Error("Inconsistent bindings for "+f)}}delete r[i]}}for(var l in t){r[l]=t[l]}return r}function Hu(r,t,i,e){t=Qu(t);var n=t.call?t.call(r,e):t[r];if(n===false){return"nothing"}if(n==="..."){return"multi"}if(n!=null&&i(n)){return"handled"}if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]"){return Hu(r,t.fallthrough,i,e)}for(var o=0;o<t.fallthrough.length;o++){var u=Hu(r,t.fallthrough[o],i,e);if(u){return u}}}}function Vu(r){var t=typeof r=="string"?r:Uu[r.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function $u(r,t,i){var e=r;if(t.altKey&&e!="Alt"){r="Alt-"+r}if((A?t.metaKey:t.ctrlKey)&&e!="Ctrl"){r="Ctrl-"+r}if((A?t.ctrlKey:t.metaKey)&&e!="Mod"){r="Cmd-"+r}if(!i&&t.shiftKey&&e!="Shift"){r="Shift-"+r}return r}function _u(r,t){if(v&&r.keyCode==34&&r["char"]){return false}var i=Uu[r.keyCode];if(i==null||r.altGraphKey){return false}if(r.keyCode==3&&r.code){i=r.code}return $u(i,r,t)}function Qu(r){return typeof r=="string"?Fu[r]:r}function Ju(r,t){var i=r.doc.sel.ranges,e=[];for(var n=0;n<i.length;n++){var o=t(i[n]);while(e.length&&at(o.from,q(e).to)<=0){var u=e.pop();if(at(u.from,o.from)<0){o.from=u.from;break}}e.push(o)}On(r,(function(){for(var t=e.length-1;t>=0;t--){uu(r.doc,"",e[t].from,e[t].to,"+delete")}ln(r)}))}function Ku(r,t,i){var e=lr(r.text,t+i,i);return e<0||e>r.text.length?null:e}function Yu(r,t,i){var e=Ku(r,t.ch,i);return e==null?null:new ft(t.line,e,i<0?"after":"before")}function Xu(r,t,i,e,n){if(r){if(t.doc.direction=="rtl"){n=-n}var o=mr(i,t.doc.direction);if(o){var u=n<0?q(o):o[0];var f=n<0==(u.level==1);var a=f?"after":"before";var l;if(u.level>0||t.doc.direction=="rtl"){var s=ee(t,i);l=n<0?i.text.length-1:0;var c=ne(t,s,l).top;l=sr((function(r){return ne(t,s,r).top==c}),n<0==(u.level==1)?u.from:u.to-1,l);if(a=="before"){l=Ku(i,l,1)}}else{l=n<0?u.to:u.from}return new ft(e,l,a)}}return new ft(e,n<0?i.text.length:0,n<0?"before":"after")}function qu(r,t,i,e){var n=mr(t,r.doc.direction);if(!n){return Yu(t,i,e)}if(i.ch>=t.text.length){i.ch=t.text.length;i.sticky="before"}else if(i.ch<=0){i.ch=0;i.sticky="after"}var o=hr(n,i.ch,i.sticky),u=n[o];if(r.doc.direction=="ltr"&&u.level%2==0&&(e>0?u.to>i.ch:u.from<i.ch)){return Yu(t,i,e)}var f=function(r,i){return Ku(t,r instanceof ft?r.ch:r,i)};var a;var l=function(i){if(!r.options.lineWrapping){return{begin:0,end:t.text.length}}a=a||ee(r,t);return ye(r,t,a,i)};var s=l(i.sticky=="before"?f(i,-1):i.ch);if(r.doc.direction=="rtl"||u.level==1){var c=u.level==1==e<0;var v=f(i,c?1:-1);if(v!=null&&(!c?v>=u.from&&v>=s.begin:v<=u.to&&v<=s.end)){var h=c?"before":"after";return new ft(i.line,v,h)}}var d=function(r,t,e){var o=function(r,t){return t?new ft(i.line,f(r,1),"before"):new ft(i.line,r,"after")};for(;r>=0&&r<n.length;r+=t){var u=n[r];var a=t>0==(u.level!=1);var l=a?e.begin:f(e.end,-1);if(u.from<=l&&l<u.to){return o(l,a)}l=a?u.from:f(u.to,-1);if(e.begin<=l&&l<e.end){return o(l,a)}}};var m=d(o+e,e,s);if(m){return m}var p=e>0?s.end:f(s.begin,-1);if(p!=null&&!(e>0&&p==t.text.length)){m=d(e>0?0:n.length-1,e,l(p));if(m){return m}}return null}var Zu={selectAll:qo,singleSelection:function(r){return r.setSelection(r.getCursor("anchor"),r.getCursor("head"),_)},killLine:function(r){return Ju(r,(function(t){if(t.empty()){var i=Zr(r.doc,t.head.line).text.length;if(t.head.ch==i&&t.head.line<r.lastLine()){return{from:t.head,to:ft(t.head.line+1,0)}}else{return{from:t.head,to:ft(t.head.line,i)}}}else{return{from:t.from(),to:t.to()}}}))},deleteLine:function(r){return Ju(r,(function(t){return{from:ft(t.from().line,0),to:dt(r.doc,ft(t.to().line+1,0))}}))},delLineLeft:function(r){return Ju(r,(function(r){return{from:ft(r.from().line,0),to:r.from()}}))},delWrappedLineLeft:function(r){return Ju(r,(function(t){var i=r.charCoords(t.head,"div").top+5;var e=r.coordsChar({left:0,top:i},"div");return{from:e,to:t.from()}}))},delWrappedLineRight:function(r){return Ju(r,(function(t){var i=r.charCoords(t.head,"div").top+5;var e=r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:e}}))},undo:function(r){return r.undo()},redo:function(r){return r.redo()},undoSelection:function(r){return r.undoSelection()},redoSelection:function(r){return r.redoSelection()},goDocStart:function(r){return r.extendSelection(ft(r.firstLine(),0))},goDocEnd:function(r){return r.extendSelection(ft(r.lastLine()))},goLineStart:function(r){return r.extendSelectionsBy((function(t){return rf(r,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(r){return r.extendSelectionsBy((function(t){return ef(r,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(r){return r.extendSelectionsBy((function(t){return tf(r,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(r){return r.extendSelectionsBy((function(t){var i=r.cursorCoords(t.head,"div").top+5;return r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:i},"div")}),J)},goLineLeft:function(r){return r.extendSelectionsBy((function(t){var i=r.cursorCoords(t.head,"div").top+5;return r.coordsChar({left:0,top:i},"div")}),J)},goLineLeftSmart:function(r){return r.extendSelectionsBy((function(t){var i=r.cursorCoords(t.head,"div").top+5;var e=r.coordsChar({left:0,top:i},"div");if(e.ch<r.getLine(e.line).search(/\S/)){return ef(r,t.head)}return e}),J)},goLineUp:function(r){return r.moveV(-1,"line")},goLineDown:function(r){return r.moveV(1,"line")},goPageUp:function(r){return r.moveV(-1,"page")},goPageDown:function(r){return r.moveV(1,"page")},goCharLeft:function(r){return r.moveH(-1,"char")},goCharRight:function(r){return r.moveH(1,"char")},goColumnLeft:function(r){return r.moveH(-1,"column")},goColumnRight:function(r){return r.moveH(1,"column")},goWordLeft:function(r){return r.moveH(-1,"word")},goGroupRight:function(r){return r.moveH(1,"group")},goGroupLeft:function(r){return r.moveH(-1,"group")},goWordRight:function(r){return r.moveH(1,"word")},delCharBefore:function(r){return r.deleteH(-1,"codepoint")},delCharAfter:function(r){return r.deleteH(1,"char")},delWordBefore:function(r){return r.deleteH(-1,"word")},delWordAfter:function(r){return r.deleteH(1,"word")},delGroupBefore:function(r){return r.deleteH(-1,"group")},delGroupAfter:function(r){return r.deleteH(1,"group")},indentAuto:function(r){return r.indentSelection("smart")},indentMore:function(r){return r.indentSelection("add")},indentLess:function(r){return r.indentSelection("subtract")},insertTab:function(r){return r.replaceSelection("\t")},insertSoftTab:function(r){var t=[],i=r.listSelections(),e=r.options.tabSize;for(var n=0;n<i.length;n++){var o=i[n].from();var u=P(r.getLine(o.line),o.ch,e);t.push(X(e-u%e))}r.replaceSelections(t)},defaultTab:function(r){if(r.somethingSelected()){r.indentSelection("add")}else{r.execCommand("insertTab")}},transposeChars:function(r){return On(r,(function(){var t=r.listSelections(),i=[];for(var e=0;e<t.length;e++){if(!t[e].empty()){continue}var n=t[e].head,o=Zr(r.doc,n.line).text;if(o){if(n.ch==o.length){n=new ft(n.line,n.ch-1)}if(n.ch>0){n=new ft(n.line,n.ch+1);r.replaceRange(o.charAt(n.ch-1)+o.charAt(n.ch-2),ft(n.line,n.ch-2),n,"+transpose")}else if(n.line>r.doc.first){var u=Zr(r.doc,n.line-1).text;if(u){n=new ft(n.line,1);r.replaceRange(o.charAt(0)+r.doc.lineSeparator()+u.charAt(u.length-1),ft(n.line-1,u.length-1),n,"+transpose")}}}i.push(new fo(n,n))}r.setSelections(i)}))},newlineAndIndent:function(r){return On(r,(function(){var t=r.listSelections();for(var i=t.length-1;i>=0;i--){r.replaceRange(r.doc.lineSeparator(),t[i].anchor,t[i].head,"+input")}t=r.listSelections();for(var e=0;e<t.length;e++){r.indentLine(t[e].from().line,null,true)}ln(r)}))},openLine:function(r){return r.replaceSelection("\n","start")},toggleOverwrite:function(r){return r.toggleOverwrite()}};function rf(r,t){var i=Zr(r.doc,t);var e=ri(i);if(e!=i){t=et(e)}return Xu(true,r,e,t,1)}function tf(r,t){var i=Zr(r.doc,t);var e=ti(i);if(e!=i){t=et(e)}return Xu(true,r,i,t,-1)}function ef(r,t){var i=rf(r,t.line);var e=Zr(r.doc,i.line);var n=mr(e,r.doc.direction);if(!n||n[0].level==0){var o=Math.max(i.ch,e.text.search(/\S/));var u=t.line==i.line&&t.ch<=o&&t.ch;return ft(i.line,u?0:o,i.sticky)}return i}function nf(r,t,i){if(typeof t=="string"){t=Zu[t];if(!t){return false}}r.display.input.ensurePolled();var e=r.display.shift,n=false;try{if(r.isReadOnly()){r.state.suppressEdits=true}if(i){r.display.shift=false}n=t(r)!=$}finally{r.display.shift=e;r.state.suppressEdits=false}return n}function of(r,t,i){for(var e=0;e<r.state.keyMaps.length;e++){var n=Hu(t,r.state.keyMaps[e],i,r);if(n){return n}}return r.options.extraKeys&&Hu(t,r.options.extraKeys,i,r)||Hu(t,r.options.keyMap,i,r)}var uf=new G;function ff(r,t,i,e){var n=r.state.keySeq;if(n){if(Vu(t)){return"handled"}if(/\'$/.test(t)){r.state.keySeq=null}else{uf.set(50,(function(){if(r.state.keySeq==n){r.state.keySeq=null;r.display.input.reset()}}))}if(af(r,n+" "+t,i,e)){return true}}return af(r,t,i,e)}function af(r,t,i,e){var n=of(r,t,e);if(n=="multi"){r.state.keySeq=t}if(n=="handled"){Di(r,"keyHandled",r,t,i)}if(n=="handled"||n=="multi"){xr(i);Ke(r)}return!!n}function lf(r,t){var i=_u(t,true);if(!i){return false}if(t.shiftKey&&!r.state.keySeq){return ff(r,"Shift-"+i,t,(function(t){return nf(r,t,true)}))||ff(r,i,t,(function(t){if(typeof t=="string"?/^go[A-Z]/.test(t):t.motion){return nf(r,t)}}))}else{return ff(r,i,t,(function(t){return nf(r,t)}))}}function sf(r,t,i){return ff(r,"'"+i+"'",t,(function(t){return nf(r,t,true)}))}var cf=null;function vf(r){var t=this;if(r.target&&r.target!=t.display.input.getField()){return}t.curOp.focus=O(z(t));if(Cr(t,r)){return}if(u&&f<11&&r.keyCode==27){r.returnValue=false}var e=r.keyCode;t.display.shift=e==16||r.shiftKey;var n=lf(t,r);if(v){cf=n?e:null;if(!n&&e==88&&!jr&&(w?r.metaKey:r.ctrlKey)){t.replaceSelection("",null,"cut")}}if(i&&!w&&!n&&e==46&&r.shiftKey&&!r.ctrlKey&&document.execCommand){document.execCommand("cut")}if(e==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)){hf(t)}}function hf(r){var t=r.display.lineDiv;R(t,"CodeMirror-crosshair");function i(r){if(r.keyCode==18||!r.altKey){L(t,"CodeMirror-crosshair");wr(document,"keyup",i);wr(document,"mouseover",i)}}gr(document,"keyup",i);gr(document,"mouseover",i)}function df(r){if(r.keyCode==16){this.doc.sel.shift=false}Cr(this,r)}function mf(r){var t=this;if(r.target&&r.target!=t.display.input.getField()){return}if($i(t.display,r)||Cr(t,r)||r.ctrlKey&&!r.altKey||w&&r.metaKey){return}var i=r.keyCode,e=r.charCode;if(v&&i==cf){cf=null;xr(r);return}if(v&&(!r.which||r.which<10)&&lf(t,r)){return}var n=String.fromCharCode(e==null?i:e);if(n=="\b"){return}if(sf(t,r,n)){return}t.display.input.onKeyPress(r)}var pf=400;var gf=function(r,t,i){this.time=r;this.pos=t;this.button=i};gf.prototype.compare=function(r,t,i){return this.time+pf>r&&at(t,this.pos)==0&&i==this.button};var bf,wf;function kf(r,t){var i=+new Date;if(wf&&wf.compare(i,r,t)){bf=wf=null;return"triple"}else if(bf&&bf.compare(i,r,t)){wf=new gf(i,r,t);bf=null;return"double"}else{bf=new gf(i,r,t);wf=null;return"single"}}function Cf(r){var t=this,i=t.display;if(Cr(t,r)||i.activeTouch&&i.input.supportsTouch()){return}i.input.ensurePolled();i.shift=r.shiftKey;if($i(i,r)){if(!a){i.scroller.draggable=false;setTimeout((function(){return i.scroller.draggable=true}),100)}return}if(Df(t,r)){return}var e=Ue(t,r),n=Dr(r),o=e?kf(e,n):"single";j(t).focus();if(n==1&&t.state.selectingText){t.state.selectingText(r)}if(e&&Mf(t,n,e,o,r)){return}if(n==1){if(e){yf(t,e,o,r)}else if(Er(r)==i.scroller){xr(r)}}else if(n==2){if(e){jo(t.doc,e)}setTimeout((function(){return i.input.focus()}),20)}else if(n==3){if(y){t.display.input.onContextMenu(r)}else{Xe(t)}}}function Mf(r,t,i,e,n){var o="Click";if(e=="double"){o="Double"+o}else if(e=="triple"){o="Triple"+o}o=(t==1?"Left":t==2?"Middle":"Right")+o;return ff(r,$u(o,n),n,(function(t){if(typeof t=="string"){t=Zu[t]}if(!t){return false}var e=false;try{if(r.isReadOnly()){r.state.suppressEdits=true}e=t(r,i)!=$}finally{r.state.suppressEdits=false}return e}))}function Af(r,t,i){var e=r.getOption("configureMouse");var n=e?e(r,t,i):{};if(n.unit==null){var o=k?i.shiftKey&&i.metaKey:i.altKey;n.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}if(n.extend==null||r.doc.extend){n.extend=r.doc.extend||i.shiftKey}if(n.addNew==null){n.addNew=w?i.metaKey:i.ctrlKey}if(n.moveOnDrag==null){n.moveOnDrag=!(w?i.altKey:i.ctrlKey)}return n}function yf(r,t,i,e){if(u){setTimeout(W(Ye,r),0)}else{r.curOp.focus=O(z(r))}var n=Af(r,i,e);var o=r.doc.sel,f;if(r.options.dragDrop&&Tr&&!r.isReadOnly()&&i=="single"&&(f=o.contains(t))>-1&&(at((f=o.ranges[f]).from(),t)<0||t.xRel>0)&&(at(f.to(),t)>0||t.xRel<0)){xf(r,e,t,n)}else{Sf(r,e,t,n)}}function xf(r,t,i,e){var n=r.display,o=false;var l=Rn(r,(function(t){if(a){n.scroller.draggable=false}r.state.draggingText=false;if(r.state.delayingBlurEvent){if(r.hasFocus()){r.state.delayingBlurEvent=false}else{Xe(r)}}wr(n.wrapper.ownerDocument,"mouseup",l);wr(n.wrapper.ownerDocument,"mousemove",s);wr(n.scroller,"dragstart",c);wr(n.scroller,"drop",l);if(!o){xr(t);if(!e.addNew){jo(r.doc,i,null,null,e.extend)}if(a&&!h||u&&f==9){setTimeout((function(){n.wrapper.ownerDocument.body.focus({preventScroll:true});n.input.focus()}),20)}else{n.input.focus()}}}));var s=function(r){o=o||Math.abs(t.clientX-r.clientX)+Math.abs(t.clientY-r.clientY)>=10};var c=function(){return o=true};if(a){n.scroller.draggable=true}r.state.draggingText=l;l.copy=!e.moveOnDrag;gr(n.wrapper.ownerDocument,"mouseup",l);gr(n.wrapper.ownerDocument,"mousemove",s);gr(n.scroller,"dragstart",c);gr(n.scroller,"drop",l);r.state.delayingBlurEvent=true;setTimeout((function(){return n.input.focus()}),20);if(n.scroller.dragDrop){n.scroller.dragDrop()}}function Lf(r,t,i){if(i=="char"){return new fo(t,t)}if(i=="word"){return r.findWordAt(t)}if(i=="line"){return new fo(ft(t.line,0),dt(r.doc,ft(t.line+1,0)))}var e=i(r,t);return new fo(e.from,e.to)}function Sf(r,t,i,e){if(u){Xe(r)}var n=r.display,o=r.doc;xr(t);var f,a,l=o.sel,s=l.ranges;if(e.addNew&&!e.extend){a=o.sel.contains(i);if(a>-1){f=s[a]}else{f=new fo(i,i)}}else{f=o.sel.primary();a=o.sel.primIndex}if(e.unit=="rectangle"){if(!e.addNew){f=new fo(i,i)}i=Ue(r,t,true,true);a=-1}else{var c=Lf(r,i,e.unit);if(e.extend){f=zo(f,c.anchor,c.head,e.extend)}else{f=c}}if(!e.addNew){a=0;Vo(o,new uo([f],0),Q);l=o.sel}else if(a==-1){a=s.length;Vo(o,ao(r,s.concat([f]),a),{scroll:false,origin:"*mouse"})}else if(s.length>1&&s[a].empty()&&e.unit=="char"&&!e.extend){Vo(o,ao(r,s.slice(0,a).concat(s.slice(a+1)),0),{scroll:false,origin:"*mouse"});l=o.sel}else{Fo(o,a,f,Q)}var v=i;function h(t){if(at(v,t)==0){return}v=t;if(e.unit=="rectangle"){var n=[],u=r.options.tabSize;var s=P(Zr(o,i.line).text,i.ch,u);var c=P(Zr(o,t.line).text,t.ch,u);var h=Math.min(s,c),d=Math.max(s,c);for(var m=Math.min(i.line,t.line),p=Math.min(r.lastLine(),Math.max(i.line,t.line));m<=p;m++){var g=Zr(o,m).text,b=K(g,h,u);if(h==d){n.push(new fo(ft(m,b),ft(m,b)))}else if(g.length>b){n.push(new fo(ft(m,b),ft(m,K(g,d,u))))}}if(!n.length){n.push(new fo(i,i))}Vo(o,ao(r,l.ranges.slice(0,a).concat(n),a),{origin:"*mouse",scroll:false});r.scrollIntoView(t)}else{var w=f;var k=Lf(r,t,e.unit);var C=w.anchor,M;if(at(k.anchor,C)>0){M=k.head;C=vt(w.from(),k.anchor)}else{M=k.anchor;C=ct(w.to(),k.head)}var A=l.ranges.slice(0);A[a]=Nf(r,new fo(dt(o,C),M));Vo(o,ao(r,A,a),Q)}}var d=n.wrapper.getBoundingClientRect();var m=0;function p(t){var i=++m;var u=Ue(r,t,true,e.unit=="rectangle");if(!u){return}if(at(u,v)!=0){r.curOp.focus=O(z(r));h(u);var f=en(n,o);if(u.line>=f.to||u.line<f.from){setTimeout(Rn(r,(function(){if(m==i){p(t)}})),150)}}else{var a=t.clientY<d.top?-20:t.clientY>d.bottom?20:0;if(a){setTimeout(Rn(r,(function(){if(m!=i){return}n.scroller.scrollTop+=a;p(t)})),50)}}}function g(t){r.state.selectingText=false;m=Infinity;if(t){xr(t);n.input.focus()}wr(n.wrapper.ownerDocument,"mousemove",b);wr(n.wrapper.ownerDocument,"mouseup",w);o.history.lastSelOrigin=null}var b=Rn(r,(function(r){if(r.buttons===0||!Dr(r)){g(r)}else{p(r)}}));var w=Rn(r,g);r.state.selectingText=w;gr(n.wrapper.ownerDocument,"mousemove",b);gr(n.wrapper.ownerDocument,"mouseup",w)}function Nf(r,t){var i=t.anchor;var e=t.head;var n=Zr(r.doc,i.line);if(at(i,e)==0&&i.sticky==e.sticky){return t}var o=mr(n);if(!o){return t}var u=hr(o,i.ch,i.sticky),f=o[u];if(f.from!=i.ch&&f.to!=i.ch){return t}var a=u+(f.from==i.ch==(f.level!=1)?0:1);if(a==0||a==o.length){return t}var l;if(e.line!=i.line){l=(e.line-i.line)*(r.doc.direction=="ltr"?1:-1)>0}else{var s=hr(o,e.ch,e.sticky);var c=s-u||(e.ch-i.ch)*(f.level==1?-1:1);if(s==a-1||s==a){l=c<0}else{l=c>0}}var v=o[a+(l?-1:0)];var h=l==(v.level==1);var d=h?v.from:v.to,m=h?"after":"before";return i.ch==d&&i.sticky==m?t:new fo(new ft(i.line,d,m),e)}function Ef(r,t,i,e){var n,o;if(t.touches){n=t.touches[0].clientX;o=t.touches[0].clientY}else{try{n=t.clientX;o=t.clientY}catch(r){return false}}if(n>=Math.floor(r.display.gutters.getBoundingClientRect().right)){return false}if(e){xr(t)}var u=r.display;var f=u.lineDiv.getBoundingClientRect();if(o>f.bottom||!Ar(r,i)){return Sr(t)}o-=f.top-u.viewOffset;for(var a=0;a<r.display.gutterSpecs.length;++a){var l=u.gutters.childNodes[a];if(l&&l.getBoundingClientRect().right>=n){var s=nt(r.doc,o);var c=r.display.gutterSpecs[a];kr(r,i,r,s,c.className,t);return Sr(t)}}}function Df(r,t){return Ef(r,t,"gutterClick",true)}function Tf(r,t){if($i(r.display,t)||If(r,t)){return}if(Cr(r,t,"contextmenu")){return}if(!y){r.display.input.onContextMenu(t)}}function If(r,t){if(!Ar(r,"gutterContextMenu")){return false}return Ef(r,t,"gutterContextMenu",false)}function Of(r){r.display.wrapper.className=r.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+r.options.theme.replace(/(^|\s)\s*/g," cm-s-");ve(r)}var Rf={toString:function(){return"CodeMirror.Init"}};var Bf={};var Uf={};function zf(r){var t=r.optionHandlers;function i(i,e,n,o){r.defaults[i]=e;if(n){t[i]=o?function(r,t,i){if(i!=Rf){n(r,t,i)}}:n}}r.defineOption=i;r.Init=Rf;i("value","",(function(r,t){return r.setValue(t)}),true);i("mode",null,(function(r,t){r.doc.modeOption=t;po(r)}),true);i("indentUnit",2,po,true);i("indentWithTabs",false);i("smartIndent",true);i("tabSize",4,(function(r){go(r);ve(r);je(r)}),true);i("lineSeparator",null,(function(r,t){r.doc.lineSep=t;if(!t){return}var i=[],e=r.doc.first;r.doc.iter((function(r){for(var n=0;;){var o=r.text.indexOf(t,n);if(o==-1){break}n=o+t.length;i.push(ft(e,o))}e++}));for(var n=i.length-1;n>=0;n--){uu(r.doc,t,i[n],ft(i[n].line,i[n].ch+t.length))}}));i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(r,t,i){r.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g");if(i!=Rf){r.refresh()}}));i("specialCharPlaceholder",gi,(function(r){return r.refresh()}),true);i("electricChars",true);i("inputStyle",b?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),true);i("spellcheck",false,(function(r,t){return r.getInputField().spellcheck=t}),true);i("autocorrect",false,(function(r,t){return r.getInputField().autocorrect=t}),true);i("autocapitalize",false,(function(r,t){return r.getInputField().autocapitalize=t}),true);i("rtlMoveVisually",!C);i("wholeLineUpdateBefore",true);i("theme","default",(function(r){Of(r);Zn(r)}),true);i("keyMap","default",(function(r,t,i){var e=Qu(t);var n=i!=Rf&&Qu(i);if(n&&n.detach){n.detach(r,e)}if(e.attach){e.attach(r,n||null)}}));i("extraKeys",null);i("configureMouse",null);i("lineWrapping",false,Wf,true);i("gutters",[],(function(r,t){r.display.gutterSpecs=Xn(t,r.options.lineNumbers);Zn(r)}),true);i("fixedGutter",true,(function(r,t){r.display.gutters.style.left=t?Oe(r.display)+"px":"0";r.refresh()}),true);i("coverGutterNextToScrollbar",false,(function(r){return kn(r)}),true);i("scrollbarStyle","native",(function(r){An(r);kn(r);r.display.scrollbars.setScrollTop(r.doc.scrollTop);r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)}),true);i("lineNumbers",false,(function(r,t){r.display.gutterSpecs=Xn(r.options.gutters,t);Zn(r)}),true);i("firstLineNumber",1,Zn,true);i("lineNumberFormatter",(function(r){return r}),Zn,true);i("showCursorWhenSelecting",false,Ve,true);i("resetSelectionOnContextMenu",true);i("lineWiseCopyCut",true);i("pasteLinesPerSelection",true);i("selectionsMayTouch",false);i("readOnly",false,(function(r,t){if(t=="nocursor"){Ze(r);r.display.input.blur()}r.display.input.readOnlyChanged(t)}));i("screenReaderLabel",null,(function(r,t){t=t===""?null:t;r.display.input.screenReaderLabelChanged(t)}));i("disableInput",false,(function(r,t){if(!t){r.display.input.reset()}}),true);i("dragDrop",true,jf);i("allowDropFileTypes",null);i("cursorBlinkRate",530);i("cursorScrollMargin",0);i("cursorHeight",1,Ve,true);i("singleCursorHeightPerLine",true,Ve,true);i("workTime",100);i("workDelay",100);i("flattenSpans",true,go,true);i("addModeClass",false,go,true);i("pollInterval",100);i("undoDepth",200,(function(r,t){return r.doc.history.undoDepth=t}));i("historyEventDelay",1250);i("viewportMargin",10,(function(r){return r.refresh()}),true);i("maxHighlightLength",1e4,go,true);i("moveInputWithCursor",true,(function(r,t){if(!t){r.display.input.resetPosition()}}));i("tabindex",null,(function(r,t){return r.display.input.getField().tabIndex=t||""}));i("autofocus",null);i("direction","ltr",(function(r,t){return r.doc.setDirection(t)}),true);i("phrases",null)}function jf(r,t,i){var e=i&&i!=Rf;if(!t!=!e){var n=r.display.dragFunctions;var o=t?gr:wr;o(r.display.scroller,"dragstart",n.start);o(r.display.scroller,"dragenter",n.enter);o(r.display.scroller,"dragover",n.over);o(r.display.scroller,"dragleave",n.leave);o(r.display.scroller,"drop",n.drop)}}function Wf(r){if(r.options.lineWrapping){R(r.display.wrapper,"CodeMirror-wrap");r.display.sizer.style.minWidth="";r.display.sizerWidth=null}else{L(r.display.wrapper,"CodeMirror-wrap");li(r)}Be(r);je(r);ve(r);setTimeout((function(){return kn(r)}),100)}function Ff(r,t){var i=this;if(!(this instanceof Ff)){return new Ff(r,t)}this.options=t=t?F(t):{};F(Bf,t,false);var e=t.value;if(typeof e=="string"){e=new xu(e,t.mode,null,t.lineSeparator,t.direction)}else if(t.mode){e.modeOption=t.mode}this.doc=e;var n=new Ff.inputStyles[t.inputStyle](this);var o=this.display=new ro(r,e,n,t);o.wrapper.CodeMirror=this;Of(this);if(t.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"}An(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:false,delayingBlurEvent:false,focused:false,suppressEdits:false,pasteIncoming:-1,cutIncoming:-1,selectingText:false,draggingText:false,highlight:new G,keySeq:null,specialChars:null};if(t.autofocus&&!b){o.input.focus()}if(u&&f<11){setTimeout((function(){return i.display.input.reset(true)}),20)}Pf(this);Ou();xn(this);this.curOp.forceUpdate=true;Co(this,e);if(t.autofocus&&!b||this.hasFocus()){setTimeout((function(){if(i.hasFocus()&&!i.state.focused){qe(i)}}),20)}else{Ze(this)}for(var l in Uf){if(Uf.hasOwnProperty(l)){Uf[l](this,t[l],Rf)}}Yn(this);if(t.finishInit){t.finishInit(this)}for(var s=0;s<Gf.length;++s){Gf[s](this)}Ln(this);if(a&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"){o.lineDiv.style.textRendering="auto"}}Ff.defaults=Bf;Ff.optionHandlers=Uf;function Pf(r){var t=r.display;gr(t.scroller,"mousedown",Rn(r,Cf));if(u&&f<11){gr(t.scroller,"dblclick",Rn(r,(function(t){if(Cr(r,t)){return}var i=Ue(r,t);if(!i||Df(r,t)||$i(r.display,t)){return}xr(t);var e=r.findWordAt(i);jo(r.doc,e.anchor,e.head)})))}else{gr(t.scroller,"dblclick",(function(t){return Cr(r,t)||xr(t)}))}gr(t.scroller,"contextmenu",(function(t){return Tf(r,t)}));gr(t.input.getField(),"contextmenu",(function(i){if(!t.scroller.contains(i.target)){Tf(r,i)}}));var i,e={end:0};function n(){if(t.activeTouch){i=setTimeout((function(){return t.activeTouch=null}),1e3);e=t.activeTouch;e.end=+new Date}}function o(r){if(r.touches.length!=1){return false}var t=r.touches[0];return t.radiusX<=1&&t.radiusY<=1}function a(r,t){if(t.left==null){return true}var i=t.left-r.left,e=t.top-r.top;return i*i+e*e>20*20}gr(t.scroller,"touchstart",(function(n){if(!Cr(r,n)&&!o(n)&&!Df(r,n)){t.input.ensurePolled();clearTimeout(i);var u=+new Date;t.activeTouch={start:u,moved:false,prev:u-e.end<=300?e:null};if(n.touches.length==1){t.activeTouch.left=n.touches[0].pageX;t.activeTouch.top=n.touches[0].pageY}}}));gr(t.scroller,"touchmove",(function(){if(t.activeTouch){t.activeTouch.moved=true}}));gr(t.scroller,"touchend",(function(i){var e=t.activeTouch;if(e&&!$i(t,i)&&e.left!=null&&!e.moved&&new Date-e.start<300){var o=r.coordsChar(t.activeTouch,"page"),u;if(!e.prev||a(e,e.prev)){u=new fo(o,o)}else if(!e.prev.prev||a(e,e.prev.prev)){u=r.findWordAt(o)}else{u=new fo(ft(o.line,0),dt(r.doc,ft(o.line+1,0)))}r.setSelection(u.anchor,u.head);r.focus();xr(i)}n()}));gr(t.scroller,"touchcancel",n);gr(t.scroller,"scroll",(function(){if(t.scroller.clientHeight){dn(r,t.scroller.scrollTop);pn(r,t.scroller.scrollLeft,true);kr(r,"scroll",r)}}));gr(t.scroller,"mousewheel",(function(t){return oo(r,t)}));gr(t.scroller,"DOMMouseScroll",(function(t){return oo(r,t)}));gr(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}));t.dragFunctions={enter:function(t){if(!Cr(r,t)){Nr(t)}},over:function(t){if(!Cr(r,t)){Eu(r,t);Nr(t)}},start:function(t){return Nu(r,t)},drop:Rn(r,Su),leave:function(t){if(!Cr(r,t)){Du(r)}}};var l=t.input.getField();gr(l,"keyup",(function(t){return df.call(r,t)}));gr(l,"keydown",Rn(r,vf));gr(l,"keypress",Rn(r,mf));gr(l,"focus",(function(t){return qe(r,t)}));gr(l,"blur",(function(t){return Ze(r,t)}))}var Gf=[];Ff.defineInitHook=function(r){return Gf.push(r)};function Hf(r,t,i,e){var n=r.doc,o;if(i==null){i="add"}if(i=="smart"){if(!n.mode.indent){i="prev"}else{o=Ct(r,t).state}}var u=r.options.tabSize;var f=Zr(n,t),a=P(f.text,null,u);if(f.stateAfter){f.stateAfter=null}var l=f.text.match(/^\s*/)[0],s;if(!e&&!/\S/.test(f.text)){s=0;i="not"}else if(i=="smart"){s=n.mode.indent(o,f.text.slice(l.length),f.text);if(s==$||s>150){if(!e){return}i="prev"}}if(i=="prev"){if(t>n.first){s=P(Zr(n,t-1).text,null,u)}else{s=0}}else if(i=="add"){s=a+r.options.indentUnit}else if(i=="subtract"){s=a-r.options.indentUnit}else if(typeof i=="number"){s=a+i}s=Math.max(0,s);var c="",v=0;if(r.options.indentWithTabs){for(var h=Math.floor(s/u);h;--h){v+=u;c+="\t"}}if(v<s){c+=X(s-v)}if(c!=l){uu(n,c,ft(t,0),ft(t,l.length),"+input");f.stateAfter=null;return true}else{for(var d=0;d<n.sel.ranges.length;d++){var m=n.sel.ranges[d];if(m.head.line==t&&m.head.ch<l.length){var p=ft(t,l.length);Fo(n,d,new fo(p,p));break}}}}var Vf=null;function $f(r){Vf=r}function _f(r,t,i,e,n){var o=r.doc;r.display.shift=false;if(!e){e=o.sel}var u=+new Date-200;var f=n=="paste"||r.state.pasteIncoming>u;var a=Ur(t),l=null;if(f&&e.ranges.length>1){if(Vf&&Vf.text.join("\n")==t){if(e.ranges.length%Vf.text.length==0){l=[];for(var s=0;s<Vf.text.length;s++){l.push(o.splitLines(Vf.text[s]))}}}else if(a.length==e.ranges.length&&r.options.pasteLinesPerSelection){l=Z(a,(function(r){return[r]}))}}var c=r.curOp.updateInput;for(var v=e.ranges.length-1;v>=0;v--){var h=e.ranges[v];var d=h.from(),m=h.to();if(h.empty()){if(i&&i>0){d=ft(d.line,d.ch-i)}else if(r.state.overwrite&&!f){m=ft(m.line,Math.min(Zr(o,m.line).text.length,m.ch+q(a).length))}else if(f&&Vf&&Vf.lineWise&&Vf.text.join("\n")==a.join("\n")){d=m=ft(d.line,0)}}var p={from:d,to:m,text:l?l[v%l.length]:a,origin:n||(f?"paste":r.state.cutIncoming>u?"cut":"+input")};ru(r.doc,p);Di(r,"inputRead",r,p)}if(t&&!f){Jf(r,t)}ln(r);if(r.curOp.updateInput<2){r.curOp.updateInput=c}r.curOp.typing=true;r.state.pasteIncoming=r.state.cutIncoming=-1}function Qf(r,t){var i=r.clipboardData&&r.clipboardData.getData("Text");if(i){r.preventDefault();if(!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()){On(t,(function(){return _f(t,i,0,null,"paste")}))}return true}}function Jf(r,t){if(!r.options.electricChars||!r.options.smartIndent){return}var i=r.doc.sel;for(var e=i.ranges.length-1;e>=0;e--){var n=i.ranges[e];if(n.head.ch>100||e&&i.ranges[e-1].head.line==n.head.line){continue}var o=r.getModeAt(n.head);var u=false;if(o.electricChars){for(var f=0;f<o.electricChars.length;f++){if(t.indexOf(o.electricChars.charAt(f))>-1){u=Hf(r,n.head.line,"smart");break}}}else if(o.electricInput){if(o.electricInput.test(Zr(r.doc,n.head.line).text.slice(0,n.head.ch))){u=Hf(r,n.head.line,"smart")}}if(u){Di(r,"electricInput",r,n.head.line)}}}function Kf(r){var t=[],i=[];for(var e=0;e<r.doc.sel.ranges.length;e++){var n=r.doc.sel.ranges[e].head.line;var o={anchor:ft(n,0),head:ft(n+1,0)};i.push(o);t.push(r.getRange(o.anchor,o.head))}return{text:t,ranges:i}}function Yf(r,t,i,e){r.setAttribute("autocorrect",i?"":"off");r.setAttribute("autocapitalize",e?"":"off");r.setAttribute("spellcheck",!!t)}function Xf(){var r=E("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none");var t=E("div",[r],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");if(a){r.style.width="1000px"}else{r.setAttribute("wrap","off")}if(p){r.style.border="1px solid black"}Yf(r);return t}function qf(r){var t=r.optionHandlers;var i=r.helpers={};r.prototype={constructor:r,focus:function(){j(this).focus();this.display.input.focus()},setOption:function(r,i){var e=this.options,n=e[r];if(e[r]==i&&r!="mode"){return}e[r]=i;if(t.hasOwnProperty(r)){Rn(this,t[r])(this,i,n)}kr(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,t){this.state.keyMaps[t?"push":"unshift"](Qu(r))},removeKeyMap:function(r){var t=this.state.keyMaps;for(var i=0;i<t.length;++i){if(t[i]==r||t[i].name==r){t.splice(i,1);return true}}},addOverlay:Bn((function(t,i){var e=t.token?t:r.getMode(this.options,t);if(e.startState){throw new Error("Overlays may not be stateful.")}rr(this.state.overlays,{mode:e,modeSpec:t,opaque:i&&i.opaque,priority:i&&i.priority||0},(function(r){return r.priority}));this.state.modeGen++;je(this)})),removeOverlay:Bn((function(r){var t=this.state.overlays;for(var i=0;i<t.length;++i){var e=t[i].modeSpec;if(e==r||typeof r=="string"&&e.name==r){t.splice(i,1);this.state.modeGen++;je(this);return}}})),indentLine:Bn((function(r,t,i){if(typeof t!="string"&&typeof t!="number"){if(t==null){t=this.options.smartIndent?"smart":"prev"}else{t=t?"add":"subtract"}}if(ot(this.doc,r)){Hf(this,r,t,i)}})),indentSelection:Bn((function(r){var t=this.doc.sel.ranges,i=-1;for(var e=0;e<t.length;e++){var n=t[e];if(!n.empty()){var o=n.from(),u=n.to();var f=Math.max(i,o.line);i=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var a=f;a<i;++a){Hf(this,a,r)}var l=this.doc.sel.ranges;if(o.ch==0&&t.length==l.length&&l[e].from().ch>0){Fo(this.doc,e,new fo(o,l[e].to()),_)}}else if(n.head.line>i){Hf(this,n.head.line,r,true);i=n.head.line;if(e==this.doc.sel.primIndex){ln(this)}}}})),getTokenAt:function(r,t){return Lt(this,r,t)},getLineTokens:function(r,t){return Lt(this,ft(r),t,true)},getTokenTypeAt:function(r){r=dt(this.doc,r);var t=kt(this,Zr(this.doc,r.line));var i=0,e=(t.length-1)/2,n=r.ch;var o;if(n==0){o=t[2]}else{for(;;){var u=i+e>>1;if((u?t[u*2-1]:0)>=n){e=u}else if(t[u*2+1]<n){i=u+1}else{o=t[u*2+2];break}}}var f=o?o.indexOf("overlay "):-1;return f<0?o:f==0?null:o.slice(0,f-1)},getModeAt:function(t){var i=this.doc.mode;if(!i.innerMode){return i}return r.innerMode(i,this.getTokenAt(t).state).mode},getHelper:function(r,t){return this.getHelpers(r,t)[0]},getHelpers:function(r,t){var e=[];if(!i.hasOwnProperty(t)){return e}var n=i[t],o=this.getModeAt(r);if(typeof o[t]=="string"){if(n[o[t]]){e.push(n[o[t]])}}else if(o[t]){for(var u=0;u<o[t].length;u++){var f=n[o[t][u]];if(f){e.push(f)}}}else if(o.helperType&&n[o.helperType]){e.push(n[o.helperType])}else if(n[o.name]){e.push(n[o.name])}for(var a=0;a<n._global.length;a++){var l=n._global[a];if(l.pred(o,this)&&H(e,l.val)==-1){e.push(l.val)}}return e},getStateAfter:function(r,t){var i=this.doc;r=ht(i,r==null?i.first+i.size-1:r);return Ct(this,r+1,t).state},cursorCoords:function(r,t){var i,e=this.doc.sel.primary();if(r==null){i=e.head}else if(typeof r=="object"){i=dt(this.doc,r)}else{i=r?e.from():e.to()}return we(this,i,t||"page")},charCoords:function(r,t){return be(this,dt(this.doc,r),t||"page")},coordsChar:function(r,t){r=ge(this,r,t||"page");return Me(this,r.left,r.top)},lineAtHeight:function(r,t){r=ge(this,{top:r,left:0},t||"page").top;return nt(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,t,i){var e=false,n;if(typeof r=="number"){var o=this.doc.first+this.doc.size-1;if(r<this.doc.first){r=this.doc.first}else if(r>o){r=o;e=true}n=Zr(this.doc,r)}else{n=r}return pe(this,n,{top:0,left:0},t||"page",i||e).top+(e?this.doc.height-fi(n):0)},defaultTextHeight:function(){return De(this.display)},defaultCharWidth:function(){return Te(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,t,i,e,n){var o=this.display;r=we(this,dt(this.doc,r));var u=r.bottom,f=r.left;t.style.position="absolute";t.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(t);o.sizer.appendChild(t);if(e=="over"){u=r.top}else if(e=="above"||e=="near"){var a=Math.max(o.wrapper.clientHeight,this.doc.height),l=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);if((e=="above"||r.bottom+t.offsetHeight>a)&&r.top>t.offsetHeight){u=r.top-t.offsetHeight}else if(r.bottom+t.offsetHeight<=a){u=r.bottom}if(f+t.offsetWidth>l){f=l-t.offsetWidth}}t.style.top=u+"px";t.style.left=t.style.right="";if(n=="right"){f=o.sizer.clientWidth-t.offsetWidth;t.style.right="0px"}else{if(n=="left"){f=0}else if(n=="middle"){f=(o.sizer.clientWidth-t.offsetWidth)/2}t.style.left=f+"px"}if(i){un(this,{left:f,top:u,right:f+t.offsetWidth,bottom:u+t.offsetHeight})}},triggerOnKeyDown:Bn(vf),triggerOnKeyPress:Bn(mf),triggerOnKeyUp:df,triggerOnMouseDown:Bn(Cf),execCommand:function(r){if(Zu.hasOwnProperty(r)){return Zu[r].call(null,this)}},triggerElectric:Bn((function(r){Jf(this,r)})),findPosH:function(r,t,i,e){var n=1;if(t<0){n=-1;t=-t}var o=dt(this.doc,r);for(var u=0;u<t;++u){o=Zf(this.doc,o,n,i,e);if(o.hitSide){break}}return o},moveH:Bn((function(r,t){var i=this;this.extendSelectionsBy((function(e){if(i.display.shift||i.doc.extend||e.empty()){return Zf(i.doc,e.head,r,t,i.options.rtlMoveVisually)}else{return r<0?e.from():e.to()}}),J)})),deleteH:Bn((function(r,t){var i=this.doc.sel,e=this.doc;if(i.somethingSelected()){e.replaceSelection("",null,"+delete")}else{Ju(this,(function(i){var n=Zf(e,i.head,r,t,false);return r<0?{from:n,to:i.head}:{from:i.head,to:n}}))}})),findPosV:function(r,t,i,e){var n=1,o=e;if(t<0){n=-1;t=-t}var u=dt(this.doc,r);for(var f=0;f<t;++f){var a=we(this,u,"div");if(o==null){o=a.left}else{a.left=o}u=ra(this,a,n,i);if(u.hitSide){break}}return u},moveV:Bn((function(r,t){var i=this;var e=this.doc,n=[];var o=!this.display.shift&&!e.extend&&e.sel.somethingSelected();e.extendSelectionsBy((function(u){if(o){return r<0?u.from():u.to()}var f=we(i,u.head,"div");if(u.goalColumn!=null){f.left=u.goalColumn}n.push(f.left);var a=ra(i,f,r,t);if(t=="page"&&u==e.sel.primary()){an(i,be(i,a,"div").top-f.top)}return a}),J);if(n.length){for(var u=0;u<e.sel.ranges.length;u++){e.sel.ranges[u].goalColumn=n[u]}}})),findWordAt:function(r){var t=this.doc,i=Zr(t,r.line).text;var e=r.ch,n=r.ch;if(i){var o=this.getHelper(r,"wordChars");if((r.sticky=="before"||n==i.length)&&e){--e}else{++n}var u=i.charAt(e);var f=or(u,o)?function(r){return or(r,o)}:/\s/.test(u)?function(r){return/\s/.test(r)}:function(r){return!/\s/.test(r)&&!or(r)};while(e>0&&f(i.charAt(e-1))){--e}while(n<i.length&&f(i.charAt(n))){++n}}return new fo(ft(r.line,e),ft(r.line,n))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite){return}if(this.state.overwrite=!this.state.overwrite){R(this.display.cursorDiv,"CodeMirror-overwrite")}else{L(this.display.cursorDiv,"CodeMirror-overwrite")}kr(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==O(z(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Bn((function(r,t){sn(this,r,t)})),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Ki(this)-this.display.barHeight,width:r.scrollWidth-Ki(this)-this.display.barWidth,clientHeight:Xi(this),clientWidth:Yi(this)}},scrollIntoView:Bn((function(r,t){if(r==null){r={from:this.doc.sel.primary().head,to:null};if(t==null){t=this.options.cursorScrollMargin}}else if(typeof r=="number"){r={from:ft(r,0),to:null}}else if(r.from==null){r={from:r,to:null}}if(!r.to){r.to=r.from}r.margin=t||0;if(r.from.line!=null){cn(this,r)}else{hn(this,r.from,r.to,r.margin)}})),setSize:Bn((function(r,t){var i=this;var e=function(r){return typeof r=="number"||/^\d+$/.test(String(r))?r+"px":r};if(r!=null){this.display.wrapper.style.width=e(r)}if(t!=null){this.display.wrapper.style.height=e(t)}if(this.options.lineWrapping){ce(this)}var n=this.display.viewFrom;this.doc.iter(n,this.display.viewTo,(function(r){if(r.widgets){for(var t=0;t<r.widgets.length;t++){if(r.widgets[t].noHScroll){We(i,n,"widget");break}}}++n}));this.curOp.forceUpdate=true;kr(this,"refresh",this)})),operation:function(r){return On(this,r)},startOperation:function(){return xn(this)},endOperation:function(){return Ln(this)},refresh:Bn((function(){var r=this.display.cachedTextHeight;je(this);this.curOp.forceUpdate=true;ve(this);sn(this,this.doc.scrollLeft,this.doc.scrollTop);Qn(this.display);if(r==null||Math.abs(r-De(this.display))>.5||this.options.lineWrapping){Be(this)}kr(this,"refresh",this)})),swapDoc:Bn((function(r){var t=this.doc;t.cm=null;if(this.state.selectingText){this.state.selectingText()}Co(this,r);ve(this);this.display.input.reset();sn(this,r.scrollLeft,r.scrollTop);this.curOp.forceScroll=true;Di(this,"swapDoc",this,t);return t})),phrase:function(r){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,r)?t[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};yr(r);r.registerHelper=function(t,e,n){if(!i.hasOwnProperty(t)){i[t]=r[t]={_global:[]}}i[t][e]=n};r.registerGlobalHelper=function(t,e,n,o){r.registerHelper(t,e,o);i[t]._global.push({pred:n,val:o})}}function Zf(r,t,i,e,n){var o=t;var u=i;var f=Zr(r,t.line);var a=n&&r.direction=="rtl"?-i:i;function l(){var i=t.line+a;if(i<r.first||i>=r.first+r.size){return false}t=new ft(i,t.ch,t.sticky);return f=Zr(r,i)}function s(o){var u;if(e=="codepoint"){var s=f.text.charCodeAt(t.ch+(i>0?0:-1));if(isNaN(s)){u=null}else{var c=i>0?s>=55296&&s<56320:s>=56320&&s<57343;u=new ft(t.line,Math.max(0,Math.min(f.text.length,t.ch+i*(c?2:1))),-i)}}else if(n){u=qu(r.cm,f,t,i)}else{u=Yu(f,t,i)}if(u==null){if(!o&&l()){t=Xu(n,r.cm,f,t.line,a)}else{return false}}else{t=u}return true}if(e=="char"||e=="codepoint"){s()}else if(e=="column"){s(true)}else if(e=="word"||e=="group"){var c=null,v=e=="group";var h=r.cm&&r.cm.getHelper(t,"wordChars");for(var d=true;;d=false){if(i<0&&!s(!d)){break}var m=f.text.charAt(t.ch)||"\n";var p=or(m,h)?"w":v&&m=="\n"?"n":!v||/\s/.test(m)?null:"p";if(v&&!d&&!p){p="s"}if(c&&c!=p){if(i<0){i=1;s();t.sticky="after"}break}if(p){c=p}if(i>0&&!s(!d)){break}}}var g=Yo(r,t,o,u,true);if(lt(o,g)){g.hitSide=true}return g}function ra(r,t,i,e){var n=r.doc,o=t.left,u;if(e=="page"){var f=Math.min(r.display.wrapper.clientHeight,j(r).innerHeight||n(r).documentElement.clientHeight);var a=Math.max(f-.5*De(r.display),3);u=(i>0?t.bottom:t.top)+i*a}else if(e=="line"){u=i>0?t.bottom+3:t.top-3}var l;for(;;){l=Me(r,o,u);if(!l.outside){break}if(i<0?u<=0:u>=n.height){l.hitSide=true;break}u+=i*5}return l}var ta=function(r){this.cm=r;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new G;this.composing=null;this.gracePeriod=false;this.readDOMTimeout=null};ta.prototype.init=function(r){var t=this;var i=this,e=i.cm;var n=i.div=r.lineDiv;n.contentEditable=true;Yf(n,e.options.spellcheck,e.options.autocorrect,e.options.autocapitalize);function o(r){for(var t=r.target;t;t=t.parentNode){if(t==n){return true}if(/\bCodeMirror-(?:line)?widget\b/.test(t.className)){break}}return false}gr(n,"paste",(function(r){if(!o(r)||Cr(e,r)||Qf(r,e)){return}if(f<=11){setTimeout(Rn(e,(function(){return t.updateFromDOM()})),20)}}));gr(n,"compositionstart",(function(r){t.composing={data:r.data,done:false}}));gr(n,"compositionupdate",(function(r){if(!t.composing){t.composing={data:r.data,done:false}}}));gr(n,"compositionend",(function(r){if(t.composing){if(r.data!=t.composing.data){t.readFromDOMSoon()}t.composing.done=true}}));gr(n,"touchstart",(function(){return i.forceCompositionEnd()}));gr(n,"input",(function(){if(!t.composing){t.readFromDOMSoon()}}));function u(r){if(!o(r)||Cr(e,r)){return}if(e.somethingSelected()){$f({lineWise:false,text:e.getSelections()});if(r.type=="cut"){e.replaceSelection("",null,"cut")}}else if(!e.options.lineWiseCopyCut){return}else{var t=Kf(e);$f({lineWise:true,text:t.text});if(r.type=="cut"){e.operation((function(){e.setSelections(t.ranges,0,_);e.replaceSelection("",null,"cut")}))}}if(r.clipboardData){r.clipboardData.clearData();var u=Vf.text.join("\n");r.clipboardData.setData("Text",u);if(r.clipboardData.getData("Text")==u){r.preventDefault();return}}var f=Xf(),a=f.firstChild;e.display.lineSpace.insertBefore(f,e.display.lineSpace.firstChild);a.value=Vf.text.join("\n");var l=O(n.ownerDocument);U(a);setTimeout((function(){e.display.lineSpace.removeChild(f);l.focus();if(l==n){i.showPrimarySelection()}}),50)}gr(n,"copy",u);gr(n,"cut",u)};ta.prototype.screenReaderLabelChanged=function(r){if(r){this.div.setAttribute("aria-label",r)}else{this.div.removeAttribute("aria-label")}};ta.prototype.prepareSelection=function(){var r=$e(this.cm,false);r.focus=O(this.div.ownerDocument)==this.div;return r};ta.prototype.showSelection=function(r,t){if(!r||!this.cm.display.view.length){return}if(r.focus||t){this.showPrimarySelection()}this.showMultipleSelections(r)};ta.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()};ta.prototype.showPrimarySelection=function(){var r=this.getSelection(),t=this.cm,e=t.doc.sel.primary();var n=e.from(),o=e.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||o.line<t.display.viewFrom){r.removeAllRanges();return}var u=ua(t,r.anchorNode,r.anchorOffset);var f=ua(t,r.focusNode,r.focusOffset);if(u&&!u.bad&&f&&!f.bad&&at(vt(u,f),n)==0&&at(ct(u,f),o)==0){return}var a=t.display.view;var l=n.line>=t.display.viewFrom&&ia(t,n)||{node:a[0].measure.map[2],offset:0};var s=o.line<t.display.viewTo&&ia(t,o);if(!s){var c=a[a.length-1].measure;var v=c.maps?c.maps[c.maps.length-1]:c.map;s={node:v[v.length-1],offset:v[v.length-2]-v[v.length-3]}}if(!l||!s){r.removeAllRanges();return}var h=r.rangeCount&&r.getRangeAt(0),d;try{d=T(l.node,l.offset,s.offset,s.node)}catch(r){}if(d){if(!i&&t.state.focused){r.collapse(l.node,l.offset);if(!d.collapsed){r.removeAllRanges();r.addRange(d)}}else{r.removeAllRanges();r.addRange(d)}if(h&&r.anchorNode==null){r.addRange(h)}else if(i){this.startGracePeriod()}}this.rememberSelection()};ta.prototype.startGracePeriod=function(){var r=this;clearTimeout(this.gracePeriod);this.gracePeriod=setTimeout((function(){r.gracePeriod=false;if(r.selectionChanged()){r.cm.operation((function(){return r.cm.curOp.selectionChanged=true}))}}),20)};ta.prototype.showMultipleSelections=function(r){N(this.cm.display.cursorDiv,r.cursors);N(this.cm.display.selectionDiv,r.selection)};ta.prototype.rememberSelection=function(){var r=this.getSelection();this.lastAnchorNode=r.anchorNode;this.lastAnchorOffset=r.anchorOffset;this.lastFocusNode=r.focusNode;this.lastFocusOffset=r.focusOffset};ta.prototype.selectionInEditor=function(){var r=this.getSelection();if(!r.rangeCount){return false}var t=r.getRangeAt(0).commonAncestorContainer;return I(this.div,t)};ta.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"){if(!this.selectionInEditor()||O(this.div.ownerDocument)!=this.div){this.showSelection(this.prepareSelection(),true)}this.div.focus()}};ta.prototype.blur=function(){this.div.blur()};ta.prototype.getField=function(){return this.div};ta.prototype.supportsTouch=function(){return true};ta.prototype.receivedFocus=function(){var r=this;var t=this;if(this.selectionInEditor()){setTimeout((function(){return r.pollSelection()}),20)}else{On(this.cm,(function(){return t.cm.curOp.selectionChanged=true}))}function i(){if(t.cm.state.focused){t.pollSelection();t.polling.set(t.cm.options.pollInterval,i)}}this.polling.set(this.cm.options.pollInterval,i)};ta.prototype.selectionChanged=function(){var r=this.getSelection();return r.anchorNode!=this.lastAnchorNode||r.anchorOffset!=this.lastAnchorOffset||r.focusNode!=this.lastFocusNode||r.focusOffset!=this.lastFocusOffset};ta.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged()){return}var r=this.getSelection(),t=this.cm;if(g&&s&&this.cm.display.gutterSpecs.length&&ea(r.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs});this.blur();this.focus();return}if(this.composing){return}this.rememberSelection();var i=ua(t,r.anchorNode,r.anchorOffset);var e=ua(t,r.focusNode,r.focusOffset);if(i&&e){On(t,(function(){Vo(t.doc,lo(i,e),_);if(i.bad||e.bad){t.curOp.selectionChanged=true}}))}};ta.prototype.pollContent=function(){if(this.readDOMTimeout!=null){clearTimeout(this.readDOMTimeout);this.readDOMTimeout=null}var r=this.cm,t=r.display,i=r.doc.sel.primary();var e=i.from(),n=i.to();if(e.ch==0&&e.line>r.firstLine()){e=ft(e.line-1,Zr(r.doc,e.line-1).length)}if(n.ch==Zr(r.doc,n.line).text.length&&n.line<r.lastLine()){n=ft(n.line+1,0)}if(e.line<t.viewFrom||n.line>t.viewTo-1){return false}var o,u,f;if(e.line==t.viewFrom||(o=ze(r,e.line))==0){u=et(t.view[0].line);f=t.view[0].node}else{u=et(t.view[o].line);f=t.view[o-1].node.nextSibling}var a=ze(r,n.line);var l,s;if(a==t.view.length-1){l=t.viewTo-1;s=t.lineDiv.lastChild}else{l=et(t.view[a+1].line)-1;s=t.view[a+1].node.previousSibling}if(!f){return false}var c=r.doc.splitLines(oa(r,f,s,u,l));var v=rt(r.doc,ft(u,0),ft(l,Zr(r.doc,l).text.length));while(c.length>1&&v.length>1){if(q(c)==q(v)){c.pop();v.pop();l--}else if(c[0]==v[0]){c.shift();v.shift();u++}else{break}}var h=0,d=0;var m=c[0],p=v[0],g=Math.min(m.length,p.length);while(h<g&&m.charCodeAt(h)==p.charCodeAt(h)){++h}var b=q(c),w=q(v);var k=Math.min(b.length-(c.length==1?h:0),w.length-(v.length==1?h:0));while(d<k&&b.charCodeAt(b.length-d-1)==w.charCodeAt(w.length-d-1)){++d}if(c.length==1&&v.length==1&&u==e.line){while(h&&h>e.ch&&b.charCodeAt(b.length-d-1)==w.charCodeAt(w.length-d-1)){h--;d++}}c[c.length-1]=b.slice(0,b.length-d).replace(/^\u200b+/,"");c[0]=c[0].slice(h).replace(/\u200b+$/,"");var C=ft(u,h);var M=ft(l,v.length?q(v).length-d:0);if(c.length>1||c[0]||at(C,M)){uu(r.doc,c,C,M,"+input");return true}};ta.prototype.ensurePolled=function(){this.forceCompositionEnd()};ta.prototype.reset=function(){this.forceCompositionEnd()};ta.prototype.forceCompositionEnd=function(){if(!this.composing){return}clearTimeout(this.readDOMTimeout);this.composing=null;this.updateFromDOM();this.div.blur();this.div.focus()};ta.prototype.readFromDOMSoon=function(){var r=this;if(this.readDOMTimeout!=null){return}this.readDOMTimeout=setTimeout((function(){r.readDOMTimeout=null;if(r.composing){if(r.composing.done){r.composing=null}else{return}}r.updateFromDOM()}),80)};ta.prototype.updateFromDOM=function(){var r=this;if(this.cm.isReadOnly()||!this.pollContent()){On(this.cm,(function(){return je(r.cm)}))}};ta.prototype.setUneditable=function(r){r.contentEditable="false"};ta.prototype.onKeyPress=function(r){if(r.charCode==0||this.composing){return}r.preventDefault();if(!this.cm.isReadOnly()){Rn(this.cm,_f)(this.cm,String.fromCharCode(r.charCode==null?r.keyCode:r.charCode),0)}};ta.prototype.readOnlyChanged=function(r){this.div.contentEditable=String(r!="nocursor")};ta.prototype.onContextMenu=function(){};ta.prototype.resetPosition=function(){};ta.prototype.needsContentAttribute=true;function ia(r,t){var i=ie(r,t.line);if(!i||i.hidden){return null}var e=Zr(r.doc,t.line);var n=Zi(i,e,t.line);var o=mr(e,r.doc.direction),u="left";if(o){var f=hr(o,t.ch);u=f%2?"right":"left"}var a=ue(n.map,t.ch,u);a.offset=a.collapse=="right"?a.end:a.start;return a}function ea(r){for(var t=r;t;t=t.parentNode){if(/CodeMirror-gutter-wrapper/.test(t.className)){return true}}return false}function na(r,t){if(t){r.bad=true}return r}function oa(r,t,i,e,n){var o="",u=false,f=r.doc.lineSeparator(),a=false;function l(r){return function(t){return t.id==r}}function s(){if(u){o+=f;if(a){o+=f}u=a=false}}function c(r){if(r){s();o+=r}}function v(t){if(t.nodeType==1){var i=t.getAttribute("cm-text");if(i){c(i);return}var o=t.getAttribute("cm-marker"),h;if(o){var d=r.findMarks(ft(e,0),ft(n+1,0),l(+o));if(d.length&&(h=d[0].find(0))){c(rt(r.doc,h.from,h.to).join(f))}return}if(t.getAttribute("contenteditable")=="false"){return}var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&t.textContent.length==0){return}if(m){s()}for(var p=0;p<t.childNodes.length;p++){v(t.childNodes[p])}if(/^(pre|p)$/i.test(t.nodeName)){a=true}if(m){u=true}}else if(t.nodeType==3){c(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}}for(;;){v(t);if(t==i){break}t=t.nextSibling;a=false}return o}function ua(r,t,i){var e;if(t==r.display.lineDiv){e=r.display.lineDiv.childNodes[i];if(!e){return na(r.clipPos(ft(r.display.viewTo-1)),true)}t=null;i=0}else{for(e=t;;e=e.parentNode){if(!e||e==r.display.lineDiv){return null}if(e.parentNode&&e.parentNode==r.display.lineDiv){break}}}for(var n=0;n<r.display.view.length;n++){var o=r.display.view[n];if(o.node==e){return fa(o,t,i)}}}function fa(r,t,i){var e=r.text.firstChild,n=false;if(!t||!I(e,t)){return na(ft(et(r.line),0),true)}if(t==e){n=true;t=e.childNodes[i];i=0;if(!t){var o=r.rest?q(r.rest):r.line;return na(ft(et(o),o.text.length),n)}}var u=t.nodeType==3?t:null,f=t;if(!u&&t.childNodes.length==1&&t.firstChild.nodeType==3){u=t.firstChild;if(i){i=u.nodeValue.length}}while(f.parentNode!=e){f=f.parentNode}var a=r.measure,l=a.maps;function s(t,i,e){for(var n=-1;n<(l?l.length:0);n++){var o=n<0?a.map:l[n];for(var u=0;u<o.length;u+=3){var f=o[u+2];if(f==t||f==i){var s=et(n<0?r.line:r.rest[n]);var c=o[u]+e;if(e<0||f!=t){c=o[u+(e?1:0)]}return ft(s,c)}}}}var c=s(u,f,i);if(c){return na(c,n)}for(var v=f.nextSibling,h=u?u.nodeValue.length-i:0;v;v=v.nextSibling){c=s(v,v.firstChild,0);if(c){return na(ft(c.line,c.ch-h),n)}else{h+=v.textContent.length}}for(var d=f.previousSibling,m=i;d;d=d.previousSibling){c=s(d,d.firstChild,-1);if(c){return na(ft(c.line,c.ch+m),n)}else{m+=d.textContent.length}}}var aa=function(r){this.cm=r;this.prevInput="";this.pollingFast=false;this.polling=new G;this.hasSelection=false;this.composing=null;this.resetting=false};aa.prototype.init=function(r){var t=this;var i=this,e=this.cm;this.createField(r);var n=this.textarea;r.wrapper.insertBefore(this.wrapper,r.wrapper.firstChild);if(p){n.style.width="0px"}gr(n,"input",(function(){if(u&&f>=9&&t.hasSelection){t.hasSelection=null}i.poll()}));gr(n,"paste",(function(r){if(Cr(e,r)||Qf(r,e)){return}e.state.pasteIncoming=+new Date;i.fastPoll()}));function o(r){if(Cr(e,r)){return}if(e.somethingSelected()){$f({lineWise:false,text:e.getSelections()})}else if(!e.options.lineWiseCopyCut){return}else{var t=Kf(e);$f({lineWise:true,text:t.text});if(r.type=="cut"){e.setSelections(t.ranges,null,_)}else{i.prevInput="";n.value=t.text.join("\n");U(n)}}if(r.type=="cut"){e.state.cutIncoming=+new Date}}gr(n,"cut",o);gr(n,"copy",o);gr(r.scroller,"paste",(function(t){if($i(r,t)||Cr(e,t)){return}if(!n.dispatchEvent){e.state.pasteIncoming=+new Date;i.focus();return}var o=new Event("paste");o.clipboardData=t.clipboardData;n.dispatchEvent(o)}));gr(r.lineSpace,"selectstart",(function(t){if(!$i(r,t)){xr(t)}}));gr(n,"compositionstart",(function(){var r=e.getCursor("from");if(i.composing){i.composing.range.clear()}i.composing={start:r,range:e.markText(r,e.getCursor("to"),{className:"CodeMirror-composing"})}}));gr(n,"compositionend",(function(){if(i.composing){i.poll();i.composing.range.clear();i.composing=null}}))};aa.prototype.createField=function(r){this.wrapper=Xf();this.textarea=this.wrapper.firstChild};aa.prototype.screenReaderLabelChanged=function(r){if(r){this.textarea.setAttribute("aria-label",r)}else{this.textarea.removeAttribute("aria-label")}};aa.prototype.prepareSelection=function(){var r=this.cm,t=r.display,i=r.doc;var e=$e(r);if(r.options.moveInputWithCursor){var n=we(r,i.sel.primary().head,"div");var o=t.wrapper.getBoundingClientRect(),u=t.lineDiv.getBoundingClientRect();e.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+u.top-o.top));e.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+u.left-o.left))}return e};aa.prototype.showSelection=function(r){var t=this.cm,i=t.display;N(i.cursorDiv,r.cursors);N(i.selectionDiv,r.selection);if(r.teTop!=null){this.wrapper.style.top=r.teTop+"px";this.wrapper.style.left=r.teLeft+"px"}};aa.prototype.reset=function(r){if(this.contextMenuPending||this.composing&&r){return}var t=this.cm;this.resetting=true;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i;if(t.state.focused){U(this.textarea)}if(u&&f>=9){this.hasSelection=i}}else if(!r){this.prevInput=this.textarea.value="";if(u&&f>=9){this.hasSelection=null}}this.resetting=false};aa.prototype.getField=function(){return this.textarea};aa.prototype.supportsTouch=function(){return false};aa.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!b||O(this.textarea.ownerDocument)!=this.textarea)){try{this.textarea.focus()}catch(r){}}};aa.prototype.blur=function(){this.textarea.blur()};aa.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0};aa.prototype.receivedFocus=function(){this.slowPoll()};aa.prototype.slowPoll=function(){var r=this;if(this.pollingFast){return}this.polling.set(this.cm.options.pollInterval,(function(){r.poll();if(r.cm.state.focused){r.slowPoll()}}))};aa.prototype.fastPoll=function(){var r=false,t=this;t.pollingFast=true;function i(){var e=t.poll();if(!e&&!r){r=true;t.polling.set(60,i)}else{t.pollingFast=false;t.slowPoll()}}t.polling.set(20,i)};aa.prototype.poll=function(){var r=this;var t=this.cm,i=this.textarea,e=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||zr(i)&&!e&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq){return false}var n=i.value;if(n==e&&!t.somethingSelected()){return false}if(u&&f>=9&&this.hasSelection===n||w&&/[\uf700-\uf7ff]/.test(n)){t.display.input.reset();return false}if(t.doc.sel==t.display.selForContextMenu){var o=n.charCodeAt(0);if(o==8203&&!e){e="​"}if(o==8666){this.reset();return this.cm.execCommand("undo")}}var a=0,l=Math.min(e.length,n.length);while(a<l&&e.charCodeAt(a)==n.charCodeAt(a)){++a}On(t,(function(){_f(t,n.slice(a),e.length-a,null,r.composing?"*compose":null);if(n.length>1e3||n.indexOf("\n")>-1){i.value=r.prevInput=""}else{r.prevInput=n}if(r.composing){r.composing.range.clear();r.composing.range=t.markText(r.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"})}}));return true};aa.prototype.ensurePolled=function(){if(this.pollingFast&&this.poll()){this.pollingFast=false}};aa.prototype.onKeyPress=function(){if(u&&f>=9){this.hasSelection=null}this.fastPoll()};aa.prototype.onContextMenu=function(r){var t=this,i=t.cm,e=i.display,n=t.textarea;if(t.contextMenuPending){t.contextMenuPending()}var o=Ue(i,r),l=e.scroller.scrollTop;if(!o||v){return}var s=i.options.resetSelectionOnContextMenu;if(s&&i.doc.sel.contains(o)==-1){Rn(i,Vo)(i.doc,lo(o),_)}var c=n.style.cssText,h=t.wrapper.style.cssText;var d=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static";n.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(r.clientY-d.top-5)+"px; left: "+(r.clientX-d.left-5)+"px;\n z-index: 1000; background: "+(u?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var m;if(a){m=n.ownerDocument.defaultView.scrollY}e.input.focus();if(a){n.ownerDocument.defaultView.scrollTo(null,m)}e.input.reset();if(!i.somethingSelected()){n.value=t.prevInput=" "}t.contextMenuPending=g;e.selForContextMenu=i.doc.sel;clearTimeout(e.detectingSelectAll);function p(){if(n.selectionStart!=null){var r=i.somethingSelected();var o="​"+(r?n.value:"");n.value="⇚";n.value=o;t.prevInput=r?"":"​";n.selectionStart=1;n.selectionEnd=o.length;e.selForContextMenu=i.doc.sel}}function g(){if(t.contextMenuPending!=g){return}t.contextMenuPending=false;t.wrapper.style.cssText=h;n.style.cssText=c;if(u&&f<9){e.scrollbars.setScrollTop(e.scroller.scrollTop=l)}if(n.selectionStart!=null){if(!u||u&&f<9){p()}var r=0,o=function(){if(e.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="​"){Rn(i,qo)(i)}else if(r++<10){e.detectingSelectAll=setTimeout(o,500)}else{e.selForContextMenu=null;e.input.reset()}};e.detectingSelectAll=setTimeout(o,200)}}if(u&&f>=9){p()}if(y){Nr(r);var b=function(){wr(window,"mouseup",b);setTimeout(g,20)};gr(window,"mouseup",b)}else{setTimeout(g,50)}};aa.prototype.readOnlyChanged=function(r){if(!r){this.reset()}this.textarea.disabled=r=="nocursor";this.textarea.readOnly=!!r};aa.prototype.setUneditable=function(){};aa.prototype.needsContentAttribute=false;function la(r,t){t=t?F(t):{};t.value=r.value;if(!t.tabindex&&r.tabIndex){t.tabindex=r.tabIndex}if(!t.placeholder&&r.placeholder){t.placeholder=r.placeholder}if(t.autofocus==null){var i=O(r.ownerDocument);t.autofocus=i==r||r.getAttribute("autofocus")!=null&&i==document.body}function e(){r.value=f.getValue()}var n;if(r.form){gr(r.form,"submit",e);if(!t.leaveSubmitMethodAlone){var o=r.form;n=o.submit;try{var u=o.submit=function(){e();o.submit=n;o.submit();o.submit=u}}catch(r){}}}t.finishInit=function(i){i.save=e;i.getTextArea=function(){return r};i.toTextArea=function(){i.toTextArea=isNaN;e();r.parentNode.removeChild(i.getWrapperElement());r.style.display="";if(r.form){wr(r.form,"submit",e);if(!t.leaveSubmitMethodAlone&&typeof r.form.submit=="function"){r.form.submit=n}}}};r.style.display="none";var f=Ff((function(t){return r.parentNode.insertBefore(t,r.nextSibling)}),t);return f}function sa(r){r.off=wr;r.on=gr;r.wheelEventPixels=no;r.Doc=xu;r.splitLines=Ur;r.countColumn=P;r.findColumn=K;r.isWordChar=nr;r.Pass=$;r.signal=kr;r.Line=si;r.changeEnd=so;r.scrollbarModel=Mn;r.Pos=ft;r.cmpPos=at;r.modes=Pr;r.mimeModes=Gr;r.resolveMode=$r;r.getMode=_r;r.modeExtensions=Qr;r.extendMode=Jr;r.copyState=Kr;r.startState=Xr;r.innerMode=Yr;r.commands=Zu;r.keyMap=Fu;r.keyName=_u;r.isModifierKey=Vu;r.lookupKey=Hu;r.normalizeKeyMap=Gu;r.StringStream=qr;r.SharedTextMarker=wu;r.TextMarker=gu;r.LineWidget=hu;r.e_preventDefault=xr;r.e_stopPropagation=Lr;r.e_stop=Nr;r.addClass=R;r.contains=I;r.rmClass=L;r.keyNames=Uu}zf(Ff);qf(Ff);var ca="iter insert remove copy getEditor constructor".split(" ");for(var va in xu.prototype){if(xu.prototype.hasOwnProperty(va)&&H(ca,va)<0){Ff.prototype[va]=function(r){return function(){return r.apply(this.doc,arguments)}}(xu.prototype[va])}}yr(xu);Ff.inputStyles={textarea:aa,contenteditable:ta};Ff.defineMode=function(r){if(!Ff.defaults.mode&&r!="null"){Ff.defaults.mode=r}Hr.apply(this,arguments)};Ff.defineMIME=Vr;Ff.defineMode("null",(function(){return{token:function(r){return r.skipToEnd()}}}));Ff.defineMIME("text/plain","null");Ff.defineExtension=function(r,t){Ff.prototype[r]=t};Ff.defineDocExtension=function(r,t){xu.prototype[r]=t};Ff.fromTextArea=la;sa(Ff);Ff.version="5.65.9";return Ff}))}));n((function(r,t){(function(r){r(u)})((function(r){r.defineMode("javascript",(function(t,i){var e=t.indentUnit;var n=i.statementIndent;var o=i.jsonld;var u=i.json||o;var f=i.trackScope!==false;var a=i.typescript;var l=i.wordCharacters||/[\w$\xa1-\uffff]/;var s=function(){function r(r){return{type:r,style:"keyword"}}var t=r("keyword a"),i=r("keyword b"),e=r("keyword c"),n=r("keyword d");var o=r("operator"),u={type:"atom",style:"atom"};return{if:r("if"),while:t,with:t,else:i,do:i,try:i,finally:i,return:n,break:n,continue:n,new:r("new"),delete:e,void:e,throw:e,debugger:r("debugger"),var:r("var"),const:r("var"),let:r("var"),function:r("function"),catch:r("catch"),for:r("for"),switch:r("switch"),case:r("case"),default:r("default"),in:o,typeof:o,instanceof:o,true:u,false:u,null:u,undefined:u,NaN:u,Infinity:u,this:r("this"),class:r("class"),super:r("atom"),yield:e,export:r("export"),import:r("import"),extends:e,await:e}}();var c=/[+\-*&%=<>!?|~^@]/;var v=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function h(r){var t=false,i,e=false;while((i=r.next())!=null){if(!t){if(i=="/"&&!e)return;if(i=="[")e=true;else if(e&&i=="]")e=false}t=!t&&i=="\\"}}var d,m;function p(r,t,i){d=r;m=i;return t}function g(r,t){var i=r.next();if(i=='"'||i=="'"){t.tokenize=b(i);return t.tokenize(r,t)}else if(i=="."&&r.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)){return p("number","number")}else if(i=="."&&r.match("..")){return p("spread","meta")}else if(/[\[\]{}\(\),;\:\.]/.test(i)){return p(i)}else if(i=="="&&r.eat(">")){return p("=>","operator")}else if(i=="0"&&r.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)){return p("number","number")}else if(/\d/.test(i)){r.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/);return p("number","number")}else if(i=="/"){if(r.eat("*")){t.tokenize=w;return w(r,t)}else if(r.eat("/")){r.skipToEnd();return p("comment","comment")}else if(nt(r,t,1)){h(r);r.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/);return p("regexp","string-2")}else{r.eat("=");return p("operator","operator",r.current())}}else if(i=="`"){t.tokenize=k;return k(r,t)}else if(i=="#"&&r.peek()=="!"){r.skipToEnd();return p("meta","meta")}else if(i=="#"&&r.eatWhile(l)){return p("variable","property")}else if(i=="<"&&r.match("!--")||i=="-"&&r.match("->")&&!/\S/.test(r.string.slice(0,r.start))){r.skipToEnd();return p("comment","comment")}else if(c.test(i)){if(i!=">"||!t.lexical||t.lexical.type!=">"){if(r.eat("=")){if(i=="!"||i=="=")r.eat("=")}else if(/[<>*+\-|&?]/.test(i)){r.eat(i);if(i==">")r.eat(i)}}if(i=="?"&&r.eat("."))return p(".");return p("operator","operator",r.current())}else if(l.test(i)){r.eatWhile(l);var e=r.current();if(t.lastType!="."){if(s.propertyIsEnumerable(e)){var n=s[e];return p(n.type,n.style,e)}if(e=="async"&&r.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,false))return p("async","keyword",e)}return p("variable","variable",e)}}function b(r){return function(t,i){var e=false,n;if(o&&t.peek()=="@"&&t.match(v)){i.tokenize=g;return p("jsonld-keyword","meta")}while((n=t.next())!=null){if(n==r&&!e)break;e=!e&&n=="\\"}if(!e)i.tokenize=g;return p("string","string")}}function w(r,t){var i=false,e;while(e=r.next()){if(e=="/"&&i){t.tokenize=g;break}i=e=="*"}return p("comment","comment")}function k(r,t){var i=false,e;while((e=r.next())!=null){if(!i&&(e=="`"||e=="$"&&r.eat("{"))){t.tokenize=g;break}i=!i&&e=="\\"}return p("quasi","string-2",r.current())}var C="([{}])";function M(r,t){if(t.fatArrowAt)t.fatArrowAt=null;var i=r.string.indexOf("=>",r.start);if(i<0)return;if(a){var e=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(r.string.slice(r.start,i));if(e)i=e.index}var n=0,o=false;for(var u=i-1;u>=0;--u){var f=r.string.charAt(u);var s=C.indexOf(f);if(s>=0&&s<3){if(!n){++u;break}if(--n==0){if(f=="(")o=true;break}}else if(s>=3&&s<6){++n}else if(l.test(f)){o=true}else if(/["'\/`]/.test(f)){for(;;--u){if(u==0)return;var c=r.string.charAt(u-1);if(c==f&&r.string.charAt(u-2)!="\\"){u--;break}}}else if(o&&!n){++u;break}}if(o&&!n)t.fatArrowAt=u}var A={atom:true,number:true,variable:true,string:true,regexp:true,this:true,import:true,"jsonld-keyword":true};function y(r,t,i,e,n,o){this.indented=r;this.column=t;this.type=i;this.prev=n;this.info=o;if(e!=null)this.align=e}function x(r,t){if(!f)return false;for(var i=r.localVars;i;i=i.next)if(i.name==t)return true;for(var e=r.context;e;e=e.prev){for(var i=e.vars;i;i=i.next)if(i.name==t)return true}}function L(r,t,i,e,n){var o=r.cc;S.state=r;S.stream=n;S.marked=null,S.cc=o;S.style=t;if(!r.lexical.hasOwnProperty("align"))r.lexical.align=true;while(true){var f=o.length?o.pop():u?$:H;if(f(i,e)){while(o.length&&o[o.length-1].lex)o.pop()();if(S.marked)return S.marked;if(i=="variable"&&x(r,e))return"variable-2";return t}}}var S={state:null,column:null,marked:null,cc:null};function N(){for(var r=arguments.length-1;r>=0;r--)S.cc.push(arguments[r])}function E(){N.apply(null,arguments);return true}function D(r,t){for(var i=t;i;i=i.next)if(i.name==r)return true;return false}function T(r){var t=S.state;S.marked="def";if(!f)return;if(t.context){if(t.lexical.info=="var"&&t.context&&t.context.block){var e=I(r,t.context);if(e!=null){t.context=e;return}}else if(!D(r,t.localVars)){t.localVars=new B(r,t.localVars);return}}if(i.globalVars&&!D(r,t.globalVars))t.globalVars=new B(r,t.globalVars)}function I(r,t){if(!t){return null}else if(t.block){var i=I(r,t.prev);if(!i)return null;if(i==t.prev)return t;return new R(i,t.vars,true)}else if(D(r,t.vars)){return t}else{return new R(t.prev,new B(r,t.vars),false)}}function O(r){return r=="public"||r=="private"||r=="protected"||r=="abstract"||r=="readonly"}function R(r,t,i){this.prev=r;this.vars=t;this.block=i}function B(r,t){this.name=r;this.next=t}var U=new B("this",new B("arguments",null));function z(){S.state.context=new R(S.state.context,S.state.localVars,false);S.state.localVars=U}function j(){S.state.context=new R(S.state.context,S.state.localVars,true);S.state.localVars=null}z.lex=j.lex=true;function W(){S.state.localVars=S.state.context.vars;S.state.context=S.state.context.prev}W.lex=true;function F(r,t){var i=function(){var i=S.state,e=i.indented;if(i.lexical.type=="stat")e=i.lexical.indented;else for(var n=i.lexical;n&&n.type==")"&&n.align;n=n.prev)e=n.indented;i.lexical=new y(e,S.stream.column(),r,null,i.lexical,t)};i.lex=true;return i}function P(){var r=S.state;if(r.lexical.prev){if(r.lexical.type==")")r.indented=r.lexical.indented;r.lexical=r.lexical.prev}}P.lex=true;function G(r){function t(i){if(i==r)return E();else if(r==";"||i=="}"||i==")"||i=="]")return N();else return E(t)}return t}function H(r,t){if(r=="var")return E(F("vardef",t),Nr,G(";"),P);if(r=="keyword a")return E(F("form"),Q,H,P);if(r=="keyword b")return E(F("form"),H,P);if(r=="keyword d")return S.stream.match(/^\s*$/,false)?E():E(F("stat"),K,G(";"),P);if(r=="debugger")return E(G(";"));if(r=="{")return E(F("}"),j,vr,P,W);if(r==";")return E();if(r=="if"){if(S.state.lexical.info=="else"&&S.state.cc[S.state.cc.length-1]==P)S.state.cc.pop()();return E(F("form"),Q,H,P,Rr)}if(r=="function")return E(jr);if(r=="for")return E(F("form"),j,Br,H,W,P);if(r=="class"||a&&t=="interface"){S.marked="keyword";return E(F("form",r=="class"?r:t),Hr,P)}if(r=="variable"){if(a&&t=="declare"){S.marked="keyword";return E(H)}else if(a&&(t=="module"||t=="enum"||t=="type")&&S.stream.match(/^\s*\w/,false)){S.marked="keyword";if(t=="enum")return E(tt);else if(t=="type")return E(Fr,G("operator"),gr,G(";"));else return E(F("form"),Er,G("{"),F("}"),vr,P,P)}else if(a&&t=="namespace"){S.marked="keyword";return E(F("form"),$,H,P)}else if(a&&t=="abstract"){S.marked="keyword";return E(H)}else{return E(F("stat"),or)}}if(r=="switch")return E(F("form"),Q,G("{"),F("}","switch"),j,vr,P,P,W);if(r=="case")return E($,G(":"));if(r=="default")return E(G(":"));if(r=="catch")return E(F("form"),z,V,H,P,W);if(r=="export")return E(F("stat"),Qr,P);if(r=="import")return E(F("stat"),Kr,P);if(r=="async")return E(H);if(t=="@")return E($,H);return N(F("stat"),$,G(";"),P)}function V(r){if(r=="(")return E(Pr,G(")"))}function $(r,t){return J(r,t,false)}function _(r,t){return J(r,t,true)}function Q(r){if(r!="(")return N();return E(F(")"),K,G(")"),P)}function J(r,t,i){if(S.state.fatArrowAt==S.stream.start){var e=i?tr:rr;if(r=="(")return E(z,F(")"),sr(Pr,")"),P,G("=>"),e,W);else if(r=="variable")return N(z,Er,G("=>"),e,W)}var n=i?X:Y;if(A.hasOwnProperty(r))return E(n);if(r=="function")return E(jr,n);if(r=="class"||a&&t=="interface"){S.marked="keyword";return E(F("form"),Gr,P)}if(r=="keyword c"||r=="async")return E(i?_:$);if(r=="(")return E(F(")"),K,G(")"),P,n);if(r=="operator"||r=="spread")return E(i?_:$);if(r=="[")return E(F("]"),rt,P,n);if(r=="{")return cr(fr,"}",null,n);if(r=="quasi")return N(q,n);if(r=="new")return E(ir(i));return E()}function K(r){if(r.match(/[;\}\)\],]/))return N();return N($)}function Y(r,t){if(r==",")return E(K);return X(r,t,false)}function X(r,t,i){var e=i==false?Y:X;var n=i==false?$:_;if(r=="=>")return E(z,i?tr:rr,W);if(r=="operator"){if(/\+\+|--/.test(t)||a&&t=="!")return E(e);if(a&&t=="<"&&S.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,false))return E(F(">"),sr(gr,">"),P,e);if(t=="?")return E($,G(":"),n);return E(n)}if(r=="quasi"){return N(q,e)}if(r==";")return;if(r=="(")return cr(_,")","call",e);if(r==".")return E(ur,e);if(r=="[")return E(F("]"),K,G("]"),P,e);if(a&&t=="as"){S.marked="keyword";return E(gr,e)}if(r=="regexp"){S.state.lastType=S.marked="operator";S.stream.backUp(S.stream.pos-S.stream.start-1);return E(n)}}function q(r,t){if(r!="quasi")return N();if(t.slice(t.length-2)!="${")return E(q);return E(K,Z)}function Z(r){if(r=="}"){S.marked="string-2";S.state.tokenize=k;return E(q)}}function rr(r){M(S.stream,S.state);return N(r=="{"?H:$)}function tr(r){M(S.stream,S.state);return N(r=="{"?H:_)}function ir(r){return function(t){if(t==".")return E(r?nr:er);else if(t=="variable"&&a)return E(xr,r?X:Y);else return N(r?_:$)}}function er(r,t){if(t=="target"){S.marked="keyword";return E(Y)}}function nr(r,t){if(t=="target"){S.marked="keyword";return E(X)}}function or(r){if(r==":")return E(P,H);return N(Y,G(";"),P)}function ur(r){if(r=="variable"){S.marked="property";return E()}}function fr(r,t){if(r=="async"){S.marked="property";return E(fr)}else if(r=="variable"||S.style=="keyword"){S.marked="property";if(t=="get"||t=="set")return E(ar);var i;if(a&&S.state.fatArrowAt==S.stream.start&&(i=S.stream.match(/^\s*:\s*/,false)))S.state.fatArrowAt=S.stream.pos+i[0].length;return E(lr)}else if(r=="number"||r=="string"){S.marked=o?"property":S.style+" property";return E(lr)}else if(r=="jsonld-keyword"){return E(lr)}else if(a&&O(t)){S.marked="keyword";return E(fr)}else if(r=="["){return E($,hr,G("]"),lr)}else if(r=="spread"){return E(_,lr)}else if(t=="*"){S.marked="keyword";return E(fr)}else if(r==":"){return N(lr)}}function ar(r){if(r!="variable")return N(lr);S.marked="property";return E(jr)}function lr(r){if(r==":")return E(_);if(r=="(")return N(jr)}function sr(r,t,i){function e(n,o){if(i?i.indexOf(n)>-1:n==","){var u=S.state.lexical;if(u.info=="call")u.pos=(u.pos||0)+1;return E((function(i,e){if(i==t||e==t)return N();return N(r)}),e)}if(n==t||o==t)return E();if(i&&i.indexOf(";")>-1)return N(r);return E(G(t))}return function(i,n){if(i==t||n==t)return E();return N(r,e)}}function cr(r,t,i){for(var e=3;e<arguments.length;e++)S.cc.push(arguments[e]);return E(F(t,i),sr(r,t),P)}function vr(r){if(r=="}")return E();return N(H,vr)}function hr(r,t){if(a){if(r==":")return E(gr);if(t=="?")return E(hr)}}function dr(r,t){if(a&&(r==":"||t=="in"))return E(gr)}function mr(r){if(a&&r==":"){if(S.stream.match(/^\s*\w+\s+is\b/,false))return E($,pr,gr);else return E(gr)}}function pr(r,t){if(t=="is"){S.marked="keyword";return E()}}function gr(r,t){if(t=="keyof"||t=="typeof"||t=="infer"||t=="readonly"){S.marked="keyword";return E(t=="typeof"?_:gr)}if(r=="variable"||t=="void"){S.marked="type";return E(yr)}if(t=="|"||t=="&")return E(gr);if(r=="string"||r=="number"||r=="atom")return E(yr);if(r=="[")return E(F("]"),sr(gr,"]",","),P,yr);if(r=="{")return E(F("}"),wr,P,yr);if(r=="(")return E(sr(Ar,")"),br,yr);if(r=="<")return E(sr(gr,">"),gr);if(r=="quasi"){return N(Cr,yr)}}function br(r){if(r=="=>")return E(gr)}function wr(r){if(r.match(/[\}\)\]]/))return E();if(r==","||r==";")return E(wr);return N(kr,wr)}function kr(r,t){if(r=="variable"||S.style=="keyword"){S.marked="property";return E(kr)}else if(t=="?"||r=="number"||r=="string"){return E(kr)}else if(r==":"){return E(gr)}else if(r=="["){return E(G("variable"),dr,G("]"),kr)}else if(r=="("){return N(Wr,kr)}else if(!r.match(/[;\}\)\],]/)){return E()}}function Cr(r,t){if(r!="quasi")return N();if(t.slice(t.length-2)!="${")return E(Cr);return E(gr,Mr)}function Mr(r){if(r=="}"){S.marked="string-2";S.state.tokenize=k;return E(Cr)}}function Ar(r,t){if(r=="variable"&&S.stream.match(/^\s*[?:]/,false)||t=="?")return E(Ar);if(r==":")return E(gr);if(r=="spread")return E(Ar);return N(gr)}function yr(r,t){if(t=="<")return E(F(">"),sr(gr,">"),P,yr);if(t=="|"||r=="."||t=="&")return E(gr);if(r=="[")return E(gr,G("]"),yr);if(t=="extends"||t=="implements"){S.marked="keyword";return E(gr)}if(t=="?")return E(gr,G(":"),gr)}function xr(r,t){if(t=="<")return E(F(">"),sr(gr,">"),P,yr)}function Lr(){return N(gr,Sr)}function Sr(r,t){if(t=="=")return E(gr)}function Nr(r,t){if(t=="enum"){S.marked="keyword";return E(tt)}return N(Er,hr,Ir,Or)}function Er(r,t){if(a&&O(t)){S.marked="keyword";return E(Er)}if(r=="variable"){T(t);return E()}if(r=="spread")return E(Er);if(r=="[")return cr(Tr,"]");if(r=="{")return cr(Dr,"}")}function Dr(r,t){if(r=="variable"&&!S.stream.match(/^\s*:/,false)){T(t);return E(Ir)}if(r=="variable")S.marked="property";if(r=="spread")return E(Er);if(r=="}")return N();if(r=="[")return E($,G("]"),G(":"),Dr);return E(G(":"),Er,Ir)}function Tr(){return N(Er,Ir)}function Ir(r,t){if(t=="=")return E(_)}function Or(r){if(r==",")return E(Nr)}function Rr(r,t){if(r=="keyword b"&&t=="else")return E(F("form","else"),H,P)}function Br(r,t){if(t=="await")return E(Br);if(r=="(")return E(F(")"),Ur,P)}function Ur(r){if(r=="var")return E(Nr,zr);if(r=="variable")return E(zr);return N(zr)}function zr(r,t){if(r==")")return E();if(r==";")return E(zr);if(t=="in"||t=="of"){S.marked="keyword";return E($,zr)}return N($,zr)}function jr(r,t){if(t=="*"){S.marked="keyword";return E(jr)}if(r=="variable"){T(t);return E(jr)}if(r=="(")return E(z,F(")"),sr(Pr,")"),P,mr,H,W);if(a&&t=="<")return E(F(">"),sr(Lr,">"),P,jr)}function Wr(r,t){if(t=="*"){S.marked="keyword";return E(Wr)}if(r=="variable"){T(t);return E(Wr)}if(r=="(")return E(z,F(")"),sr(Pr,")"),P,mr,W);if(a&&t=="<")return E(F(">"),sr(Lr,">"),P,Wr)}function Fr(r,t){if(r=="keyword"||r=="variable"){S.marked="type";return E(Fr)}else if(t=="<"){return E(F(">"),sr(Lr,">"),P)}}function Pr(r,t){if(t=="@")E($,Pr);if(r=="spread")return E(Pr);if(a&&O(t)){S.marked="keyword";return E(Pr)}if(a&&r=="this")return E(hr,Ir);return N(Er,hr,Ir)}function Gr(r,t){if(r=="variable")return Hr(r,t);return Vr(r,t)}function Hr(r,t){if(r=="variable"){T(t);return E(Vr)}}function Vr(r,t){if(t=="<")return E(F(">"),sr(Lr,">"),P,Vr);if(t=="extends"||t=="implements"||a&&r==","){if(t=="implements")S.marked="keyword";return E(a?gr:$,Vr)}if(r=="{")return E(F("}"),$r,P)}function $r(r,t){if(r=="async"||r=="variable"&&(t=="static"||t=="get"||t=="set"||a&&O(t))&&S.stream.match(/^\s+[\w$\xa1-\uffff]/,false)){S.marked="keyword";return E($r)}if(r=="variable"||S.style=="keyword"){S.marked="property";return E(_r,$r)}if(r=="number"||r=="string")return E(_r,$r);if(r=="[")return E($,hr,G("]"),_r,$r);if(t=="*"){S.marked="keyword";return E($r)}if(a&&r=="(")return N(Wr,$r);if(r==";"||r==",")return E($r);if(r=="}")return E();if(t=="@")return E($,$r)}function _r(r,t){if(t=="!")return E(_r);if(t=="?")return E(_r);if(r==":")return E(gr,Ir);if(t=="=")return E(_);var i=S.state.lexical.prev,e=i&&i.info=="interface";return N(e?Wr:jr)}function Qr(r,t){if(t=="*"){S.marked="keyword";return E(Zr,G(";"))}if(t=="default"){S.marked="keyword";return E($,G(";"))}if(r=="{")return E(sr(Jr,"}"),Zr,G(";"));return N(H)}function Jr(r,t){if(t=="as"){S.marked="keyword";return E(G("variable"))}if(r=="variable")return N(_,Jr)}function Kr(r){if(r=="string")return E();if(r=="(")return N($);if(r==".")return N(Y);return N(Yr,Xr,Zr)}function Yr(r,t){if(r=="{")return cr(Yr,"}");if(r=="variable")T(t);if(t=="*")S.marked="keyword";return E(qr)}function Xr(r){if(r==",")return E(Yr,Xr)}function qr(r,t){if(t=="as"){S.marked="keyword";return E(Yr)}}function Zr(r,t){if(t=="from"){S.marked="keyword";return E($)}}function rt(r){if(r=="]")return E();return N(sr(_,"]"))}function tt(){return N(F("form"),Er,G("{"),F("}"),sr(it,"}"),P,P)}function it(){return N(Er,Ir)}function et(r,t){return r.lastType=="operator"||r.lastType==","||c.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function nt(r,t,i){return t.tokenize==g&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||t.lastType=="quasi"&&/\{\s*$/.test(r.string.slice(0,r.pos-(i||0)))}return{startState:function(r){var t={tokenize:g,lastType:"sof",cc:[],lexical:new y((r||0)-e,0,"block",false),localVars:i.localVars,context:i.localVars&&new R(null,null,false),indented:r||0};if(i.globalVars&&typeof i.globalVars=="object")t.globalVars=i.globalVars;return t},token:function(r,t){if(r.sol()){if(!t.lexical.hasOwnProperty("align"))t.lexical.align=false;t.indented=r.indentation();M(r,t)}if(t.tokenize!=w&&r.eatSpace())return null;var i=t.tokenize(r,t);if(d=="comment")return i;t.lastType=d=="operator"&&(m=="++"||m=="--")?"incdec":d;return L(t,i,d,m,r)},indent:function(t,o){if(t.tokenize==w||t.tokenize==k)return r.Pass;if(t.tokenize!=g)return 0;var u=o&&o.charAt(0),f=t.lexical,a;if(!/^\s*else\b/.test(o))for(var l=t.cc.length-1;l>=0;--l){var s=t.cc[l];if(s==P)f=f.prev;else if(s!=Rr&&s!=W)break}while((f.type=="stat"||f.type=="form")&&(u=="}"||(a=t.cc[t.cc.length-1])&&(a==Y||a==X)&&!/^[,\.=+\-*:?[\(]/.test(o)))f=f.prev;if(n&&f.type==")"&&f.prev.type=="stat")f=f.prev;var c=f.type,v=u==c;if(c=="vardef")return f.indented+(t.lastType=="operator"||t.lastType==","?f.info.length+1:0);else if(c=="form"&&u=="{")return f.indented;else if(c=="form")return f.indented+e;else if(c=="stat")return f.indented+(et(t,o)?n||e:0);else if(f.info=="switch"&&!v&&i.doubleIndentSwitch!=false)return f.indented+(/^(?:case|default)\b/.test(o)?e:2*e);else if(f.align)return f.column+(v?0:1);else return f.indented+(v?0:e)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:u?null:"/*",blockCommentEnd:u?null:"*/",blockCommentContinue:u?null:" * ",lineComment:u?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:u?"json":"javascript",jsonldMode:o,jsonMode:u,expressionAllowed:nt,skipExpression:function(t){L(t,"atom","atom","true",new r.StringStream("",2,null))}}}));r.registerHelper("wordChars","javascript",/[\w$]/);r.defineMIME("text/javascript","javascript");r.defineMIME("text/ecmascript","javascript");r.defineMIME("application/javascript","javascript");r.defineMIME("application/x-javascript","javascript");r.defineMIME("application/ecmascript","javascript");r.defineMIME("application/json",{name:"javascript",json:true});r.defineMIME("application/x-json",{name:"javascript",json:true});r.defineMIME("application/manifest+json",{name:"javascript",json:true});r.defineMIME("application/ld+json",{name:"javascript",jsonld:true});r.defineMIME("text/typescript",{name:"javascript",typescript:true});r.defineMIME("application/typescript",{name:"javascript",typescript:true})}))}));n((function(r,t){(function(r){r(u)})((function(r){var t="CodeMirror-activeline";var i="CodeMirror-activeline-background";var e="CodeMirror-activeline-gutter";r.defineOption("styleActiveLine",false,(function(t,i,e){var o=e==r.Init?false:e;if(i==o)return;if(o){t.off("beforeSelectionChange",f);n(t);delete t.state.activeLines}if(i){t.state.activeLines=[];u(t,t.listSelections());t.on("beforeSelectionChange",f)}}));function n(r){for(var n=0;n<r.state.activeLines.length;n++){r.removeLineClass(r.state.activeLines[n],"wrap",t);r.removeLineClass(r.state.activeLines[n],"background",i);r.removeLineClass(r.state.activeLines[n],"gutter",e)}}function o(r,t){if(r.length!=t.length)return false;for(var i=0;i<r.length;i++)if(r[i]!=t[i])return false;return true}function u(r,u){var f=[];for(var a=0;a<u.length;a++){var l=u[a];var s=r.getOption("styleActiveLine");if(typeof s=="object"&&s.nonEmpty?l.anchor.line!=l.head.line:!l.empty())continue;var c=r.getLineHandleVisualStart(l.head.line);if(f[f.length-1]!=c)f.push(c)}if(o(r.state.activeLines,f))return;r.operation((function(){n(r);for(var o=0;o<f.length;o++){r.addLineClass(f[o],"wrap",t);r.addLineClass(f[o],"background",i);r.addLineClass(f[o],"gutter",e)}r.state.activeLines=f}))}function f(r,t){u(r,t.ranges)}}))}));n((function(r,t){(function(r){r(u)})((function(r){var t=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8);var i=r.Pos;var e={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function n(r){return r&&r.bracketRegex||/[(){}[\]]/}function o(r,t,o){var f=r.getLineHandle(t.line),a=t.ch-1;var l=o&&o.afterCursor;if(l==null)l=/(^| )cm-fat-cursor($| )/.test(r.getWrapperElement().className);var s=n(o);var c=!l&&a>=0&&s.test(f.text.charAt(a))&&e[f.text.charAt(a)]||s.test(f.text.charAt(a+1))&&e[f.text.charAt(++a)];if(!c)return null;var v=c.charAt(1)==">"?1:-1;if(o&&o.strict&&v>0!=(a==t.ch))return null;var h=r.getTokenTypeAt(i(t.line,a+1));var d=u(r,i(t.line,a+(v>0?1:0)),v,h,o);if(d==null)return null;return{from:i(t.line,a),to:d&&d.pos,match:d&&d.ch==c.charAt(0),forward:v>0}}function u(r,t,o,u,f){var a=f&&f.maxScanLineLength||1e4;var l=f&&f.maxScanLines||1e3;var s=[];var c=n(f);var v=o>0?Math.min(t.line+l,r.lastLine()+1):Math.max(r.firstLine()-1,t.line-l);for(var h=t.line;h!=v;h+=o){var d=r.getLine(h);if(!d)continue;var m=o>0?0:d.length-1,p=o>0?d.length:-1;if(d.length>a)continue;if(h==t.line)m=t.ch-(o<0?1:0);for(;m!=p;m+=o){var g=d.charAt(m);if(c.test(g)&&(u===undefined||(r.getTokenTypeAt(i(h,m+1))||"")==(u||""))){var b=e[g];if(b&&b.charAt(1)==">"==o>0)s.push(g);else if(!s.length)return{pos:i(h,m),ch:g};else s.pop()}}}return h-o==(o>0?r.lastLine():r.firstLine())?false:null}function f(r,e,n){var u=r.state.matchBrackets.maxHighlightLineLength||1e3,f=n&&n.highlightNonMatching;var a=[],l=r.listSelections();for(var s=0;s<l.length;s++){var c=l[s].empty()&&o(r,l[s].head,n);if(c&&(c.match||f!==false)&&r.getLine(c.from.line).length<=u){var v=c.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";a.push(r.markText(c.from,i(c.from.line,c.from.ch+1),{className:v}));if(c.to&&r.getLine(c.to.line).length<=u)a.push(r.markText(c.to,i(c.to.line,c.to.ch+1),{className:v}))}}if(a.length){if(t&&r.state.focused)r.focus();var h=function(){r.operation((function(){for(var r=0;r<a.length;r++)a[r].clear()}))};if(e)setTimeout(h,800);else return h}}function a(r){r.operation((function(){if(r.state.matchBrackets.currentlyHighlighted){r.state.matchBrackets.currentlyHighlighted();r.state.matchBrackets.currentlyHighlighted=null}r.state.matchBrackets.currentlyHighlighted=f(r,false,r.state.matchBrackets)}))}function l(r){if(r.state.matchBrackets&&r.state.matchBrackets.currentlyHighlighted){r.state.matchBrackets.currentlyHighlighted();r.state.matchBrackets.currentlyHighlighted=null}}r.defineOption("matchBrackets",false,(function(t,i,e){if(e&&e!=r.Init){t.off("cursorActivity",a);t.off("focus",a);t.off("blur",l);l(t)}if(i){t.state.matchBrackets=typeof i=="object"?i:{};t.on("cursorActivity",a);t.on("focus",a);t.on("blur",l)}}));r.defineExtension("matchBrackets",(function(){f(this,true)}));r.defineExtension("findMatchingBracket",(function(r,t,i){if(i||typeof t=="boolean"){if(!i){t=t?{strict:true}:null}else{i.strict=t;t=i}}return o(this,r,t)}));r.defineExtension("scanForBracket",(function(r,t,i,e){return u(this,r,t,i,e)}))}))}));n((function(r,t){(function(r){r(u)})((function(r){var t="CodeMirror-lint-markers";var i="CodeMirror-lint-line-";function e(t,i,e){var n=document.createElement("div");n.className="CodeMirror-lint-tooltip cm-s-"+t.options.theme;n.appendChild(e.cloneNode(true));if(t.state.lint.options.selfContain)t.getWrapperElement().appendChild(n);else document.body.appendChild(n);function o(t){if(!n.parentNode)return r.off(document,"mousemove",o);n.style.top=Math.max(0,t.clientY-n.offsetHeight-5)+"px";n.style.left=t.clientX+5+"px"}r.on(document,"mousemove",o);o(i);if(n.style.opacity!=null)n.style.opacity=1;return n}function n(r){if(r.parentNode)r.parentNode.removeChild(r)}function o(r){if(!r.parentNode)return;if(r.style.opacity==null)n(r);r.style.opacity=0;setTimeout((function(){n(r)}),600)}function u(t,i,n,u){var f=e(t,i,n);function a(){r.off(u,"mouseout",a);if(f){o(f);f=null}}var l=setInterval((function(){if(f)for(var r=u;;r=r.parentNode){if(r&&r.nodeType==11)r=r.host;if(r==document.body)return;if(!r){a();break}}if(!f)return clearInterval(l)}),400);r.on(u,"mouseout",a)}function f(r,t,i){this.marked=[];if(t instanceof Function)t={getAnnotations:t};if(!t||t===true)t={};this.options={};this.linterOptions=t.options||{};for(var e in a)this.options[e]=a[e];for(var e in t){if(a.hasOwnProperty(e)){if(t[e]!=null)this.options[e]=t[e]}else if(!t.options){this.linterOptions[e]=t[e]}}this.timeout=null;this.hasGutter=i;this.onMouseOver=function(t){k(r,t)};this.waitingFor=0}var a={highlightLines:false,tooltips:true,delay:500,lintOnChange:true,getAnnotations:null,async:false,selfContain:null,formatAnnotation:null,onUpdateLinting:null};function l(r){var i=r.state.lint;if(i.hasGutter)r.clearGutter(t);if(i.options.highlightLines)s(r);for(var e=0;e<i.marked.length;++e)i.marked[e].clear();i.marked.length=0}function s(r){r.eachLine((function(t){var i=t.wrapClass&&/\bCodeMirror-lint-line-\w+\b/.exec(t.wrapClass);if(i)r.removeLineClass(t,"wrap",i[0])}))}function c(t,i,e,n,o){var f=document.createElement("div"),a=f;f.className="CodeMirror-lint-marker CodeMirror-lint-marker-"+e;if(n){a=f.appendChild(document.createElement("div"));a.className="CodeMirror-lint-marker CodeMirror-lint-marker-multiple"}if(o!=false)r.on(a,"mouseover",(function(r){u(t,r,i,a)}));return f}function v(r,t){if(r=="error")return r;else return t}function h(r){var t=[];for(var i=0;i<r.length;++i){var e=r[i],n=e.from.line;(t[n]||(t[n]=[])).push(e)}return t}function d(r){var t=r.severity;if(!t)t="error";var i=document.createElement("div");i.className="CodeMirror-lint-message CodeMirror-lint-message-"+t;if(typeof r.messageHTML!="undefined"){i.innerHTML=r.messageHTML}else{i.appendChild(document.createTextNode(r.message))}return i}function m(t,i){var e=t.state.lint;var n=++e.waitingFor;function o(){n=-1;t.off("change",o)}t.on("change",o);i(t.getValue(),(function(i,u){t.off("change",o);if(e.waitingFor!=n)return;if(u&&i instanceof r)i=u;t.operation((function(){g(t,i)}))}),e.linterOptions,t)}function p(t){var i=t.state.lint;if(!i)return;var e=i.options;var n=e.getAnnotations||t.getHelper(r.Pos(0,0),"lint");if(!n)return;if(e.async||n.async){m(t,n)}else{var o=n(t.getValue(),i.linterOptions,t);if(!o)return;if(o.then)o.then((function(r){t.operation((function(){g(t,r)}))}));else t.operation((function(){g(t,o)}))}}function g(r,e){var n=r.state.lint;if(!n)return;var o=n.options;l(r);var u=h(e);for(var f=0;f<u.length;++f){var a=u[f];if(!a)continue;var s=[];a=a.filter((function(r){return s.indexOf(r.message)>-1?false:s.push(r.message)}));var m=null;var p=n.hasGutter&&document.createDocumentFragment();for(var g=0;g<a.length;++g){var b=a[g];var w=b.severity;if(!w)w="error";m=v(m,w);if(o.formatAnnotation)b=o.formatAnnotation(b);if(n.hasGutter)p.appendChild(d(b));if(b.to)n.marked.push(r.markText(b.from,b.to,{className:"CodeMirror-lint-mark CodeMirror-lint-mark-"+w,__annotation:b}))}if(n.hasGutter)r.setGutterMarker(f,t,c(r,p,m,u[f].length>1,o.tooltips));if(o.highlightLines)r.addLineClass(f,"wrap",i+m)}if(o.onUpdateLinting)o.onUpdateLinting(e,u,r)}function b(r){var t=r.state.lint;if(!t)return;clearTimeout(t.timeout);t.timeout=setTimeout((function(){p(r)}),t.options.delay)}function w(r,t,i){var e=i.target||i.srcElement;var n=document.createDocumentFragment();for(var o=0;o<t.length;o++){var f=t[o];n.appendChild(d(f))}u(r,i,n,e)}function k(r,t){var i=t.target||t.srcElement;if(!/\bCodeMirror-lint-mark-/.test(i.className))return;var e=i.getBoundingClientRect(),n=(e.left+e.right)/2,o=(e.top+e.bottom)/2;var u=r.findMarksAt(r.coordsChar({left:n,top:o},"client"));var f=[];for(var a=0;a<u.length;++a){var l=u[a].__annotation;if(l)f.push(l)}if(f.length)w(r,f,t)}r.defineOption("lint",false,(function(i,e,n){if(n&&n!=r.Init){l(i);if(i.state.lint.options.lintOnChange!==false)i.off("change",b);r.off(i.getWrapperElement(),"mouseover",i.state.lint.onMouseOver);clearTimeout(i.state.lint.timeout);delete i.state.lint}if(e){var o=i.getOption("gutters"),u=false;for(var a=0;a<o.length;++a)if(o[a]==t)u=true;var s=i.state.lint=new f(i,e,u);if(s.options.lintOnChange)i.on("change",b);if(s.options.tooltips!=false&&s.options.tooltips!="gutter")r.on(i.getWrapperElement(),"mouseover",s.onMouseOver);p(i)}}));r.defineExtension("performLint",(function(){p(this)}))}))}));n((function(r,t){(function(r){r(u)})((function(r){r.registerHelper("lint","json",(function(t){var i=[];if(!window.jsonlint){if(window.console){window.console.error("Error: window.jsonlint not defined, CodeMirror JSON linting cannot run.")}return i}var e=window.jsonlint.parser||window.jsonlint;e.parseError=function(t,e){var n=e.loc;i.push({from:r.Pos(n.first_line-1,n.first_column),to:r.Pos(n.last_line-1,n.last_column),message:t})};try{e.parse(t)}catch(r){}return i}))}))}));var f=n((function(r,t){(function(r){r(u)})((function(r){function t(t,e,o,u){if(o&&o.call){var f=o;o=null}else{var f=n(t,o,"rangeFinder")}if(typeof e=="number")e=r.Pos(e,0);var a=n(t,o,"minFoldSize");function l(r){var i=f(t,e);if(!i||i.to.line-i.from.line<a)return null;if(u==="fold")return i;var n=t.findMarksAt(i.from);for(var o=0;o<n.length;++o){if(n[o].__isFold){if(!r)return null;i.cleared=true;n[o].clear()}}return i}var s=l(true);if(n(t,o,"scanUp"))while(!s&&e.line>t.firstLine()){e=r.Pos(e.line-1,0);s=l(false)}if(!s||s.cleared||u==="unfold")return;var c=i(t,o,s);r.on(c,"mousedown",(function(t){v.clear();r.e_preventDefault(t)}));var v=t.markText(s.from,s.to,{replacedWith:c,clearOnEnter:n(t,o,"clearOnEnter"),__isFold:true});v.on("clear",(function(i,e){r.signal(t,"unfold",t,i,e)}));r.signal(t,"fold",t,s.from,s.to)}function i(r,t,i){var e=n(r,t,"widget");if(typeof e=="function"){e=e(i.from,i.to)}if(typeof e=="string"){var o=document.createTextNode(e);e=document.createElement("span");e.appendChild(o);e.className="CodeMirror-foldmarker"}else if(e){e=e.cloneNode(true)}return e}r.newFoldFunction=function(r,i){return function(e,n){t(e,n,{rangeFinder:r,widget:i})}};r.defineExtension("foldCode",(function(r,i,e){t(this,r,i,e)}));r.defineExtension("isFolded",(function(r){var t=this.findMarksAt(r);for(var i=0;i<t.length;++i)if(t[i].__isFold)return true}));r.commands.toggleFold=function(r){r.foldCode(r.getCursor())};r.commands.fold=function(r){r.foldCode(r.getCursor(),null,"fold")};r.commands.unfold=function(r){r.foldCode(r.getCursor(),{scanUp:false},"unfold")};r.commands.foldAll=function(t){t.operation((function(){for(var i=t.firstLine(),e=t.lastLine();i<=e;i++)t.foldCode(r.Pos(i,0),{scanUp:false},"fold")}))};r.commands.unfoldAll=function(t){t.operation((function(){for(var i=t.firstLine(),e=t.lastLine();i<=e;i++)t.foldCode(r.Pos(i,0),{scanUp:false},"unfold")}))};r.registerHelper("fold","combine",(function(){var r=Array.prototype.slice.call(arguments,0);return function(t,i){for(var e=0;e<r.length;++e){var n=r[e](t,i);if(n)return n}}}));r.registerHelper("fold","auto",(function(r,t){var i=r.getHelpers(t,"fold");for(var e=0;e<i.length;e++){var n=i[e](r,t);if(n)return n}}));var e={rangeFinder:r.fold.auto,widget:"↔",minFoldSize:0,scanUp:false,clearOnEnter:true};r.defineOption("foldOptions",null);function n(r,t,i){if(t&&t[i]!==undefined)return t[i];var n=r.options.foldOptions;if(n&&n[i]!==undefined)return n[i];return e[i]}r.defineExtension("foldOption",(function(r,t){return n(this,r,t)}))}))}));n((function(r,t){(function(r){r(u,f)})((function(r){r.defineOption("foldGutter",false,(function(t,n,o){if(o&&o!=r.Init){t.clearGutter(t.state.foldGutter.options.gutter);t.state.foldGutter=null;t.off("gutterClick",l);t.off("changes",c);t.off("viewportChange",v);t.off("fold",h);t.off("unfold",h);t.off("swapDoc",c);t.off("optionChange",s)}if(n){t.state.foldGutter=new i(e(n));a(t);t.on("gutterClick",l);t.on("changes",c);t.on("viewportChange",v);t.on("fold",h);t.on("unfold",h);t.on("swapDoc",c);t.on("optionChange",s)}}));var t=r.Pos;function i(r){this.options=r;this.from=this.to=0}function e(r){if(r===true)r={};if(r.gutter==null)r.gutter="CodeMirror-foldgutter";if(r.indicatorOpen==null)r.indicatorOpen="CodeMirror-foldgutter-open";if(r.indicatorFolded==null)r.indicatorFolded="CodeMirror-foldgutter-folded";return r}function n(r,i){var e=r.findMarks(t(i,0),t(i+1,0));for(var n=0;n<e.length;++n){if(e[n].__isFold){var o=e[n].find(-1);if(o&&o.line===i)return e[n]}}}function o(r){if(typeof r=="string"){var t=document.createElement("div");t.className=r+" CodeMirror-guttermarker-subtle";return t}else{return r.cloneNode(true)}}function u(r,i,e){var u=r.state.foldGutter.options,a=i-1;var l=r.foldOption(u,"minFoldSize");var s=r.foldOption(u,"rangeFinder");var c=typeof u.indicatorFolded=="string"&&f(u.indicatorFolded);var v=typeof u.indicatorOpen=="string"&&f(u.indicatorOpen);r.eachLine(i,e,(function(i){++a;var e=null;var f=i.gutterMarkers;if(f)f=f[u.gutter];if(n(r,a)){if(c&&f&&c.test(f.className))return;e=o(u.indicatorFolded)}else{var h=t(a,0);var d=s&&s(r,h);if(d&&d.to.line-d.from.line>=l){if(v&&f&&v.test(f.className))return;e=o(u.indicatorOpen)}}if(!e&&!f)return;r.setGutterMarker(i,u.gutter,e)}))}function f(r){return new RegExp("(^|\\s)"+r+"(?:$|\\s)\\s*")}function a(r){var t=r.getViewport(),i=r.state.foldGutter;if(!i)return;r.operation((function(){u(r,t.from,t.to)}));i.from=t.from;i.to=t.to}function l(r,i,e){var o=r.state.foldGutter;if(!o)return;var u=o.options;if(e!=u.gutter)return;var f=n(r,i);if(f)f.clear();else r.foldCode(t(i,0),u)}function s(r,t){if(t=="mode")c(r)}function c(r){var t=r.state.foldGutter;if(!t)return;var i=t.options;t.from=t.to=0;clearTimeout(t.changeUpdate);t.changeUpdate=setTimeout((function(){a(r)}),i.foldOnChangeTimeSpan||600)}function v(r){var t=r.state.foldGutter;if(!t)return;var i=t.options;clearTimeout(t.changeUpdate);t.changeUpdate=setTimeout((function(){var i=r.getViewport();if(t.from==t.to||i.from-t.to>20||t.from-i.to>20){a(r)}else{r.operation((function(){if(i.from<t.from){u(r,i.from,t.from);t.from=i.from}if(i.to>t.to){u(r,t.to,i.to);t.to=i.to}}))}}),i.updateViewportTimeSpan||400)}function h(r,t){var i=r.state.foldGutter;if(!i)return;var e=t.line;if(e>=i.from&&e<i.to)u(r,e,e+1)}}))}));n((function(r,t){(function(r){r(u)})((function(r){function t(t){return function(i,e){var n=e.line,o=i.getLine(n);function u(t){var u;for(var f=e.ch,a=0;;){var l=f<=0?-1:o.lastIndexOf(t[0],f-1);if(l==-1){if(a==1)break;a=1;f=o.length;continue}if(a==1&&l<e.ch)break;u=i.getTokenTypeAt(r.Pos(n,l+1));if(!/^(comment|string)/.test(u))return{ch:l+1,tokenType:u,pair:t};f=l-1}}function f(t){var e=1,o=i.lastLine(),u,f=t.ch,a;r:for(var l=n;l<=o;++l){var s=i.getLine(l),c=l==n?f:0;for(;;){var v=s.indexOf(t.pair[0],c),h=s.indexOf(t.pair[1],c);if(v<0)v=s.length;if(h<0)h=s.length;c=Math.min(v,h);if(c==s.length)break;if(i.getTokenTypeAt(r.Pos(l,c+1))==t.tokenType){if(c==v)++e;else if(!--e){u=l;a=c;break r}}++c}}if(u==null||n==u)return null;return{from:r.Pos(n,f),to:r.Pos(u,a)}}var a=[];for(var l=0;l<t.length;l++){var s=u(t[l]);if(s)a.push(s)}a.sort((function(r,t){return r.ch-t.ch}));for(var l=0;l<a.length;l++){var c=f(a[l]);if(c)return c}return null}}r.registerHelper("fold","brace",t([["{","}"],["[","]"]]));r.registerHelper("fold","brace-paren",t([["{","}"],["[","]"],["(",")"]]));r.registerHelper("fold","import",(function(t,i){function e(i){if(i<t.firstLine()||i>t.lastLine())return null;var e=t.getTokenAt(r.Pos(i,1));if(!/\S/.test(e.string))e=t.getTokenAt(r.Pos(i,e.end+1));if(e.type!="keyword"||e.string!="import")return null;for(var n=i,o=Math.min(t.lastLine(),i+10);n<=o;++n){var u=t.getLine(n),f=u.indexOf(";");if(f!=-1)return{startCh:e.end,end:r.Pos(n,f)}}}var n=i.line,o=e(n),u;if(!o||e(n-1)||(u=e(n-2))&&u.end.line==n-1)return null;for(var f=o.end;;){var a=e(f.line+1);if(a==null)break;f=a.end}return{from:t.clipPos(r.Pos(n,o.startCh+1)),to:f}}));r.registerHelper("fold","include",(function(t,i){function e(i){if(i<t.firstLine()||i>t.lastLine())return null;var e=t.getTokenAt(r.Pos(i,1));if(!/\S/.test(e.string))e=t.getTokenAt(r.Pos(i,e.end+1));if(e.type=="meta"&&e.string.slice(0,8)=="#include")return e.start+8}var n=i.line,o=e(n);if(o==null||e(n-1)!=null)return null;for(var u=n;;){var f=e(u+1);if(f==null)break;++u}return{from:r.Pos(n,o+1),to:t.clipPos(r.Pos(u))}}))}))}));var a=n((function(r){var t=function(){var r=true,t=false;var i={};var e=function(){var r;var t;var i={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};var e;var n=function(t){throw{name:"SyntaxError",message:t,at:r,text:e}};var o=function(i){if(i&&i!==t){n("Expected '"+i+"' instead of '"+t+"'")}t=e.charAt(r);r+=1;return t};var u=function(){var r;var i="";if(t==="-"){i="-";o("-")}while(t>="0"&&t<="9"){i+=t;o()}if(t==="."){i+=".";while(o()&&t>="0"&&t<="9"){i+=t}}if(t==="e"||t==="E"){i+=t;o();if(t==="-"||t==="+"){i+=t;o()}while(t>="0"&&t<="9"){i+=t;o()}}r=+i;if(!isFinite(r)){n("Bad number")}else{return r}};var f=function(){var r;var e;var u="";var f;if(t==='"'){while(o()){if(t==='"'){o();return u}if(t==="\\"){o();if(t==="u"){f=0;for(e=0;e<4;e+=1){r=parseInt(o(),16);if(!isFinite(r)){break}f=f*16+r}u+=String.fromCharCode(f)}else if(typeof i[t]==="string"){u+=i[t]}else{break}}else{u+=t}}}n("Bad string")};var a=function(){while(t&&t<=" "){o()}};var l=function(){switch(t){case"t":o("t");o("r");o("u");o("e");return true;case"f":o("f");o("a");o("l");o("s");o("e");return false;case"n":o("n");o("u");o("l");o("l");return null}n("Unexpected '"+t+"'")};var s;var c=function(){var r=[];if(t==="["){o("[");a();if(t==="]"){o("]");return r}while(t){r.push(s());a();if(t==="]"){o("]");return r}o(",");a()}}n("Bad array")};var v=function(){var r;var i={};if(t==="{"){o("{");a();if(t==="}"){o("}");return i}while(t){r=f();a();o(":");if(Object.hasOwnProperty.call(i,r)){n("Duplicate key '"+r+"'")}i[r]=s();a();if(t==="}"){o("}");return i}o(",");a()}}n("Bad object")};s=function(){a();switch(t){case"{":return v();case"[":return c();case'"':return f();case"-":return u();default:return t>="0"&&t<="9"?u():l()}};return function(i,o){var u;e=i;r=0;t=" ";u=s();a();if(t){n("Syntax error")}return typeof o==="function"?function r(t,i){var e;var n;var u=t[i];if(u&&typeof u==="object"){for(e in u){if(Object.prototype.hasOwnProperty.call(u,e)){n=r(u,e);if(n!==undefined){u[e]=n}else{delete u[e]}}}}return o.call(t,i,u)}({"":u},""):u}}();var n=function(){var r={trace:function r(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function r(t,i,e,n,o,u,f){var a=u.length-1;switch(o){case 1:this.$=t.replace(/\\(\\|")/g,"$"+"1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b");break;case 2:this.$=Number(t);break;case 3:this.$=null;break;case 4:this.$=true;break;case 5:this.$=false;break;case 6:return this.$=u[a-1];case 13:this.$={};break;case 14:this.$=u[a-1];break;case 15:this.$=[u[a-2],u[a]];break;case 16:this.$={};this.$[u[a][0]]=u[a][1];break;case 17:this.$=u[a-2];u[a-2][u[a][0]]=u[a][1];break;case 18:this.$=[];break;case 19:this.$=u[a-1];break;case 20:this.$=[u[a]];break;case 21:this.$=u[a-2];u[a-2].push(u[a]);break}},table:[{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],12:1,13:2,15:7,16:8,17:[1,14],23:[1,15]},{1:[3]},{14:[1,16]},{14:[2,7],18:[2,7],22:[2,7],24:[2,7]},{14:[2,8],18:[2,8],22:[2,8],24:[2,8]},{14:[2,9],18:[2,9],22:[2,9],24:[2,9]},{14:[2,10],18:[2,10],22:[2,10],24:[2,10]},{14:[2,11],18:[2,11],22:[2,11],24:[2,11]},{14:[2,12],18:[2,12],22:[2,12],24:[2,12]},{14:[2,3],18:[2,3],22:[2,3],24:[2,3]},{14:[2,4],18:[2,4],22:[2,4],24:[2,4]},{14:[2,5],18:[2,5],22:[2,5],24:[2,5]},{14:[2,1],18:[2,1],21:[2,1],22:[2,1],24:[2,1]},{14:[2,2],18:[2,2],22:[2,2],24:[2,2]},{3:20,4:[1,12],18:[1,17],19:18,20:19},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:23,15:7,16:8,17:[1,14],23:[1,15],24:[1,21],25:22},{1:[2,6]},{14:[2,13],18:[2,13],22:[2,13],24:[2,13]},{18:[1,24],22:[1,25]},{18:[2,16],22:[2,16]},{21:[1,26]},{14:[2,18],18:[2,18],22:[2,18],24:[2,18]},{22:[1,28],24:[1,27]},{22:[2,20],24:[2,20]},{14:[2,14],18:[2,14],22:[2,14],24:[2,14]},{3:20,4:[1,12],20:29},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:30,15:7,16:8,17:[1,14],23:[1,15]},{14:[2,19],18:[2,19],22:[2,19],24:[2,19]},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:31,15:7,16:8,17:[1,14],23:[1,15]},{18:[2,17],22:[2,17]},{18:[2,15],22:[2,15]},{22:[2,21],24:[2,21]}],defaultActions:{16:[2,6]},parseError:function r(t,i){throw new Error(t)},parse:function r(t){var i=this,e=[0],n=[null],o=[],u=this.table,f="",a=0,l=0,s=0,c=2,v=1;this.lexer.setInput(t);this.lexer.yy=this.yy;this.yy.lexer=this.lexer;if(typeof this.lexer.yylloc=="undefined")this.lexer.yylloc={};var h=this.lexer.yylloc;o.push(h);if(typeof this.yy.parseError==="function")this.parseError=this.yy.parseError;function d(r){e.length=e.length-2*r;n.length=n.length-r;o.length=o.length-r}function m(){var r;r=i.lexer.lex()||1;if(typeof r!=="number"){r=i.symbols_[r]||r}return r}var p,g,b,w,k,C={},M,A,y,x;while(true){b=e[e.length-1];if(this.defaultActions[b]){w=this.defaultActions[b]}else{if(p==null)p=m();w=u[b]&&u[b][p]}if(typeof w==="undefined"||!w.length||!w[0]){if(!s){x=[];for(M in u[b])if(this.terminals_[M]&&M>2){x.push("'"+this.terminals_[M]+"'")}var L="";if(this.lexer.showPosition){L="Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+x.join(", ")+", got '"+this.terminals_[p]+"'"}else{L="Parse error on line "+(a+1)+": Unexpected "+(p==1?"end of input":"'"+(this.terminals_[p]||p)+"'")}this.parseError(L,{text:this.lexer.match,token:this.terminals_[p]||p,line:this.lexer.yylineno,loc:h,expected:x})}if(s==3){if(p==v){throw new Error(L||"Parsing halted.")}l=this.lexer.yyleng;f=this.lexer.yytext;a=this.lexer.yylineno;h=this.lexer.yylloc;p=m()}while(1){if(c.toString()in u[b]){break}if(b==0){throw new Error(L||"Parsing halted.")}d(1);b=e[e.length-1]}g=p;p=c;b=e[e.length-1];w=u[b]&&u[b][c];s=3}if(w[0]instanceof Array&&w.length>1){throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+p)}switch(w[0]){case 1:e.push(p);n.push(this.lexer.yytext);o.push(this.lexer.yylloc);e.push(w[1]);p=null;if(!g){l=this.lexer.yyleng;f=this.lexer.yytext;a=this.lexer.yylineno;h=this.lexer.yylloc;if(s>0)s--}else{p=g;g=null}break;case 2:A=this.productions_[w[1]][1];C.$=n[n.length-A];C._$={first_line:o[o.length-(A||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(A||1)].first_column,last_column:o[o.length-1].last_column};k=this.performAction.call(C,f,l,a,this.yy,w[1],n,o);if(typeof k!=="undefined"){return k}if(A){e=e.slice(0,-1*A*2);n=n.slice(0,-1*A);o=o.slice(0,-1*A)}e.push(this.productions_[w[1]][0]);n.push(C.$);o.push(C._$);y=u[e[e.length-2]][e[e.length-1]];e.push(y);break;case 3:return true}}return true}};var t=function(){var r={EOF:1,parseError:function r(t,i){if(this.yy.parseError){this.yy.parseError(t,i)}else{throw new Error(t)}},setInput:function(r){this._input=r;this._more=this._less=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};return this},input:function(){var r=this._input[0];this.yytext+=r;this.yyleng++;this.match+=r;this.matched+=r;var t=r.match(/\n/);if(t)this.yylineno++;this._input=this._input.slice(1);return r},unput:function(r){this._input=r+this._input;return this},more:function(){this._more=true;return this},less:function(r){this._input=this.match.slice(r)+this._input},pastInput:function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var r=this.match;if(r.length<20){r+=this._input.substr(0,20-r.length)}return(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var r=this.pastInput();var t=new Array(r.length+1).join("-");return r+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done){return this.EOF}if(!this._input)this.done=true;var r,t,i,e,n;if(!this._more){this.yytext="";this.match=""}var o=this._currentRules();for(var u=0;u<o.length;u++){i=this._input.match(this.rules[o[u]]);if(i&&(!t||i[0].length>t[0].length)){t=i;e=u;if(!this.options.flex)break}}if(t){n=t[0].match(/\n.*/g);if(n)this.yylineno+=n.length;this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-1:this.yylloc.last_column+t[0].length};this.yytext+=t[0];this.match+=t[0];this.yyleng=this.yytext.length;this._more=false;this._input=this._input.slice(t[0].length);this.matched+=t[0];r=this.performAction.call(this,this.yy,this,o[e],this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input)this.done=false;if(r)return r;else return}if(this._input===""){return this.EOF}else{this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},lex:function r(){var t=this.next();if(typeof t!=="undefined"){return t}else{return this.lex()}},begin:function r(t){this.conditionStack.push(t)},popState:function r(){return this.conditionStack.pop()},_currentRules:function r(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function r(t){this.begin(t)}};r.options={};r.performAction=function r(t,i,e,n){switch(e){case 0:break;case 1:return 6;case 2:i.yytext=i.yytext.substr(1,i.yyleng-2);return 4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}};r.rules=[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/];r.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:true}};return r}();r.lexer=t;return r}();var o=n.parse;n.parse=function(t){var i=o.call(n,t);var u=typeof e==="undefined"?r("./doug-json-parse"):e;try{u(t)}catch(r){if(/Duplicate key|Bad string|Unexpected/.test(r.message)){var f=t.substring(0,r.at).split("\n");var a=f.length;var l=f[a-1].length-1;this.parseError(r.message,{line:a,col:l,message:r.message.replace(/./,(function(r){return r.toLowerCase()}))});throw SyntaxError(r.message+" on line "+a)}}return i};if(typeof i!=="undefined"){i.parser=n;i.parse=function(){return n.parse.apply(n,arguments)};i.main=function t(e){if(!e[1])throw new Error("Usage: "+e[0]+" FILE");if(typeof process!=="undefined"){var n=r("fs").readFileSync(r("path").join(process.cwd(),e[1]),"utf8")}else{var o=r("file").path(r("file").cwd());var n=o.join(e[1]).read({charset:"utf-8"})}return i.parser.parse(n)};if(r.main===t){i.main(typeof process!=="undefined"?process.argv.slice(1):r("system").args)}}return i}();if(r.exports)r.exports=t}));const l=".CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0;}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px;}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white;}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{0%{}50%{background-color:transparent}100%{}}@-webkit-keyframes blink{0%{}50%{background-color:transparent}100%{}}@keyframes blink{0%{}50%{background-color:transparent}100%{}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:#f00}.cm-invalidchar{color:#f00}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, .3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative;z-index:0}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px;}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:0.1px;}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, .4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:none}.CodeMirror-lint-markers{width:16px}.CodeMirror-lint-tooltip{background-color:#ffd;border:1px solid black;border-radius:4px 4px 4px 4px;color:black;font-family:monospace;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;white-space:pre;white-space:pre-wrap;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-lint-mark{background-position:left bottom;background-repeat:repeat-x}.CodeMirror-lint-mark-warning{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=\")}.CodeMirror-lint-mark-error{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==\")}.CodeMirror-lint-marker{background-position:center center;background-repeat:no-repeat;cursor:pointer;display:inline-block;height:16px;width:16px;vertical-align:middle;position:relative}.CodeMirror-lint-message{padding-left:18px;background-position:top left;background-repeat:no-repeat}.CodeMirror-lint-marker-warning,.CodeMirror-lint-message-warning{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=\")}.CodeMirror-lint-marker-error,.CodeMirror-lint-message-error{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=\")}.CodeMirror-lint-marker-multiple{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC\");background-repeat:no-repeat;background-position:right bottom;width:100%;height:100%}.CodeMirror-lint-line-error{background-color:rgba(183, 76, 81, 0.08)}.CodeMirror-lint-line-warning{background-color:rgba(255, 211, 0, 0.1)}.CodeMirror-foldmarker{color:blue;text-shadow:#b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{cursor:pointer}.CodeMirror-foldgutter-open:after{content:\"\\25BE\"}.CodeMirror-foldgutter-folded:after{content:\"\\25B8\"}:host{display:flex;font-size:var(--code-editor-font-size, 0.875rem);--code-editor-neutral-text-color:var(--contrast-1100);--code-editor-background-color:var(--contrast-200);--code-editor-gutter-background-color:var(--contrast-300);--code-editor-line-number-text-color:var(--contrast-700);--code-editor-cursor-color:var(--color-amber-dark);--code-editor-selection-highlight-color:var(--color-cyan-default);--code-editor-selection-lowlight-color:var(--contrast-600)}:host .cm-attribute,:host .cm-property,:host .cm-keyword{color:rgb(var(--color-violet-light))}:host .cm-operator{color:rgb(var(--color-sky-dark))}:host .cm-variable{color:rgb(var(--color-pink-light))}:host .cm-variable-2{color:rgb(var(--contrast-1100))}:host .cm-variable-3,:host .cm-type{color:rgb(var(--color-amber-darker))}:host .cm-builtin,:host .cm-meta{color:rgb(var(--color-amber-default))}:host .cm-atom{color:rgb(var(--color-coral-default))}:host .cm-tag,:host .cm-number{color:rgb(var(--color-magenta-default))}:host .cm-def{color:rgb(var(--color-sky-default))}:host .cm-string{color:rgb(var(--color-green-dark))}:host .cm-string-2{color:rgb(var(--color-pink-default))}:host .cm-qualifier{color:rgb(var(--color-grass-default))}:host .cm-error{color:rgb(var(--color-white));background-color:rgb(var(--color-red-default))}:host .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.7)}@media (prefers-color-scheme: dark){:root:not([data-theme=force-light]) :host{--code-editor-neutral-text-color:var(--contrast-1600);--code-editor-line-number-text-color:var(--contrast-800);--code-editor-cursor-color:var(--color-amber-default);--code-editor-selection-highlight-color:var(--color-cyan-light);--code-editor-selection-lowlight-color:var(--contrast-100)}:root:not([data-theme=force-light]) :host .cm-attribute,:root:not([data-theme=force-light]) :host .cm-property,:root:not([data-theme=force-light]) :host .cm-keyword{color:rgb(var(--color-purple-lighter))}:root:not([data-theme=force-light]) :host .cm-operator{color:rgb(var(--color-sky-lighter))}:root:not([data-theme=force-light]) :host .cm-variable-3,:root:not([data-theme=force-light]) :host .cm-type{color:rgb(var(--color-yellow-light))}:root:not([data-theme=force-light]) :host .cm-atom{color:rgb(var(--color-coral-light))}:root:not([data-theme=force-light]) :host .cm-tag,:root:not([data-theme=force-light]) :host .cm-number{color:rgb(var(--color-magenta-light))}:root:not([data-theme=force-light]) :host .cm-def{color:rgb(var(--color-sky-light))}:root:not([data-theme=force-light]) :host .cm-string{color:rgb(var(--color-lime-light))}:root:not([data-theme=force-light]) :host .cm-string-2{color:rgb(var(--color-pink-lighter))}:root:not([data-theme=force-light]) :host .cm-qualifier{color:rgb(var(--color-grass-light))}:root:not([data-theme=force-light]) :host .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.4)}}:root[data-theme=force-dark] :host{--code-editor-neutral-text-color:var(--contrast-1600);--code-editor-line-number-text-color:var(--contrast-800);--code-editor-cursor-color:var(--color-amber-default);--code-editor-selection-highlight-color:var(--color-cyan-light);--code-editor-selection-lowlight-color:var(--contrast-100)}:root[data-theme=force-dark] :host .cm-attribute,:root[data-theme=force-dark] :host .cm-property,:root[data-theme=force-dark] :host .cm-keyword{color:rgb(var(--color-purple-lighter))}:root[data-theme=force-dark] :host .cm-operator{color:rgb(var(--color-sky-lighter))}:root[data-theme=force-dark] :host .cm-variable-3,:root[data-theme=force-dark] :host .cm-type{color:rgb(var(--color-yellow-light))}:root[data-theme=force-dark] :host .cm-atom{color:rgb(var(--color-coral-light))}:root[data-theme=force-dark] :host .cm-tag,:root[data-theme=force-dark] :host .cm-number{color:rgb(var(--color-magenta-light))}:root[data-theme=force-dark] :host .cm-def{color:rgb(var(--color-sky-light))}:root[data-theme=force-dark] :host .cm-string{color:rgb(var(--color-lime-light))}:root[data-theme=force-dark] :host .cm-string-2{color:rgb(var(--color-pink-lighter))}:root[data-theme=force-dark] :host .cm-qualifier{color:rgb(var(--color-grass-light))}:root[data-theme=force-dark] :host .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.4)}.editor{display:flex;align-items:stretch;width:100%}.editor.readonly .CodeMirror-focused .CodeMirror-cursors{visibility:visible !important}.cm-s-lime.CodeMirror{color:rgb(var(--code-editor-neutral-text-color));background-color:rgb(var(--code-editor-background-color));border-radius:0.25rem;height:auto;width:100%}.cm-s-lime .CodeMirror-scroll{max-height:var(--code-editor-max-height, 10rem)}.cm-s-lime.CodeMirror-focused div.CodeMirror-selected{background:rgba(var(--code-editor-selection-highlight-color), 0.15)}.cm-s-lime div.CodeMirror-selected{background:rgba(var(--code-editor-selection-highlight-color), 0.05)}.cm-s-lime .CodeMirror-gutters{background-color:rgb(var(--code-editor-gutter-background-color));color:rgb(var(--code-editor-line-number-text-color));border:none}.cm-s-lime .CodeMirror-guttermarker,.cm-s-lime .CodeMirror-guttermarker-subtle,.cm-s-lime .CodeMirror-linenumber{color:rgb(var(--code-editor-line-number-text-color))}.cm-s-lime .CodeMirror-cursor{border-left:1px solid rgb(var(--code-editor-cursor-color))}.editor.readonly .cm-s-lime .CodeMirror-cursor{border-color:rgba(var(--code-editor-neutral-text-color), 0.5);border-width:0.125rem}.cm-s-lime .CodeMirror-activeline-background{background:rgba(var(--code-editor-selection-lowlight-color), 0.5)}.cm-s-lime .CodeMirror-matchingbracket{font-weight:bold;color:rgb(var(--code-editor-neutral-text-color)) !important;background:rgba(var(--code-editor-selection-highlight-color), 0.15);position:relative}.cm-s-lime .CodeMirror-matchingbracket:before{content:\"_\";color:rgb(var(--code-editor-selection-highlight-color), 0.8);position:absolute;bottom:-0.4rem;left:0;right:0}.cm-s-lime .CodeMirror-lint-marker-error,.cm-s-lime .CodeMirror-lint-message-error{background-image:url(\"data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><defs/><path fill='rgb(255,255,255)' d='M7.219 5.781L5.78 7.22 14.563 16 5.78 24.781 7.22 26.22 16 17.437l8.781 8.782 1.438-1.438L17.437 16l8.782-8.781L24.78 5.78 16 14.563z'/></svg>\");background-color:rgb(var(--color-red-default));background-size:0.75rem;border-radius:50%}.cm-s-lime .CodeMirror-foldmarker{position:relative;transition:color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;color:transparent;background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal);text-shadow:none;padding:0 0.5rem;border-radius:1rem;background-image:url(\"data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' xml:space='preserve'><circle fill='rgba(186,186,192,0.7)' cx='16' cy='16' r='2'/><circle fill='rgba(186,186,192,0.7)' cx='26' cy='16' r='2'/><circle fill='rgba(186,186,192,0.7)' cx='6' cy='16' r='2'/></svg>\");background-size:contain;background-repeat:no-repeat;background-position:center}.cm-s-lime .CodeMirror-foldmarker:hover{color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.cm-s-lime .CodeMirror-foldmarker:active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}.cm-s-lime [class^=CodeMirror-foldgutter]{color:var(--code-editor-neutral-text-color);transition:opacity 0.2s ease;opacity:0.4}.cm-s-lime [class^=CodeMirror-foldgutter]:hover{opacity:1}.cm-s-lime .CodeMirror-foldgutter-folded{opacity:0.7}";const s=class{constructor(i){r(this,i);this.change=t(this,"change",7);this.handleChangeDarkMode=()=>{if(this.colorScheme!=="auto"){return}this.forceRedraw()};this.handleChange=()=>{this.change.emit(this.editor.getValue())};this.handleResize=()=>{if(!this.editor){return}this.editor.refresh()};this.value="";this.language=undefined;this.readonly=false;this.lineNumbers=false;this.fold=false;this.lint=false;this.colorScheme="auto";this.random=undefined}connectedCallback(){this.observer=new ResizeObserver(this.handleResize);this.observer.observe(this.host);this.darkMode.addEventListener("change",this.handleChangeDarkMode)}disconnectedCallback(){this.observer.unobserve(this.host);this.editor.off("change",this.handleChange);this.editor=null;this.darkMode.removeEventListener("change",this.handleChangeDarkMode);const r=this.host.shadowRoot.querySelector(".editor");r===null||r===void 0?void 0:r.childNodes.forEach((r=>{r.remove()}))}componentDidRender(){if(this.editor){return}this.editor=this.createEditor()}watchValue(r){if(!this.editor){return}const t=this.editor.getValue();if(r===t){return}this.editor.getDoc().setValue(r||"")}createEditor(){const r=this.getOptions();const t=u(this.host.shadowRoot.querySelector(".editor"),r);t.on("change",this.handleChange);t.setOption("extraKeys",{Tab:r=>{const t=Array(r.getOption("indentUnit")+1).join(" ");r.replaceSelection(t)}});return t}getOptions(){let r=this.language;const t=4;let i="lime light";const e=[];if(this.isDarkMode()){i="lime dark"}if(this.language==="json"){r={name:"application/json",json:true};if(this.lint){e.push("CodeMirror-lint-markers");if(!("jsonlint"in window)){window["jsonlint"]=a}}}else if(this.language==="typescript"){r={name:"application/typescript",typescript:true}}if(this.fold){e.push("CodeMirror-foldgutter")}return{mode:r,value:this.value||"",theme:i,readOnly:this.readonly,tabSize:t,indentUnit:t,lineNumbers:this.lineNumbers,styleActiveLine:true,matchBrackets:true,lint:this.lint,foldGutter:this.fold,gutters:e}}isDarkMode(){if(this.colorScheme!=="auto"){return this.colorScheme==="dark"}return this.darkMode.matches}render(){const r={editor:true,readonly:this.readonly,"is-dark-mode":this.isDarkMode(),"is-light-mode":!this.isDarkMode()};return i("div",{class:r})}forceRedraw(){this.random=Math.random()}get darkMode(){return matchMedia("(prefers-color-scheme: dark)")}get host(){return e(this)}static get watchers(){return{value:["watchValue"]}}};s.style=l;export{s as limel_code_editor};
2
- //# sourceMappingURL=p-848437f8.entry.js.map
1
+ import{r,c as t,h as i,g as e}from"./p-3075aa67.js";import{c as n,a as o}from"./p-eab67c09.js";var u=n((function(r,t){(function(t,i){r.exports=i()})(o,(function(){var r=navigator.userAgent;var t=navigator.platform;var i=/gecko\/\d/i.test(r);var e=/MSIE \d/.test(r);var n=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(r);var o=/Edge\/(\d+)/.exec(r);var u=e||n||o;var f=u&&(e?document.documentMode||6:+(o||n)[1]);var a=!o&&/WebKit\//.test(r);var l=a&&/Qt\/\d+\.\d+/.test(r);var s=!o&&/Chrome\/(\d+)/.exec(r);var c=s&&+s[1];var v=/Opera\//.test(r);var h=/Apple Computer/.test(navigator.vendor);var d=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(r);var m=/PhantomJS/.test(r);var p=h&&(/Mobile\/\w+/.test(r)||navigator.maxTouchPoints>2);var g=/Android/.test(r);var b=p||g||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(r);var w=p||/Mac/.test(t);var k=/\bCrOS\b/.test(r);var C=/win/i.test(t);var M=v&&r.match(/Version\/(\d*\.\d*)/);if(M){M=Number(M[1])}if(M&&M>=15){v=false;a=true}var A=w&&(l||v&&(M==null||M<12.11));var y=i||u&&f>=9;function x(r){return new RegExp("(^|\\s)"+r+"(?:$|\\s)\\s*")}var L=function(r,t){var i=r.className;var e=x(t).exec(i);if(e){var n=i.slice(e.index+e[0].length);r.className=i.slice(0,e.index)+(n?e[1]+n:"")}};function S(r){for(var t=r.childNodes.length;t>0;--t){r.removeChild(r.firstChild)}return r}function N(r,t){return S(r).appendChild(t)}function E(r,t,i,e){var n=document.createElement(r);if(i){n.className=i}if(e){n.style.cssText=e}if(typeof t=="string"){n.appendChild(document.createTextNode(t))}else if(t){for(var o=0;o<t.length;++o){n.appendChild(t[o])}}return n}function D(r,t,i,e){var n=E(r,t,i,e);n.setAttribute("role","presentation");return n}var T;if(document.createRange){T=function(r,t,i,e){var n=document.createRange();n.setEnd(e||r,i);n.setStart(r,t);return n}}else{T=function(r,t,i){var e=document.body.createTextRange();try{e.moveToElementText(r.parentNode)}catch(r){return e}e.collapse(true);e.moveEnd("character",i);e.moveStart("character",t);return e}}function I(r,t){if(t.nodeType==3){t=t.parentNode}if(r.contains){return r.contains(t)}do{if(t.nodeType==11){t=t.host}if(t==r){return true}}while(t=t.parentNode)}function O(r){var t;try{t=r.activeElement}catch(i){t=r.body||null}while(t&&t.shadowRoot&&t.shadowRoot.activeElement){t=t.shadowRoot.activeElement}return t}function R(r,t){var i=r.className;if(!x(t).test(i)){r.className+=(i?" ":"")+t}}function B(r,t){var i=r.split(" ");for(var e=0;e<i.length;e++){if(i[e]&&!x(i[e]).test(t)){t+=" "+i[e]}}return t}var U=function(r){r.select()};if(p){U=function(r){r.selectionStart=0;r.selectionEnd=r.value.length}}else if(u){U=function(r){try{r.select()}catch(r){}}}function z(r){return r.display.wrapper.ownerDocument}function j(r){return z(r).defaultView}function W(r){var t=Array.prototype.slice.call(arguments,1);return function(){return r.apply(null,t)}}function F(r,t,i){if(!t){t={}}for(var e in r){if(r.hasOwnProperty(e)&&(i!==false||!t.hasOwnProperty(e))){t[e]=r[e]}}return t}function P(r,t,i,e,n){if(t==null){t=r.search(/[^\s\u00a0]/);if(t==-1){t=r.length}}for(var o=e||0,u=n||0;;){var f=r.indexOf("\t",o);if(f<0||f>=t){return u+(t-o)}u+=f-o;u+=i-u%i;o=f+1}}var G=function(){this.id=null;this.f=null;this.time=0;this.handler=W(this.onTimeout,this)};G.prototype.onTimeout=function(r){r.id=0;if(r.time<=+new Date){r.f()}else{setTimeout(r.handler,r.time-+new Date)}};G.prototype.set=function(r,t){this.f=t;var i=+new Date+r;if(!this.id||i<this.time){clearTimeout(this.id);this.id=setTimeout(this.handler,r);this.time=i}};function H(r,t){for(var i=0;i<r.length;++i){if(r[i]==t){return i}}return-1}var V=50;var $={toString:function(){return"CodeMirror.Pass"}};var _={scroll:false},Q={origin:"*mouse"},J={origin:"+move"};function K(r,t,i){for(var e=0,n=0;;){var o=r.indexOf("\t",e);if(o==-1){o=r.length}var u=o-e;if(o==r.length||n+u>=t){return e+Math.min(u,t-n)}n+=o-e;n+=i-n%i;e=o+1;if(n>=t){return e}}}var Y=[""];function X(r){while(Y.length<=r){Y.push(q(Y)+" ")}return Y[r]}function q(r){return r[r.length-1]}function Z(r,t){var i=[];for(var e=0;e<r.length;e++){i[e]=t(r[e],e)}return i}function rr(r,t,i){var e=0,n=i(t);while(e<r.length&&i(r[e])<=n){e++}r.splice(e,0,t)}function tr(){}function ir(r,t){var i;if(Object.create){i=Object.create(r)}else{tr.prototype=r;i=new tr}if(t){F(t,i)}return i}var er=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;function nr(r){return/\w/.test(r)||r>"€"&&(r.toUpperCase()!=r.toLowerCase()||er.test(r))}function or(r,t){if(!t){return nr(r)}if(t.source.indexOf("\\w")>-1&&nr(r)){return true}return t.test(r)}function ur(r){for(var t in r){if(r.hasOwnProperty(t)&&r[t]){return false}}return true}var fr=/[\u0300-\u036f\u0483-\u0489\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u065e\u0670\u06d6-\u06dc\u06de-\u06e4\u06e7\u06e8\u06ea-\u06ed\u0711\u0730-\u074a\u07a6-\u07b0\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0900-\u0902\u093c\u0941-\u0948\u094d\u0951-\u0955\u0962\u0963\u0981\u09bc\u09be\u09c1-\u09c4\u09cd\u09d7\u09e2\u09e3\u0a01\u0a02\u0a3c\u0a41\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a70\u0a71\u0a75\u0a81\u0a82\u0abc\u0ac1-\u0ac5\u0ac7\u0ac8\u0acd\u0ae2\u0ae3\u0b01\u0b3c\u0b3e\u0b3f\u0b41-\u0b44\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b82\u0bbe\u0bc0\u0bcd\u0bd7\u0c3e-\u0c40\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0cbc\u0cbf\u0cc2\u0cc6\u0ccc\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0d3e\u0d41-\u0d44\u0d4d\u0d57\u0d62\u0d63\u0dca\u0dcf\u0dd2-\u0dd4\u0dd6\u0ddf\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0f18\u0f19\u0f35\u0f37\u0f39\u0f71-\u0f7e\u0f80-\u0f84\u0f86\u0f87\u0f90-\u0f97\u0f99-\u0fbc\u0fc6\u102d-\u1030\u1032-\u1037\u1039\u103a\u103d\u103e\u1058\u1059\u105e-\u1060\u1071-\u1074\u1082\u1085\u1086\u108d\u109d\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b7-\u17bd\u17c6\u17c9-\u17d3\u17dd\u180b-\u180d\u18a9\u1920-\u1922\u1927\u1928\u1932\u1939-\u193b\u1a17\u1a18\u1a56\u1a58-\u1a5e\u1a60\u1a62\u1a65-\u1a6c\u1a73-\u1a7c\u1a7f\u1b00-\u1b03\u1b34\u1b36-\u1b3a\u1b3c\u1b42\u1b6b-\u1b73\u1b80\u1b81\u1ba2-\u1ba5\u1ba8\u1ba9\u1c2c-\u1c33\u1c36\u1c37\u1cd0-\u1cd2\u1cd4-\u1ce0\u1ce2-\u1ce8\u1ced\u1dc0-\u1de6\u1dfd-\u1dff\u200c\u200d\u20d0-\u20f0\u2cef-\u2cf1\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua66f-\ua672\ua67c\ua67d\ua6f0\ua6f1\ua802\ua806\ua80b\ua825\ua826\ua8c4\ua8e0-\ua8f1\ua926-\ua92d\ua947-\ua951\ua980-\ua982\ua9b3\ua9b6-\ua9b9\ua9bc\uaa29-\uaa2e\uaa31\uaa32\uaa35\uaa36\uaa43\uaa4c\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uabe5\uabe8\uabed\udc00-\udfff\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\uff9e\uff9f]/;function ar(r){return r.charCodeAt(0)>=768&&fr.test(r)}function lr(r,t,i){while((i<0?t>0:t<r.length)&&ar(r.charAt(t))){t+=i}return t}function sr(r,t,i){var e=t>i?-1:1;for(;;){if(t==i){return t}var n=(t+i)/2,o=e<0?Math.ceil(n):Math.floor(n);if(o==t){return r(o)?t:i}if(r(o)){i=o}else{t=o+e}}}function cr(r,t,i,e){if(!r){return e(t,i,"ltr",0)}var n=false;for(var o=0;o<r.length;++o){var u=r[o];if(u.from<i&&u.to>t||t==i&&u.to==t){e(Math.max(u.from,t),Math.min(u.to,i),u.level==1?"rtl":"ltr",o);n=true}}if(!n){e(t,i,"ltr")}}var vr=null;function hr(r,t,i){var e;vr=null;for(var n=0;n<r.length;++n){var o=r[n];if(o.from<t&&o.to>t){return n}if(o.to==t){if(o.from!=o.to&&i=="before"){e=n}else{vr=n}}if(o.from==t){if(o.from!=o.to&&i!="before"){e=n}else{vr=n}}}return e!=null?e:vr}var dr=function(){var r="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN";var t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function i(i){if(i<=247){return r.charAt(i)}else if(1424<=i&&i<=1524){return"R"}else if(1536<=i&&i<=1785){return t.charAt(i-1536)}else if(1774<=i&&i<=2220){return"r"}else if(8192<=i&&i<=8203){return"w"}else if(i==8204){return"b"}else{return"L"}}var e=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/;var n=/[stwN]/,o=/[LRr]/,u=/[Lb1n]/,f=/[1n]/;function a(r,t,i){this.level=r;this.from=t;this.to=i}return function(r,t){var l=t=="ltr"?"L":"R";if(r.length==0||t=="ltr"&&!e.test(r)){return false}var s=r.length,c=[];for(var v=0;v<s;++v){c.push(i(r.charCodeAt(v)))}for(var h=0,d=l;h<s;++h){var m=c[h];if(m=="m"){c[h]=d}else{d=m}}for(var p=0,g=l;p<s;++p){var b=c[p];if(b=="1"&&g=="r"){c[p]="n"}else if(o.test(b)){g=b;if(b=="r"){c[p]="R"}}}for(var w=1,k=c[0];w<s-1;++w){var C=c[w];if(C=="+"&&k=="1"&&c[w+1]=="1"){c[w]="1"}else if(C==","&&k==c[w+1]&&(k=="1"||k=="n")){c[w]=k}k=C}for(var M=0;M<s;++M){var A=c[M];if(A==","){c[M]="N"}else if(A=="%"){var y=void 0;for(y=M+1;y<s&&c[y]=="%";++y){}var x=M&&c[M-1]=="!"||y<s&&c[y]=="1"?"1":"N";for(var L=M;L<y;++L){c[L]=x}M=y-1}}for(var S=0,N=l;S<s;++S){var E=c[S];if(N=="L"&&E=="1"){c[S]="L"}else if(o.test(E)){N=E}}for(var D=0;D<s;++D){if(n.test(c[D])){var T=void 0;for(T=D+1;T<s&&n.test(c[T]);++T){}var I=(D?c[D-1]:l)=="L";var O=(T<s?c[T]:l)=="L";var R=I==O?I?"L":"R":l;for(var B=D;B<T;++B){c[B]=R}D=T-1}}var U=[],z;for(var j=0;j<s;){if(u.test(c[j])){var W=j;for(++j;j<s&&u.test(c[j]);++j){}U.push(new a(0,W,j))}else{var F=j,P=U.length,G=t=="rtl"?1:0;for(++j;j<s&&c[j]!="L";++j){}for(var H=F;H<j;){if(f.test(c[H])){if(F<H){U.splice(P,0,new a(1,F,H));P+=G}var V=H;for(++H;H<j&&f.test(c[H]);++H){}U.splice(P,0,new a(2,V,H));P+=G;F=H}else{++H}}if(F<j){U.splice(P,0,new a(1,F,j))}}}if(t=="ltr"){if(U[0].level==1&&(z=r.match(/^\s+/))){U[0].from=z[0].length;U.unshift(new a(0,0,z[0].length))}if(q(U).level==1&&(z=r.match(/\s+$/))){q(U).to-=z[0].length;U.push(new a(0,s-z[0].length,s))}}return t=="rtl"?U.reverse():U}}();function mr(r,t){var i=r.order;if(i==null){i=r.order=dr(r.text,t)}return i}var pr=[];var gr=function(r,t,i){if(r.addEventListener){r.addEventListener(t,i,false)}else if(r.attachEvent){r.attachEvent("on"+t,i)}else{var e=r._handlers||(r._handlers={});e[t]=(e[t]||pr).concat(i)}};function br(r,t){return r._handlers&&r._handlers[t]||pr}function wr(r,t,i){if(r.removeEventListener){r.removeEventListener(t,i,false)}else if(r.detachEvent){r.detachEvent("on"+t,i)}else{var e=r._handlers,n=e&&e[t];if(n){var o=H(n,i);if(o>-1){e[t]=n.slice(0,o).concat(n.slice(o+1))}}}}function kr(r,t){var i=br(r,t);if(!i.length){return}var e=Array.prototype.slice.call(arguments,2);for(var n=0;n<i.length;++n){i[n].apply(null,e)}}function Cr(r,t,i){if(typeof t=="string"){t={type:t,preventDefault:function(){this.defaultPrevented=true}}}kr(r,i||t.type,r,t);return Sr(t)||t.codemirrorIgnore}function Mr(r){var t=r._handlers&&r._handlers.cursorActivity;if(!t){return}var i=r.curOp.cursorActivityHandlers||(r.curOp.cursorActivityHandlers=[]);for(var e=0;e<t.length;++e){if(H(i,t[e])==-1){i.push(t[e])}}}function Ar(r,t){return br(r,t).length>0}function yr(r){r.prototype.on=function(r,t){gr(this,r,t)};r.prototype.off=function(r,t){wr(this,r,t)}}function xr(r){if(r.preventDefault){r.preventDefault()}else{r.returnValue=false}}function Lr(r){if(r.stopPropagation){r.stopPropagation()}else{r.cancelBubble=true}}function Sr(r){return r.defaultPrevented!=null?r.defaultPrevented:r.returnValue==false}function Nr(r){xr(r);Lr(r)}function Er(r){return r.target||r.srcElement}function Dr(r){var t=r.which;if(t==null){if(r.button&1){t=1}else if(r.button&2){t=3}else if(r.button&4){t=2}}if(w&&r.ctrlKey&&t==1){t=3}return t}var Tr=function(){if(u&&f<9){return false}var r=E("div");return"draggable"in r||"dragDrop"in r}();var Ir;function Or(r){if(Ir==null){var t=E("span","​");N(r,E("span",[t,document.createTextNode("x")]));if(r.firstChild.offsetHeight!=0){Ir=t.offsetWidth<=1&&t.offsetHeight>2&&!(u&&f<8)}}var i=Ir?E("span","​"):E("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");i.setAttribute("cm-text","");return i}var Rr;function Br(r){if(Rr!=null){return Rr}var t=N(r,document.createTextNode("AخA"));var i=T(t,0,1).getBoundingClientRect();var e=T(t,1,2).getBoundingClientRect();S(r);if(!i||i.left==i.right){return false}return Rr=e.right-i.right<3}var Ur="\n\nb".split(/\n/).length!=3?function(r){var t=0,i=[],e=r.length;while(t<=e){var n=r.indexOf("\n",t);if(n==-1){n=r.length}var o=r.slice(t,r.charAt(n-1)=="\r"?n-1:n);var u=o.indexOf("\r");if(u!=-1){i.push(o.slice(0,u));t+=u+1}else{i.push(o);t=n+1}}return i}:function(r){return r.split(/\r\n?|\n/)};var zr=window.getSelection?function(r){try{return r.selectionStart!=r.selectionEnd}catch(r){return false}}:function(r){var t;try{t=r.ownerDocument.selection.createRange()}catch(r){}if(!t||t.parentElement()!=r){return false}return t.compareEndPoints("StartToEnd",t)!=0};var jr=function(){var r=E("div");if("oncopy"in r){return true}r.setAttribute("oncopy","return;");return typeof r.oncopy=="function"}();var Wr=null;function Fr(r){if(Wr!=null){return Wr}var t=N(r,E("span","x"));var i=t.getBoundingClientRect();var e=T(t,0,1).getBoundingClientRect();return Wr=Math.abs(i.left-e.left)>1}var Pr={},Gr={};function Hr(r,t){if(arguments.length>2){t.dependencies=Array.prototype.slice.call(arguments,2)}Pr[r]=t}function Vr(r,t){Gr[r]=t}function $r(r){if(typeof r=="string"&&Gr.hasOwnProperty(r)){r=Gr[r]}else if(r&&typeof r.name=="string"&&Gr.hasOwnProperty(r.name)){var t=Gr[r.name];if(typeof t=="string"){t={name:t}}r=ir(t,r);r.name=t.name}else if(typeof r=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(r)){return $r("application/xml")}else if(typeof r=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(r)){return $r("application/json")}if(typeof r=="string"){return{name:r}}else{return r||{name:"null"}}}function _r(r,t){t=$r(t);var i=Pr[t.name];if(!i){return _r(r,"text/plain")}var e=i(r,t);if(Qr.hasOwnProperty(t.name)){var n=Qr[t.name];for(var o in n){if(!n.hasOwnProperty(o)){continue}if(e.hasOwnProperty(o)){e["_"+o]=e[o]}e[o]=n[o]}}e.name=t.name;if(t.helperType){e.helperType=t.helperType}if(t.modeProps){for(var u in t.modeProps){e[u]=t.modeProps[u]}}return e}var Qr={};function Jr(r,t){var i=Qr.hasOwnProperty(r)?Qr[r]:Qr[r]={};F(t,i)}function Kr(r,t){if(t===true){return t}if(r.copyState){return r.copyState(t)}var i={};for(var e in t){var n=t[e];if(n instanceof Array){n=n.concat([])}i[e]=n}return i}function Yr(r,t){var i;while(r.innerMode){i=r.innerMode(t);if(!i||i.mode==r){break}t=i.state;r=i.mode}return i||{mode:r,state:t}}function Xr(r,t,i){return r.startState?r.startState(t,i):true}var qr=function(r,t,i){this.pos=this.start=0;this.string=r;this.tabSize=t||8;this.lastColumnPos=this.lastColumnValue=0;this.lineStart=0;this.lineOracle=i};qr.prototype.eol=function(){return this.pos>=this.string.length};qr.prototype.sol=function(){return this.pos==this.lineStart};qr.prototype.peek=function(){return this.string.charAt(this.pos)||undefined};qr.prototype.next=function(){if(this.pos<this.string.length){return this.string.charAt(this.pos++)}};qr.prototype.eat=function(r){var t=this.string.charAt(this.pos);var i;if(typeof r=="string"){i=t==r}else{i=t&&(r.test?r.test(t):r(t))}if(i){++this.pos;return t}};qr.prototype.eatWhile=function(r){var t=this.pos;while(this.eat(r)){}return this.pos>t};qr.prototype.eatSpace=function(){var r=this.pos;while(/[\s\u00a0]/.test(this.string.charAt(this.pos))){++this.pos}return this.pos>r};qr.prototype.skipToEnd=function(){this.pos=this.string.length};qr.prototype.skipTo=function(r){var t=this.string.indexOf(r,this.pos);if(t>-1){this.pos=t;return true}};qr.prototype.backUp=function(r){this.pos-=r};qr.prototype.column=function(){if(this.lastColumnPos<this.start){this.lastColumnValue=P(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue);this.lastColumnPos=this.start}return this.lastColumnValue-(this.lineStart?P(this.string,this.lineStart,this.tabSize):0)};qr.prototype.indentation=function(){return P(this.string,null,this.tabSize)-(this.lineStart?P(this.string,this.lineStart,this.tabSize):0)};qr.prototype.match=function(r,t,i){if(typeof r=="string"){var e=function(r){return i?r.toLowerCase():r};var n=this.string.substr(this.pos,r.length);if(e(n)==e(r)){if(t!==false){this.pos+=r.length}return true}}else{var o=this.string.slice(this.pos).match(r);if(o&&o.index>0){return null}if(o&&t!==false){this.pos+=o[0].length}return o}};qr.prototype.current=function(){return this.string.slice(this.start,this.pos)};qr.prototype.hideFirstChars=function(r,t){this.lineStart+=r;try{return t()}finally{this.lineStart-=r}};qr.prototype.lookAhead=function(r){var t=this.lineOracle;return t&&t.lookAhead(r)};qr.prototype.baseToken=function(){var r=this.lineOracle;return r&&r.baseToken(this.pos)};function Zr(r,t){t-=r.first;if(t<0||t>=r.size){throw new Error("There is no line "+(t+r.first)+" in the document.")}var i=r;while(!i.lines){for(var e=0;;++e){var n=i.children[e],o=n.chunkSize();if(t<o){i=n;break}t-=o}}return i.lines[t]}function rt(r,t,i){var e=[],n=t.line;r.iter(t.line,i.line+1,(function(r){var o=r.text;if(n==i.line){o=o.slice(0,i.ch)}if(n==t.line){o=o.slice(t.ch)}e.push(o);++n}));return e}function tt(r,t,i){var e=[];r.iter(t,i,(function(r){e.push(r.text)}));return e}function it(r,t){var i=t-r.height;if(i){for(var e=r;e;e=e.parent){e.height+=i}}}function et(r){if(r.parent==null){return null}var t=r.parent,i=H(t.lines,r);for(var e=t.parent;e;t=e,e=e.parent){for(var n=0;;++n){if(e.children[n]==t){break}i+=e.children[n].chunkSize()}}return i+t.first}function nt(r,t){var i=r.first;r:do{for(var e=0;e<r.children.length;++e){var n=r.children[e],o=n.height;if(t<o){r=n;continue r}t-=o;i+=n.chunkSize()}return i}while(!r.lines);var u=0;for(;u<r.lines.length;++u){var f=r.lines[u],a=f.height;if(t<a){break}t-=a}return i+u}function ot(r,t){return t>=r.first&&t<r.first+r.size}function ut(r,t){return String(r.lineNumberFormatter(t+r.firstLineNumber))}function ft(r,t,i){if(i===void 0)i=null;if(!(this instanceof ft)){return new ft(r,t,i)}this.line=r;this.ch=t;this.sticky=i}function at(r,t){return r.line-t.line||r.ch-t.ch}function lt(r,t){return r.sticky==t.sticky&&at(r,t)==0}function st(r){return ft(r.line,r.ch)}function ct(r,t){return at(r,t)<0?t:r}function vt(r,t){return at(r,t)<0?r:t}function ht(r,t){return Math.max(r.first,Math.min(t,r.first+r.size-1))}function dt(r,t){if(t.line<r.first){return ft(r.first,0)}var i=r.first+r.size-1;if(t.line>i){return ft(i,Zr(r,i).text.length)}return mt(t,Zr(r,t.line).text.length)}function mt(r,t){var i=r.ch;if(i==null||i>t){return ft(r.line,t)}else if(i<0){return ft(r.line,0)}else{return r}}function pt(r,t){var i=[];for(var e=0;e<t.length;e++){i[e]=dt(r,t[e])}return i}var gt=function(r,t){this.state=r;this.lookAhead=t};var bt=function(r,t,i,e){this.state=t;this.doc=r;this.line=i;this.maxLookAhead=e||0;this.baseTokens=null;this.baseTokenPos=1};bt.prototype.lookAhead=function(r){var t=this.doc.getLine(this.line+r);if(t!=null&&r>this.maxLookAhead){this.maxLookAhead=r}return t};bt.prototype.baseToken=function(r){if(!this.baseTokens){return null}while(this.baseTokens[this.baseTokenPos]<=r){this.baseTokenPos+=2}var t=this.baseTokens[this.baseTokenPos+1];return{type:t&&t.replace(/( |^)overlay .*/,""),size:this.baseTokens[this.baseTokenPos]-r}};bt.prototype.nextLine=function(){this.line++;if(this.maxLookAhead>0){this.maxLookAhead--}};bt.fromSaved=function(r,t,i){if(t instanceof gt){return new bt(r,Kr(r.mode,t.state),i,t.lookAhead)}else{return new bt(r,Kr(r.mode,t),i)}};bt.prototype.save=function(r){var t=r!==false?Kr(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new gt(t,this.maxLookAhead):t};function wt(r,t,i,e){var n=[r.state.modeGen],o={};Nt(r,t.text,r.doc.mode,i,(function(r,t){return n.push(r,t)}),o,e);var u=i.state;var f=function(e){i.baseTokens=n;var f=r.state.overlays[e],a=1,l=0;i.state=true;Nt(r,t.text,f.mode,i,(function(r,t){var i=a;while(l<r){var e=n[a];if(e>r){n.splice(a,1,r,n[a+1],e)}a+=2;l=Math.min(r,e)}if(!t){return}if(f.opaque){n.splice(i,a-i,r,"overlay "+t);a=i+2}else{for(;i<a;i+=2){var o=n[i+1];n[i+1]=(o?o+" ":"")+"overlay "+t}}}),o);i.state=u;i.baseTokens=null;i.baseTokenPos=1};for(var a=0;a<r.state.overlays.length;++a)f(a);return{styles:n,classes:o.bgClass||o.textClass?o:null}}function kt(r,t,i){if(!t.styles||t.styles[0]!=r.state.modeGen){var e=Ct(r,et(t));var n=t.text.length>r.options.maxHighlightLength&&Kr(r.doc.mode,e.state);var o=wt(r,t,e);if(n){e.state=n}t.stateAfter=e.save(!n);t.styles=o.styles;if(o.classes){t.styleClasses=o.classes}else if(t.styleClasses){t.styleClasses=null}if(i===r.doc.highlightFrontier){r.doc.modeFrontier=Math.max(r.doc.modeFrontier,++r.doc.highlightFrontier)}}return t.styles}function Ct(r,t,i){var e=r.doc,n=r.display;if(!e.mode.startState){return new bt(e,true,t)}var o=Et(r,t,i);var u=o>e.first&&Zr(e,o-1).stateAfter;var f=u?bt.fromSaved(e,u,o):new bt(e,Xr(e.mode),o);e.iter(o,t,(function(i){Mt(r,i.text,f);var e=f.line;i.stateAfter=e==t-1||e%5==0||e>=n.viewFrom&&e<n.viewTo?f.save():null;f.nextLine()}));if(i){e.modeFrontier=f.line}return f}function Mt(r,t,i,e){var n=r.doc.mode;var o=new qr(t,r.options.tabSize,i);o.start=o.pos=e||0;if(t==""){At(n,i.state)}while(!o.eol()){yt(n,o,i.state);o.start=o.pos}}function At(r,t){if(r.blankLine){return r.blankLine(t)}if(!r.innerMode){return}var i=Yr(r,t);if(i.mode.blankLine){return i.mode.blankLine(i.state)}}function yt(r,t,i,e){for(var n=0;n<10;n++){if(e){e[0]=Yr(r,i).mode}var o=r.token(t,i);if(t.pos>t.start){return o}}throw new Error("Mode "+r.name+" failed to advance stream.")}var xt=function(r,t,i){this.start=r.start;this.end=r.pos;this.string=r.current();this.type=t||null;this.state=i};function Lt(r,t,i,e){var n=r.doc,o=n.mode,u;t=dt(n,t);var f=Zr(n,t.line),a=Ct(r,t.line,i);var l=new qr(f.text,r.options.tabSize,a),s;if(e){s=[]}while((e||l.pos<t.ch)&&!l.eol()){l.start=l.pos;u=yt(o,l,a.state);if(e){s.push(new xt(l,u,Kr(n.mode,a.state)))}}return e?s:new xt(l,u,a.state)}function St(r,t){if(r){for(;;){var i=r.match(/(?:^|\s+)line-(background-)?(\S+)/);if(!i){break}r=r.slice(0,i.index)+r.slice(i.index+i[0].length);var e=i[1]?"bgClass":"textClass";if(t[e]==null){t[e]=i[2]}else if(!new RegExp("(?:^|\\s)"+i[2]+"(?:$|\\s)").test(t[e])){t[e]+=" "+i[2]}}}return r}function Nt(r,t,i,e,n,o,u){var f=i.flattenSpans;if(f==null){f=r.options.flattenSpans}var a=0,l=null;var s=new qr(t,r.options.tabSize,e),c;var v=r.options.addModeClass&&[null];if(t==""){St(At(i,e.state),o)}while(!s.eol()){if(s.pos>r.options.maxHighlightLength){f=false;if(u){Mt(r,t,e,s.pos)}s.pos=t.length;c=null}else{c=St(yt(i,s,e.state,v),o)}if(v){var h=v[0].name;if(h){c="m-"+(c?h+" "+c:h)}}if(!f||l!=c){while(a<s.start){a=Math.min(s.start,a+5e3);n(a,l)}l=c}s.start=s.pos}while(a<s.pos){var d=Math.min(s.pos,a+5e3);n(d,l);a=d}}function Et(r,t,i){var e,n,o=r.doc;var u=i?-1:t-(r.doc.mode.innerMode?1e3:100);for(var f=t;f>u;--f){if(f<=o.first){return o.first}var a=Zr(o,f-1),l=a.stateAfter;if(l&&(!i||f+(l instanceof gt?l.lookAhead:0)<=o.modeFrontier)){return f}var s=P(a.text,null,r.options.tabSize);if(n==null||e>s){n=f-1;e=s}}return n}function Dt(r,t){r.modeFrontier=Math.min(r.modeFrontier,t);if(r.highlightFrontier<t-10){return}var i=r.first;for(var e=t-1;e>i;e--){var n=Zr(r,e).stateAfter;if(n&&(!(n instanceof gt)||e+n.lookAhead<t)){i=e+1;break}}r.highlightFrontier=Math.min(r.highlightFrontier,i)}var Tt=false,It=false;function Ot(){Tt=true}function Rt(){It=true}function Bt(r,t,i){this.marker=r;this.from=t;this.to=i}function Ut(r,t){if(r){for(var i=0;i<r.length;++i){var e=r[i];if(e.marker==t){return e}}}}function zt(r,t){var i;for(var e=0;e<r.length;++e){if(r[e]!=t){(i||(i=[])).push(r[e])}}return i}function jt(r,t,i){var e=i&&window.WeakSet&&(i.markedSpans||(i.markedSpans=new WeakSet));if(e&&r.markedSpans&&e.has(r.markedSpans)){r.markedSpans.push(t)}else{r.markedSpans=r.markedSpans?r.markedSpans.concat([t]):[t];if(e){e.add(r.markedSpans)}}t.marker.attachLine(r)}function Wt(r,t,i){var e;if(r){for(var n=0;n<r.length;++n){var o=r[n],u=o.marker;var f=o.from==null||(u.inclusiveLeft?o.from<=t:o.from<t);if(f||o.from==t&&u.type=="bookmark"&&(!i||!o.marker.insertLeft)){var a=o.to==null||(u.inclusiveRight?o.to>=t:o.to>t);(e||(e=[])).push(new Bt(u,o.from,a?null:o.to))}}}return e}function Ft(r,t,i){var e;if(r){for(var n=0;n<r.length;++n){var o=r[n],u=o.marker;var f=o.to==null||(u.inclusiveRight?o.to>=t:o.to>t);if(f||o.from==t&&u.type=="bookmark"&&(!i||o.marker.insertLeft)){var a=o.from==null||(u.inclusiveLeft?o.from<=t:o.from<t);(e||(e=[])).push(new Bt(u,a?null:o.from-t,o.to==null?null:o.to-t))}}}return e}function Pt(r,t){if(t.full){return null}var i=ot(r,t.from.line)&&Zr(r,t.from.line).markedSpans;var e=ot(r,t.to.line)&&Zr(r,t.to.line).markedSpans;if(!i&&!e){return null}var n=t.from.ch,o=t.to.ch,u=at(t.from,t.to)==0;var f=Wt(i,n,u);var a=Ft(e,o,u);var l=t.text.length==1,s=q(t.text).length+(l?n:0);if(f){for(var c=0;c<f.length;++c){var v=f[c];if(v.to==null){var h=Ut(a,v.marker);if(!h){v.to=n}else if(l){v.to=h.to==null?null:h.to+s}}}}if(a){for(var d=0;d<a.length;++d){var m=a[d];if(m.to!=null){m.to+=s}if(m.from==null){var p=Ut(f,m.marker);if(!p){m.from=s;if(l){(f||(f=[])).push(m)}}}else{m.from+=s;if(l){(f||(f=[])).push(m)}}}}if(f){f=Gt(f)}if(a&&a!=f){a=Gt(a)}var g=[f];if(!l){var b=t.text.length-2,w;if(b>0&&f){for(var k=0;k<f.length;++k){if(f[k].to==null){(w||(w=[])).push(new Bt(f[k].marker,null,null))}}}for(var C=0;C<b;++C){g.push(w)}g.push(a)}return g}function Gt(r){for(var t=0;t<r.length;++t){var i=r[t];if(i.from!=null&&i.from==i.to&&i.marker.clearWhenEmpty!==false){r.splice(t--,1)}}if(!r.length){return null}return r}function Ht(r,t,i){var e=null;r.iter(t.line,i.line+1,(function(r){if(r.markedSpans){for(var t=0;t<r.markedSpans.length;++t){var i=r.markedSpans[t].marker;if(i.readOnly&&(!e||H(e,i)==-1)){(e||(e=[])).push(i)}}}}));if(!e){return null}var n=[{from:t,to:i}];for(var o=0;o<e.length;++o){var u=e[o],f=u.find(0);for(var a=0;a<n.length;++a){var l=n[a];if(at(l.to,f.from)<0||at(l.from,f.to)>0){continue}var s=[a,1],c=at(l.from,f.from),v=at(l.to,f.to);if(c<0||!u.inclusiveLeft&&!c){s.push({from:l.from,to:f.from})}if(v>0||!u.inclusiveRight&&!v){s.push({from:f.to,to:l.to})}n.splice.apply(n,s);a+=s.length-3}}return n}function Vt(r){var t=r.markedSpans;if(!t){return}for(var i=0;i<t.length;++i){t[i].marker.detachLine(r)}r.markedSpans=null}function $t(r,t){if(!t){return}for(var i=0;i<t.length;++i){t[i].marker.attachLine(r)}r.markedSpans=t}function _t(r){return r.inclusiveLeft?-1:0}function Qt(r){return r.inclusiveRight?1:0}function Jt(r,t){var i=r.lines.length-t.lines.length;if(i!=0){return i}var e=r.find(),n=t.find();var o=at(e.from,n.from)||_t(r)-_t(t);if(o){return-o}var u=at(e.to,n.to)||Qt(r)-Qt(t);if(u){return u}return t.id-r.id}function Kt(r,t){var i=It&&r.markedSpans,e;if(i){for(var n=void 0,o=0;o<i.length;++o){n=i[o];if(n.marker.collapsed&&(t?n.from:n.to)==null&&(!e||Jt(e,n.marker)<0)){e=n.marker}}}return e}function Yt(r){return Kt(r,true)}function Xt(r){return Kt(r,false)}function qt(r,t){var i=It&&r.markedSpans,e;if(i){for(var n=0;n<i.length;++n){var o=i[n];if(o.marker.collapsed&&(o.from==null||o.from<t)&&(o.to==null||o.to>t)&&(!e||Jt(e,o.marker)<0)){e=o.marker}}}return e}function Zt(r,t,i,e,n){var o=Zr(r,t);var u=It&&o.markedSpans;if(u){for(var f=0;f<u.length;++f){var a=u[f];if(!a.marker.collapsed){continue}var l=a.marker.find(0);var s=at(l.from,i)||_t(a.marker)-_t(n);var c=at(l.to,e)||Qt(a.marker)-Qt(n);if(s>=0&&c<=0||s<=0&&c>=0){continue}if(s<=0&&(a.marker.inclusiveRight&&n.inclusiveLeft?at(l.to,i)>=0:at(l.to,i)>0)||s>=0&&(a.marker.inclusiveRight&&n.inclusiveLeft?at(l.from,e)<=0:at(l.from,e)<0)){return true}}}}function ri(r){var t;while(t=Yt(r)){r=t.find(-1,true).line}return r}function ti(r){var t;while(t=Xt(r)){r=t.find(1,true).line}return r}function ii(r){var t,i;while(t=Xt(r)){r=t.find(1,true).line;(i||(i=[])).push(r)}return i}function ei(r,t){var i=Zr(r,t),e=ri(i);if(i==e){return t}return et(e)}function ni(r,t){if(t>r.lastLine()){return t}var i=Zr(r,t),e;if(!oi(r,i)){return t}while(e=Xt(i)){i=e.find(1,true).line}return et(i)+1}function oi(r,t){var i=It&&t.markedSpans;if(i){for(var e=void 0,n=0;n<i.length;++n){e=i[n];if(!e.marker.collapsed){continue}if(e.from==null){return true}if(e.marker.widgetNode){continue}if(e.from==0&&e.marker.inclusiveLeft&&ui(r,t,e)){return true}}}}function ui(r,t,i){if(i.to==null){var e=i.marker.find(1,true);return ui(r,e.line,Ut(e.line.markedSpans,i.marker))}if(i.marker.inclusiveRight&&i.to==t.text.length){return true}for(var n=void 0,o=0;o<t.markedSpans.length;++o){n=t.markedSpans[o];if(n.marker.collapsed&&!n.marker.widgetNode&&n.from==i.to&&(n.to==null||n.to!=i.from)&&(n.marker.inclusiveLeft||i.marker.inclusiveRight)&&ui(r,t,n)){return true}}}function fi(r){r=ri(r);var t=0,i=r.parent;for(var e=0;e<i.lines.length;++e){var n=i.lines[e];if(n==r){break}else{t+=n.height}}for(var o=i.parent;o;i=o,o=i.parent){for(var u=0;u<o.children.length;++u){var f=o.children[u];if(f==i){break}else{t+=f.height}}}return t}function ai(r){if(r.height==0){return 0}var t=r.text.length,i,e=r;while(i=Yt(e)){var n=i.find(0,true);e=n.from.line;t+=n.from.ch-n.to.ch}e=r;while(i=Xt(e)){var o=i.find(0,true);t-=e.text.length-o.from.ch;e=o.to.line;t+=e.text.length-o.to.ch}return t}function li(r){var t=r.display,i=r.doc;t.maxLine=Zr(i,i.first);t.maxLineLength=ai(t.maxLine);t.maxLineChanged=true;i.iter((function(r){var i=ai(r);if(i>t.maxLineLength){t.maxLineLength=i;t.maxLine=r}}))}var si=function(r,t,i){this.text=r;$t(this,t);this.height=i?i(this):1};si.prototype.lineNo=function(){return et(this)};yr(si);function ci(r,t,i,e){r.text=t;if(r.stateAfter){r.stateAfter=null}if(r.styles){r.styles=null}if(r.order!=null){r.order=null}Vt(r);$t(r,i);var n=e?e(r):1;if(n!=r.height){it(r,n)}}function vi(r){r.parent=null;Vt(r)}var hi={},di={};function mi(r,t){if(!r||/^\s*$/.test(r)){return null}var i=t.addModeClass?di:hi;return i[r]||(i[r]=r.replace(/\S+/g,"cm-$&"))}function pi(r,t){var i=D("span",null,null,a?"padding-right: .1px":null);var e={pre:D("pre",[i],"CodeMirror-line"),content:i,col:0,pos:0,cm:r,trailingSpace:false,splitSpaces:r.getOption("lineWrapping")};t.measure={};for(var n=0;n<=(t.rest?t.rest.length:0);n++){var o=n?t.rest[n-1]:t.line,u=void 0;e.pos=0;e.addToken=bi;if(Br(r.display.measure)&&(u=mr(o,r.doc.direction))){e.addToken=ki(e.addToken,u)}e.map=[];var f=t!=r.display.externalMeasured&&et(o);Mi(o,e,kt(r,o,f));if(o.styleClasses){if(o.styleClasses.bgClass){e.bgClass=B(o.styleClasses.bgClass,e.bgClass||"")}if(o.styleClasses.textClass){e.textClass=B(o.styleClasses.textClass,e.textClass||"")}}if(e.map.length==0){e.map.push(0,0,e.content.appendChild(Or(r.display.measure)))}if(n==0){t.measure.map=e.map;t.measure.cache={}}else{(t.measure.maps||(t.measure.maps=[])).push(e.map);(t.measure.caches||(t.measure.caches=[])).push({})}}if(a){var l=e.content.lastChild;if(/\bcm-tab\b/.test(l.className)||l.querySelector&&l.querySelector(".cm-tab")){e.content.className="cm-tab-wrap-hack"}}kr(r,"renderLine",r,t.line,e.pre);if(e.pre.className){e.textClass=B(e.pre.className,e.textClass||"")}return e}function gi(r){var t=E("span","•","cm-invalidchar");t.title="\\u"+r.charCodeAt(0).toString(16);t.setAttribute("aria-label",t.title);return t}function bi(r,t,i,e,n,o,a){if(!t){return}var l=r.splitSpaces?wi(t,r.trailingSpace):t;var s=r.cm.state.specialChars,c=false;var v;if(!s.test(t)){r.col+=t.length;v=document.createTextNode(l);r.map.push(r.pos,r.pos+t.length,v);if(u&&f<9){c=true}r.pos+=t.length}else{v=document.createDocumentFragment();var h=0;while(true){s.lastIndex=h;var d=s.exec(t);var m=d?d.index-h:t.length-h;if(m){var p=document.createTextNode(l.slice(h,h+m));if(u&&f<9){v.appendChild(E("span",[p]))}else{v.appendChild(p)}r.map.push(r.pos,r.pos+m,p);r.col+=m;r.pos+=m}if(!d){break}h+=m+1;var g=void 0;if(d[0]=="\t"){var b=r.cm.options.tabSize,w=b-r.col%b;g=v.appendChild(E("span",X(w),"cm-tab"));g.setAttribute("role","presentation");g.setAttribute("cm-text","\t");r.col+=w}else if(d[0]=="\r"||d[0]=="\n"){g=v.appendChild(E("span",d[0]=="\r"?"␍":"␤","cm-invalidchar"));g.setAttribute("cm-text",d[0]);r.col+=1}else{g=r.cm.options.specialCharPlaceholder(d[0]);g.setAttribute("cm-text",d[0]);if(u&&f<9){v.appendChild(E("span",[g]))}else{v.appendChild(g)}r.col+=1}r.map.push(r.pos,r.pos+1,g);r.pos++}}r.trailingSpace=l.charCodeAt(t.length-1)==32;if(i||e||n||c||o||a){var k=i||"";if(e){k+=e}if(n){k+=n}var C=E("span",[v],k,o);if(a){for(var M in a){if(a.hasOwnProperty(M)&&M!="style"&&M!="class"){C.setAttribute(M,a[M])}}}return r.content.appendChild(C)}r.content.appendChild(v)}function wi(r,t){if(r.length>1&&!/ /.test(r)){return r}var i=t,e="";for(var n=0;n<r.length;n++){var o=r.charAt(n);if(o==" "&&i&&(n==r.length-1||r.charCodeAt(n+1)==32)){o=" "}e+=o;i=o==" "}return e}function ki(r,t){return function(i,e,n,o,u,f,a){n=n?n+" cm-force-border":"cm-force-border";var l=i.pos,s=l+e.length;for(;;){var c=void 0;for(var v=0;v<t.length;v++){c=t[v];if(c.to>l&&c.from<=l){break}}if(c.to>=s){return r(i,e,n,o,u,f,a)}r(i,e.slice(0,c.to-l),n,o,null,f,a);o=null;e=e.slice(c.to-l);l=c.to}}}function Ci(r,t,i,e){var n=!e&&i.widgetNode;if(n){r.map.push(r.pos,r.pos+t,n)}if(!e&&r.cm.display.input.needsContentAttribute){if(!n){n=r.content.appendChild(document.createElement("span"))}n.setAttribute("cm-marker",i.id)}if(n){r.cm.display.input.setUneditable(n);r.content.appendChild(n)}r.pos+=t;r.trailingSpace=false}function Mi(r,t,i){var e=r.markedSpans,n=r.text,o=0;if(!e){for(var u=1;u<i.length;u+=2){t.addToken(t,n.slice(o,o=i[u]),mi(i[u+1],t.cm.options))}return}var f=n.length,a=0,l=1,s="",c,v;var h=0,d,m,p,g,b;for(;;){if(h==a){d=m=p=v="";b=null;g=null;h=Infinity;var w=[],k=void 0;for(var C=0;C<e.length;++C){var M=e[C],A=M.marker;if(A.type=="bookmark"&&M.from==a&&A.widgetNode){w.push(A)}else if(M.from<=a&&(M.to==null||M.to>a||A.collapsed&&M.to==a&&M.from==a)){if(M.to!=null&&M.to!=a&&h>M.to){h=M.to;m=""}if(A.className){d+=" "+A.className}if(A.css){v=(v?v+";":"")+A.css}if(A.startStyle&&M.from==a){p+=" "+A.startStyle}if(A.endStyle&&M.to==h){(k||(k=[])).push(A.endStyle,M.to)}if(A.title){(b||(b={})).title=A.title}if(A.attributes){for(var y in A.attributes){(b||(b={}))[y]=A.attributes[y]}}if(A.collapsed&&(!g||Jt(g.marker,A)<0)){g=M}}else if(M.from>a&&h>M.from){h=M.from}}if(k){for(var x=0;x<k.length;x+=2){if(k[x+1]==h){m+=" "+k[x]}}}if(!g||g.from==a){for(var L=0;L<w.length;++L){Ci(t,0,w[L])}}if(g&&(g.from||0)==a){Ci(t,(g.to==null?f+1:g.to)-a,g.marker,g.from==null);if(g.to==null){return}if(g.to==a){g=false}}}if(a>=f){break}var S=Math.min(f,h);while(true){if(s){var N=a+s.length;if(!g){var E=N>S?s.slice(0,S-a):s;t.addToken(t,E,c?c+d:d,p,a+E.length==h?m:"",v,b)}if(N>=S){s=s.slice(S-a);a=S;break}a=N;p=""}s=n.slice(o,o=i[l++]);c=mi(i[l++],t.cm.options)}}}function Ai(r,t,i){this.line=t;this.rest=ii(t);this.size=this.rest?et(q(this.rest))-i+1:1;this.node=this.text=null;this.hidden=oi(r,t)}function yi(r,t,i){var e=[],n;for(var o=t;o<i;o=n){var u=new Ai(r.doc,Zr(r.doc,o),o);n=o+u.size;e.push(u)}return e}var xi=null;function Li(r){if(xi){xi.ops.push(r)}else{r.ownsGroup=xi={ops:[r],delayedCallbacks:[]}}}function Si(r){var t=r.delayedCallbacks,i=0;do{for(;i<t.length;i++){t[i].call(null)}for(var e=0;e<r.ops.length;e++){var n=r.ops[e];if(n.cursorActivityHandlers){while(n.cursorActivityCalled<n.cursorActivityHandlers.length){n.cursorActivityHandlers[n.cursorActivityCalled++].call(null,n.cm)}}}}while(i<t.length)}function Ni(r,t){var i=r.ownsGroup;if(!i){return}try{Si(i)}finally{xi=null;t(i)}}var Ei=null;function Di(r,t){var i=br(r,t);if(!i.length){return}var e=Array.prototype.slice.call(arguments,2),n;if(xi){n=xi.delayedCallbacks}else if(Ei){n=Ei}else{n=Ei=[];setTimeout(Ti,0)}var o=function(r){n.push((function(){return i[r].apply(null,e)}))};for(var u=0;u<i.length;++u)o(u)}function Ti(){var r=Ei;Ei=null;for(var t=0;t<r.length;++t){r[t]()}}function Ii(r,t,i,e){for(var n=0;n<t.changes.length;n++){var o=t.changes[n];if(o=="text"){Ui(r,t)}else if(o=="gutter"){ji(r,t,i,e)}else if(o=="class"){zi(r,t)}else if(o=="widget"){Wi(r,t,e)}}t.changes=null}function Oi(r){if(r.node==r.text){r.node=E("div",null,null,"position: relative");if(r.text.parentNode){r.text.parentNode.replaceChild(r.node,r.text)}r.node.appendChild(r.text);if(u&&f<8){r.node.style.zIndex=2}}return r.node}function Ri(r,t){var i=t.bgClass?t.bgClass+" "+(t.line.bgClass||""):t.line.bgClass;if(i){i+=" CodeMirror-linebackground"}if(t.background){if(i){t.background.className=i}else{t.background.parentNode.removeChild(t.background);t.background=null}}else if(i){var e=Oi(t);t.background=e.insertBefore(E("div",null,i),e.firstChild);r.display.input.setUneditable(t.background)}}function Bi(r,t){var i=r.display.externalMeasured;if(i&&i.line==t.line){r.display.externalMeasured=null;t.measure=i.measure;return i.built}return pi(r,t)}function Ui(r,t){var i=t.text.className;var e=Bi(r,t);if(t.text==t.node){t.node=e.pre}t.text.parentNode.replaceChild(e.pre,t.text);t.text=e.pre;if(e.bgClass!=t.bgClass||e.textClass!=t.textClass){t.bgClass=e.bgClass;t.textClass=e.textClass;zi(r,t)}else if(i){t.text.className=i}}function zi(r,t){Ri(r,t);if(t.line.wrapClass){Oi(t).className=t.line.wrapClass}else if(t.node!=t.text){t.node.className=""}var i=t.textClass?t.textClass+" "+(t.line.textClass||""):t.line.textClass;t.text.className=i||""}function ji(r,t,i,e){if(t.gutter){t.node.removeChild(t.gutter);t.gutter=null}if(t.gutterBackground){t.node.removeChild(t.gutterBackground);t.gutterBackground=null}if(t.line.gutterClass){var n=Oi(t);t.gutterBackground=E("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(r.options.fixedGutter?e.fixedPos:-e.gutterTotalWidth)+"px; width: "+e.gutterTotalWidth+"px");r.display.input.setUneditable(t.gutterBackground);n.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(r.options.lineNumbers||o){var u=Oi(t);var f=t.gutter=E("div",null,"CodeMirror-gutter-wrapper","left: "+(r.options.fixedGutter?e.fixedPos:-e.gutterTotalWidth)+"px");f.setAttribute("aria-hidden","true");r.display.input.setUneditable(f);u.insertBefore(f,t.text);if(t.line.gutterClass){f.className+=" "+t.line.gutterClass}if(r.options.lineNumbers&&(!o||!o["CodeMirror-linenumbers"])){t.lineNumber=f.appendChild(E("div",ut(r.options,i),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+e.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+r.display.lineNumInnerWidth+"px"))}if(o){for(var a=0;a<r.display.gutterSpecs.length;++a){var l=r.display.gutterSpecs[a].className,s=o.hasOwnProperty(l)&&o[l];if(s){f.appendChild(E("div",[s],"CodeMirror-gutter-elt","left: "+e.gutterLeft[l]+"px; width: "+e.gutterWidth[l]+"px"))}}}}}function Wi(r,t,i){if(t.alignable){t.alignable=null}var e=x("CodeMirror-linewidget");for(var n=t.node.firstChild,o=void 0;n;n=o){o=n.nextSibling;if(e.test(n.className)){t.node.removeChild(n)}}Pi(r,t,i)}function Fi(r,t,i,e){var n=Bi(r,t);t.text=t.node=n.pre;if(n.bgClass){t.bgClass=n.bgClass}if(n.textClass){t.textClass=n.textClass}zi(r,t);ji(r,t,i,e);Pi(r,t,e);return t.node}function Pi(r,t,i){Gi(r,t.line,t,i,true);if(t.rest){for(var e=0;e<t.rest.length;e++){Gi(r,t.rest[e],t,i,false)}}}function Gi(r,t,i,e,n){if(!t.widgets){return}var o=Oi(i);for(var u=0,f=t.widgets;u<f.length;++u){var a=f[u],l=E("div",[a.node],"CodeMirror-linewidget"+(a.className?" "+a.className:""));if(!a.handleMouseEvents){l.setAttribute("cm-ignore-events","true")}Hi(a,l,i,e);r.display.input.setUneditable(l);if(n&&a.above){o.insertBefore(l,i.gutter||i.text)}else{o.appendChild(l)}Di(a,"redraw")}}function Hi(r,t,i,e){if(r.noHScroll){(i.alignable||(i.alignable=[])).push(t);var n=e.wrapperWidth;t.style.left=e.fixedPos+"px";if(!r.coverGutter){n-=e.gutterTotalWidth;t.style.paddingLeft=e.gutterTotalWidth+"px"}t.style.width=n+"px"}if(r.coverGutter){t.style.zIndex=5;t.style.position="relative";if(!r.noHScroll){t.style.marginLeft=-e.gutterTotalWidth+"px"}}}function Vi(r){if(r.height!=null){return r.height}var t=r.doc.cm;if(!t){return 0}if(!I(document.body,r.node)){var i="position: relative;";if(r.coverGutter){i+="margin-left: -"+t.display.gutters.offsetWidth+"px;"}if(r.noHScroll){i+="width: "+t.display.wrapper.clientWidth+"px;"}N(t.display.measure,E("div",[r.node],null,i))}return r.height=r.node.parentNode.offsetHeight}function $i(r,t){for(var i=Er(t);i!=r.wrapper;i=i.parentNode){if(!i||i.nodeType==1&&i.getAttribute("cm-ignore-events")=="true"||i.parentNode==r.sizer&&i!=r.mover){return true}}}function _i(r){return r.lineSpace.offsetTop}function Qi(r){return r.mover.offsetHeight-r.lineSpace.offsetHeight}function Ji(r){if(r.cachedPaddingH){return r.cachedPaddingH}var t=N(r.measure,E("pre","x","CodeMirror-line-like"));var i=window.getComputedStyle?window.getComputedStyle(t):t.currentStyle;var e={left:parseInt(i.paddingLeft),right:parseInt(i.paddingRight)};if(!isNaN(e.left)&&!isNaN(e.right)){r.cachedPaddingH=e}return e}function Ki(r){return V-r.display.nativeBarWidth}function Yi(r){return r.display.scroller.clientWidth-Ki(r)-r.display.barWidth}function Xi(r){return r.display.scroller.clientHeight-Ki(r)-r.display.barHeight}function qi(r,t,i){var e=r.options.lineWrapping;var n=e&&Yi(r);if(!t.measure.heights||e&&t.measure.width!=n){var o=t.measure.heights=[];if(e){t.measure.width=n;var u=t.text.firstChild.getClientRects();for(var f=0;f<u.length-1;f++){var a=u[f],l=u[f+1];if(Math.abs(a.bottom-l.bottom)>2){o.push((a.bottom+l.top)/2-i.top)}}}o.push(i.bottom-i.top)}}function Zi(r,t,i){if(r.line==t){return{map:r.measure.map,cache:r.measure.cache}}if(r.rest){for(var e=0;e<r.rest.length;e++){if(r.rest[e]==t){return{map:r.measure.maps[e],cache:r.measure.caches[e]}}}for(var n=0;n<r.rest.length;n++){if(et(r.rest[n])>i){return{map:r.measure.maps[n],cache:r.measure.caches[n],before:true}}}}}function re(r,t){t=ri(t);var i=et(t);var e=r.display.externalMeasured=new Ai(r.doc,t,i);e.lineN=i;var n=e.built=pi(r,e);e.text=n.pre;N(r.display.lineMeasure,n.pre);return e}function te(r,t,i,e){return ne(r,ee(r,t),i,e)}function ie(r,t){if(t>=r.display.viewFrom&&t<r.display.viewTo){return r.display.view[ze(r,t)]}var i=r.display.externalMeasured;if(i&&t>=i.lineN&&t<i.lineN+i.size){return i}}function ee(r,t){var i=et(t);var e=ie(r,i);if(e&&!e.text){e=null}else if(e&&e.changes){Ii(r,e,i,Ie(r));r.curOp.forceUpdate=true}if(!e){e=re(r,t)}var n=Zi(e,t,i);return{line:t,view:e,rect:null,map:n.map,cache:n.cache,before:n.before,hasHeights:false}}function ne(r,t,i,e,n){if(t.before){i=-1}var o=i+(e||""),u;if(t.cache.hasOwnProperty(o)){u=t.cache[o]}else{if(!t.rect){t.rect=t.view.text.getBoundingClientRect()}if(!t.hasHeights){qi(r,t.view,t.rect);t.hasHeights=true}u=ae(r,t,i,e);if(!u.bogus){t.cache[o]=u}}return{left:u.left,right:u.right,top:n?u.rtop:u.top,bottom:n?u.rbottom:u.bottom}}var oe={left:0,right:0,top:0,bottom:0};function ue(r,t,i){var e,n,o,u,f,a;for(var l=0;l<r.length;l+=3){f=r[l];a=r[l+1];if(t<f){n=0;o=1;u="left"}else if(t<a){n=t-f;o=n+1}else if(l==r.length-3||t==a&&r[l+3]>t){o=a-f;n=o-1;if(t>=a){u="right"}}if(n!=null){e=r[l+2];if(f==a&&i==(e.insertLeft?"left":"right")){u=i}if(i=="left"&&n==0){while(l&&r[l-2]==r[l-3]&&r[l-1].insertLeft){e=r[(l-=3)+2];u="left"}}if(i=="right"&&n==a-f){while(l<r.length-3&&r[l+3]==r[l+4]&&!r[l+5].insertLeft){e=r[(l+=3)+2];u="right"}}break}}return{node:e,start:n,end:o,collapse:u,coverStart:f,coverEnd:a}}function fe(r,t){var i=oe;if(t=="left"){for(var e=0;e<r.length;e++){if((i=r[e]).left!=i.right){break}}}else{for(var n=r.length-1;n>=0;n--){if((i=r[n]).left!=i.right){break}}}return i}function ae(r,t,i,e){var n=ue(t.map,i,e);var o=n.node,a=n.start,l=n.end,s=n.collapse;var c;if(o.nodeType==3){for(var v=0;v<4;v++){while(a&&ar(t.line.text.charAt(n.coverStart+a))){--a}while(n.coverStart+l<n.coverEnd&&ar(t.line.text.charAt(n.coverStart+l))){++l}if(u&&f<9&&a==0&&l==n.coverEnd-n.coverStart){c=o.parentNode.getBoundingClientRect()}else{c=fe(T(o,a,l).getClientRects(),e)}if(c.left||c.right||a==0){break}l=a;a=a-1;s="right"}if(u&&f<11){c=le(r.display.measure,c)}}else{if(a>0){s=e="right"}var h;if(r.options.lineWrapping&&(h=o.getClientRects()).length>1){c=h[e=="right"?h.length-1:0]}else{c=o.getBoundingClientRect()}}if(u&&f<9&&!a&&(!c||!c.left&&!c.right)){var d=o.parentNode.getClientRects()[0];if(d){c={left:d.left,right:d.left+Te(r.display),top:d.top,bottom:d.bottom}}else{c=oe}}var m=c.top-t.rect.top,p=c.bottom-t.rect.top;var g=(m+p)/2;var b=t.view.measure.heights;var w=0;for(;w<b.length-1;w++){if(g<b[w]){break}}var k=w?b[w-1]:0,C=b[w];var M={left:(s=="right"?c.right:c.left)-t.rect.left,right:(s=="left"?c.left:c.right)-t.rect.left,top:k,bottom:C};if(!c.left&&!c.right){M.bogus=true}if(!r.options.singleCursorHeightPerLine){M.rtop=m;M.rbottom=p}return M}function le(r,t){if(!window.screen||screen.logicalXDPI==null||screen.logicalXDPI==screen.deviceXDPI||!Fr(r)){return t}var i=screen.logicalXDPI/screen.deviceXDPI;var e=screen.logicalYDPI/screen.deviceYDPI;return{left:t.left*i,right:t.right*i,top:t.top*e,bottom:t.bottom*e}}function se(r){if(r.measure){r.measure.cache={};r.measure.heights=null;if(r.rest){for(var t=0;t<r.rest.length;t++){r.measure.caches[t]={}}}}}function ce(r){r.display.externalMeasure=null;S(r.display.lineMeasure);for(var t=0;t<r.display.view.length;t++){se(r.display.view[t])}}function ve(r){ce(r);r.display.cachedCharWidth=r.display.cachedTextHeight=r.display.cachedPaddingH=null;if(!r.options.lineWrapping){r.display.maxLineChanged=true}r.display.lineNumChars=null}function he(r){if(s&&g){return-(r.body.getBoundingClientRect().left-parseInt(getComputedStyle(r.body).marginLeft))}return r.defaultView.pageXOffset||(r.documentElement||r.body).scrollLeft}function de(r){if(s&&g){return-(r.body.getBoundingClientRect().top-parseInt(getComputedStyle(r.body).marginTop))}return r.defaultView.pageYOffset||(r.documentElement||r.body).scrollTop}function me(r){var t=ri(r);var i=t.widgets;var e=0;if(i){for(var n=0;n<i.length;++n){if(i[n].above){e+=Vi(i[n])}}}return e}function pe(r,t,i,e,n){if(!n){var o=me(t);i.top+=o;i.bottom+=o}if(e=="line"){return i}if(!e){e="local"}var u=fi(t);if(e=="local"){u+=_i(r.display)}else{u-=r.display.viewOffset}if(e=="page"||e=="window"){var f=r.display.lineSpace.getBoundingClientRect();u+=f.top+(e=="window"?0:de(z(r)));var a=f.left+(e=="window"?0:he(z(r)));i.left+=a;i.right+=a}i.top+=u;i.bottom+=u;return i}function ge(r,t,i){if(i=="div"){return t}var e=t.left,n=t.top;if(i=="page"){e-=he(z(r));n-=de(z(r))}else if(i=="local"||!i){var o=r.display.sizer.getBoundingClientRect();e+=o.left;n+=o.top}var u=r.display.lineSpace.getBoundingClientRect();return{left:e-u.left,top:n-u.top}}function be(r,t,i,e,n){if(!e){e=Zr(r.doc,t.line)}return pe(r,e,te(r,e,t.ch,n),i)}function we(r,t,i,e,n,o){e=e||Zr(r.doc,t.line);if(!n){n=ee(r,e)}function u(t,u){var f=ne(r,n,t,u?"right":"left",o);if(u){f.left=f.right}else{f.right=f.left}return pe(r,e,f,i)}var f=mr(e,r.doc.direction),a=t.ch,l=t.sticky;if(a>=e.text.length){a=e.text.length;l="before"}else if(a<=0){a=0;l="after"}if(!f){return u(l=="before"?a-1:a,l=="before")}function s(r,t,i){var e=f[t],n=e.level==1;return u(i?r-1:r,n!=i)}var c=hr(f,a,l);var v=vr;var h=s(a,c,l=="before");if(v!=null){h.other=s(a,v,l!="before")}return h}function ke(r,t){var i=0;t=dt(r.doc,t);if(!r.options.lineWrapping){i=Te(r.display)*t.ch}var e=Zr(r.doc,t.line);var n=fi(e)+_i(r.display);return{left:i,right:i,top:n,bottom:n+e.height}}function Ce(r,t,i,e,n){var o=ft(r,t,i);o.xRel=n;if(e){o.outside=e}return o}function Me(r,t,i){var e=r.doc;i+=r.display.viewOffset;if(i<0){return Ce(e.first,0,null,-1,-1)}var n=nt(e,i),o=e.first+e.size-1;if(n>o){return Ce(e.first+e.size-1,Zr(e,o).text.length,null,1,1)}if(t<0){t=0}var u=Zr(e,n);for(;;){var f=Le(r,u,n,t,i);var a=qt(u,f.ch+(f.xRel>0||f.outside>0?1:0));if(!a){return f}var l=a.find(1);if(l.line==n){return l}u=Zr(e,n=l.line)}}function Ae(r,t,i,e){e-=me(t);var n=t.text.length;var o=sr((function(t){return ne(r,i,t-1).bottom<=e}),n,0);n=sr((function(t){return ne(r,i,t).top>e}),o,n);return{begin:o,end:n}}function ye(r,t,i,e){if(!i){i=ee(r,t)}var n=pe(r,t,ne(r,i,e),"line").top;return Ae(r,t,i,n)}function xe(r,t,i,e){return r.bottom<=i?false:r.top>i?true:(e?r.left:r.right)>t}function Le(r,t,i,e,n){n-=fi(t);var o=ee(r,t);var u=me(t);var f=0,a=t.text.length,l=true;var s=mr(t,r.doc.direction);if(s){var c=(r.options.lineWrapping?Ne:Se)(r,t,i,o,s,e,n);l=c.level!=1;f=l?c.from:c.to-1;a=l?c.to:c.from-1}var v=null,h=null;var d=sr((function(t){var i=ne(r,o,t);i.top+=u;i.bottom+=u;if(!xe(i,e,n,false)){return false}if(i.top<=n&&i.left<=e){v=t;h=i}return true}),f,a);var m,p,g=false;if(h){var b=e-h.left<h.right-e,w=b==l;d=v+(w?0:1);p=w?"after":"before";m=b?h.left:h.right}else{if(!l&&(d==a||d==f)){d++}p=d==0?"after":d==t.text.length?"before":ne(r,o,d-(l?1:0)).bottom+u<=n==l?"after":"before";var k=we(r,ft(i,d,p),"line",t,o);m=k.left;g=n<k.top?-1:n>=k.bottom?1:0}d=lr(t.text,d,1);return Ce(i,d,p,g,e-m)}function Se(r,t,i,e,n,o,u){var f=sr((function(f){var a=n[f],l=a.level!=1;return xe(we(r,ft(i,l?a.to:a.from,l?"before":"after"),"line",t,e),o,u,true)}),0,n.length-1);var a=n[f];if(f>0){var l=a.level!=1;var s=we(r,ft(i,l?a.from:a.to,l?"after":"before"),"line",t,e);if(xe(s,o,u,true)&&s.top>u){a=n[f-1]}}return a}function Ne(r,t,i,e,n,o,u){var f=Ae(r,t,e,u);var a=f.begin;var l=f.end;if(/\s/.test(t.text.charAt(l-1))){l--}var s=null,c=null;for(var v=0;v<n.length;v++){var h=n[v];if(h.from>=l||h.to<=a){continue}var d=h.level!=1;var m=ne(r,e,d?Math.min(l,h.to)-1:Math.max(a,h.from)).right;var p=m<o?o-m+1e9:m-o;if(!s||c>p){s=h;c=p}}if(!s){s=n[n.length-1]}if(s.from<a){s={from:a,to:s.to,level:s.level}}if(s.to>l){s={from:s.from,to:l,level:s.level}}return s}var Ee;function De(r){if(r.cachedTextHeight!=null){return r.cachedTextHeight}if(Ee==null){Ee=E("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t){Ee.appendChild(document.createTextNode("x"));Ee.appendChild(E("br"))}Ee.appendChild(document.createTextNode("x"))}N(r.measure,Ee);var i=Ee.offsetHeight/50;if(i>3){r.cachedTextHeight=i}S(r.measure);return i||1}function Te(r){if(r.cachedCharWidth!=null){return r.cachedCharWidth}var t=E("span","xxxxxxxxxx");var i=E("pre",[t],"CodeMirror-line-like");N(r.measure,i);var e=t.getBoundingClientRect(),n=(e.right-e.left)/10;if(n>2){r.cachedCharWidth=n}return n||10}function Ie(r){var t=r.display,i={},e={};var n=t.gutters.clientLeft;for(var o=t.gutters.firstChild,u=0;o;o=o.nextSibling,++u){var f=r.display.gutterSpecs[u].className;i[f]=o.offsetLeft+o.clientLeft+n;e[f]=o.clientWidth}return{fixedPos:Oe(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:i,gutterWidth:e,wrapperWidth:t.wrapper.clientWidth}}function Oe(r){return r.scroller.getBoundingClientRect().left-r.sizer.getBoundingClientRect().left}function Re(r){var t=De(r.display),i=r.options.lineWrapping;var e=i&&Math.max(5,r.display.scroller.clientWidth/Te(r.display)-3);return function(n){if(oi(r.doc,n)){return 0}var o=0;if(n.widgets){for(var u=0;u<n.widgets.length;u++){if(n.widgets[u].height){o+=n.widgets[u].height}}}if(i){return o+(Math.ceil(n.text.length/e)||1)*t}else{return o+t}}}function Be(r){var t=r.doc,i=Re(r);t.iter((function(r){var t=i(r);if(t!=r.height){it(r,t)}}))}function Ue(r,t,i,e){var n=r.display;if(!i&&Er(t).getAttribute("cm-not-content")=="true"){return null}var o,u,f=n.lineSpace.getBoundingClientRect();try{o=t.clientX-f.left;u=t.clientY-f.top}catch(r){return null}var a=Me(r,o,u),l;if(e&&a.xRel>0&&(l=Zr(r.doc,a.line).text).length==a.ch){var s=P(l,l.length,r.options.tabSize)-l.length;a=ft(a.line,Math.max(0,Math.round((o-Ji(r.display).left)/Te(r.display))-s))}return a}function ze(r,t){if(t>=r.display.viewTo){return null}t-=r.display.viewFrom;if(t<0){return null}var i=r.display.view;for(var e=0;e<i.length;e++){t-=i[e].size;if(t<0){return e}}}function je(r,t,i,e){if(t==null){t=r.doc.first}if(i==null){i=r.doc.first+r.doc.size}if(!e){e=0}var n=r.display;if(e&&i<n.viewTo&&(n.updateLineNumbers==null||n.updateLineNumbers>t)){n.updateLineNumbers=t}r.curOp.viewChanged=true;if(t>=n.viewTo){if(It&&ei(r.doc,t)<n.viewTo){Fe(r)}}else if(i<=n.viewFrom){if(It&&ni(r.doc,i+e)>n.viewFrom){Fe(r)}else{n.viewFrom+=e;n.viewTo+=e}}else if(t<=n.viewFrom&&i>=n.viewTo){Fe(r)}else if(t<=n.viewFrom){var o=Pe(r,i,i+e,1);if(o){n.view=n.view.slice(o.index);n.viewFrom=o.lineN;n.viewTo+=e}else{Fe(r)}}else if(i>=n.viewTo){var u=Pe(r,t,t,-1);if(u){n.view=n.view.slice(0,u.index);n.viewTo=u.lineN}else{Fe(r)}}else{var f=Pe(r,t,t,-1);var a=Pe(r,i,i+e,1);if(f&&a){n.view=n.view.slice(0,f.index).concat(yi(r,f.lineN,a.lineN)).concat(n.view.slice(a.index));n.viewTo+=e}else{Fe(r)}}var l=n.externalMeasured;if(l){if(i<l.lineN){l.lineN+=e}else if(t<l.lineN+l.size){n.externalMeasured=null}}}function We(r,t,i){r.curOp.viewChanged=true;var e=r.display,n=r.display.externalMeasured;if(n&&t>=n.lineN&&t<n.lineN+n.size){e.externalMeasured=null}if(t<e.viewFrom||t>=e.viewTo){return}var o=e.view[ze(r,t)];if(o.node==null){return}var u=o.changes||(o.changes=[]);if(H(u,i)==-1){u.push(i)}}function Fe(r){r.display.viewFrom=r.display.viewTo=r.doc.first;r.display.view=[];r.display.viewOffset=0}function Pe(r,t,i,e){var n=ze(r,t),o,u=r.display.view;if(!It||i==r.doc.first+r.doc.size){return{index:n,lineN:i}}var f=r.display.viewFrom;for(var a=0;a<n;a++){f+=u[a].size}if(f!=t){if(e>0){if(n==u.length-1){return null}o=f+u[n].size-t;n++}else{o=f-t}t+=o;i+=o}while(ei(r.doc,i)!=i){if(n==(e<0?0:u.length-1)){return null}i+=e*u[n-(e<0?1:0)].size;n+=e}return{index:n,lineN:i}}function Ge(r,t,i){var e=r.display,n=e.view;if(n.length==0||t>=e.viewTo||i<=e.viewFrom){e.view=yi(r,t,i);e.viewFrom=t}else{if(e.viewFrom>t){e.view=yi(r,t,e.viewFrom).concat(e.view)}else if(e.viewFrom<t){e.view=e.view.slice(ze(r,t))}e.viewFrom=t;if(e.viewTo<i){e.view=e.view.concat(yi(r,e.viewTo,i))}else if(e.viewTo>i){e.view=e.view.slice(0,ze(r,i))}}e.viewTo=i}function He(r){var t=r.display.view,i=0;for(var e=0;e<t.length;e++){var n=t[e];if(!n.hidden&&(!n.node||n.changes)){++i}}return i}function Ve(r){r.display.input.showSelection(r.display.input.prepareSelection())}function $e(r,t){if(t===void 0)t=true;var i=r.doc,e={};var n=e.cursors=document.createDocumentFragment();var o=e.selection=document.createDocumentFragment();var u=r.options.$customCursor;if(u){t=true}for(var f=0;f<i.sel.ranges.length;f++){if(!t&&f==i.sel.primIndex){continue}var a=i.sel.ranges[f];if(a.from().line>=r.display.viewTo||a.to().line<r.display.viewFrom){continue}var l=a.empty();if(u){var s=u(r,a);if(s){_e(r,s,n)}}else if(l||r.options.showCursorWhenSelecting){_e(r,a.head,n)}if(!l){Je(r,a,o)}}return e}function _e(r,t,i){var e=we(r,t,"div",null,null,!r.options.singleCursorHeightPerLine);var n=i.appendChild(E("div"," ","CodeMirror-cursor"));n.style.left=e.left+"px";n.style.top=e.top+"px";n.style.height=Math.max(0,e.bottom-e.top)*r.options.cursorHeight+"px";if(/\bcm-fat-cursor\b/.test(r.getWrapperElement().className)){var o=be(r,t,"div",null,null);var u=o.right-o.left;n.style.width=(u>0?u:r.defaultCharWidth())+"px"}if(e.other){var f=i.appendChild(E("div"," ","CodeMirror-cursor CodeMirror-secondarycursor"));f.style.display="";f.style.left=e.other.left+"px";f.style.top=e.other.top+"px";f.style.height=(e.other.bottom-e.other.top)*.85+"px"}}function Qe(r,t){return r.top-t.top||r.left-t.left}function Je(r,t,i){var e=r.display,n=r.doc;var o=document.createDocumentFragment();var u=Ji(r.display),f=u.left;var a=Math.max(e.sizerWidth,Yi(r)-e.sizer.offsetLeft)-u.right;var l=n.direction=="ltr";function s(r,t,i,e){if(t<0){t=0}t=Math.round(t);e=Math.round(e);o.appendChild(E("div",null,"CodeMirror-selected","position: absolute; left: "+r+"px;\n top: "+t+"px; width: "+(i==null?a-r:i)+"px;\n height: "+(e-t)+"px"))}function c(t,i,e){var o=Zr(n,t);var u=o.text.length;var c,v;function h(i,e){return be(r,ft(t,i),"div",o,e)}function d(t,i,e){var n=ye(r,o,null,t);var u=i=="ltr"==(e=="after")?"left":"right";var f=e=="after"?n.begin:n.end-(/\s/.test(o.text.charAt(n.end-1))?2:1);return h(f,u)[u]}var m=mr(o,n.direction);cr(m,i||0,e==null?u:e,(function(r,t,n,o){var p=n=="ltr";var g=h(r,p?"left":"right");var b=h(t-1,p?"right":"left");var w=i==null&&r==0,k=e==null&&t==u;var C=o==0,M=!m||o==m.length-1;if(b.top-g.top<=3){var A=(l?w:k)&&C;var y=(l?k:w)&&M;var x=A?f:(p?g:b).left;var L=y?a:(p?b:g).right;s(x,g.top,L-x,g.bottom)}else{var S,N,E,D;if(p){S=l&&w&&C?f:g.left;N=l?a:d(r,n,"before");E=l?f:d(t,n,"after");D=l&&k&&M?a:b.right}else{S=!l?f:d(r,n,"before");N=!l&&w&&C?a:g.right;E=!l&&k&&M?f:b.left;D=!l?a:d(t,n,"after")}s(S,g.top,N-S,g.bottom);if(g.bottom<b.top){s(f,g.bottom,null,b.top)}s(E,b.top,D-E,b.bottom)}if(!c||Qe(g,c)<0){c=g}if(Qe(b,c)<0){c=b}if(!v||Qe(g,v)<0){v=g}if(Qe(b,v)<0){v=b}}));return{start:c,end:v}}var v=t.from(),h=t.to();if(v.line==h.line){c(v.line,v.ch,h.ch)}else{var d=Zr(n,v.line),m=Zr(n,h.line);var p=ri(d)==ri(m);var g=c(v.line,v.ch,p?d.text.length+1:null).end;var b=c(h.line,p?0:null,h.ch).start;if(p){if(g.top<b.top-2){s(g.right,g.top,null,g.bottom);s(f,b.top,b.left,b.bottom)}else{s(g.right,g.top,b.left-g.right,g.bottom)}}if(g.bottom<b.top){s(f,g.bottom,null,b.top)}}i.appendChild(o)}function Ke(r){if(!r.state.focused){return}var t=r.display;clearInterval(t.blinker);var i=true;t.cursorDiv.style.visibility="";if(r.options.cursorBlinkRate>0){t.blinker=setInterval((function(){if(!r.hasFocus()){Ze(r)}t.cursorDiv.style.visibility=(i=!i)?"":"hidden"}),r.options.cursorBlinkRate)}else if(r.options.cursorBlinkRate<0){t.cursorDiv.style.visibility="hidden"}}function Ye(r){if(!r.hasFocus()){r.display.input.focus();if(!r.state.focused){qe(r)}}}function Xe(r){r.state.delayingBlurEvent=true;setTimeout((function(){if(r.state.delayingBlurEvent){r.state.delayingBlurEvent=false;if(r.state.focused){Ze(r)}}}),100)}function qe(r,t){if(r.state.delayingBlurEvent&&!r.state.draggingText){r.state.delayingBlurEvent=false}if(r.options.readOnly=="nocursor"){return}if(!r.state.focused){kr(r,"focus",r,t);r.state.focused=true;R(r.display.wrapper,"CodeMirror-focused");if(!r.curOp&&r.display.selForContextMenu!=r.doc.sel){r.display.input.reset();if(a){setTimeout((function(){return r.display.input.reset(true)}),20)}}r.display.input.receivedFocus()}Ke(r)}function Ze(r,t){if(r.state.delayingBlurEvent){return}if(r.state.focused){kr(r,"blur",r,t);r.state.focused=false;L(r.display.wrapper,"CodeMirror-focused")}clearInterval(r.display.blinker);setTimeout((function(){if(!r.state.focused){r.display.shift=false}}),150)}function rn(r){var t=r.display;var i=t.lineDiv.offsetTop;var e=Math.max(0,t.scroller.getBoundingClientRect().top);var n=t.lineDiv.getBoundingClientRect().top;var o=0;for(var a=0;a<t.view.length;a++){var l=t.view[a],s=r.options.lineWrapping;var c=void 0,v=0;if(l.hidden){continue}n+=l.line.height;if(u&&f<8){var h=l.node.offsetTop+l.node.offsetHeight;c=h-i;i=h}else{var d=l.node.getBoundingClientRect();c=d.bottom-d.top;if(!s&&l.text.firstChild){v=l.text.firstChild.getBoundingClientRect().right-d.left-1}}var m=l.line.height-c;if(m>.005||m<-.005){if(n<e){o-=m}it(l.line,c);tn(l.line);if(l.rest){for(var p=0;p<l.rest.length;p++){tn(l.rest[p])}}}if(v>r.display.sizerWidth){var g=Math.ceil(v/Te(r.display));if(g>r.display.maxLineLength){r.display.maxLineLength=g;r.display.maxLine=l.line;r.display.maxLineChanged=true}}}if(Math.abs(o)>2){t.scroller.scrollTop+=o}}function tn(r){if(r.widgets){for(var t=0;t<r.widgets.length;++t){var i=r.widgets[t],e=i.node.parentNode;if(e){i.height=e.offsetHeight}}}}function en(r,t,i){var e=i&&i.top!=null?Math.max(0,i.top):r.scroller.scrollTop;e=Math.floor(e-_i(r));var n=i&&i.bottom!=null?i.bottom:e+r.wrapper.clientHeight;var o=nt(t,e),u=nt(t,n);if(i&&i.ensure){var f=i.ensure.from.line,a=i.ensure.to.line;if(f<o){o=f;u=nt(t,fi(Zr(t,f))+r.wrapper.clientHeight)}else if(Math.min(a,t.lastLine())>=u){o=nt(t,fi(Zr(t,a))-r.wrapper.clientHeight);u=a}}return{from:o,to:Math.max(u,o+1)}}function nn(r,t){if(Cr(r,"scrollCursorIntoView")){return}var i=r.display,e=i.sizer.getBoundingClientRect(),n=null;var o=i.wrapper.ownerDocument;if(t.top+e.top<0){n=true}else if(t.bottom+e.top>(o.defaultView.innerHeight||o.documentElement.clientHeight)){n=false}if(n!=null&&!m){var u=E("div","​",null,"position: absolute;\n top: "+(t.top-i.viewOffset-_i(r.display))+"px;\n height: "+(t.bottom-t.top+Ki(r)+i.barHeight)+"px;\n left: "+t.left+"px; width: "+Math.max(2,t.right-t.left)+"px;");r.display.lineSpace.appendChild(u);u.scrollIntoView(n);r.display.lineSpace.removeChild(u)}}function on(r,t,i,e){if(e==null){e=0}var n;if(!r.options.lineWrapping&&t==i){i=t.sticky=="before"?ft(t.line,t.ch+1,"before"):t;t=t.ch?ft(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t}for(var o=0;o<5;o++){var u=false;var f=we(r,t);var a=!i||i==t?f:we(r,i);n={left:Math.min(f.left,a.left),top:Math.min(f.top,a.top)-e,right:Math.max(f.left,a.left),bottom:Math.max(f.bottom,a.bottom)+e};var l=fn(r,n);var s=r.doc.scrollTop,c=r.doc.scrollLeft;if(l.scrollTop!=null){dn(r,l.scrollTop);if(Math.abs(r.doc.scrollTop-s)>1){u=true}}if(l.scrollLeft!=null){pn(r,l.scrollLeft);if(Math.abs(r.doc.scrollLeft-c)>1){u=true}}if(!u){break}}return n}function un(r,t){var i=fn(r,t);if(i.scrollTop!=null){dn(r,i.scrollTop)}if(i.scrollLeft!=null){pn(r,i.scrollLeft)}}function fn(r,t){var i=r.display,e=De(r.display);if(t.top<0){t.top=0}var n=r.curOp&&r.curOp.scrollTop!=null?r.curOp.scrollTop:i.scroller.scrollTop;var o=Xi(r),u={};if(t.bottom-t.top>o){t.bottom=t.top+o}var f=r.doc.height+Qi(i);var a=t.top<e,l=t.bottom>f-e;if(t.top<n){u.scrollTop=a?0:t.top}else if(t.bottom>n+o){var s=Math.min(t.top,(l?f:t.bottom)-o);if(s!=n){u.scrollTop=s}}var c=r.options.fixedGutter?0:i.gutters.offsetWidth;var v=r.curOp&&r.curOp.scrollLeft!=null?r.curOp.scrollLeft:i.scroller.scrollLeft-c;var h=Yi(r)-i.gutters.offsetWidth;var d=t.right-t.left>h;if(d){t.right=t.left+h}if(t.left<10){u.scrollLeft=0}else if(t.left<v){u.scrollLeft=Math.max(0,t.left+c-(d?0:10))}else if(t.right>h+v-3){u.scrollLeft=t.right+(d?0:10)-h}return u}function an(r,t){if(t==null){return}vn(r);r.curOp.scrollTop=(r.curOp.scrollTop==null?r.doc.scrollTop:r.curOp.scrollTop)+t}function ln(r){vn(r);var t=r.getCursor();r.curOp.scrollToPos={from:t,to:t,margin:r.options.cursorScrollMargin}}function sn(r,t,i){if(t!=null||i!=null){vn(r)}if(t!=null){r.curOp.scrollLeft=t}if(i!=null){r.curOp.scrollTop=i}}function cn(r,t){vn(r);r.curOp.scrollToPos=t}function vn(r){var t=r.curOp.scrollToPos;if(t){r.curOp.scrollToPos=null;var i=ke(r,t.from),e=ke(r,t.to);hn(r,i,e,t.margin)}}function hn(r,t,i,e){var n=fn(r,{left:Math.min(t.left,i.left),top:Math.min(t.top,i.top)-e,right:Math.max(t.right,i.right),bottom:Math.max(t.bottom,i.bottom)+e});sn(r,n.scrollLeft,n.scrollTop)}function dn(r,t){if(Math.abs(r.doc.scrollTop-t)<2){return}if(!i){$n(r,{top:t})}mn(r,t,true);if(i){$n(r)}zn(r,100)}function mn(r,t,i){t=Math.max(0,Math.min(r.display.scroller.scrollHeight-r.display.scroller.clientHeight,t));if(r.display.scroller.scrollTop==t&&!i){return}r.doc.scrollTop=t;r.display.scrollbars.setScrollTop(t);if(r.display.scroller.scrollTop!=t){r.display.scroller.scrollTop=t}}function pn(r,t,i,e){t=Math.max(0,Math.min(t,r.display.scroller.scrollWidth-r.display.scroller.clientWidth));if((i?t==r.doc.scrollLeft:Math.abs(r.doc.scrollLeft-t)<2)&&!e){return}r.doc.scrollLeft=t;Kn(r);if(r.display.scroller.scrollLeft!=t){r.display.scroller.scrollLeft=t}r.display.scrollbars.setScrollLeft(t)}function gn(r){var t=r.display,i=t.gutters.offsetWidth;var e=Math.round(r.doc.height+Qi(r.display));return{clientHeight:t.scroller.clientHeight,viewHeight:t.wrapper.clientHeight,scrollWidth:t.scroller.scrollWidth,clientWidth:t.scroller.clientWidth,viewWidth:t.wrapper.clientWidth,barLeft:r.options.fixedGutter?i:0,docHeight:e,scrollHeight:e+Ki(r)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:i}}var bn=function(r,t,i){this.cm=i;var e=this.vert=E("div",[E("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar");var n=this.horiz=E("div",[E("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e.tabIndex=n.tabIndex=-1;r(e);r(n);gr(e,"scroll",(function(){if(e.clientHeight){t(e.scrollTop,"vertical")}}));gr(n,"scroll",(function(){if(n.clientWidth){t(n.scrollLeft,"horizontal")}}));this.checkedZeroWidth=false;if(u&&f<8){this.horiz.style.minHeight=this.vert.style.minWidth="18px"}};bn.prototype.update=function(r){var t=r.scrollWidth>r.clientWidth+1;var i=r.scrollHeight>r.clientHeight+1;var e=r.nativeBarWidth;if(i){this.vert.style.display="block";this.vert.style.bottom=t?e+"px":"0";var n=r.viewHeight-(t?e:0);this.vert.firstChild.style.height=Math.max(0,r.scrollHeight-r.clientHeight+n)+"px"}else{this.vert.scrollTop=0;this.vert.style.display="";this.vert.firstChild.style.height="0"}if(t){this.horiz.style.display="block";this.horiz.style.right=i?e+"px":"0";this.horiz.style.left=r.barLeft+"px";var o=r.viewWidth-r.barLeft-(i?e:0);this.horiz.firstChild.style.width=Math.max(0,r.scrollWidth-r.clientWidth+o)+"px"}else{this.horiz.style.display="";this.horiz.firstChild.style.width="0"}if(!this.checkedZeroWidth&&r.clientHeight>0){if(e==0){this.zeroWidthHack()}this.checkedZeroWidth=true}return{right:i?e:0,bottom:t?e:0}};bn.prototype.setScrollLeft=function(r){if(this.horiz.scrollLeft!=r){this.horiz.scrollLeft=r}if(this.disableHoriz){this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")}};bn.prototype.setScrollTop=function(r){if(this.vert.scrollTop!=r){this.vert.scrollTop=r}if(this.disableVert){this.enableZeroWidthBar(this.vert,this.disableVert,"vert")}};bn.prototype.zeroWidthHack=function(){var r=w&&!d?"12px":"18px";this.horiz.style.height=this.vert.style.width=r;this.horiz.style.visibility=this.vert.style.visibility="hidden";this.disableHoriz=new G;this.disableVert=new G};bn.prototype.enableZeroWidthBar=function(r,t,i){r.style.visibility="";function e(){var n=r.getBoundingClientRect();var o=i=="vert"?document.elementFromPoint(n.right-1,(n.top+n.bottom)/2):document.elementFromPoint((n.right+n.left)/2,n.bottom-1);if(o!=r){r.style.visibility="hidden"}else{t.set(1e3,e)}}t.set(1e3,e)};bn.prototype.clear=function(){var r=this.horiz.parentNode;r.removeChild(this.horiz);r.removeChild(this.vert)};var wn=function(){};wn.prototype.update=function(){return{bottom:0,right:0}};wn.prototype.setScrollLeft=function(){};wn.prototype.setScrollTop=function(){};wn.prototype.clear=function(){};function kn(r,t){if(!t){t=gn(r)}var i=r.display.barWidth,e=r.display.barHeight;Cn(r,t);for(var n=0;n<4&&i!=r.display.barWidth||e!=r.display.barHeight;n++){if(i!=r.display.barWidth&&r.options.lineWrapping){rn(r)}Cn(r,gn(r));i=r.display.barWidth;e=r.display.barHeight}}function Cn(r,t){var i=r.display;var e=i.scrollbars.update(t);i.sizer.style.paddingRight=(i.barWidth=e.right)+"px";i.sizer.style.paddingBottom=(i.barHeight=e.bottom)+"px";i.heightForcer.style.borderBottom=e.bottom+"px solid transparent";if(e.right&&e.bottom){i.scrollbarFiller.style.display="block";i.scrollbarFiller.style.height=e.bottom+"px";i.scrollbarFiller.style.width=e.right+"px"}else{i.scrollbarFiller.style.display=""}if(e.bottom&&r.options.coverGutterNextToScrollbar&&r.options.fixedGutter){i.gutterFiller.style.display="block";i.gutterFiller.style.height=e.bottom+"px";i.gutterFiller.style.width=t.gutterWidth+"px"}else{i.gutterFiller.style.display=""}}var Mn={native:bn,null:wn};function An(r){if(r.display.scrollbars){r.display.scrollbars.clear();if(r.display.scrollbars.addClass){L(r.display.wrapper,r.display.scrollbars.addClass)}}r.display.scrollbars=new Mn[r.options.scrollbarStyle]((function(t){r.display.wrapper.insertBefore(t,r.display.scrollbarFiller);gr(t,"mousedown",(function(){if(r.state.focused){setTimeout((function(){return r.display.input.focus()}),0)}}));t.setAttribute("cm-not-content","true")}),(function(t,i){if(i=="horizontal"){pn(r,t)}else{dn(r,t)}}),r);if(r.display.scrollbars.addClass){R(r.display.wrapper,r.display.scrollbars.addClass)}}var yn=0;function xn(r){r.curOp={cm:r,viewChanged:false,startHeight:r.doc.height,forceUpdate:false,updateInput:0,typing:false,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:false,updateMaxLine:false,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:false,id:++yn,markArrays:null};Li(r.curOp)}function Ln(r){var t=r.curOp;if(t){Ni(t,(function(r){for(var t=0;t<r.ops.length;t++){r.ops[t].cm.curOp=null}Sn(r)}))}}function Sn(r){var t=r.ops;for(var i=0;i<t.length;i++){Nn(t[i])}for(var e=0;e<t.length;e++){En(t[e])}for(var n=0;n<t.length;n++){Dn(t[n])}for(var o=0;o<t.length;o++){Tn(t[o])}for(var u=0;u<t.length;u++){In(t[u])}}function Nn(r){var t=r.cm,i=t.display;Fn(t);if(r.updateMaxLine){li(t)}r.mustUpdate=r.viewChanged||r.forceUpdate||r.scrollTop!=null||r.scrollToPos&&(r.scrollToPos.from.line<i.viewFrom||r.scrollToPos.to.line>=i.viewTo)||i.maxLineChanged&&t.options.lineWrapping;r.update=r.mustUpdate&&new Wn(t,r.mustUpdate&&{top:r.scrollTop,ensure:r.scrollToPos},r.forceUpdate)}function En(r){r.updatedDisplay=r.mustUpdate&&Hn(r.cm,r.update)}function Dn(r){var t=r.cm,i=t.display;if(r.updatedDisplay){rn(t)}r.barMeasure=gn(t);if(i.maxLineChanged&&!t.options.lineWrapping){r.adjustWidthTo=te(t,i.maxLine,i.maxLine.text.length).left+3;t.display.sizerWidth=r.adjustWidthTo;r.barMeasure.scrollWidth=Math.max(i.scroller.clientWidth,i.sizer.offsetLeft+r.adjustWidthTo+Ki(t)+t.display.barWidth);r.maxScrollLeft=Math.max(0,i.sizer.offsetLeft+r.adjustWidthTo-Yi(t))}if(r.updatedDisplay||r.selectionChanged){r.preparedSelection=i.input.prepareSelection()}}function Tn(r){var t=r.cm;if(r.adjustWidthTo!=null){t.display.sizer.style.minWidth=r.adjustWidthTo+"px";if(r.maxScrollLeft<t.doc.scrollLeft){pn(t,Math.min(t.display.scroller.scrollLeft,r.maxScrollLeft),true)}t.display.maxLineChanged=false}var i=r.focus&&r.focus==O(z(t));if(r.preparedSelection){t.display.input.showSelection(r.preparedSelection,i)}if(r.updatedDisplay||r.startHeight!=t.doc.height){kn(t,r.barMeasure)}if(r.updatedDisplay){Jn(t,r.barMeasure)}if(r.selectionChanged){Ke(t)}if(t.state.focused&&r.updateInput){t.display.input.reset(r.typing)}if(i){Ye(r.cm)}}function In(r){var t=r.cm,i=t.display,e=t.doc;if(r.updatedDisplay){Vn(t,r.update)}if(i.wheelStartX!=null&&(r.scrollTop!=null||r.scrollLeft!=null||r.scrollToPos)){i.wheelStartX=i.wheelStartY=null}if(r.scrollTop!=null){mn(t,r.scrollTop,r.forceScroll)}if(r.scrollLeft!=null){pn(t,r.scrollLeft,true,true)}if(r.scrollToPos){var n=on(t,dt(e,r.scrollToPos.from),dt(e,r.scrollToPos.to),r.scrollToPos.margin);nn(t,n)}var o=r.maybeHiddenMarkers,u=r.maybeUnhiddenMarkers;if(o){for(var f=0;f<o.length;++f){if(!o[f].lines.length){kr(o[f],"hide")}}}if(u){for(var a=0;a<u.length;++a){if(u[a].lines.length){kr(u[a],"unhide")}}}if(i.wrapper.offsetHeight){e.scrollTop=t.display.scroller.scrollTop}if(r.changeObjs){kr(t,"changes",t,r.changeObjs)}if(r.update){r.update.finish()}}function On(r,t){if(r.curOp){return t()}xn(r);try{return t()}finally{Ln(r)}}function Rn(r,t){return function(){if(r.curOp){return t.apply(r,arguments)}xn(r);try{return t.apply(r,arguments)}finally{Ln(r)}}}function Bn(r){return function(){if(this.curOp){return r.apply(this,arguments)}xn(this);try{return r.apply(this,arguments)}finally{Ln(this)}}}function Un(r){return function(){var t=this.cm;if(!t||t.curOp){return r.apply(this,arguments)}xn(t);try{return r.apply(this,arguments)}finally{Ln(t)}}}function zn(r,t){if(r.doc.highlightFrontier<r.display.viewTo){r.state.highlight.set(t,W(jn,r))}}function jn(r){var t=r.doc;if(t.highlightFrontier>=r.display.viewTo){return}var i=+new Date+r.options.workTime;var e=Ct(r,t.highlightFrontier);var n=[];t.iter(e.line,Math.min(t.first+t.size,r.display.viewTo+500),(function(o){if(e.line>=r.display.viewFrom){var u=o.styles;var f=o.text.length>r.options.maxHighlightLength?Kr(t.mode,e.state):null;var a=wt(r,o,e,true);if(f){e.state=f}o.styles=a.styles;var l=o.styleClasses,s=a.classes;if(s){o.styleClasses=s}else if(l){o.styleClasses=null}var c=!u||u.length!=o.styles.length||l!=s&&(!l||!s||l.bgClass!=s.bgClass||l.textClass!=s.textClass);for(var v=0;!c&&v<u.length;++v){c=u[v]!=o.styles[v]}if(c){n.push(e.line)}o.stateAfter=e.save();e.nextLine()}else{if(o.text.length<=r.options.maxHighlightLength){Mt(r,o.text,e)}o.stateAfter=e.line%5==0?e.save():null;e.nextLine()}if(+new Date>i){zn(r,r.options.workDelay);return true}}));t.highlightFrontier=e.line;t.modeFrontier=Math.max(t.modeFrontier,e.line);if(n.length){On(r,(function(){for(var t=0;t<n.length;t++){We(r,n[t],"text")}}))}}var Wn=function(r,t,i){var e=r.display;this.viewport=t;this.visible=en(e,r.doc,t);this.editorIsHidden=!e.wrapper.offsetWidth;this.wrapperHeight=e.wrapper.clientHeight;this.wrapperWidth=e.wrapper.clientWidth;this.oldDisplayWidth=Yi(r);this.force=i;this.dims=Ie(r);this.events=[]};Wn.prototype.signal=function(r,t){if(Ar(r,t)){this.events.push(arguments)}};Wn.prototype.finish=function(){for(var r=0;r<this.events.length;r++){kr.apply(null,this.events[r])}};function Fn(r){var t=r.display;if(!t.scrollbarsClipped&&t.scroller.offsetWidth){t.nativeBarWidth=t.scroller.offsetWidth-t.scroller.clientWidth;t.heightForcer.style.height=Ki(r)+"px";t.sizer.style.marginBottom=-t.nativeBarWidth+"px";t.sizer.style.borderRightWidth=Ki(r)+"px";t.scrollbarsClipped=true}}function Pn(r){if(r.hasFocus()){return null}var t=O(z(r));if(!t||!I(r.display.lineDiv,t)){return null}var i={activeElt:t};if(window.getSelection){var e=j(r).getSelection();if(e.anchorNode&&e.extend&&I(r.display.lineDiv,e.anchorNode)){i.anchorNode=e.anchorNode;i.anchorOffset=e.anchorOffset;i.focusNode=e.focusNode;i.focusOffset=e.focusOffset}}return i}function Gn(r){if(!r||!r.activeElt||r.activeElt==O(r.activeElt.ownerDocument)){return}r.activeElt.focus();if(!/^(INPUT|TEXTAREA)$/.test(r.activeElt.nodeName)&&r.anchorNode&&I(document.body,r.anchorNode)&&I(document.body,r.focusNode)){var t=r.activeElt.ownerDocument;var i=t.defaultView.getSelection(),e=t.createRange();e.setEnd(r.anchorNode,r.anchorOffset);e.collapse(false);i.removeAllRanges();i.addRange(e);i.extend(r.focusNode,r.focusOffset)}}function Hn(r,t){var i=r.display,e=r.doc;if(t.editorIsHidden){Fe(r);return false}if(!t.force&&t.visible.from>=i.viewFrom&&t.visible.to<=i.viewTo&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)&&i.renderedView==i.view&&He(r)==0){return false}if(Yn(r)){Fe(r);t.dims=Ie(r)}var n=e.first+e.size;var o=Math.max(t.visible.from-r.options.viewportMargin,e.first);var u=Math.min(n,t.visible.to+r.options.viewportMargin);if(i.viewFrom<o&&o-i.viewFrom<20){o=Math.max(e.first,i.viewFrom)}if(i.viewTo>u&&i.viewTo-u<20){u=Math.min(n,i.viewTo)}if(It){o=ei(r.doc,o);u=ni(r.doc,u)}var f=o!=i.viewFrom||u!=i.viewTo||i.lastWrapHeight!=t.wrapperHeight||i.lastWrapWidth!=t.wrapperWidth;Ge(r,o,u);i.viewOffset=fi(Zr(r.doc,i.viewFrom));r.display.mover.style.top=i.viewOffset+"px";var a=He(r);if(!f&&a==0&&!t.force&&i.renderedView==i.view&&(i.updateLineNumbers==null||i.updateLineNumbers>=i.viewTo)){return false}var l=Pn(r);if(a>4){i.lineDiv.style.display="none"}_n(r,i.updateLineNumbers,t.dims);if(a>4){i.lineDiv.style.display=""}i.renderedView=i.view;Gn(l);S(i.cursorDiv);S(i.selectionDiv);i.gutters.style.height=i.sizer.style.minHeight=0;if(f){i.lastWrapHeight=t.wrapperHeight;i.lastWrapWidth=t.wrapperWidth;zn(r,400)}i.updateLineNumbers=null;return true}function Vn(r,t){var i=t.viewport;for(var e=true;;e=false){if(!e||!r.options.lineWrapping||t.oldDisplayWidth==Yi(r)){if(i&&i.top!=null){i={top:Math.min(r.doc.height+Qi(r.display)-Xi(r),i.top)}}t.visible=en(r.display,r.doc,i);if(t.visible.from>=r.display.viewFrom&&t.visible.to<=r.display.viewTo){break}}else if(e){t.visible=en(r.display,r.doc,i)}if(!Hn(r,t)){break}rn(r);var n=gn(r);Ve(r);kn(r,n);Jn(r,n);t.force=false}t.signal(r,"update",r);if(r.display.viewFrom!=r.display.reportedViewFrom||r.display.viewTo!=r.display.reportedViewTo){t.signal(r,"viewportChange",r,r.display.viewFrom,r.display.viewTo);r.display.reportedViewFrom=r.display.viewFrom;r.display.reportedViewTo=r.display.viewTo}}function $n(r,t){var i=new Wn(r,t);if(Hn(r,i)){rn(r);Vn(r,i);var e=gn(r);Ve(r);kn(r,e);Jn(r,e);i.finish()}}function _n(r,t,i){var e=r.display,n=r.options.lineNumbers;var o=e.lineDiv,u=o.firstChild;function f(t){var i=t.nextSibling;if(a&&w&&r.display.currentWheelTarget==t){t.style.display="none"}else{t.parentNode.removeChild(t)}return i}var l=e.view,s=e.viewFrom;for(var c=0;c<l.length;c++){var v=l[c];if(v.hidden);else if(!v.node||v.node.parentNode!=o){var h=Fi(r,v,s,i);o.insertBefore(h,u)}else{while(u!=v.node){u=f(u)}var d=n&&t!=null&&t<=s&&v.lineNumber;if(v.changes){if(H(v.changes,"gutter")>-1){d=false}Ii(r,v,s,i)}if(d){S(v.lineNumber);v.lineNumber.appendChild(document.createTextNode(ut(r.options,s)))}u=v.node.nextSibling}s+=v.size}while(u){u=f(u)}}function Qn(r){var t=r.gutters.offsetWidth;r.sizer.style.marginLeft=t+"px";Di(r,"gutterChanged",r)}function Jn(r,t){r.display.sizer.style.minHeight=t.docHeight+"px";r.display.heightForcer.style.top=t.docHeight+"px";r.display.gutters.style.height=t.docHeight+r.display.barHeight+Ki(r)+"px"}function Kn(r){var t=r.display,i=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!r.options.fixedGutter)){return}var e=Oe(t)-t.scroller.scrollLeft+r.doc.scrollLeft;var n=t.gutters.offsetWidth,o=e+"px";for(var u=0;u<i.length;u++){if(!i[u].hidden){if(r.options.fixedGutter){if(i[u].gutter){i[u].gutter.style.left=o}if(i[u].gutterBackground){i[u].gutterBackground.style.left=o}}var f=i[u].alignable;if(f){for(var a=0;a<f.length;a++){f[a].style.left=o}}}}if(r.options.fixedGutter){t.gutters.style.left=e+n+"px"}}function Yn(r){if(!r.options.lineNumbers){return false}var t=r.doc,i=ut(r.options,t.first+t.size-1),e=r.display;if(i.length!=e.lineNumChars){var n=e.measure.appendChild(E("div",[E("div",i)],"CodeMirror-linenumber CodeMirror-gutter-elt"));var o=n.firstChild.offsetWidth,u=n.offsetWidth-o;e.lineGutter.style.width="";e.lineNumInnerWidth=Math.max(o,e.lineGutter.offsetWidth-u)+1;e.lineNumWidth=e.lineNumInnerWidth+u;e.lineNumChars=e.lineNumInnerWidth?i.length:-1;e.lineGutter.style.width=e.lineNumWidth+"px";Qn(r.display);return true}return false}function Xn(r,t){var i=[],e=false;for(var n=0;n<r.length;n++){var o=r[n],u=null;if(typeof o!="string"){u=o.style;o=o.className}if(o=="CodeMirror-linenumbers"){if(!t){continue}else{e=true}}i.push({className:o,style:u})}if(t&&!e){i.push({className:"CodeMirror-linenumbers",style:null})}return i}function qn(r){var t=r.gutters,i=r.gutterSpecs;S(t);r.lineGutter=null;for(var e=0;e<i.length;++e){var n=i[e];var o=n.className;var u=n.style;var f=t.appendChild(E("div",null,"CodeMirror-gutter "+o));if(u){f.style.cssText=u}if(o=="CodeMirror-linenumbers"){r.lineGutter=f;f.style.width=(r.lineNumWidth||1)+"px"}}t.style.display=i.length?"":"none";Qn(r)}function Zn(r){qn(r.display);je(r);Kn(r)}function ro(r,t,e,n){var o=this;this.input=e;o.scrollbarFiller=E("div",null,"CodeMirror-scrollbar-filler");o.scrollbarFiller.setAttribute("cm-not-content","true");o.gutterFiller=E("div",null,"CodeMirror-gutter-filler");o.gutterFiller.setAttribute("cm-not-content","true");o.lineDiv=D("div",null,"CodeMirror-code");o.selectionDiv=E("div",null,null,"position: relative; z-index: 1");o.cursorDiv=E("div",null,"CodeMirror-cursors");o.measure=E("div",null,"CodeMirror-measure");o.lineMeasure=E("div",null,"CodeMirror-measure");o.lineSpace=D("div",[o.measure,o.lineMeasure,o.selectionDiv,o.cursorDiv,o.lineDiv],null,"position: relative; outline: none");var l=D("div",[o.lineSpace],"CodeMirror-lines");o.mover=E("div",[l],null,"position: relative");o.sizer=E("div",[o.mover],"CodeMirror-sizer");o.sizerWidth=null;o.heightForcer=E("div",null,null,"position: absolute; height: "+V+"px; width: 1px;");o.gutters=E("div",null,"CodeMirror-gutters");o.lineGutter=null;o.scroller=E("div",[o.sizer,o.heightForcer,o.gutters],"CodeMirror-scroll");o.scroller.setAttribute("tabIndex","-1");o.wrapper=E("div",[o.scrollbarFiller,o.gutterFiller,o.scroller],"CodeMirror");if(s&&c>=105){o.wrapper.style.clipPath="inset(0px)"}o.wrapper.setAttribute("translate","no");if(u&&f<8){o.gutters.style.zIndex=-1;o.scroller.style.paddingRight=0}if(!a&&!(i&&b)){o.scroller.draggable=true}if(r){if(r.appendChild){r.appendChild(o.wrapper)}else{r(o.wrapper)}}o.viewFrom=o.viewTo=t.first;o.reportedViewFrom=o.reportedViewTo=t.first;o.view=[];o.renderedView=null;o.externalMeasured=null;o.viewOffset=0;o.lastWrapHeight=o.lastWrapWidth=0;o.updateLineNumbers=null;o.nativeBarWidth=o.barHeight=o.barWidth=0;o.scrollbarsClipped=false;o.lineNumWidth=o.lineNumInnerWidth=o.lineNumChars=null;o.alignWidgets=false;o.cachedCharWidth=o.cachedTextHeight=o.cachedPaddingH=null;o.maxLine=null;o.maxLineLength=0;o.maxLineChanged=false;o.wheelDX=o.wheelDY=o.wheelStartX=o.wheelStartY=null;o.shift=false;o.selForContextMenu=null;o.activeTouch=null;o.gutterSpecs=Xn(n.gutters,n.lineNumbers);qn(o);e.init(o)}var to=0,io=null;if(u){io=-.53}else if(i){io=15}else if(s){io=-.7}else if(h){io=-1/3}function eo(r){var t=r.wheelDeltaX,i=r.wheelDeltaY;if(t==null&&r.detail&&r.axis==r.HORIZONTAL_AXIS){t=r.detail}if(i==null&&r.detail&&r.axis==r.VERTICAL_AXIS){i=r.detail}else if(i==null){i=r.wheelDelta}return{x:t,y:i}}function no(r){var t=eo(r);t.x*=io;t.y*=io;return t}function oo(r,t){if(s&&c==102){if(r.display.chromeScrollHack==null){r.display.sizer.style.pointerEvents="none"}else{clearTimeout(r.display.chromeScrollHack)}r.display.chromeScrollHack=setTimeout((function(){r.display.chromeScrollHack=null;r.display.sizer.style.pointerEvents=""}),100)}var e=eo(t),n=e.x,o=e.y;var u=io;if(t.deltaMode===0){n=t.deltaX;o=t.deltaY;u=1}var f=r.display,l=f.scroller;var h=l.scrollWidth>l.clientWidth;var d=l.scrollHeight>l.clientHeight;if(!(n&&h||o&&d)){return}if(o&&w&&a){r:for(var m=t.target,p=f.view;m!=l;m=m.parentNode){for(var g=0;g<p.length;g++){if(p[g].node==m){r.display.currentWheelTarget=m;break r}}}}if(n&&!i&&!v&&u!=null){if(o&&d){dn(r,Math.max(0,l.scrollTop+o*u))}pn(r,Math.max(0,l.scrollLeft+n*u));if(!o||o&&d){xr(t)}f.wheelStartX=null;return}if(o&&u!=null){var b=o*u;var k=r.doc.scrollTop,C=k+f.wrapper.clientHeight;if(b<0){k=Math.max(0,k+b-50)}else{C=Math.min(r.doc.height,C+b+50)}$n(r,{top:k,bottom:C})}if(to<20&&t.deltaMode!==0){if(f.wheelStartX==null){f.wheelStartX=l.scrollLeft;f.wheelStartY=l.scrollTop;f.wheelDX=n;f.wheelDY=o;setTimeout((function(){if(f.wheelStartX==null){return}var r=l.scrollLeft-f.wheelStartX;var t=l.scrollTop-f.wheelStartY;var i=t&&f.wheelDY&&t/f.wheelDY||r&&f.wheelDX&&r/f.wheelDX;f.wheelStartX=f.wheelStartY=null;if(!i){return}io=(io*to+i)/(to+1);++to}),200)}else{f.wheelDX+=n;f.wheelDY+=o}}}var uo=function(r,t){this.ranges=r;this.primIndex=t};uo.prototype.primary=function(){return this.ranges[this.primIndex]};uo.prototype.equals=function(r){if(r==this){return true}if(r.primIndex!=this.primIndex||r.ranges.length!=this.ranges.length){return false}for(var t=0;t<this.ranges.length;t++){var i=this.ranges[t],e=r.ranges[t];if(!lt(i.anchor,e.anchor)||!lt(i.head,e.head)){return false}}return true};uo.prototype.deepCopy=function(){var r=[];for(var t=0;t<this.ranges.length;t++){r[t]=new fo(st(this.ranges[t].anchor),st(this.ranges[t].head))}return new uo(r,this.primIndex)};uo.prototype.somethingSelected=function(){for(var r=0;r<this.ranges.length;r++){if(!this.ranges[r].empty()){return true}}return false};uo.prototype.contains=function(r,t){if(!t){t=r}for(var i=0;i<this.ranges.length;i++){var e=this.ranges[i];if(at(t,e.from())>=0&&at(r,e.to())<=0){return i}}return-1};var fo=function(r,t){this.anchor=r;this.head=t};fo.prototype.from=function(){return vt(this.anchor,this.head)};fo.prototype.to=function(){return ct(this.anchor,this.head)};fo.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function ao(r,t,i){var e=r&&r.options.selectionsMayTouch;var n=t[i];t.sort((function(r,t){return at(r.from(),t.from())}));i=H(t,n);for(var o=1;o<t.length;o++){var u=t[o],f=t[o-1];var a=at(f.to(),u.from());if(e&&!u.empty()?a>0:a>=0){var l=vt(f.from(),u.from()),s=ct(f.to(),u.to());var c=f.empty()?u.from()==u.head:f.from()==f.head;if(o<=i){--i}t.splice(--o,2,new fo(c?s:l,c?l:s))}}return new uo(t,i)}function lo(r,t){return new uo([new fo(r,t||r)],0)}function so(r){if(!r.text){return r.to}return ft(r.from.line+r.text.length-1,q(r.text).length+(r.text.length==1?r.from.ch:0))}function co(r,t){if(at(r,t.from)<0){return r}if(at(r,t.to)<=0){return so(t)}var i=r.line+t.text.length-(t.to.line-t.from.line)-1,e=r.ch;if(r.line==t.to.line){e+=so(t).ch-t.to.ch}return ft(i,e)}function vo(r,t){var i=[];for(var e=0;e<r.sel.ranges.length;e++){var n=r.sel.ranges[e];i.push(new fo(co(n.anchor,t),co(n.head,t)))}return ao(r.cm,i,r.sel.primIndex)}function ho(r,t,i){if(r.line==t.line){return ft(i.line,r.ch-t.ch+i.ch)}else{return ft(i.line+(r.line-t.line),r.ch)}}function mo(r,t,i){var e=[];var n=ft(r.first,0),o=n;for(var u=0;u<t.length;u++){var f=t[u];var a=ho(f.from,n,o);var l=ho(so(f),n,o);n=f.to;o=l;if(i=="around"){var s=r.sel.ranges[u],c=at(s.head,s.anchor)<0;e[u]=new fo(c?l:a,c?a:l)}else{e[u]=new fo(a,a)}}return new uo(e,r.sel.primIndex)}function po(r){r.doc.mode=_r(r.options,r.doc.modeOption);go(r)}function go(r){r.doc.iter((function(r){if(r.stateAfter){r.stateAfter=null}if(r.styles){r.styles=null}}));r.doc.modeFrontier=r.doc.highlightFrontier=r.doc.first;zn(r,100);r.state.modeGen++;if(r.curOp){je(r)}}function bo(r,t){return t.from.ch==0&&t.to.ch==0&&q(t.text)==""&&(!r.cm||r.cm.options.wholeLineUpdateBefore)}function wo(r,t,i,e){function n(r){return i?i[r]:null}function o(r,i,n){ci(r,i,n,e);Di(r,"change",r,t)}function u(r,t){var i=[];for(var o=r;o<t;++o){i.push(new si(l[o],n(o),e))}return i}var f=t.from,a=t.to,l=t.text;var s=Zr(r,f.line),c=Zr(r,a.line);var v=q(l),h=n(l.length-1),d=a.line-f.line;if(t.full){r.insert(0,u(0,l.length));r.remove(l.length,r.size-l.length)}else if(bo(r,t)){var m=u(0,l.length-1);o(c,c.text,h);if(d){r.remove(f.line,d)}if(m.length){r.insert(f.line,m)}}else if(s==c){if(l.length==1){o(s,s.text.slice(0,f.ch)+v+s.text.slice(a.ch),h)}else{var p=u(1,l.length-1);p.push(new si(v+s.text.slice(a.ch),h,e));o(s,s.text.slice(0,f.ch)+l[0],n(0));r.insert(f.line+1,p)}}else if(l.length==1){o(s,s.text.slice(0,f.ch)+l[0]+c.text.slice(a.ch),n(0));r.remove(f.line+1,d)}else{o(s,s.text.slice(0,f.ch)+l[0],n(0));o(c,v+c.text.slice(a.ch),h);var g=u(1,l.length-1);if(d>1){r.remove(f.line+1,d-1)}r.insert(f.line+1,g)}Di(r,"change",r,t)}function ko(r,t,i){function e(r,n,o){if(r.linked){for(var u=0;u<r.linked.length;++u){var f=r.linked[u];if(f.doc==n){continue}var a=o&&f.sharedHist;if(i&&!a){continue}t(f.doc,a);e(f.doc,r,a)}}}e(r,null,true)}function Co(r,t){if(t.cm){throw new Error("This document is already in use.")}r.doc=t;t.cm=r;Be(r);po(r);Mo(r);r.options.direction=t.direction;if(!r.options.lineWrapping){li(r)}r.options.mode=t.modeOption;je(r)}function Mo(r){(r.doc.direction=="rtl"?R:L)(r.display.lineDiv,"CodeMirror-rtl")}function Ao(r){On(r,(function(){Mo(r);je(r)}))}function yo(r){this.done=[];this.undone=[];this.undoDepth=r?r.undoDepth:Infinity;this.lastModTime=this.lastSelTime=0;this.lastOp=this.lastSelOp=null;this.lastOrigin=this.lastSelOrigin=null;this.generation=this.maxGeneration=r?r.maxGeneration:1}function xo(r,t){var i={from:st(t.from),to:so(t),text:rt(r,t.from,t.to)};Io(r,i,t.from.line,t.to.line+1);ko(r,(function(r){return Io(r,i,t.from.line,t.to.line+1)}),true);return i}function Lo(r){while(r.length){var t=q(r);if(t.ranges){r.pop()}else{break}}}function So(r,t){if(t){Lo(r.done);return q(r.done)}else if(r.done.length&&!q(r.done).ranges){return q(r.done)}else if(r.done.length>1&&!r.done[r.done.length-2].ranges){r.done.pop();return q(r.done)}}function No(r,t,i,e){var n=r.history;n.undone.length=0;var o=+new Date,u;var f;if((n.lastOp==e||n.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&n.lastModTime>o-(r.cm?r.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(u=So(n,n.lastOp==e))){f=q(u.changes);if(at(t.from,t.to)==0&&at(t.from,f.to)==0){f.to=so(t)}else{u.changes.push(xo(r,t))}}else{var a=q(n.done);if(!a||!a.ranges){To(r.sel,n.done)}u={changes:[xo(r,t)],generation:n.generation};n.done.push(u);while(n.done.length>n.undoDepth){n.done.shift();if(!n.done[0].ranges){n.done.shift()}}}n.done.push(i);n.generation=++n.maxGeneration;n.lastModTime=n.lastSelTime=o;n.lastOp=n.lastSelOp=e;n.lastOrigin=n.lastSelOrigin=t.origin;if(!f){kr(r,"historyAdded")}}function Eo(r,t,i,e){var n=t.charAt(0);return n=="*"||n=="+"&&i.ranges.length==e.ranges.length&&i.somethingSelected()==e.somethingSelected()&&new Date-r.history.lastSelTime<=(r.cm?r.cm.options.historyEventDelay:500)}function Do(r,t,i,e){var n=r.history,o=e&&e.origin;if(i==n.lastSelOp||o&&n.lastSelOrigin==o&&(n.lastModTime==n.lastSelTime&&n.lastOrigin==o||Eo(r,o,q(n.done),t))){n.done[n.done.length-1]=t}else{To(t,n.done)}n.lastSelTime=+new Date;n.lastSelOrigin=o;n.lastSelOp=i;if(e&&e.clearRedo!==false){Lo(n.undone)}}function To(r,t){var i=q(t);if(!(i&&i.ranges&&i.equals(r))){t.push(r)}}function Io(r,t,i,e){var n=t["spans_"+r.id],o=0;r.iter(Math.max(r.first,i),Math.min(r.first+r.size,e),(function(i){if(i.markedSpans){(n||(n=t["spans_"+r.id]={}))[o]=i.markedSpans}++o}))}function Oo(r){if(!r){return null}var t;for(var i=0;i<r.length;++i){if(r[i].marker.explicitlyCleared){if(!t){t=r.slice(0,i)}}else if(t){t.push(r[i])}}return!t?r:t.length?t:null}function Ro(r,t){var i=t["spans_"+r.id];if(!i){return null}var e=[];for(var n=0;n<t.text.length;++n){e.push(Oo(i[n]))}return e}function Bo(r,t){var i=Ro(r,t);var e=Pt(r,t);if(!i){return e}if(!e){return i}for(var n=0;n<i.length;++n){var o=i[n],u=e[n];if(o&&u){r:for(var f=0;f<u.length;++f){var a=u[f];for(var l=0;l<o.length;++l){if(o[l].marker==a.marker){continue r}}o.push(a)}}else if(u){i[n]=u}}return i}function Uo(r,t,i){var e=[];for(var n=0;n<r.length;++n){var o=r[n];if(o.ranges){e.push(i?uo.prototype.deepCopy.call(o):o);continue}var u=o.changes,f=[];e.push({changes:f});for(var a=0;a<u.length;++a){var l=u[a],s=void 0;f.push({from:l.from,to:l.to,text:l.text});if(t){for(var c in l){if(s=c.match(/^spans_(\d+)$/)){if(H(t,Number(s[1]))>-1){q(f)[c]=l[c];delete l[c]}}}}}}return e}function zo(r,t,i,e){if(e){var n=r.anchor;if(i){var o=at(t,n)<0;if(o!=at(i,n)<0){n=t;t=i}else if(o!=at(t,i)<0){t=i}}return new fo(n,t)}else{return new fo(i||t,t)}}function jo(r,t,i,e,n){if(n==null){n=r.cm&&(r.cm.display.shift||r.extend)}Vo(r,new uo([zo(r.sel.primary(),t,i,n)],0),e)}function Wo(r,t,i){var e=[];var n=r.cm&&(r.cm.display.shift||r.extend);for(var o=0;o<r.sel.ranges.length;o++){e[o]=zo(r.sel.ranges[o],t[o],null,n)}var u=ao(r.cm,e,r.sel.primIndex);Vo(r,u,i)}function Fo(r,t,i,e){var n=r.sel.ranges.slice(0);n[t]=i;Vo(r,ao(r.cm,n,r.sel.primIndex),e)}function Po(r,t,i,e){Vo(r,lo(t,i),e)}function Go(r,t,i){var e={ranges:t.ranges,update:function(t){this.ranges=[];for(var i=0;i<t.length;i++){this.ranges[i]=new fo(dt(r,t[i].anchor),dt(r,t[i].head))}},origin:i&&i.origin};kr(r,"beforeSelectionChange",r,e);if(r.cm){kr(r.cm,"beforeSelectionChange",r.cm,e)}if(e.ranges!=t.ranges){return ao(r.cm,e.ranges,e.ranges.length-1)}else{return t}}function Ho(r,t,i){var e=r.history.done,n=q(e);if(n&&n.ranges){e[e.length-1]=t;$o(r,t,i)}else{Vo(r,t,i)}}function Vo(r,t,i){$o(r,t,i);Do(r,r.sel,r.cm?r.cm.curOp.id:NaN,i)}function $o(r,t,i){if(Ar(r,"beforeSelectionChange")||r.cm&&Ar(r.cm,"beforeSelectionChange")){t=Go(r,t,i)}var e=i&&i.bias||(at(t.primary().head,r.sel.primary().head)<0?-1:1);_o(r,Jo(r,t,e,true));if(!(i&&i.scroll===false)&&r.cm&&r.cm.getOption("readOnly")!="nocursor"){ln(r.cm)}}function _o(r,t){if(t.equals(r.sel)){return}r.sel=t;if(r.cm){r.cm.curOp.updateInput=1;r.cm.curOp.selectionChanged=true;Mr(r.cm)}Di(r,"cursorActivity",r)}function Qo(r){_o(r,Jo(r,r.sel,null,false))}function Jo(r,t,i,e){var n;for(var o=0;o<t.ranges.length;o++){var u=t.ranges[o];var f=t.ranges.length==r.sel.ranges.length&&r.sel.ranges[o];var a=Yo(r,u.anchor,f&&f.anchor,i,e);var l=u.head==u.anchor?a:Yo(r,u.head,f&&f.head,i,e);if(n||a!=u.anchor||l!=u.head){if(!n){n=t.ranges.slice(0,o)}n[o]=new fo(a,l)}}return n?ao(r.cm,n,t.primIndex):t}function Ko(r,t,i,e,n){var o=Zr(r,t.line);if(o.markedSpans){for(var u=0;u<o.markedSpans.length;++u){var f=o.markedSpans[u],a=f.marker;var l="selectLeft"in a?!a.selectLeft:a.inclusiveLeft;var s="selectRight"in a?!a.selectRight:a.inclusiveRight;if((f.from==null||(l?f.from<=t.ch:f.from<t.ch))&&(f.to==null||(s?f.to>=t.ch:f.to>t.ch))){if(n){kr(a,"beforeCursorEnter");if(a.explicitlyCleared){if(!o.markedSpans){break}else{--u;continue}}}if(!a.atomic){continue}if(i){var c=a.find(e<0?1:-1),v=void 0;if(e<0?s:l){c=Xo(r,c,-e,c&&c.line==t.line?o:null)}if(c&&c.line==t.line&&(v=at(c,i))&&(e<0?v<0:v>0)){return Ko(r,c,t,e,n)}}var h=a.find(e<0?-1:1);if(e<0?l:s){h=Xo(r,h,e,h.line==t.line?o:null)}return h?Ko(r,h,t,e,n):null}}}return t}function Yo(r,t,i,e,n){var o=e||1;var u=Ko(r,t,i,o,n)||!n&&Ko(r,t,i,o,true)||Ko(r,t,i,-o,n)||!n&&Ko(r,t,i,-o,true);if(!u){r.cantEdit=true;return ft(r.first,0)}return u}function Xo(r,t,i,e){if(i<0&&t.ch==0){if(t.line>r.first){return dt(r,ft(t.line-1))}else{return null}}else if(i>0&&t.ch==(e||Zr(r,t.line)).text.length){if(t.line<r.first+r.size-1){return ft(t.line+1,0)}else{return null}}else{return new ft(t.line,t.ch+i)}}function qo(r){r.setSelection(ft(r.firstLine(),0),ft(r.lastLine()),_)}function Zo(r,t,i){var e={canceled:false,from:t.from,to:t.to,text:t.text,origin:t.origin,cancel:function(){return e.canceled=true}};if(i){e.update=function(t,i,n,o){if(t){e.from=dt(r,t)}if(i){e.to=dt(r,i)}if(n){e.text=n}if(o!==undefined){e.origin=o}}}kr(r,"beforeChange",r,e);if(r.cm){kr(r.cm,"beforeChange",r.cm,e)}if(e.canceled){if(r.cm){r.cm.curOp.updateInput=2}return null}return{from:e.from,to:e.to,text:e.text,origin:e.origin}}function ru(r,t,i){if(r.cm){if(!r.cm.curOp){return Rn(r.cm,ru)(r,t,i)}if(r.cm.state.suppressEdits){return}}if(Ar(r,"beforeChange")||r.cm&&Ar(r.cm,"beforeChange")){t=Zo(r,t,true);if(!t){return}}var e=Tt&&!i&&Ht(r,t.from,t.to);if(e){for(var n=e.length-1;n>=0;--n){tu(r,{from:e[n].from,to:e[n].to,text:n?[""]:t.text,origin:t.origin})}}else{tu(r,t)}}function tu(r,t){if(t.text.length==1&&t.text[0]==""&&at(t.from,t.to)==0){return}var i=vo(r,t);No(r,t,i,r.cm?r.cm.curOp.id:NaN);nu(r,t,i,Pt(r,t));var e=[];ko(r,(function(r,i){if(!i&&H(e,r.history)==-1){lu(r.history,t);e.push(r.history)}nu(r,t,null,Pt(r,t))}))}function iu(r,t,i){var e=r.cm&&r.cm.state.suppressEdits;if(e&&!i){return}var n=r.history,o,u=r.sel;var f=t=="undo"?n.done:n.undone,a=t=="undo"?n.undone:n.done;var l=0;for(;l<f.length;l++){o=f[l];if(i?o.ranges&&!o.equals(r.sel):!o.ranges){break}}if(l==f.length){return}n.lastOrigin=n.lastSelOrigin=null;for(;;){o=f.pop();if(o.ranges){To(o,a);if(i&&!o.equals(r.sel)){Vo(r,o,{clearRedo:false});return}u=o}else if(e){f.push(o);return}else{break}}var s=[];To(u,a);a.push({changes:s,generation:n.generation});n.generation=o.generation||++n.maxGeneration;var c=Ar(r,"beforeChange")||r.cm&&Ar(r.cm,"beforeChange");var v=function(i){var e=o.changes[i];e.origin=t;if(c&&!Zo(r,e,false)){f.length=0;return{}}s.push(xo(r,e));var n=i?vo(r,e):q(f);nu(r,e,n,Bo(r,e));if(!i&&r.cm){r.cm.scrollIntoView({from:e.from,to:so(e)})}var u=[];ko(r,(function(r,t){if(!t&&H(u,r.history)==-1){lu(r.history,e);u.push(r.history)}nu(r,e,null,Bo(r,e))}))};for(var h=o.changes.length-1;h>=0;--h){var d=v(h);if(d)return d.v}}function eu(r,t){if(t==0){return}r.first+=t;r.sel=new uo(Z(r.sel.ranges,(function(r){return new fo(ft(r.anchor.line+t,r.anchor.ch),ft(r.head.line+t,r.head.ch))})),r.sel.primIndex);if(r.cm){je(r.cm,r.first,r.first-t,t);for(var i=r.cm.display,e=i.viewFrom;e<i.viewTo;e++){We(r.cm,e,"gutter")}}}function nu(r,t,i,e){if(r.cm&&!r.cm.curOp){return Rn(r.cm,nu)(r,t,i,e)}if(t.to.line<r.first){eu(r,t.text.length-1-(t.to.line-t.from.line));return}if(t.from.line>r.lastLine()){return}if(t.from.line<r.first){var n=t.text.length-1-(r.first-t.from.line);eu(r,n);t={from:ft(r.first,0),to:ft(t.to.line+n,t.to.ch),text:[q(t.text)],origin:t.origin}}var o=r.lastLine();if(t.to.line>o){t={from:t.from,to:ft(o,Zr(r,o).text.length),text:[t.text[0]],origin:t.origin}}t.removed=rt(r,t.from,t.to);if(!i){i=vo(r,t)}if(r.cm){ou(r.cm,t,e)}else{wo(r,t,e)}$o(r,i,_);if(r.cantEdit&&Yo(r,ft(r.firstLine(),0))){r.cantEdit=false}}function ou(r,t,i){var e=r.doc,n=r.display,o=t.from,u=t.to;var f=false,a=o.line;if(!r.options.lineWrapping){a=et(ri(Zr(e,o.line)));e.iter(a,u.line+1,(function(r){if(r==n.maxLine){f=true;return true}}))}if(e.sel.contains(t.from,t.to)>-1){Mr(r)}wo(e,t,i,Re(r));if(!r.options.lineWrapping){e.iter(a,o.line+t.text.length,(function(r){var t=ai(r);if(t>n.maxLineLength){n.maxLine=r;n.maxLineLength=t;n.maxLineChanged=true;f=false}}));if(f){r.curOp.updateMaxLine=true}}Dt(e,o.line);zn(r,400);var l=t.text.length-(u.line-o.line)-1;if(t.full){je(r)}else if(o.line==u.line&&t.text.length==1&&!bo(r.doc,t)){We(r,o.line,"text")}else{je(r,o.line,u.line+1,l)}var s=Ar(r,"changes"),c=Ar(r,"change");if(c||s){var v={from:o,to:u,text:t.text,removed:t.removed,origin:t.origin};if(c){Di(r,"change",r,v)}if(s){(r.curOp.changeObjs||(r.curOp.changeObjs=[])).push(v)}}r.display.selForContextMenu=null}function uu(r,t,i,e,n){var o;if(!e){e=i}if(at(e,i)<0){o=[e,i],i=o[0],e=o[1]}if(typeof t=="string"){t=r.splitLines(t)}ru(r,{from:i,to:e,text:t,origin:n})}function fu(r,t,i,e){if(i<r.line){r.line+=e}else if(t<r.line){r.line=t;r.ch=0}}function au(r,t,i,e){for(var n=0;n<r.length;++n){var o=r[n],u=true;if(o.ranges){if(!o.copied){o=r[n]=o.deepCopy();o.copied=true}for(var f=0;f<o.ranges.length;f++){fu(o.ranges[f].anchor,t,i,e);fu(o.ranges[f].head,t,i,e)}continue}for(var a=0;a<o.changes.length;++a){var l=o.changes[a];if(i<l.from.line){l.from=ft(l.from.line+e,l.from.ch);l.to=ft(l.to.line+e,l.to.ch)}else if(t<=l.to.line){u=false;break}}if(!u){r.splice(0,n+1);n=0}}}function lu(r,t){var i=t.from.line,e=t.to.line,n=t.text.length-(e-i)-1;au(r.done,i,e,n);au(r.undone,i,e,n)}function su(r,t,i,e){var n=t,o=t;if(typeof t=="number"){o=Zr(r,ht(r,t))}else{n=et(t)}if(n==null){return null}if(e(o,n)&&r.cm){We(r.cm,n,i)}return o}function cu(r){this.lines=r;this.parent=null;var t=0;for(var i=0;i<r.length;++i){r[i].parent=this;t+=r[i].height}this.height=t}cu.prototype={chunkSize:function(){return this.lines.length},removeInner:function(r,t){for(var i=r,e=r+t;i<e;++i){var n=this.lines[i];this.height-=n.height;vi(n);Di(n,"delete")}this.lines.splice(r,t)},collapse:function(r){r.push.apply(r,this.lines)},insertInner:function(r,t,i){this.height+=i;this.lines=this.lines.slice(0,r).concat(t).concat(this.lines.slice(r));for(var e=0;e<t.length;++e){t[e].parent=this}},iterN:function(r,t,i){for(var e=r+t;r<e;++r){if(i(this.lines[r])){return true}}}};function vu(r){this.children=r;var t=0,i=0;for(var e=0;e<r.length;++e){var n=r[e];t+=n.chunkSize();i+=n.height;n.parent=this}this.size=t;this.height=i;this.parent=null}vu.prototype={chunkSize:function(){return this.size},removeInner:function(r,t){this.size-=t;for(var i=0;i<this.children.length;++i){var e=this.children[i],n=e.chunkSize();if(r<n){var o=Math.min(t,n-r),u=e.height;e.removeInner(r,o);this.height-=u-e.height;if(n==o){this.children.splice(i--,1);e.parent=null}if((t-=o)==0){break}r=0}else{r-=n}}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof cu))){var f=[];this.collapse(f);this.children=[new cu(f)];this.children[0].parent=this}},collapse:function(r){for(var t=0;t<this.children.length;++t){this.children[t].collapse(r)}},insertInner:function(r,t,i){this.size+=t.length;this.height+=i;for(var e=0;e<this.children.length;++e){var n=this.children[e],o=n.chunkSize();if(r<=o){n.insertInner(r,t,i);if(n.lines&&n.lines.length>50){var u=n.lines.length%25+25;for(var f=u;f<n.lines.length;){var a=new cu(n.lines.slice(f,f+=25));n.height-=a.height;this.children.splice(++e,0,a);a.parent=this}n.lines=n.lines.slice(0,u);this.maybeSpill()}break}r-=o}},maybeSpill:function(){if(this.children.length<=10){return}var r=this;do{var t=r.children.splice(r.children.length-5,5);var i=new vu(t);if(!r.parent){var e=new vu(r.children);e.parent=r;r.children=[e,i];r=e}else{r.size-=i.size;r.height-=i.height;var n=H(r.parent.children,r);r.parent.children.splice(n+1,0,i)}i.parent=r.parent}while(r.children.length>10);r.parent.maybeSpill()},iterN:function(r,t,i){for(var e=0;e<this.children.length;++e){var n=this.children[e],o=n.chunkSize();if(r<o){var u=Math.min(t,o-r);if(n.iterN(r,u,i)){return true}if((t-=u)==0){break}r=0}else{r-=o}}}};var hu=function(r,t,i){if(i){for(var e in i){if(i.hasOwnProperty(e)){this[e]=i[e]}}}this.doc=r;this.node=t};hu.prototype.clear=function(){var r=this.doc.cm,t=this.line.widgets,i=this.line,e=et(i);if(e==null||!t){return}for(var n=0;n<t.length;++n){if(t[n]==this){t.splice(n--,1)}}if(!t.length){i.widgets=null}var o=Vi(this);it(i,Math.max(0,i.height-o));if(r){On(r,(function(){du(r,i,-o);We(r,e,"widget")}));Di(r,"lineWidgetCleared",r,this,e)}};hu.prototype.changed=function(){var r=this;var t=this.height,i=this.doc.cm,e=this.line;this.height=null;var n=Vi(this)-t;if(!n){return}if(!oi(this.doc,e)){it(e,e.height+n)}if(i){On(i,(function(){i.curOp.forceUpdate=true;du(i,e,n);Di(i,"lineWidgetChanged",i,r,et(e))}))}};yr(hu);function du(r,t,i){if(fi(t)<(r.curOp&&r.curOp.scrollTop||r.doc.scrollTop)){an(r,i)}}function mu(r,t,i,e){var n=new hu(r,i,e);var o=r.cm;if(o&&n.noHScroll){o.display.alignWidgets=true}su(r,t,"widget",(function(t){var i=t.widgets||(t.widgets=[]);if(n.insertAt==null){i.push(n)}else{i.splice(Math.min(i.length,Math.max(0,n.insertAt)),0,n)}n.line=t;if(o&&!oi(r,t)){var e=fi(t)<r.scrollTop;it(t,t.height+Vi(n));if(e){an(o,n.height)}o.curOp.forceUpdate=true}return true}));if(o){Di(o,"lineWidgetAdded",o,n,typeof t=="number"?t:et(t))}return n}var pu=0;var gu=function(r,t){this.lines=[];this.type=t;this.doc=r;this.id=++pu};gu.prototype.clear=function(){if(this.explicitlyCleared){return}var r=this.doc.cm,t=r&&!r.curOp;if(t){xn(r)}if(Ar(this,"clear")){var i=this.find();if(i){Di(this,"clear",i.from,i.to)}}var e=null,n=null;for(var o=0;o<this.lines.length;++o){var u=this.lines[o];var f=Ut(u.markedSpans,this);if(r&&!this.collapsed){We(r,et(u),"text")}else if(r){if(f.to!=null){n=et(u)}if(f.from!=null){e=et(u)}}u.markedSpans=zt(u.markedSpans,f);if(f.from==null&&this.collapsed&&!oi(this.doc,u)&&r){it(u,De(r.display))}}if(r&&this.collapsed&&!r.options.lineWrapping){for(var a=0;a<this.lines.length;++a){var l=ri(this.lines[a]),s=ai(l);if(s>r.display.maxLineLength){r.display.maxLine=l;r.display.maxLineLength=s;r.display.maxLineChanged=true}}}if(e!=null&&r&&this.collapsed){je(r,e,n+1)}this.lines.length=0;this.explicitlyCleared=true;if(this.atomic&&this.doc.cantEdit){this.doc.cantEdit=false;if(r){Qo(r.doc)}}if(r){Di(r,"markerCleared",r,this,e,n)}if(t){Ln(r)}if(this.parent){this.parent.clear()}};gu.prototype.find=function(r,t){if(r==null&&this.type=="bookmark"){r=1}var i,e;for(var n=0;n<this.lines.length;++n){var o=this.lines[n];var u=Ut(o.markedSpans,this);if(u.from!=null){i=ft(t?o:et(o),u.from);if(r==-1){return i}}if(u.to!=null){e=ft(t?o:et(o),u.to);if(r==1){return e}}}return i&&{from:i,to:e}};gu.prototype.changed=function(){var r=this;var t=this.find(-1,true),i=this,e=this.doc.cm;if(!t||!e){return}On(e,(function(){var n=t.line,o=et(t.line);var u=ie(e,o);if(u){se(u);e.curOp.selectionChanged=e.curOp.forceUpdate=true}e.curOp.updateMaxLine=true;if(!oi(i.doc,n)&&i.height!=null){var f=i.height;i.height=null;var a=Vi(i)-f;if(a){it(n,n.height+a)}}Di(e,"markerChanged",e,r)}))};gu.prototype.attachLine=function(r){if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;if(!t.maybeHiddenMarkers||H(t.maybeHiddenMarkers,this)==-1){(t.maybeUnhiddenMarkers||(t.maybeUnhiddenMarkers=[])).push(this)}}this.lines.push(r)};gu.prototype.detachLine=function(r){this.lines.splice(H(this.lines,r),1);if(!this.lines.length&&this.doc.cm){var t=this.doc.cm.curOp;(t.maybeHiddenMarkers||(t.maybeHiddenMarkers=[])).push(this)}};yr(gu);function bu(r,t,i,e,n){if(e&&e.shared){return ku(r,t,i,e,n)}if(r.cm&&!r.cm.curOp){return Rn(r.cm,bu)(r,t,i,e,n)}var o=new gu(r,n),u=at(t,i);if(e){F(e,o,false)}if(u>0||u==0&&o.clearWhenEmpty!==false){return o}if(o.replacedWith){o.collapsed=true;o.widgetNode=D("span",[o.replacedWith],"CodeMirror-widget");if(!e.handleMouseEvents){o.widgetNode.setAttribute("cm-ignore-events","true")}if(e.insertLeft){o.widgetNode.insertLeft=true}}if(o.collapsed){if(Zt(r,t.line,t,i,o)||t.line!=i.line&&Zt(r,i.line,t,i,o)){throw new Error("Inserting collapsed marker partially overlapping an existing one")}Rt()}if(o.addToHistory){No(r,{from:t,to:i,origin:"markText"},r.sel,NaN)}var f=t.line,a=r.cm,l;r.iter(f,i.line+1,(function(e){if(a&&o.collapsed&&!a.options.lineWrapping&&ri(e)==a.display.maxLine){l=true}if(o.collapsed&&f!=t.line){it(e,0)}jt(e,new Bt(o,f==t.line?t.ch:null,f==i.line?i.ch:null),r.cm&&r.cm.curOp);++f}));if(o.collapsed){r.iter(t.line,i.line+1,(function(t){if(oi(r,t)){it(t,0)}}))}if(o.clearOnEnter){gr(o,"beforeCursorEnter",(function(){return o.clear()}))}if(o.readOnly){Ot();if(r.history.done.length||r.history.undone.length){r.clearHistory()}}if(o.collapsed){o.id=++pu;o.atomic=true}if(a){if(l){a.curOp.updateMaxLine=true}if(o.collapsed){je(a,t.line,i.line+1)}else if(o.className||o.startStyle||o.endStyle||o.css||o.attributes||o.title){for(var s=t.line;s<=i.line;s++){We(a,s,"text")}}if(o.atomic){Qo(a.doc)}Di(a,"markerAdded",a,o)}return o}var wu=function(r,t){this.markers=r;this.primary=t;for(var i=0;i<r.length;++i){r[i].parent=this}};wu.prototype.clear=function(){if(this.explicitlyCleared){return}this.explicitlyCleared=true;for(var r=0;r<this.markers.length;++r){this.markers[r].clear()}Di(this,"clear")};wu.prototype.find=function(r,t){return this.primary.find(r,t)};yr(wu);function ku(r,t,i,e,n){e=F(e);e.shared=false;var o=[bu(r,t,i,e,n)],u=o[0];var f=e.widgetNode;ko(r,(function(r){if(f){e.widgetNode=f.cloneNode(true)}o.push(bu(r,dt(r,t),dt(r,i),e,n));for(var a=0;a<r.linked.length;++a){if(r.linked[a].isParent){return}}u=q(o)}));return new wu(o,u)}function Cu(r){return r.findMarks(ft(r.first,0),r.clipPos(ft(r.lastLine())),(function(r){return r.parent}))}function Mu(r,t){for(var i=0;i<t.length;i++){var e=t[i],n=e.find();var o=r.clipPos(n.from),u=r.clipPos(n.to);if(at(o,u)){var f=bu(r,o,u,e.primary,e.primary.type);e.markers.push(f);f.parent=e}}}function Au(r){var t=function(t){var i=r[t],e=[i.primary.doc];ko(i.primary.doc,(function(r){return e.push(r)}));for(var n=0;n<i.markers.length;n++){var o=i.markers[n];if(H(e,o.doc)==-1){o.parent=null;i.markers.splice(n--,1)}}};for(var i=0;i<r.length;i++)t(i)}var yu=0;var xu=function(r,t,i,e,n){if(!(this instanceof xu)){return new xu(r,t,i,e,n)}if(i==null){i=0}vu.call(this,[new cu([new si("",null)])]);this.first=i;this.scrollTop=this.scrollLeft=0;this.cantEdit=false;this.cleanGeneration=1;this.modeFrontier=this.highlightFrontier=i;var o=ft(i,0);this.sel=lo(o);this.history=new yo(null);this.id=++yu;this.modeOption=t;this.lineSep=e;this.direction=n=="rtl"?"rtl":"ltr";this.extend=false;if(typeof r=="string"){r=this.splitLines(r)}wo(this,{from:o,to:o,text:r});Vo(this,lo(o),_)};xu.prototype=ir(vu.prototype,{constructor:xu,iter:function(r,t,i){if(i){this.iterN(r-this.first,t-r,i)}else{this.iterN(this.first,this.first+this.size,r)}},insert:function(r,t){var i=0;for(var e=0;e<t.length;++e){i+=t[e].height}this.insertInner(r-this.first,t,i)},remove:function(r,t){this.removeInner(r-this.first,t)},getValue:function(r){var t=tt(this,this.first,this.first+this.size);if(r===false){return t}return t.join(r||this.lineSeparator())},setValue:Un((function(r){var t=ft(this.first,0),i=this.first+this.size-1;ru(this,{from:t,to:ft(i,Zr(this,i).text.length),text:this.splitLines(r),origin:"setValue",full:true},true);if(this.cm){sn(this.cm,0,0)}Vo(this,lo(t),_)})),replaceRange:function(r,t,i,e){t=dt(this,t);i=i?dt(this,i):t;uu(this,r,t,i,e)},getRange:function(r,t,i){var e=rt(this,dt(this,r),dt(this,t));if(i===false){return e}if(i===""){return e.join("")}return e.join(i||this.lineSeparator())},getLine:function(r){var t=this.getLineHandle(r);return t&&t.text},getLineHandle:function(r){if(ot(this,r)){return Zr(this,r)}},getLineNumber:function(r){return et(r)},getLineHandleVisualStart:function(r){if(typeof r=="number"){r=Zr(this,r)}return ri(r)},lineCount:function(){return this.size},firstLine:function(){return this.first},lastLine:function(){return this.first+this.size-1},clipPos:function(r){return dt(this,r)},getCursor:function(r){var t=this.sel.primary(),i;if(r==null||r=="head"){i=t.head}else if(r=="anchor"){i=t.anchor}else if(r=="end"||r=="to"||r===false){i=t.to()}else{i=t.from()}return i},listSelections:function(){return this.sel.ranges},somethingSelected:function(){return this.sel.somethingSelected()},setCursor:Un((function(r,t,i){Po(this,dt(this,typeof r=="number"?ft(r,t||0):r),null,i)})),setSelection:Un((function(r,t,i){Po(this,dt(this,r),dt(this,t||r),i)})),extendSelection:Un((function(r,t,i){jo(this,dt(this,r),t&&dt(this,t),i)})),extendSelections:Un((function(r,t){Wo(this,pt(this,r),t)})),extendSelectionsBy:Un((function(r,t){var i=Z(this.sel.ranges,r);Wo(this,pt(this,i),t)})),setSelections:Un((function(r,t,i){if(!r.length){return}var e=[];for(var n=0;n<r.length;n++){e[n]=new fo(dt(this,r[n].anchor),dt(this,r[n].head||r[n].anchor))}if(t==null){t=Math.min(r.length-1,this.sel.primIndex)}Vo(this,ao(this.cm,e,t),i)})),addSelection:Un((function(r,t,i){var e=this.sel.ranges.slice(0);e.push(new fo(dt(this,r),dt(this,t||r)));Vo(this,ao(this.cm,e,e.length-1),i)})),getSelection:function(r){var t=this.sel.ranges,i;for(var e=0;e<t.length;e++){var n=rt(this,t[e].from(),t[e].to());i=i?i.concat(n):n}if(r===false){return i}else{return i.join(r||this.lineSeparator())}},getSelections:function(r){var t=[],i=this.sel.ranges;for(var e=0;e<i.length;e++){var n=rt(this,i[e].from(),i[e].to());if(r!==false){n=n.join(r||this.lineSeparator())}t[e]=n}return t},replaceSelection:function(r,t,i){var e=[];for(var n=0;n<this.sel.ranges.length;n++){e[n]=r}this.replaceSelections(e,t,i||"+input")},replaceSelections:Un((function(r,t,i){var e=[],n=this.sel;for(var o=0;o<n.ranges.length;o++){var u=n.ranges[o];e[o]={from:u.from(),to:u.to(),text:this.splitLines(r[o]),origin:i}}var f=t&&t!="end"&&mo(this,e,t);for(var a=e.length-1;a>=0;a--){ru(this,e[a])}if(f){Ho(this,f)}else if(this.cm){ln(this.cm)}})),undo:Un((function(){iu(this,"undo")})),redo:Un((function(){iu(this,"redo")})),undoSelection:Un((function(){iu(this,"undo",true)})),redoSelection:Un((function(){iu(this,"redo",true)})),setExtending:function(r){this.extend=r},getExtending:function(){return this.extend},historySize:function(){var r=this.history,t=0,i=0;for(var e=0;e<r.done.length;e++){if(!r.done[e].ranges){++t}}for(var n=0;n<r.undone.length;n++){if(!r.undone[n].ranges){++i}}return{undo:t,redo:i}},clearHistory:function(){var r=this;this.history=new yo(this.history);ko(this,(function(t){return t.history=r.history}),true)},markClean:function(){this.cleanGeneration=this.changeGeneration(true)},changeGeneration:function(r){if(r){this.history.lastOp=this.history.lastSelOp=this.history.lastOrigin=null}return this.history.generation},isClean:function(r){return this.history.generation==(r||this.cleanGeneration)},getHistory:function(){return{done:Uo(this.history.done),undone:Uo(this.history.undone)}},setHistory:function(r){var t=this.history=new yo(this.history);t.done=Uo(r.done.slice(0),null,true);t.undone=Uo(r.undone.slice(0),null,true)},setGutterMarker:Un((function(r,t,i){return su(this,r,"gutter",(function(r){var e=r.gutterMarkers||(r.gutterMarkers={});e[t]=i;if(!i&&ur(e)){r.gutterMarkers=null}return true}))})),clearGutter:Un((function(r){var t=this;this.iter((function(i){if(i.gutterMarkers&&i.gutterMarkers[r]){su(t,i,"gutter",(function(){i.gutterMarkers[r]=null;if(ur(i.gutterMarkers)){i.gutterMarkers=null}return true}))}}))})),lineInfo:function(r){var t;if(typeof r=="number"){if(!ot(this,r)){return null}t=r;r=Zr(this,r);if(!r){return null}}else{t=et(r);if(t==null){return null}}return{line:t,handle:r,text:r.text,gutterMarkers:r.gutterMarkers,textClass:r.textClass,bgClass:r.bgClass,wrapClass:r.wrapClass,widgets:r.widgets}},addLineClass:Un((function(r,t,i){return su(this,r,t=="gutter"?"gutter":"class",(function(r){var e=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";if(!r[e]){r[e]=i}else if(x(i).test(r[e])){return false}else{r[e]+=" "+i}return true}))})),removeLineClass:Un((function(r,t,i){return su(this,r,t=="gutter"?"gutter":"class",(function(r){var e=t=="text"?"textClass":t=="background"?"bgClass":t=="gutter"?"gutterClass":"wrapClass";var n=r[e];if(!n){return false}else if(i==null){r[e]=null}else{var o=n.match(x(i));if(!o){return false}var u=o.index+o[0].length;r[e]=n.slice(0,o.index)+(!o.index||u==n.length?"":" ")+n.slice(u)||null}return true}))})),addLineWidget:Un((function(r,t,i){return mu(this,r,t,i)})),removeLineWidget:function(r){r.clear()},markText:function(r,t,i){return bu(this,dt(this,r),dt(this,t),i,i&&i.type||"range")},setBookmark:function(r,t){var i={replacedWith:t&&(t.nodeType==null?t.widget:t),insertLeft:t&&t.insertLeft,clearWhenEmpty:false,shared:t&&t.shared,handleMouseEvents:t&&t.handleMouseEvents};r=dt(this,r);return bu(this,r,r,i,"bookmark")},findMarksAt:function(r){r=dt(this,r);var t=[],i=Zr(this,r.line).markedSpans;if(i){for(var e=0;e<i.length;++e){var n=i[e];if((n.from==null||n.from<=r.ch)&&(n.to==null||n.to>=r.ch)){t.push(n.marker.parent||n.marker)}}}return t},findMarks:function(r,t,i){r=dt(this,r);t=dt(this,t);var e=[],n=r.line;this.iter(r.line,t.line+1,(function(o){var u=o.markedSpans;if(u){for(var f=0;f<u.length;f++){var a=u[f];if(!(a.to!=null&&n==r.line&&r.ch>=a.to||a.from==null&&n!=r.line||a.from!=null&&n==t.line&&a.from>=t.ch)&&(!i||i(a.marker))){e.push(a.marker.parent||a.marker)}}}++n}));return e},getAllMarks:function(){var r=[];this.iter((function(t){var i=t.markedSpans;if(i){for(var e=0;e<i.length;++e){if(i[e].from!=null){r.push(i[e].marker)}}}}));return r},posFromIndex:function(r){var t,i=this.first,e=this.lineSeparator().length;this.iter((function(n){var o=n.text.length+e;if(o>r){t=r;return true}r-=o;++i}));return dt(this,ft(i,t))},indexFromPos:function(r){r=dt(this,r);var t=r.ch;if(r.line<this.first||r.ch<0){return 0}var i=this.lineSeparator().length;this.iter(this.first,r.line,(function(r){t+=r.text.length+i}));return t},copy:function(r){var t=new xu(tt(this,this.first,this.first+this.size),this.modeOption,this.first,this.lineSep,this.direction);t.scrollTop=this.scrollTop;t.scrollLeft=this.scrollLeft;t.sel=this.sel;t.extend=false;if(r){t.history.undoDepth=this.history.undoDepth;t.setHistory(this.getHistory())}return t},linkedDoc:function(r){if(!r){r={}}var t=this.first,i=this.first+this.size;if(r.from!=null&&r.from>t){t=r.from}if(r.to!=null&&r.to<i){i=r.to}var e=new xu(tt(this,t,i),r.mode||this.modeOption,t,this.lineSep,this.direction);if(r.sharedHist){e.history=this.history}(this.linked||(this.linked=[])).push({doc:e,sharedHist:r.sharedHist});e.linked=[{doc:this,isParent:true,sharedHist:r.sharedHist}];Mu(e,Cu(this));return e},unlinkDoc:function(r){if(r instanceof Ff){r=r.doc}if(this.linked){for(var t=0;t<this.linked.length;++t){var i=this.linked[t];if(i.doc!=r){continue}this.linked.splice(t,1);r.unlinkDoc(this);Au(Cu(this));break}}if(r.history==this.history){var e=[r.id];ko(r,(function(r){return e.push(r.id)}),true);r.history=new yo(null);r.history.done=Uo(this.history.done,e);r.history.undone=Uo(this.history.undone,e)}},iterLinkedDocs:function(r){ko(this,r)},getMode:function(){return this.mode},getEditor:function(){return this.cm},splitLines:function(r){if(this.lineSep){return r.split(this.lineSep)}return Ur(r)},lineSeparator:function(){return this.lineSep||"\n"},setDirection:Un((function(r){if(r!="rtl"){r="ltr"}if(r==this.direction){return}this.direction=r;this.iter((function(r){return r.order=null}));if(this.cm){Ao(this.cm)}}))});xu.prototype.eachLine=xu.prototype.iter;var Lu=0;function Su(r){var t=this;Du(t);if(Cr(t,r)||$i(t.display,r)){return}xr(r);if(u){Lu=+new Date}var i=Ue(t,r,true),e=r.dataTransfer.files;if(!i||t.isReadOnly()){return}if(e&&e.length&&window.FileReader&&window.File){var n=e.length,o=Array(n),f=0;var a=function(){if(++f==n){Rn(t,(function(){i=dt(t.doc,i);var r={from:i,to:i,text:t.doc.splitLines(o.filter((function(r){return r!=null})).join(t.doc.lineSeparator())),origin:"paste"};ru(t.doc,r);Ho(t.doc,lo(dt(t.doc,i),dt(t.doc,so(r))))}))()}};var l=function(r,i){if(t.options.allowDropFileTypes&&H(t.options.allowDropFileTypes,r.type)==-1){a();return}var e=new FileReader;e.onerror=function(){return a()};e.onload=function(){var r=e.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(r)){a();return}o[i]=r;a()};e.readAsText(r)};for(var s=0;s<e.length;s++){l(e[s],s)}}else{if(t.state.draggingText&&t.doc.sel.contains(i)>-1){t.state.draggingText(r);setTimeout((function(){return t.display.input.focus()}),20);return}try{var c=r.dataTransfer.getData("Text");if(c){var v;if(t.state.draggingText&&!t.state.draggingText.copy){v=t.listSelections()}$o(t.doc,lo(i,i));if(v){for(var h=0;h<v.length;++h){uu(t.doc,"",v[h].anchor,v[h].head,"drag")}}t.replaceSelection(c,"around","paste");t.display.input.focus()}}catch(r){}}}function Nu(r,t){if(u&&(!r.state.draggingText||+new Date-Lu<100)){Nr(t);return}if(Cr(r,t)||$i(r.display,t)){return}t.dataTransfer.setData("Text",r.getSelection());t.dataTransfer.effectAllowed="copyMove";if(t.dataTransfer.setDragImage&&!h){var i=E("img",null,null,"position: fixed; left: 0; top: 0;");i.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";if(v){i.width=i.height=1;r.display.wrapper.appendChild(i);i._top=i.offsetTop}t.dataTransfer.setDragImage(i,0,0);if(v){i.parentNode.removeChild(i)}}}function Eu(r,t){var i=Ue(r,t);if(!i){return}var e=document.createDocumentFragment();_e(r,i,e);if(!r.display.dragCursor){r.display.dragCursor=E("div",null,"CodeMirror-cursors CodeMirror-dragcursors");r.display.lineSpace.insertBefore(r.display.dragCursor,r.display.cursorDiv)}N(r.display.dragCursor,e)}function Du(r){if(r.display.dragCursor){r.display.lineSpace.removeChild(r.display.dragCursor);r.display.dragCursor=null}}function Tu(r){if(!document.getElementsByClassName){return}var t=document.getElementsByClassName("CodeMirror"),i=[];for(var e=0;e<t.length;e++){var n=t[e].CodeMirror;if(n){i.push(n)}}if(i.length){i[0].operation((function(){for(var t=0;t<i.length;t++){r(i[t])}}))}}var Iu=false;function Ou(){if(Iu){return}Ru();Iu=true}function Ru(){var r;gr(window,"resize",(function(){if(r==null){r=setTimeout((function(){r=null;Tu(Bu)}),100)}}));gr(window,"blur",(function(){return Tu(Ze)}))}function Bu(r){var t=r.display;t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null;t.scrollbarsClipped=false;r.setSize()}var Uu={3:"Pause",8:"Backspace",9:"Tab",13:"Enter",16:"Shift",17:"Ctrl",18:"Alt",19:"Pause",20:"CapsLock",27:"Esc",32:"Space",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"Left",38:"Up",39:"Right",40:"Down",44:"PrintScrn",45:"Insert",46:"Delete",59:";",61:"=",91:"Mod",92:"Mod",93:"Mod",106:"*",107:"=",109:"-",110:".",111:"/",145:"ScrollLock",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'",224:"Mod",63232:"Up",63233:"Down",63234:"Left",63235:"Right",63272:"Delete",63273:"Home",63275:"End",63276:"PageUp",63277:"PageDown",63302:"Insert"};for(var zu=0;zu<10;zu++){Uu[zu+48]=Uu[zu+96]=String(zu)}for(var ju=65;ju<=90;ju++){Uu[ju]=String.fromCharCode(ju)}for(var Wu=1;Wu<=12;Wu++){Uu[Wu+111]=Uu[Wu+63235]="F"+Wu}var Fu={};Fu.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"};Fu.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"};Fu.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars","Ctrl-O":"openLine"};Fu.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]};Fu["default"]=w?Fu.macDefault:Fu.pcDefault;function Pu(r){var t=r.split(/-(?!$)/);r=t[t.length-1];var i,e,n,o;for(var u=0;u<t.length-1;u++){var f=t[u];if(/^(cmd|meta|m)$/i.test(f)){o=true}else if(/^a(lt)?$/i.test(f)){i=true}else if(/^(c|ctrl|control)$/i.test(f)){e=true}else if(/^s(hift)?$/i.test(f)){n=true}else{throw new Error("Unrecognized modifier name: "+f)}}if(i){r="Alt-"+r}if(e){r="Ctrl-"+r}if(o){r="Cmd-"+r}if(n){r="Shift-"+r}return r}function Gu(r){var t={};for(var i in r){if(r.hasOwnProperty(i)){var e=r[i];if(/^(name|fallthrough|(de|at)tach)$/.test(i)){continue}if(e=="..."){delete r[i];continue}var n=Z(i.split(" "),Pu);for(var o=0;o<n.length;o++){var u=void 0,f=void 0;if(o==n.length-1){f=n.join(" ");u=e}else{f=n.slice(0,o+1).join(" ");u="..."}var a=t[f];if(!a){t[f]=u}else if(a!=u){throw new Error("Inconsistent bindings for "+f)}}delete r[i]}}for(var l in t){r[l]=t[l]}return r}function Hu(r,t,i,e){t=Qu(t);var n=t.call?t.call(r,e):t[r];if(n===false){return"nothing"}if(n==="..."){return"multi"}if(n!=null&&i(n)){return"handled"}if(t.fallthrough){if(Object.prototype.toString.call(t.fallthrough)!="[object Array]"){return Hu(r,t.fallthrough,i,e)}for(var o=0;o<t.fallthrough.length;o++){var u=Hu(r,t.fallthrough[o],i,e);if(u){return u}}}}function Vu(r){var t=typeof r=="string"?r:Uu[r.keyCode];return t=="Ctrl"||t=="Alt"||t=="Shift"||t=="Mod"}function $u(r,t,i){var e=r;if(t.altKey&&e!="Alt"){r="Alt-"+r}if((A?t.metaKey:t.ctrlKey)&&e!="Ctrl"){r="Ctrl-"+r}if((A?t.ctrlKey:t.metaKey)&&e!="Mod"){r="Cmd-"+r}if(!i&&t.shiftKey&&e!="Shift"){r="Shift-"+r}return r}function _u(r,t){if(v&&r.keyCode==34&&r["char"]){return false}var i=Uu[r.keyCode];if(i==null||r.altGraphKey){return false}if(r.keyCode==3&&r.code){i=r.code}return $u(i,r,t)}function Qu(r){return typeof r=="string"?Fu[r]:r}function Ju(r,t){var i=r.doc.sel.ranges,e=[];for(var n=0;n<i.length;n++){var o=t(i[n]);while(e.length&&at(o.from,q(e).to)<=0){var u=e.pop();if(at(u.from,o.from)<0){o.from=u.from;break}}e.push(o)}On(r,(function(){for(var t=e.length-1;t>=0;t--){uu(r.doc,"",e[t].from,e[t].to,"+delete")}ln(r)}))}function Ku(r,t,i){var e=lr(r.text,t+i,i);return e<0||e>r.text.length?null:e}function Yu(r,t,i){var e=Ku(r,t.ch,i);return e==null?null:new ft(t.line,e,i<0?"after":"before")}function Xu(r,t,i,e,n){if(r){if(t.doc.direction=="rtl"){n=-n}var o=mr(i,t.doc.direction);if(o){var u=n<0?q(o):o[0];var f=n<0==(u.level==1);var a=f?"after":"before";var l;if(u.level>0||t.doc.direction=="rtl"){var s=ee(t,i);l=n<0?i.text.length-1:0;var c=ne(t,s,l).top;l=sr((function(r){return ne(t,s,r).top==c}),n<0==(u.level==1)?u.from:u.to-1,l);if(a=="before"){l=Ku(i,l,1)}}else{l=n<0?u.to:u.from}return new ft(e,l,a)}}return new ft(e,n<0?i.text.length:0,n<0?"before":"after")}function qu(r,t,i,e){var n=mr(t,r.doc.direction);if(!n){return Yu(t,i,e)}if(i.ch>=t.text.length){i.ch=t.text.length;i.sticky="before"}else if(i.ch<=0){i.ch=0;i.sticky="after"}var o=hr(n,i.ch,i.sticky),u=n[o];if(r.doc.direction=="ltr"&&u.level%2==0&&(e>0?u.to>i.ch:u.from<i.ch)){return Yu(t,i,e)}var f=function(r,i){return Ku(t,r instanceof ft?r.ch:r,i)};var a;var l=function(i){if(!r.options.lineWrapping){return{begin:0,end:t.text.length}}a=a||ee(r,t);return ye(r,t,a,i)};var s=l(i.sticky=="before"?f(i,-1):i.ch);if(r.doc.direction=="rtl"||u.level==1){var c=u.level==1==e<0;var v=f(i,c?1:-1);if(v!=null&&(!c?v>=u.from&&v>=s.begin:v<=u.to&&v<=s.end)){var h=c?"before":"after";return new ft(i.line,v,h)}}var d=function(r,t,e){var o=function(r,t){return t?new ft(i.line,f(r,1),"before"):new ft(i.line,r,"after")};for(;r>=0&&r<n.length;r+=t){var u=n[r];var a=t>0==(u.level!=1);var l=a?e.begin:f(e.end,-1);if(u.from<=l&&l<u.to){return o(l,a)}l=a?u.from:f(u.to,-1);if(e.begin<=l&&l<e.end){return o(l,a)}}};var m=d(o+e,e,s);if(m){return m}var p=e>0?s.end:f(s.begin,-1);if(p!=null&&!(e>0&&p==t.text.length)){m=d(e>0?0:n.length-1,e,l(p));if(m){return m}}return null}var Zu={selectAll:qo,singleSelection:function(r){return r.setSelection(r.getCursor("anchor"),r.getCursor("head"),_)},killLine:function(r){return Ju(r,(function(t){if(t.empty()){var i=Zr(r.doc,t.head.line).text.length;if(t.head.ch==i&&t.head.line<r.lastLine()){return{from:t.head,to:ft(t.head.line+1,0)}}else{return{from:t.head,to:ft(t.head.line,i)}}}else{return{from:t.from(),to:t.to()}}}))},deleteLine:function(r){return Ju(r,(function(t){return{from:ft(t.from().line,0),to:dt(r.doc,ft(t.to().line+1,0))}}))},delLineLeft:function(r){return Ju(r,(function(r){return{from:ft(r.from().line,0),to:r.from()}}))},delWrappedLineLeft:function(r){return Ju(r,(function(t){var i=r.charCoords(t.head,"div").top+5;var e=r.coordsChar({left:0,top:i},"div");return{from:e,to:t.from()}}))},delWrappedLineRight:function(r){return Ju(r,(function(t){var i=r.charCoords(t.head,"div").top+5;var e=r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:i},"div");return{from:t.from(),to:e}}))},undo:function(r){return r.undo()},redo:function(r){return r.redo()},undoSelection:function(r){return r.undoSelection()},redoSelection:function(r){return r.redoSelection()},goDocStart:function(r){return r.extendSelection(ft(r.firstLine(),0))},goDocEnd:function(r){return r.extendSelection(ft(r.lastLine()))},goLineStart:function(r){return r.extendSelectionsBy((function(t){return rf(r,t.head.line)}),{origin:"+move",bias:1})},goLineStartSmart:function(r){return r.extendSelectionsBy((function(t){return ef(r,t.head)}),{origin:"+move",bias:1})},goLineEnd:function(r){return r.extendSelectionsBy((function(t){return tf(r,t.head.line)}),{origin:"+move",bias:-1})},goLineRight:function(r){return r.extendSelectionsBy((function(t){var i=r.cursorCoords(t.head,"div").top+5;return r.coordsChar({left:r.display.lineDiv.offsetWidth+100,top:i},"div")}),J)},goLineLeft:function(r){return r.extendSelectionsBy((function(t){var i=r.cursorCoords(t.head,"div").top+5;return r.coordsChar({left:0,top:i},"div")}),J)},goLineLeftSmart:function(r){return r.extendSelectionsBy((function(t){var i=r.cursorCoords(t.head,"div").top+5;var e=r.coordsChar({left:0,top:i},"div");if(e.ch<r.getLine(e.line).search(/\S/)){return ef(r,t.head)}return e}),J)},goLineUp:function(r){return r.moveV(-1,"line")},goLineDown:function(r){return r.moveV(1,"line")},goPageUp:function(r){return r.moveV(-1,"page")},goPageDown:function(r){return r.moveV(1,"page")},goCharLeft:function(r){return r.moveH(-1,"char")},goCharRight:function(r){return r.moveH(1,"char")},goColumnLeft:function(r){return r.moveH(-1,"column")},goColumnRight:function(r){return r.moveH(1,"column")},goWordLeft:function(r){return r.moveH(-1,"word")},goGroupRight:function(r){return r.moveH(1,"group")},goGroupLeft:function(r){return r.moveH(-1,"group")},goWordRight:function(r){return r.moveH(1,"word")},delCharBefore:function(r){return r.deleteH(-1,"codepoint")},delCharAfter:function(r){return r.deleteH(1,"char")},delWordBefore:function(r){return r.deleteH(-1,"word")},delWordAfter:function(r){return r.deleteH(1,"word")},delGroupBefore:function(r){return r.deleteH(-1,"group")},delGroupAfter:function(r){return r.deleteH(1,"group")},indentAuto:function(r){return r.indentSelection("smart")},indentMore:function(r){return r.indentSelection("add")},indentLess:function(r){return r.indentSelection("subtract")},insertTab:function(r){return r.replaceSelection("\t")},insertSoftTab:function(r){var t=[],i=r.listSelections(),e=r.options.tabSize;for(var n=0;n<i.length;n++){var o=i[n].from();var u=P(r.getLine(o.line),o.ch,e);t.push(X(e-u%e))}r.replaceSelections(t)},defaultTab:function(r){if(r.somethingSelected()){r.indentSelection("add")}else{r.execCommand("insertTab")}},transposeChars:function(r){return On(r,(function(){var t=r.listSelections(),i=[];for(var e=0;e<t.length;e++){if(!t[e].empty()){continue}var n=t[e].head,o=Zr(r.doc,n.line).text;if(o){if(n.ch==o.length){n=new ft(n.line,n.ch-1)}if(n.ch>0){n=new ft(n.line,n.ch+1);r.replaceRange(o.charAt(n.ch-1)+o.charAt(n.ch-2),ft(n.line,n.ch-2),n,"+transpose")}else if(n.line>r.doc.first){var u=Zr(r.doc,n.line-1).text;if(u){n=new ft(n.line,1);r.replaceRange(o.charAt(0)+r.doc.lineSeparator()+u.charAt(u.length-1),ft(n.line-1,u.length-1),n,"+transpose")}}}i.push(new fo(n,n))}r.setSelections(i)}))},newlineAndIndent:function(r){return On(r,(function(){var t=r.listSelections();for(var i=t.length-1;i>=0;i--){r.replaceRange(r.doc.lineSeparator(),t[i].anchor,t[i].head,"+input")}t=r.listSelections();for(var e=0;e<t.length;e++){r.indentLine(t[e].from().line,null,true)}ln(r)}))},openLine:function(r){return r.replaceSelection("\n","start")},toggleOverwrite:function(r){return r.toggleOverwrite()}};function rf(r,t){var i=Zr(r.doc,t);var e=ri(i);if(e!=i){t=et(e)}return Xu(true,r,e,t,1)}function tf(r,t){var i=Zr(r.doc,t);var e=ti(i);if(e!=i){t=et(e)}return Xu(true,r,i,t,-1)}function ef(r,t){var i=rf(r,t.line);var e=Zr(r.doc,i.line);var n=mr(e,r.doc.direction);if(!n||n[0].level==0){var o=Math.max(i.ch,e.text.search(/\S/));var u=t.line==i.line&&t.ch<=o&&t.ch;return ft(i.line,u?0:o,i.sticky)}return i}function nf(r,t,i){if(typeof t=="string"){t=Zu[t];if(!t){return false}}r.display.input.ensurePolled();var e=r.display.shift,n=false;try{if(r.isReadOnly()){r.state.suppressEdits=true}if(i){r.display.shift=false}n=t(r)!=$}finally{r.display.shift=e;r.state.suppressEdits=false}return n}function of(r,t,i){for(var e=0;e<r.state.keyMaps.length;e++){var n=Hu(t,r.state.keyMaps[e],i,r);if(n){return n}}return r.options.extraKeys&&Hu(t,r.options.extraKeys,i,r)||Hu(t,r.options.keyMap,i,r)}var uf=new G;function ff(r,t,i,e){var n=r.state.keySeq;if(n){if(Vu(t)){return"handled"}if(/\'$/.test(t)){r.state.keySeq=null}else{uf.set(50,(function(){if(r.state.keySeq==n){r.state.keySeq=null;r.display.input.reset()}}))}if(af(r,n+" "+t,i,e)){return true}}return af(r,t,i,e)}function af(r,t,i,e){var n=of(r,t,e);if(n=="multi"){r.state.keySeq=t}if(n=="handled"){Di(r,"keyHandled",r,t,i)}if(n=="handled"||n=="multi"){xr(i);Ke(r)}return!!n}function lf(r,t){var i=_u(t,true);if(!i){return false}if(t.shiftKey&&!r.state.keySeq){return ff(r,"Shift-"+i,t,(function(t){return nf(r,t,true)}))||ff(r,i,t,(function(t){if(typeof t=="string"?/^go[A-Z]/.test(t):t.motion){return nf(r,t)}}))}else{return ff(r,i,t,(function(t){return nf(r,t)}))}}function sf(r,t,i){return ff(r,"'"+i+"'",t,(function(t){return nf(r,t,true)}))}var cf=null;function vf(r){var t=this;if(r.target&&r.target!=t.display.input.getField()){return}t.curOp.focus=O(z(t));if(Cr(t,r)){return}if(u&&f<11&&r.keyCode==27){r.returnValue=false}var e=r.keyCode;t.display.shift=e==16||r.shiftKey;var n=lf(t,r);if(v){cf=n?e:null;if(!n&&e==88&&!jr&&(w?r.metaKey:r.ctrlKey)){t.replaceSelection("",null,"cut")}}if(i&&!w&&!n&&e==46&&r.shiftKey&&!r.ctrlKey&&document.execCommand){document.execCommand("cut")}if(e==18&&!/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)){hf(t)}}function hf(r){var t=r.display.lineDiv;R(t,"CodeMirror-crosshair");function i(r){if(r.keyCode==18||!r.altKey){L(t,"CodeMirror-crosshair");wr(document,"keyup",i);wr(document,"mouseover",i)}}gr(document,"keyup",i);gr(document,"mouseover",i)}function df(r){if(r.keyCode==16){this.doc.sel.shift=false}Cr(this,r)}function mf(r){var t=this;if(r.target&&r.target!=t.display.input.getField()){return}if($i(t.display,r)||Cr(t,r)||r.ctrlKey&&!r.altKey||w&&r.metaKey){return}var i=r.keyCode,e=r.charCode;if(v&&i==cf){cf=null;xr(r);return}if(v&&(!r.which||r.which<10)&&lf(t,r)){return}var n=String.fromCharCode(e==null?i:e);if(n=="\b"){return}if(sf(t,r,n)){return}t.display.input.onKeyPress(r)}var pf=400;var gf=function(r,t,i){this.time=r;this.pos=t;this.button=i};gf.prototype.compare=function(r,t,i){return this.time+pf>r&&at(t,this.pos)==0&&i==this.button};var bf,wf;function kf(r,t){var i=+new Date;if(wf&&wf.compare(i,r,t)){bf=wf=null;return"triple"}else if(bf&&bf.compare(i,r,t)){wf=new gf(i,r,t);bf=null;return"double"}else{bf=new gf(i,r,t);wf=null;return"single"}}function Cf(r){var t=this,i=t.display;if(Cr(t,r)||i.activeTouch&&i.input.supportsTouch()){return}i.input.ensurePolled();i.shift=r.shiftKey;if($i(i,r)){if(!a){i.scroller.draggable=false;setTimeout((function(){return i.scroller.draggable=true}),100)}return}if(Df(t,r)){return}var e=Ue(t,r),n=Dr(r),o=e?kf(e,n):"single";j(t).focus();if(n==1&&t.state.selectingText){t.state.selectingText(r)}if(e&&Mf(t,n,e,o,r)){return}if(n==1){if(e){yf(t,e,o,r)}else if(Er(r)==i.scroller){xr(r)}}else if(n==2){if(e){jo(t.doc,e)}setTimeout((function(){return i.input.focus()}),20)}else if(n==3){if(y){t.display.input.onContextMenu(r)}else{Xe(t)}}}function Mf(r,t,i,e,n){var o="Click";if(e=="double"){o="Double"+o}else if(e=="triple"){o="Triple"+o}o=(t==1?"Left":t==2?"Middle":"Right")+o;return ff(r,$u(o,n),n,(function(t){if(typeof t=="string"){t=Zu[t]}if(!t){return false}var e=false;try{if(r.isReadOnly()){r.state.suppressEdits=true}e=t(r,i)!=$}finally{r.state.suppressEdits=false}return e}))}function Af(r,t,i){var e=r.getOption("configureMouse");var n=e?e(r,t,i):{};if(n.unit==null){var o=k?i.shiftKey&&i.metaKey:i.altKey;n.unit=o?"rectangle":t=="single"?"char":t=="double"?"word":"line"}if(n.extend==null||r.doc.extend){n.extend=r.doc.extend||i.shiftKey}if(n.addNew==null){n.addNew=w?i.metaKey:i.ctrlKey}if(n.moveOnDrag==null){n.moveOnDrag=!(w?i.altKey:i.ctrlKey)}return n}function yf(r,t,i,e){if(u){setTimeout(W(Ye,r),0)}else{r.curOp.focus=O(z(r))}var n=Af(r,i,e);var o=r.doc.sel,f;if(r.options.dragDrop&&Tr&&!r.isReadOnly()&&i=="single"&&(f=o.contains(t))>-1&&(at((f=o.ranges[f]).from(),t)<0||t.xRel>0)&&(at(f.to(),t)>0||t.xRel<0)){xf(r,e,t,n)}else{Sf(r,e,t,n)}}function xf(r,t,i,e){var n=r.display,o=false;var l=Rn(r,(function(t){if(a){n.scroller.draggable=false}r.state.draggingText=false;if(r.state.delayingBlurEvent){if(r.hasFocus()){r.state.delayingBlurEvent=false}else{Xe(r)}}wr(n.wrapper.ownerDocument,"mouseup",l);wr(n.wrapper.ownerDocument,"mousemove",s);wr(n.scroller,"dragstart",c);wr(n.scroller,"drop",l);if(!o){xr(t);if(!e.addNew){jo(r.doc,i,null,null,e.extend)}if(a&&!h||u&&f==9){setTimeout((function(){n.wrapper.ownerDocument.body.focus({preventScroll:true});n.input.focus()}),20)}else{n.input.focus()}}}));var s=function(r){o=o||Math.abs(t.clientX-r.clientX)+Math.abs(t.clientY-r.clientY)>=10};var c=function(){return o=true};if(a){n.scroller.draggable=true}r.state.draggingText=l;l.copy=!e.moveOnDrag;gr(n.wrapper.ownerDocument,"mouseup",l);gr(n.wrapper.ownerDocument,"mousemove",s);gr(n.scroller,"dragstart",c);gr(n.scroller,"drop",l);r.state.delayingBlurEvent=true;setTimeout((function(){return n.input.focus()}),20);if(n.scroller.dragDrop){n.scroller.dragDrop()}}function Lf(r,t,i){if(i=="char"){return new fo(t,t)}if(i=="word"){return r.findWordAt(t)}if(i=="line"){return new fo(ft(t.line,0),dt(r.doc,ft(t.line+1,0)))}var e=i(r,t);return new fo(e.from,e.to)}function Sf(r,t,i,e){if(u){Xe(r)}var n=r.display,o=r.doc;xr(t);var f,a,l=o.sel,s=l.ranges;if(e.addNew&&!e.extend){a=o.sel.contains(i);if(a>-1){f=s[a]}else{f=new fo(i,i)}}else{f=o.sel.primary();a=o.sel.primIndex}if(e.unit=="rectangle"){if(!e.addNew){f=new fo(i,i)}i=Ue(r,t,true,true);a=-1}else{var c=Lf(r,i,e.unit);if(e.extend){f=zo(f,c.anchor,c.head,e.extend)}else{f=c}}if(!e.addNew){a=0;Vo(o,new uo([f],0),Q);l=o.sel}else if(a==-1){a=s.length;Vo(o,ao(r,s.concat([f]),a),{scroll:false,origin:"*mouse"})}else if(s.length>1&&s[a].empty()&&e.unit=="char"&&!e.extend){Vo(o,ao(r,s.slice(0,a).concat(s.slice(a+1)),0),{scroll:false,origin:"*mouse"});l=o.sel}else{Fo(o,a,f,Q)}var v=i;function h(t){if(at(v,t)==0){return}v=t;if(e.unit=="rectangle"){var n=[],u=r.options.tabSize;var s=P(Zr(o,i.line).text,i.ch,u);var c=P(Zr(o,t.line).text,t.ch,u);var h=Math.min(s,c),d=Math.max(s,c);for(var m=Math.min(i.line,t.line),p=Math.min(r.lastLine(),Math.max(i.line,t.line));m<=p;m++){var g=Zr(o,m).text,b=K(g,h,u);if(h==d){n.push(new fo(ft(m,b),ft(m,b)))}else if(g.length>b){n.push(new fo(ft(m,b),ft(m,K(g,d,u))))}}if(!n.length){n.push(new fo(i,i))}Vo(o,ao(r,l.ranges.slice(0,a).concat(n),a),{origin:"*mouse",scroll:false});r.scrollIntoView(t)}else{var w=f;var k=Lf(r,t,e.unit);var C=w.anchor,M;if(at(k.anchor,C)>0){M=k.head;C=vt(w.from(),k.anchor)}else{M=k.anchor;C=ct(w.to(),k.head)}var A=l.ranges.slice(0);A[a]=Nf(r,new fo(dt(o,C),M));Vo(o,ao(r,A,a),Q)}}var d=n.wrapper.getBoundingClientRect();var m=0;function p(t){var i=++m;var u=Ue(r,t,true,e.unit=="rectangle");if(!u){return}if(at(u,v)!=0){r.curOp.focus=O(z(r));h(u);var f=en(n,o);if(u.line>=f.to||u.line<f.from){setTimeout(Rn(r,(function(){if(m==i){p(t)}})),150)}}else{var a=t.clientY<d.top?-20:t.clientY>d.bottom?20:0;if(a){setTimeout(Rn(r,(function(){if(m!=i){return}n.scroller.scrollTop+=a;p(t)})),50)}}}function g(t){r.state.selectingText=false;m=Infinity;if(t){xr(t);n.input.focus()}wr(n.wrapper.ownerDocument,"mousemove",b);wr(n.wrapper.ownerDocument,"mouseup",w);o.history.lastSelOrigin=null}var b=Rn(r,(function(r){if(r.buttons===0||!Dr(r)){g(r)}else{p(r)}}));var w=Rn(r,g);r.state.selectingText=w;gr(n.wrapper.ownerDocument,"mousemove",b);gr(n.wrapper.ownerDocument,"mouseup",w)}function Nf(r,t){var i=t.anchor;var e=t.head;var n=Zr(r.doc,i.line);if(at(i,e)==0&&i.sticky==e.sticky){return t}var o=mr(n);if(!o){return t}var u=hr(o,i.ch,i.sticky),f=o[u];if(f.from!=i.ch&&f.to!=i.ch){return t}var a=u+(f.from==i.ch==(f.level!=1)?0:1);if(a==0||a==o.length){return t}var l;if(e.line!=i.line){l=(e.line-i.line)*(r.doc.direction=="ltr"?1:-1)>0}else{var s=hr(o,e.ch,e.sticky);var c=s-u||(e.ch-i.ch)*(f.level==1?-1:1);if(s==a-1||s==a){l=c<0}else{l=c>0}}var v=o[a+(l?-1:0)];var h=l==(v.level==1);var d=h?v.from:v.to,m=h?"after":"before";return i.ch==d&&i.sticky==m?t:new fo(new ft(i.line,d,m),e)}function Ef(r,t,i,e){var n,o;if(t.touches){n=t.touches[0].clientX;o=t.touches[0].clientY}else{try{n=t.clientX;o=t.clientY}catch(r){return false}}if(n>=Math.floor(r.display.gutters.getBoundingClientRect().right)){return false}if(e){xr(t)}var u=r.display;var f=u.lineDiv.getBoundingClientRect();if(o>f.bottom||!Ar(r,i)){return Sr(t)}o-=f.top-u.viewOffset;for(var a=0;a<r.display.gutterSpecs.length;++a){var l=u.gutters.childNodes[a];if(l&&l.getBoundingClientRect().right>=n){var s=nt(r.doc,o);var c=r.display.gutterSpecs[a];kr(r,i,r,s,c.className,t);return Sr(t)}}}function Df(r,t){return Ef(r,t,"gutterClick",true)}function Tf(r,t){if($i(r.display,t)||If(r,t)){return}if(Cr(r,t,"contextmenu")){return}if(!y){r.display.input.onContextMenu(t)}}function If(r,t){if(!Ar(r,"gutterContextMenu")){return false}return Ef(r,t,"gutterContextMenu",false)}function Of(r){r.display.wrapper.className=r.display.wrapper.className.replace(/\s*cm-s-\S+/g,"")+r.options.theme.replace(/(^|\s)\s*/g," cm-s-");ve(r)}var Rf={toString:function(){return"CodeMirror.Init"}};var Bf={};var Uf={};function zf(r){var t=r.optionHandlers;function i(i,e,n,o){r.defaults[i]=e;if(n){t[i]=o?function(r,t,i){if(i!=Rf){n(r,t,i)}}:n}}r.defineOption=i;r.Init=Rf;i("value","",(function(r,t){return r.setValue(t)}),true);i("mode",null,(function(r,t){r.doc.modeOption=t;po(r)}),true);i("indentUnit",2,po,true);i("indentWithTabs",false);i("smartIndent",true);i("tabSize",4,(function(r){go(r);ve(r);je(r)}),true);i("lineSeparator",null,(function(r,t){r.doc.lineSep=t;if(!t){return}var i=[],e=r.doc.first;r.doc.iter((function(r){for(var n=0;;){var o=r.text.indexOf(t,n);if(o==-1){break}n=o+t.length;i.push(ft(e,o))}e++}));for(var n=i.length-1;n>=0;n--){uu(r.doc,t,i[n],ft(i[n].line,i[n].ch+t.length))}}));i("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b\u200e\u200f\u2028\u2029\u202d\u202e\u2066\u2067\u2069\ufeff\ufff9-\ufffc]/g,(function(r,t,i){r.state.specialChars=new RegExp(t.source+(t.test("\t")?"":"|\t"),"g");if(i!=Rf){r.refresh()}}));i("specialCharPlaceholder",gi,(function(r){return r.refresh()}),true);i("electricChars",true);i("inputStyle",b?"contenteditable":"textarea",(function(){throw new Error("inputStyle can not (yet) be changed in a running editor")}),true);i("spellcheck",false,(function(r,t){return r.getInputField().spellcheck=t}),true);i("autocorrect",false,(function(r,t){return r.getInputField().autocorrect=t}),true);i("autocapitalize",false,(function(r,t){return r.getInputField().autocapitalize=t}),true);i("rtlMoveVisually",!C);i("wholeLineUpdateBefore",true);i("theme","default",(function(r){Of(r);Zn(r)}),true);i("keyMap","default",(function(r,t,i){var e=Qu(t);var n=i!=Rf&&Qu(i);if(n&&n.detach){n.detach(r,e)}if(e.attach){e.attach(r,n||null)}}));i("extraKeys",null);i("configureMouse",null);i("lineWrapping",false,Wf,true);i("gutters",[],(function(r,t){r.display.gutterSpecs=Xn(t,r.options.lineNumbers);Zn(r)}),true);i("fixedGutter",true,(function(r,t){r.display.gutters.style.left=t?Oe(r.display)+"px":"0";r.refresh()}),true);i("coverGutterNextToScrollbar",false,(function(r){return kn(r)}),true);i("scrollbarStyle","native",(function(r){An(r);kn(r);r.display.scrollbars.setScrollTop(r.doc.scrollTop);r.display.scrollbars.setScrollLeft(r.doc.scrollLeft)}),true);i("lineNumbers",false,(function(r,t){r.display.gutterSpecs=Xn(r.options.gutters,t);Zn(r)}),true);i("firstLineNumber",1,Zn,true);i("lineNumberFormatter",(function(r){return r}),Zn,true);i("showCursorWhenSelecting",false,Ve,true);i("resetSelectionOnContextMenu",true);i("lineWiseCopyCut",true);i("pasteLinesPerSelection",true);i("selectionsMayTouch",false);i("readOnly",false,(function(r,t){if(t=="nocursor"){Ze(r);r.display.input.blur()}r.display.input.readOnlyChanged(t)}));i("screenReaderLabel",null,(function(r,t){t=t===""?null:t;r.display.input.screenReaderLabelChanged(t)}));i("disableInput",false,(function(r,t){if(!t){r.display.input.reset()}}),true);i("dragDrop",true,jf);i("allowDropFileTypes",null);i("cursorBlinkRate",530);i("cursorScrollMargin",0);i("cursorHeight",1,Ve,true);i("singleCursorHeightPerLine",true,Ve,true);i("workTime",100);i("workDelay",100);i("flattenSpans",true,go,true);i("addModeClass",false,go,true);i("pollInterval",100);i("undoDepth",200,(function(r,t){return r.doc.history.undoDepth=t}));i("historyEventDelay",1250);i("viewportMargin",10,(function(r){return r.refresh()}),true);i("maxHighlightLength",1e4,go,true);i("moveInputWithCursor",true,(function(r,t){if(!t){r.display.input.resetPosition()}}));i("tabindex",null,(function(r,t){return r.display.input.getField().tabIndex=t||""}));i("autofocus",null);i("direction","ltr",(function(r,t){return r.doc.setDirection(t)}),true);i("phrases",null)}function jf(r,t,i){var e=i&&i!=Rf;if(!t!=!e){var n=r.display.dragFunctions;var o=t?gr:wr;o(r.display.scroller,"dragstart",n.start);o(r.display.scroller,"dragenter",n.enter);o(r.display.scroller,"dragover",n.over);o(r.display.scroller,"dragleave",n.leave);o(r.display.scroller,"drop",n.drop)}}function Wf(r){if(r.options.lineWrapping){R(r.display.wrapper,"CodeMirror-wrap");r.display.sizer.style.minWidth="";r.display.sizerWidth=null}else{L(r.display.wrapper,"CodeMirror-wrap");li(r)}Be(r);je(r);ve(r);setTimeout((function(){return kn(r)}),100)}function Ff(r,t){var i=this;if(!(this instanceof Ff)){return new Ff(r,t)}this.options=t=t?F(t):{};F(Bf,t,false);var e=t.value;if(typeof e=="string"){e=new xu(e,t.mode,null,t.lineSeparator,t.direction)}else if(t.mode){e.modeOption=t.mode}this.doc=e;var n=new Ff.inputStyles[t.inputStyle](this);var o=this.display=new ro(r,e,n,t);o.wrapper.CodeMirror=this;Of(this);if(t.lineWrapping){this.display.wrapper.className+=" CodeMirror-wrap"}An(this);this.state={keyMaps:[],overlays:[],modeGen:0,overwrite:false,delayingBlurEvent:false,focused:false,suppressEdits:false,pasteIncoming:-1,cutIncoming:-1,selectingText:false,draggingText:false,highlight:new G,keySeq:null,specialChars:null};if(t.autofocus&&!b){o.input.focus()}if(u&&f<11){setTimeout((function(){return i.display.input.reset(true)}),20)}Pf(this);Ou();xn(this);this.curOp.forceUpdate=true;Co(this,e);if(t.autofocus&&!b||this.hasFocus()){setTimeout((function(){if(i.hasFocus()&&!i.state.focused){qe(i)}}),20)}else{Ze(this)}for(var l in Uf){if(Uf.hasOwnProperty(l)){Uf[l](this,t[l],Rf)}}Yn(this);if(t.finishInit){t.finishInit(this)}for(var s=0;s<Gf.length;++s){Gf[s](this)}Ln(this);if(a&&t.lineWrapping&&getComputedStyle(o.lineDiv).textRendering=="optimizelegibility"){o.lineDiv.style.textRendering="auto"}}Ff.defaults=Bf;Ff.optionHandlers=Uf;function Pf(r){var t=r.display;gr(t.scroller,"mousedown",Rn(r,Cf));if(u&&f<11){gr(t.scroller,"dblclick",Rn(r,(function(t){if(Cr(r,t)){return}var i=Ue(r,t);if(!i||Df(r,t)||$i(r.display,t)){return}xr(t);var e=r.findWordAt(i);jo(r.doc,e.anchor,e.head)})))}else{gr(t.scroller,"dblclick",(function(t){return Cr(r,t)||xr(t)}))}gr(t.scroller,"contextmenu",(function(t){return Tf(r,t)}));gr(t.input.getField(),"contextmenu",(function(i){if(!t.scroller.contains(i.target)){Tf(r,i)}}));var i,e={end:0};function n(){if(t.activeTouch){i=setTimeout((function(){return t.activeTouch=null}),1e3);e=t.activeTouch;e.end=+new Date}}function o(r){if(r.touches.length!=1){return false}var t=r.touches[0];return t.radiusX<=1&&t.radiusY<=1}function a(r,t){if(t.left==null){return true}var i=t.left-r.left,e=t.top-r.top;return i*i+e*e>20*20}gr(t.scroller,"touchstart",(function(n){if(!Cr(r,n)&&!o(n)&&!Df(r,n)){t.input.ensurePolled();clearTimeout(i);var u=+new Date;t.activeTouch={start:u,moved:false,prev:u-e.end<=300?e:null};if(n.touches.length==1){t.activeTouch.left=n.touches[0].pageX;t.activeTouch.top=n.touches[0].pageY}}}));gr(t.scroller,"touchmove",(function(){if(t.activeTouch){t.activeTouch.moved=true}}));gr(t.scroller,"touchend",(function(i){var e=t.activeTouch;if(e&&!$i(t,i)&&e.left!=null&&!e.moved&&new Date-e.start<300){var o=r.coordsChar(t.activeTouch,"page"),u;if(!e.prev||a(e,e.prev)){u=new fo(o,o)}else if(!e.prev.prev||a(e,e.prev.prev)){u=r.findWordAt(o)}else{u=new fo(ft(o.line,0),dt(r.doc,ft(o.line+1,0)))}r.setSelection(u.anchor,u.head);r.focus();xr(i)}n()}));gr(t.scroller,"touchcancel",n);gr(t.scroller,"scroll",(function(){if(t.scroller.clientHeight){dn(r,t.scroller.scrollTop);pn(r,t.scroller.scrollLeft,true);kr(r,"scroll",r)}}));gr(t.scroller,"mousewheel",(function(t){return oo(r,t)}));gr(t.scroller,"DOMMouseScroll",(function(t){return oo(r,t)}));gr(t.wrapper,"scroll",(function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}));t.dragFunctions={enter:function(t){if(!Cr(r,t)){Nr(t)}},over:function(t){if(!Cr(r,t)){Eu(r,t);Nr(t)}},start:function(t){return Nu(r,t)},drop:Rn(r,Su),leave:function(t){if(!Cr(r,t)){Du(r)}}};var l=t.input.getField();gr(l,"keyup",(function(t){return df.call(r,t)}));gr(l,"keydown",Rn(r,vf));gr(l,"keypress",Rn(r,mf));gr(l,"focus",(function(t){return qe(r,t)}));gr(l,"blur",(function(t){return Ze(r,t)}))}var Gf=[];Ff.defineInitHook=function(r){return Gf.push(r)};function Hf(r,t,i,e){var n=r.doc,o;if(i==null){i="add"}if(i=="smart"){if(!n.mode.indent){i="prev"}else{o=Ct(r,t).state}}var u=r.options.tabSize;var f=Zr(n,t),a=P(f.text,null,u);if(f.stateAfter){f.stateAfter=null}var l=f.text.match(/^\s*/)[0],s;if(!e&&!/\S/.test(f.text)){s=0;i="not"}else if(i=="smart"){s=n.mode.indent(o,f.text.slice(l.length),f.text);if(s==$||s>150){if(!e){return}i="prev"}}if(i=="prev"){if(t>n.first){s=P(Zr(n,t-1).text,null,u)}else{s=0}}else if(i=="add"){s=a+r.options.indentUnit}else if(i=="subtract"){s=a-r.options.indentUnit}else if(typeof i=="number"){s=a+i}s=Math.max(0,s);var c="",v=0;if(r.options.indentWithTabs){for(var h=Math.floor(s/u);h;--h){v+=u;c+="\t"}}if(v<s){c+=X(s-v)}if(c!=l){uu(n,c,ft(t,0),ft(t,l.length),"+input");f.stateAfter=null;return true}else{for(var d=0;d<n.sel.ranges.length;d++){var m=n.sel.ranges[d];if(m.head.line==t&&m.head.ch<l.length){var p=ft(t,l.length);Fo(n,d,new fo(p,p));break}}}}var Vf=null;function $f(r){Vf=r}function _f(r,t,i,e,n){var o=r.doc;r.display.shift=false;if(!e){e=o.sel}var u=+new Date-200;var f=n=="paste"||r.state.pasteIncoming>u;var a=Ur(t),l=null;if(f&&e.ranges.length>1){if(Vf&&Vf.text.join("\n")==t){if(e.ranges.length%Vf.text.length==0){l=[];for(var s=0;s<Vf.text.length;s++){l.push(o.splitLines(Vf.text[s]))}}}else if(a.length==e.ranges.length&&r.options.pasteLinesPerSelection){l=Z(a,(function(r){return[r]}))}}var c=r.curOp.updateInput;for(var v=e.ranges.length-1;v>=0;v--){var h=e.ranges[v];var d=h.from(),m=h.to();if(h.empty()){if(i&&i>0){d=ft(d.line,d.ch-i)}else if(r.state.overwrite&&!f){m=ft(m.line,Math.min(Zr(o,m.line).text.length,m.ch+q(a).length))}else if(f&&Vf&&Vf.lineWise&&Vf.text.join("\n")==a.join("\n")){d=m=ft(d.line,0)}}var p={from:d,to:m,text:l?l[v%l.length]:a,origin:n||(f?"paste":r.state.cutIncoming>u?"cut":"+input")};ru(r.doc,p);Di(r,"inputRead",r,p)}if(t&&!f){Jf(r,t)}ln(r);if(r.curOp.updateInput<2){r.curOp.updateInput=c}r.curOp.typing=true;r.state.pasteIncoming=r.state.cutIncoming=-1}function Qf(r,t){var i=r.clipboardData&&r.clipboardData.getData("Text");if(i){r.preventDefault();if(!t.isReadOnly()&&!t.options.disableInput&&t.hasFocus()){On(t,(function(){return _f(t,i,0,null,"paste")}))}return true}}function Jf(r,t){if(!r.options.electricChars||!r.options.smartIndent){return}var i=r.doc.sel;for(var e=i.ranges.length-1;e>=0;e--){var n=i.ranges[e];if(n.head.ch>100||e&&i.ranges[e-1].head.line==n.head.line){continue}var o=r.getModeAt(n.head);var u=false;if(o.electricChars){for(var f=0;f<o.electricChars.length;f++){if(t.indexOf(o.electricChars.charAt(f))>-1){u=Hf(r,n.head.line,"smart");break}}}else if(o.electricInput){if(o.electricInput.test(Zr(r.doc,n.head.line).text.slice(0,n.head.ch))){u=Hf(r,n.head.line,"smart")}}if(u){Di(r,"electricInput",r,n.head.line)}}}function Kf(r){var t=[],i=[];for(var e=0;e<r.doc.sel.ranges.length;e++){var n=r.doc.sel.ranges[e].head.line;var o={anchor:ft(n,0),head:ft(n+1,0)};i.push(o);t.push(r.getRange(o.anchor,o.head))}return{text:t,ranges:i}}function Yf(r,t,i,e){r.setAttribute("autocorrect",i?"":"off");r.setAttribute("autocapitalize",e?"":"off");r.setAttribute("spellcheck",!!t)}function Xf(){var r=E("textarea",null,null,"position: absolute; bottom: -1em; padding: 0; width: 1px; height: 1em; min-height: 1em; outline: none");var t=E("div",[r],null,"overflow: hidden; position: relative; width: 3px; height: 0px;");if(a){r.style.width="1000px"}else{r.setAttribute("wrap","off")}if(p){r.style.border="1px solid black"}Yf(r);return t}function qf(r){var t=r.optionHandlers;var i=r.helpers={};r.prototype={constructor:r,focus:function(){j(this).focus();this.display.input.focus()},setOption:function(r,i){var e=this.options,n=e[r];if(e[r]==i&&r!="mode"){return}e[r]=i;if(t.hasOwnProperty(r)){Rn(this,t[r])(this,i,n)}kr(this,"optionChange",this,r)},getOption:function(r){return this.options[r]},getDoc:function(){return this.doc},addKeyMap:function(r,t){this.state.keyMaps[t?"push":"unshift"](Qu(r))},removeKeyMap:function(r){var t=this.state.keyMaps;for(var i=0;i<t.length;++i){if(t[i]==r||t[i].name==r){t.splice(i,1);return true}}},addOverlay:Bn((function(t,i){var e=t.token?t:r.getMode(this.options,t);if(e.startState){throw new Error("Overlays may not be stateful.")}rr(this.state.overlays,{mode:e,modeSpec:t,opaque:i&&i.opaque,priority:i&&i.priority||0},(function(r){return r.priority}));this.state.modeGen++;je(this)})),removeOverlay:Bn((function(r){var t=this.state.overlays;for(var i=0;i<t.length;++i){var e=t[i].modeSpec;if(e==r||typeof r=="string"&&e.name==r){t.splice(i,1);this.state.modeGen++;je(this);return}}})),indentLine:Bn((function(r,t,i){if(typeof t!="string"&&typeof t!="number"){if(t==null){t=this.options.smartIndent?"smart":"prev"}else{t=t?"add":"subtract"}}if(ot(this.doc,r)){Hf(this,r,t,i)}})),indentSelection:Bn((function(r){var t=this.doc.sel.ranges,i=-1;for(var e=0;e<t.length;e++){var n=t[e];if(!n.empty()){var o=n.from(),u=n.to();var f=Math.max(i,o.line);i=Math.min(this.lastLine(),u.line-(u.ch?0:1))+1;for(var a=f;a<i;++a){Hf(this,a,r)}var l=this.doc.sel.ranges;if(o.ch==0&&t.length==l.length&&l[e].from().ch>0){Fo(this.doc,e,new fo(o,l[e].to()),_)}}else if(n.head.line>i){Hf(this,n.head.line,r,true);i=n.head.line;if(e==this.doc.sel.primIndex){ln(this)}}}})),getTokenAt:function(r,t){return Lt(this,r,t)},getLineTokens:function(r,t){return Lt(this,ft(r),t,true)},getTokenTypeAt:function(r){r=dt(this.doc,r);var t=kt(this,Zr(this.doc,r.line));var i=0,e=(t.length-1)/2,n=r.ch;var o;if(n==0){o=t[2]}else{for(;;){var u=i+e>>1;if((u?t[u*2-1]:0)>=n){e=u}else if(t[u*2+1]<n){i=u+1}else{o=t[u*2+2];break}}}var f=o?o.indexOf("overlay "):-1;return f<0?o:f==0?null:o.slice(0,f-1)},getModeAt:function(t){var i=this.doc.mode;if(!i.innerMode){return i}return r.innerMode(i,this.getTokenAt(t).state).mode},getHelper:function(r,t){return this.getHelpers(r,t)[0]},getHelpers:function(r,t){var e=[];if(!i.hasOwnProperty(t)){return e}var n=i[t],o=this.getModeAt(r);if(typeof o[t]=="string"){if(n[o[t]]){e.push(n[o[t]])}}else if(o[t]){for(var u=0;u<o[t].length;u++){var f=n[o[t][u]];if(f){e.push(f)}}}else if(o.helperType&&n[o.helperType]){e.push(n[o.helperType])}else if(n[o.name]){e.push(n[o.name])}for(var a=0;a<n._global.length;a++){var l=n._global[a];if(l.pred(o,this)&&H(e,l.val)==-1){e.push(l.val)}}return e},getStateAfter:function(r,t){var i=this.doc;r=ht(i,r==null?i.first+i.size-1:r);return Ct(this,r+1,t).state},cursorCoords:function(r,t){var i,e=this.doc.sel.primary();if(r==null){i=e.head}else if(typeof r=="object"){i=dt(this.doc,r)}else{i=r?e.from():e.to()}return we(this,i,t||"page")},charCoords:function(r,t){return be(this,dt(this.doc,r),t||"page")},coordsChar:function(r,t){r=ge(this,r,t||"page");return Me(this,r.left,r.top)},lineAtHeight:function(r,t){r=ge(this,{top:r,left:0},t||"page").top;return nt(this.doc,r+this.display.viewOffset)},heightAtLine:function(r,t,i){var e=false,n;if(typeof r=="number"){var o=this.doc.first+this.doc.size-1;if(r<this.doc.first){r=this.doc.first}else if(r>o){r=o;e=true}n=Zr(this.doc,r)}else{n=r}return pe(this,n,{top:0,left:0},t||"page",i||e).top+(e?this.doc.height-fi(n):0)},defaultTextHeight:function(){return De(this.display)},defaultCharWidth:function(){return Te(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(r,t,i,e,n){var o=this.display;r=we(this,dt(this.doc,r));var u=r.bottom,f=r.left;t.style.position="absolute";t.setAttribute("cm-ignore-events","true");this.display.input.setUneditable(t);o.sizer.appendChild(t);if(e=="over"){u=r.top}else if(e=="above"||e=="near"){var a=Math.max(o.wrapper.clientHeight,this.doc.height),l=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);if((e=="above"||r.bottom+t.offsetHeight>a)&&r.top>t.offsetHeight){u=r.top-t.offsetHeight}else if(r.bottom+t.offsetHeight<=a){u=r.bottom}if(f+t.offsetWidth>l){f=l-t.offsetWidth}}t.style.top=u+"px";t.style.left=t.style.right="";if(n=="right"){f=o.sizer.clientWidth-t.offsetWidth;t.style.right="0px"}else{if(n=="left"){f=0}else if(n=="middle"){f=(o.sizer.clientWidth-t.offsetWidth)/2}t.style.left=f+"px"}if(i){un(this,{left:f,top:u,right:f+t.offsetWidth,bottom:u+t.offsetHeight})}},triggerOnKeyDown:Bn(vf),triggerOnKeyPress:Bn(mf),triggerOnKeyUp:df,triggerOnMouseDown:Bn(Cf),execCommand:function(r){if(Zu.hasOwnProperty(r)){return Zu[r].call(null,this)}},triggerElectric:Bn((function(r){Jf(this,r)})),findPosH:function(r,t,i,e){var n=1;if(t<0){n=-1;t=-t}var o=dt(this.doc,r);for(var u=0;u<t;++u){o=Zf(this.doc,o,n,i,e);if(o.hitSide){break}}return o},moveH:Bn((function(r,t){var i=this;this.extendSelectionsBy((function(e){if(i.display.shift||i.doc.extend||e.empty()){return Zf(i.doc,e.head,r,t,i.options.rtlMoveVisually)}else{return r<0?e.from():e.to()}}),J)})),deleteH:Bn((function(r,t){var i=this.doc.sel,e=this.doc;if(i.somethingSelected()){e.replaceSelection("",null,"+delete")}else{Ju(this,(function(i){var n=Zf(e,i.head,r,t,false);return r<0?{from:n,to:i.head}:{from:i.head,to:n}}))}})),findPosV:function(r,t,i,e){var n=1,o=e;if(t<0){n=-1;t=-t}var u=dt(this.doc,r);for(var f=0;f<t;++f){var a=we(this,u,"div");if(o==null){o=a.left}else{a.left=o}u=ra(this,a,n,i);if(u.hitSide){break}}return u},moveV:Bn((function(r,t){var i=this;var e=this.doc,n=[];var o=!this.display.shift&&!e.extend&&e.sel.somethingSelected();e.extendSelectionsBy((function(u){if(o){return r<0?u.from():u.to()}var f=we(i,u.head,"div");if(u.goalColumn!=null){f.left=u.goalColumn}n.push(f.left);var a=ra(i,f,r,t);if(t=="page"&&u==e.sel.primary()){an(i,be(i,a,"div").top-f.top)}return a}),J);if(n.length){for(var u=0;u<e.sel.ranges.length;u++){e.sel.ranges[u].goalColumn=n[u]}}})),findWordAt:function(r){var t=this.doc,i=Zr(t,r.line).text;var e=r.ch,n=r.ch;if(i){var o=this.getHelper(r,"wordChars");if((r.sticky=="before"||n==i.length)&&e){--e}else{++n}var u=i.charAt(e);var f=or(u,o)?function(r){return or(r,o)}:/\s/.test(u)?function(r){return/\s/.test(r)}:function(r){return!/\s/.test(r)&&!or(r)};while(e>0&&f(i.charAt(e-1))){--e}while(n<i.length&&f(i.charAt(n))){++n}}return new fo(ft(r.line,e),ft(r.line,n))},toggleOverwrite:function(r){if(r!=null&&r==this.state.overwrite){return}if(this.state.overwrite=!this.state.overwrite){R(this.display.cursorDiv,"CodeMirror-overwrite")}else{L(this.display.cursorDiv,"CodeMirror-overwrite")}kr(this,"overwriteToggle",this,this.state.overwrite)},hasFocus:function(){return this.display.input.getField()==O(z(this))},isReadOnly:function(){return!!(this.options.readOnly||this.doc.cantEdit)},scrollTo:Bn((function(r,t){sn(this,r,t)})),getScrollInfo:function(){var r=this.display.scroller;return{left:r.scrollLeft,top:r.scrollTop,height:r.scrollHeight-Ki(this)-this.display.barHeight,width:r.scrollWidth-Ki(this)-this.display.barWidth,clientHeight:Xi(this),clientWidth:Yi(this)}},scrollIntoView:Bn((function(r,t){if(r==null){r={from:this.doc.sel.primary().head,to:null};if(t==null){t=this.options.cursorScrollMargin}}else if(typeof r=="number"){r={from:ft(r,0),to:null}}else if(r.from==null){r={from:r,to:null}}if(!r.to){r.to=r.from}r.margin=t||0;if(r.from.line!=null){cn(this,r)}else{hn(this,r.from,r.to,r.margin)}})),setSize:Bn((function(r,t){var i=this;var e=function(r){return typeof r=="number"||/^\d+$/.test(String(r))?r+"px":r};if(r!=null){this.display.wrapper.style.width=e(r)}if(t!=null){this.display.wrapper.style.height=e(t)}if(this.options.lineWrapping){ce(this)}var n=this.display.viewFrom;this.doc.iter(n,this.display.viewTo,(function(r){if(r.widgets){for(var t=0;t<r.widgets.length;t++){if(r.widgets[t].noHScroll){We(i,n,"widget");break}}}++n}));this.curOp.forceUpdate=true;kr(this,"refresh",this)})),operation:function(r){return On(this,r)},startOperation:function(){return xn(this)},endOperation:function(){return Ln(this)},refresh:Bn((function(){var r=this.display.cachedTextHeight;je(this);this.curOp.forceUpdate=true;ve(this);sn(this,this.doc.scrollLeft,this.doc.scrollTop);Qn(this.display);if(r==null||Math.abs(r-De(this.display))>.5||this.options.lineWrapping){Be(this)}kr(this,"refresh",this)})),swapDoc:Bn((function(r){var t=this.doc;t.cm=null;if(this.state.selectingText){this.state.selectingText()}Co(this,r);ve(this);this.display.input.reset();sn(this,r.scrollLeft,r.scrollTop);this.curOp.forceScroll=true;Di(this,"swapDoc",this,t);return t})),phrase:function(r){var t=this.options.phrases;return t&&Object.prototype.hasOwnProperty.call(t,r)?t[r]:r},getInputField:function(){return this.display.input.getField()},getWrapperElement:function(){return this.display.wrapper},getScrollerElement:function(){return this.display.scroller},getGutterElement:function(){return this.display.gutters}};yr(r);r.registerHelper=function(t,e,n){if(!i.hasOwnProperty(t)){i[t]=r[t]={_global:[]}}i[t][e]=n};r.registerGlobalHelper=function(t,e,n,o){r.registerHelper(t,e,o);i[t]._global.push({pred:n,val:o})}}function Zf(r,t,i,e,n){var o=t;var u=i;var f=Zr(r,t.line);var a=n&&r.direction=="rtl"?-i:i;function l(){var i=t.line+a;if(i<r.first||i>=r.first+r.size){return false}t=new ft(i,t.ch,t.sticky);return f=Zr(r,i)}function s(o){var u;if(e=="codepoint"){var s=f.text.charCodeAt(t.ch+(i>0?0:-1));if(isNaN(s)){u=null}else{var c=i>0?s>=55296&&s<56320:s>=56320&&s<57343;u=new ft(t.line,Math.max(0,Math.min(f.text.length,t.ch+i*(c?2:1))),-i)}}else if(n){u=qu(r.cm,f,t,i)}else{u=Yu(f,t,i)}if(u==null){if(!o&&l()){t=Xu(n,r.cm,f,t.line,a)}else{return false}}else{t=u}return true}if(e=="char"||e=="codepoint"){s()}else if(e=="column"){s(true)}else if(e=="word"||e=="group"){var c=null,v=e=="group";var h=r.cm&&r.cm.getHelper(t,"wordChars");for(var d=true;;d=false){if(i<0&&!s(!d)){break}var m=f.text.charAt(t.ch)||"\n";var p=or(m,h)?"w":v&&m=="\n"?"n":!v||/\s/.test(m)?null:"p";if(v&&!d&&!p){p="s"}if(c&&c!=p){if(i<0){i=1;s();t.sticky="after"}break}if(p){c=p}if(i>0&&!s(!d)){break}}}var g=Yo(r,t,o,u,true);if(lt(o,g)){g.hitSide=true}return g}function ra(r,t,i,e){var n=r.doc,o=t.left,u;if(e=="page"){var f=Math.min(r.display.wrapper.clientHeight,j(r).innerHeight||n(r).documentElement.clientHeight);var a=Math.max(f-.5*De(r.display),3);u=(i>0?t.bottom:t.top)+i*a}else if(e=="line"){u=i>0?t.bottom+3:t.top-3}var l;for(;;){l=Me(r,o,u);if(!l.outside){break}if(i<0?u<=0:u>=n.height){l.hitSide=true;break}u+=i*5}return l}var ta=function(r){this.cm=r;this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null;this.polling=new G;this.composing=null;this.gracePeriod=false;this.readDOMTimeout=null};ta.prototype.init=function(r){var t=this;var i=this,e=i.cm;var n=i.div=r.lineDiv;n.contentEditable=true;Yf(n,e.options.spellcheck,e.options.autocorrect,e.options.autocapitalize);function o(r){for(var t=r.target;t;t=t.parentNode){if(t==n){return true}if(/\bCodeMirror-(?:line)?widget\b/.test(t.className)){break}}return false}gr(n,"paste",(function(r){if(!o(r)||Cr(e,r)||Qf(r,e)){return}if(f<=11){setTimeout(Rn(e,(function(){return t.updateFromDOM()})),20)}}));gr(n,"compositionstart",(function(r){t.composing={data:r.data,done:false}}));gr(n,"compositionupdate",(function(r){if(!t.composing){t.composing={data:r.data,done:false}}}));gr(n,"compositionend",(function(r){if(t.composing){if(r.data!=t.composing.data){t.readFromDOMSoon()}t.composing.done=true}}));gr(n,"touchstart",(function(){return i.forceCompositionEnd()}));gr(n,"input",(function(){if(!t.composing){t.readFromDOMSoon()}}));function u(r){if(!o(r)||Cr(e,r)){return}if(e.somethingSelected()){$f({lineWise:false,text:e.getSelections()});if(r.type=="cut"){e.replaceSelection("",null,"cut")}}else if(!e.options.lineWiseCopyCut){return}else{var t=Kf(e);$f({lineWise:true,text:t.text});if(r.type=="cut"){e.operation((function(){e.setSelections(t.ranges,0,_);e.replaceSelection("",null,"cut")}))}}if(r.clipboardData){r.clipboardData.clearData();var u=Vf.text.join("\n");r.clipboardData.setData("Text",u);if(r.clipboardData.getData("Text")==u){r.preventDefault();return}}var f=Xf(),a=f.firstChild;e.display.lineSpace.insertBefore(f,e.display.lineSpace.firstChild);a.value=Vf.text.join("\n");var l=O(n.ownerDocument);U(a);setTimeout((function(){e.display.lineSpace.removeChild(f);l.focus();if(l==n){i.showPrimarySelection()}}),50)}gr(n,"copy",u);gr(n,"cut",u)};ta.prototype.screenReaderLabelChanged=function(r){if(r){this.div.setAttribute("aria-label",r)}else{this.div.removeAttribute("aria-label")}};ta.prototype.prepareSelection=function(){var r=$e(this.cm,false);r.focus=O(this.div.ownerDocument)==this.div;return r};ta.prototype.showSelection=function(r,t){if(!r||!this.cm.display.view.length){return}if(r.focus||t){this.showPrimarySelection()}this.showMultipleSelections(r)};ta.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()};ta.prototype.showPrimarySelection=function(){var r=this.getSelection(),t=this.cm,e=t.doc.sel.primary();var n=e.from(),o=e.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||o.line<t.display.viewFrom){r.removeAllRanges();return}var u=ua(t,r.anchorNode,r.anchorOffset);var f=ua(t,r.focusNode,r.focusOffset);if(u&&!u.bad&&f&&!f.bad&&at(vt(u,f),n)==0&&at(ct(u,f),o)==0){return}var a=t.display.view;var l=n.line>=t.display.viewFrom&&ia(t,n)||{node:a[0].measure.map[2],offset:0};var s=o.line<t.display.viewTo&&ia(t,o);if(!s){var c=a[a.length-1].measure;var v=c.maps?c.maps[c.maps.length-1]:c.map;s={node:v[v.length-1],offset:v[v.length-2]-v[v.length-3]}}if(!l||!s){r.removeAllRanges();return}var h=r.rangeCount&&r.getRangeAt(0),d;try{d=T(l.node,l.offset,s.offset,s.node)}catch(r){}if(d){if(!i&&t.state.focused){r.collapse(l.node,l.offset);if(!d.collapsed){r.removeAllRanges();r.addRange(d)}}else{r.removeAllRanges();r.addRange(d)}if(h&&r.anchorNode==null){r.addRange(h)}else if(i){this.startGracePeriod()}}this.rememberSelection()};ta.prototype.startGracePeriod=function(){var r=this;clearTimeout(this.gracePeriod);this.gracePeriod=setTimeout((function(){r.gracePeriod=false;if(r.selectionChanged()){r.cm.operation((function(){return r.cm.curOp.selectionChanged=true}))}}),20)};ta.prototype.showMultipleSelections=function(r){N(this.cm.display.cursorDiv,r.cursors);N(this.cm.display.selectionDiv,r.selection)};ta.prototype.rememberSelection=function(){var r=this.getSelection();this.lastAnchorNode=r.anchorNode;this.lastAnchorOffset=r.anchorOffset;this.lastFocusNode=r.focusNode;this.lastFocusOffset=r.focusOffset};ta.prototype.selectionInEditor=function(){var r=this.getSelection();if(!r.rangeCount){return false}var t=r.getRangeAt(0).commonAncestorContainer;return I(this.div,t)};ta.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"){if(!this.selectionInEditor()||O(this.div.ownerDocument)!=this.div){this.showSelection(this.prepareSelection(),true)}this.div.focus()}};ta.prototype.blur=function(){this.div.blur()};ta.prototype.getField=function(){return this.div};ta.prototype.supportsTouch=function(){return true};ta.prototype.receivedFocus=function(){var r=this;var t=this;if(this.selectionInEditor()){setTimeout((function(){return r.pollSelection()}),20)}else{On(this.cm,(function(){return t.cm.curOp.selectionChanged=true}))}function i(){if(t.cm.state.focused){t.pollSelection();t.polling.set(t.cm.options.pollInterval,i)}}this.polling.set(this.cm.options.pollInterval,i)};ta.prototype.selectionChanged=function(){var r=this.getSelection();return r.anchorNode!=this.lastAnchorNode||r.anchorOffset!=this.lastAnchorOffset||r.focusNode!=this.lastFocusNode||r.focusOffset!=this.lastFocusOffset};ta.prototype.pollSelection=function(){if(this.readDOMTimeout!=null||this.gracePeriod||!this.selectionChanged()){return}var r=this.getSelection(),t=this.cm;if(g&&s&&this.cm.display.gutterSpecs.length&&ea(r.anchorNode)){this.cm.triggerOnKeyDown({type:"keydown",keyCode:8,preventDefault:Math.abs});this.blur();this.focus();return}if(this.composing){return}this.rememberSelection();var i=ua(t,r.anchorNode,r.anchorOffset);var e=ua(t,r.focusNode,r.focusOffset);if(i&&e){On(t,(function(){Vo(t.doc,lo(i,e),_);if(i.bad||e.bad){t.curOp.selectionChanged=true}}))}};ta.prototype.pollContent=function(){if(this.readDOMTimeout!=null){clearTimeout(this.readDOMTimeout);this.readDOMTimeout=null}var r=this.cm,t=r.display,i=r.doc.sel.primary();var e=i.from(),n=i.to();if(e.ch==0&&e.line>r.firstLine()){e=ft(e.line-1,Zr(r.doc,e.line-1).length)}if(n.ch==Zr(r.doc,n.line).text.length&&n.line<r.lastLine()){n=ft(n.line+1,0)}if(e.line<t.viewFrom||n.line>t.viewTo-1){return false}var o,u,f;if(e.line==t.viewFrom||(o=ze(r,e.line))==0){u=et(t.view[0].line);f=t.view[0].node}else{u=et(t.view[o].line);f=t.view[o-1].node.nextSibling}var a=ze(r,n.line);var l,s;if(a==t.view.length-1){l=t.viewTo-1;s=t.lineDiv.lastChild}else{l=et(t.view[a+1].line)-1;s=t.view[a+1].node.previousSibling}if(!f){return false}var c=r.doc.splitLines(oa(r,f,s,u,l));var v=rt(r.doc,ft(u,0),ft(l,Zr(r.doc,l).text.length));while(c.length>1&&v.length>1){if(q(c)==q(v)){c.pop();v.pop();l--}else if(c[0]==v[0]){c.shift();v.shift();u++}else{break}}var h=0,d=0;var m=c[0],p=v[0],g=Math.min(m.length,p.length);while(h<g&&m.charCodeAt(h)==p.charCodeAt(h)){++h}var b=q(c),w=q(v);var k=Math.min(b.length-(c.length==1?h:0),w.length-(v.length==1?h:0));while(d<k&&b.charCodeAt(b.length-d-1)==w.charCodeAt(w.length-d-1)){++d}if(c.length==1&&v.length==1&&u==e.line){while(h&&h>e.ch&&b.charCodeAt(b.length-d-1)==w.charCodeAt(w.length-d-1)){h--;d++}}c[c.length-1]=b.slice(0,b.length-d).replace(/^\u200b+/,"");c[0]=c[0].slice(h).replace(/\u200b+$/,"");var C=ft(u,h);var M=ft(l,v.length?q(v).length-d:0);if(c.length>1||c[0]||at(C,M)){uu(r.doc,c,C,M,"+input");return true}};ta.prototype.ensurePolled=function(){this.forceCompositionEnd()};ta.prototype.reset=function(){this.forceCompositionEnd()};ta.prototype.forceCompositionEnd=function(){if(!this.composing){return}clearTimeout(this.readDOMTimeout);this.composing=null;this.updateFromDOM();this.div.blur();this.div.focus()};ta.prototype.readFromDOMSoon=function(){var r=this;if(this.readDOMTimeout!=null){return}this.readDOMTimeout=setTimeout((function(){r.readDOMTimeout=null;if(r.composing){if(r.composing.done){r.composing=null}else{return}}r.updateFromDOM()}),80)};ta.prototype.updateFromDOM=function(){var r=this;if(this.cm.isReadOnly()||!this.pollContent()){On(this.cm,(function(){return je(r.cm)}))}};ta.prototype.setUneditable=function(r){r.contentEditable="false"};ta.prototype.onKeyPress=function(r){if(r.charCode==0||this.composing){return}r.preventDefault();if(!this.cm.isReadOnly()){Rn(this.cm,_f)(this.cm,String.fromCharCode(r.charCode==null?r.keyCode:r.charCode),0)}};ta.prototype.readOnlyChanged=function(r){this.div.contentEditable=String(r!="nocursor")};ta.prototype.onContextMenu=function(){};ta.prototype.resetPosition=function(){};ta.prototype.needsContentAttribute=true;function ia(r,t){var i=ie(r,t.line);if(!i||i.hidden){return null}var e=Zr(r.doc,t.line);var n=Zi(i,e,t.line);var o=mr(e,r.doc.direction),u="left";if(o){var f=hr(o,t.ch);u=f%2?"right":"left"}var a=ue(n.map,t.ch,u);a.offset=a.collapse=="right"?a.end:a.start;return a}function ea(r){for(var t=r;t;t=t.parentNode){if(/CodeMirror-gutter-wrapper/.test(t.className)){return true}}return false}function na(r,t){if(t){r.bad=true}return r}function oa(r,t,i,e,n){var o="",u=false,f=r.doc.lineSeparator(),a=false;function l(r){return function(t){return t.id==r}}function s(){if(u){o+=f;if(a){o+=f}u=a=false}}function c(r){if(r){s();o+=r}}function v(t){if(t.nodeType==1){var i=t.getAttribute("cm-text");if(i){c(i);return}var o=t.getAttribute("cm-marker"),h;if(o){var d=r.findMarks(ft(e,0),ft(n+1,0),l(+o));if(d.length&&(h=d[0].find(0))){c(rt(r.doc,h.from,h.to).join(f))}return}if(t.getAttribute("contenteditable")=="false"){return}var m=/^(pre|div|p|li|table|br)$/i.test(t.nodeName);if(!/^br$/i.test(t.nodeName)&&t.textContent.length==0){return}if(m){s()}for(var p=0;p<t.childNodes.length;p++){v(t.childNodes[p])}if(/^(pre|p)$/i.test(t.nodeName)){a=true}if(m){u=true}}else if(t.nodeType==3){c(t.nodeValue.replace(/\u200b/g,"").replace(/\u00a0/g," "))}}for(;;){v(t);if(t==i){break}t=t.nextSibling;a=false}return o}function ua(r,t,i){var e;if(t==r.display.lineDiv){e=r.display.lineDiv.childNodes[i];if(!e){return na(r.clipPos(ft(r.display.viewTo-1)),true)}t=null;i=0}else{for(e=t;;e=e.parentNode){if(!e||e==r.display.lineDiv){return null}if(e.parentNode&&e.parentNode==r.display.lineDiv){break}}}for(var n=0;n<r.display.view.length;n++){var o=r.display.view[n];if(o.node==e){return fa(o,t,i)}}}function fa(r,t,i){var e=r.text.firstChild,n=false;if(!t||!I(e,t)){return na(ft(et(r.line),0),true)}if(t==e){n=true;t=e.childNodes[i];i=0;if(!t){var o=r.rest?q(r.rest):r.line;return na(ft(et(o),o.text.length),n)}}var u=t.nodeType==3?t:null,f=t;if(!u&&t.childNodes.length==1&&t.firstChild.nodeType==3){u=t.firstChild;if(i){i=u.nodeValue.length}}while(f.parentNode!=e){f=f.parentNode}var a=r.measure,l=a.maps;function s(t,i,e){for(var n=-1;n<(l?l.length:0);n++){var o=n<0?a.map:l[n];for(var u=0;u<o.length;u+=3){var f=o[u+2];if(f==t||f==i){var s=et(n<0?r.line:r.rest[n]);var c=o[u]+e;if(e<0||f!=t){c=o[u+(e?1:0)]}return ft(s,c)}}}}var c=s(u,f,i);if(c){return na(c,n)}for(var v=f.nextSibling,h=u?u.nodeValue.length-i:0;v;v=v.nextSibling){c=s(v,v.firstChild,0);if(c){return na(ft(c.line,c.ch-h),n)}else{h+=v.textContent.length}}for(var d=f.previousSibling,m=i;d;d=d.previousSibling){c=s(d,d.firstChild,-1);if(c){return na(ft(c.line,c.ch+m),n)}else{m+=d.textContent.length}}}var aa=function(r){this.cm=r;this.prevInput="";this.pollingFast=false;this.polling=new G;this.hasSelection=false;this.composing=null;this.resetting=false};aa.prototype.init=function(r){var t=this;var i=this,e=this.cm;this.createField(r);var n=this.textarea;r.wrapper.insertBefore(this.wrapper,r.wrapper.firstChild);if(p){n.style.width="0px"}gr(n,"input",(function(){if(u&&f>=9&&t.hasSelection){t.hasSelection=null}i.poll()}));gr(n,"paste",(function(r){if(Cr(e,r)||Qf(r,e)){return}e.state.pasteIncoming=+new Date;i.fastPoll()}));function o(r){if(Cr(e,r)){return}if(e.somethingSelected()){$f({lineWise:false,text:e.getSelections()})}else if(!e.options.lineWiseCopyCut){return}else{var t=Kf(e);$f({lineWise:true,text:t.text});if(r.type=="cut"){e.setSelections(t.ranges,null,_)}else{i.prevInput="";n.value=t.text.join("\n");U(n)}}if(r.type=="cut"){e.state.cutIncoming=+new Date}}gr(n,"cut",o);gr(n,"copy",o);gr(r.scroller,"paste",(function(t){if($i(r,t)||Cr(e,t)){return}if(!n.dispatchEvent){e.state.pasteIncoming=+new Date;i.focus();return}var o=new Event("paste");o.clipboardData=t.clipboardData;n.dispatchEvent(o)}));gr(r.lineSpace,"selectstart",(function(t){if(!$i(r,t)){xr(t)}}));gr(n,"compositionstart",(function(){var r=e.getCursor("from");if(i.composing){i.composing.range.clear()}i.composing={start:r,range:e.markText(r,e.getCursor("to"),{className:"CodeMirror-composing"})}}));gr(n,"compositionend",(function(){if(i.composing){i.poll();i.composing.range.clear();i.composing=null}}))};aa.prototype.createField=function(r){this.wrapper=Xf();this.textarea=this.wrapper.firstChild};aa.prototype.screenReaderLabelChanged=function(r){if(r){this.textarea.setAttribute("aria-label",r)}else{this.textarea.removeAttribute("aria-label")}};aa.prototype.prepareSelection=function(){var r=this.cm,t=r.display,i=r.doc;var e=$e(r);if(r.options.moveInputWithCursor){var n=we(r,i.sel.primary().head,"div");var o=t.wrapper.getBoundingClientRect(),u=t.lineDiv.getBoundingClientRect();e.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,n.top+u.top-o.top));e.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,n.left+u.left-o.left))}return e};aa.prototype.showSelection=function(r){var t=this.cm,i=t.display;N(i.cursorDiv,r.cursors);N(i.selectionDiv,r.selection);if(r.teTop!=null){this.wrapper.style.top=r.teTop+"px";this.wrapper.style.left=r.teLeft+"px"}};aa.prototype.reset=function(r){if(this.contextMenuPending||this.composing&&r){return}var t=this.cm;this.resetting=true;if(t.somethingSelected()){this.prevInput="";var i=t.getSelection();this.textarea.value=i;if(t.state.focused){U(this.textarea)}if(u&&f>=9){this.hasSelection=i}}else if(!r){this.prevInput=this.textarea.value="";if(u&&f>=9){this.hasSelection=null}}this.resetting=false};aa.prototype.getField=function(){return this.textarea};aa.prototype.supportsTouch=function(){return false};aa.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!b||O(this.textarea.ownerDocument)!=this.textarea)){try{this.textarea.focus()}catch(r){}}};aa.prototype.blur=function(){this.textarea.blur()};aa.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0};aa.prototype.receivedFocus=function(){this.slowPoll()};aa.prototype.slowPoll=function(){var r=this;if(this.pollingFast){return}this.polling.set(this.cm.options.pollInterval,(function(){r.poll();if(r.cm.state.focused){r.slowPoll()}}))};aa.prototype.fastPoll=function(){var r=false,t=this;t.pollingFast=true;function i(){var e=t.poll();if(!e&&!r){r=true;t.polling.set(60,i)}else{t.pollingFast=false;t.slowPoll()}}t.polling.set(20,i)};aa.prototype.poll=function(){var r=this;var t=this.cm,i=this.textarea,e=this.prevInput;if(this.contextMenuPending||this.resetting||!t.state.focused||zr(i)&&!e&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq){return false}var n=i.value;if(n==e&&!t.somethingSelected()){return false}if(u&&f>=9&&this.hasSelection===n||w&&/[\uf700-\uf7ff]/.test(n)){t.display.input.reset();return false}if(t.doc.sel==t.display.selForContextMenu){var o=n.charCodeAt(0);if(o==8203&&!e){e="​"}if(o==8666){this.reset();return this.cm.execCommand("undo")}}var a=0,l=Math.min(e.length,n.length);while(a<l&&e.charCodeAt(a)==n.charCodeAt(a)){++a}On(t,(function(){_f(t,n.slice(a),e.length-a,null,r.composing?"*compose":null);if(n.length>1e3||n.indexOf("\n")>-1){i.value=r.prevInput=""}else{r.prevInput=n}if(r.composing){r.composing.range.clear();r.composing.range=t.markText(r.composing.start,t.getCursor("to"),{className:"CodeMirror-composing"})}}));return true};aa.prototype.ensurePolled=function(){if(this.pollingFast&&this.poll()){this.pollingFast=false}};aa.prototype.onKeyPress=function(){if(u&&f>=9){this.hasSelection=null}this.fastPoll()};aa.prototype.onContextMenu=function(r){var t=this,i=t.cm,e=i.display,n=t.textarea;if(t.contextMenuPending){t.contextMenuPending()}var o=Ue(i,r),l=e.scroller.scrollTop;if(!o||v){return}var s=i.options.resetSelectionOnContextMenu;if(s&&i.doc.sel.contains(o)==-1){Rn(i,Vo)(i.doc,lo(o),_)}var c=n.style.cssText,h=t.wrapper.style.cssText;var d=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static";n.style.cssText="position: absolute; width: 30px; height: 30px;\n top: "+(r.clientY-d.top-5)+"px; left: "+(r.clientX-d.left-5)+"px;\n z-index: 1000; background: "+(u?"rgba(255, 255, 255, .05)":"transparent")+";\n outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);";var m;if(a){m=n.ownerDocument.defaultView.scrollY}e.input.focus();if(a){n.ownerDocument.defaultView.scrollTo(null,m)}e.input.reset();if(!i.somethingSelected()){n.value=t.prevInput=" "}t.contextMenuPending=g;e.selForContextMenu=i.doc.sel;clearTimeout(e.detectingSelectAll);function p(){if(n.selectionStart!=null){var r=i.somethingSelected();var o="​"+(r?n.value:"");n.value="⇚";n.value=o;t.prevInput=r?"":"​";n.selectionStart=1;n.selectionEnd=o.length;e.selForContextMenu=i.doc.sel}}function g(){if(t.contextMenuPending!=g){return}t.contextMenuPending=false;t.wrapper.style.cssText=h;n.style.cssText=c;if(u&&f<9){e.scrollbars.setScrollTop(e.scroller.scrollTop=l)}if(n.selectionStart!=null){if(!u||u&&f<9){p()}var r=0,o=function(){if(e.selForContextMenu==i.doc.sel&&n.selectionStart==0&&n.selectionEnd>0&&t.prevInput=="​"){Rn(i,qo)(i)}else if(r++<10){e.detectingSelectAll=setTimeout(o,500)}else{e.selForContextMenu=null;e.input.reset()}};e.detectingSelectAll=setTimeout(o,200)}}if(u&&f>=9){p()}if(y){Nr(r);var b=function(){wr(window,"mouseup",b);setTimeout(g,20)};gr(window,"mouseup",b)}else{setTimeout(g,50)}};aa.prototype.readOnlyChanged=function(r){if(!r){this.reset()}this.textarea.disabled=r=="nocursor";this.textarea.readOnly=!!r};aa.prototype.setUneditable=function(){};aa.prototype.needsContentAttribute=false;function la(r,t){t=t?F(t):{};t.value=r.value;if(!t.tabindex&&r.tabIndex){t.tabindex=r.tabIndex}if(!t.placeholder&&r.placeholder){t.placeholder=r.placeholder}if(t.autofocus==null){var i=O(r.ownerDocument);t.autofocus=i==r||r.getAttribute("autofocus")!=null&&i==document.body}function e(){r.value=f.getValue()}var n;if(r.form){gr(r.form,"submit",e);if(!t.leaveSubmitMethodAlone){var o=r.form;n=o.submit;try{var u=o.submit=function(){e();o.submit=n;o.submit();o.submit=u}}catch(r){}}}t.finishInit=function(i){i.save=e;i.getTextArea=function(){return r};i.toTextArea=function(){i.toTextArea=isNaN;e();r.parentNode.removeChild(i.getWrapperElement());r.style.display="";if(r.form){wr(r.form,"submit",e);if(!t.leaveSubmitMethodAlone&&typeof r.form.submit=="function"){r.form.submit=n}}}};r.style.display="none";var f=Ff((function(t){return r.parentNode.insertBefore(t,r.nextSibling)}),t);return f}function sa(r){r.off=wr;r.on=gr;r.wheelEventPixels=no;r.Doc=xu;r.splitLines=Ur;r.countColumn=P;r.findColumn=K;r.isWordChar=nr;r.Pass=$;r.signal=kr;r.Line=si;r.changeEnd=so;r.scrollbarModel=Mn;r.Pos=ft;r.cmpPos=at;r.modes=Pr;r.mimeModes=Gr;r.resolveMode=$r;r.getMode=_r;r.modeExtensions=Qr;r.extendMode=Jr;r.copyState=Kr;r.startState=Xr;r.innerMode=Yr;r.commands=Zu;r.keyMap=Fu;r.keyName=_u;r.isModifierKey=Vu;r.lookupKey=Hu;r.normalizeKeyMap=Gu;r.StringStream=qr;r.SharedTextMarker=wu;r.TextMarker=gu;r.LineWidget=hu;r.e_preventDefault=xr;r.e_stopPropagation=Lr;r.e_stop=Nr;r.addClass=R;r.contains=I;r.rmClass=L;r.keyNames=Uu}zf(Ff);qf(Ff);var ca="iter insert remove copy getEditor constructor".split(" ");for(var va in xu.prototype){if(xu.prototype.hasOwnProperty(va)&&H(ca,va)<0){Ff.prototype[va]=function(r){return function(){return r.apply(this.doc,arguments)}}(xu.prototype[va])}}yr(xu);Ff.inputStyles={textarea:aa,contenteditable:ta};Ff.defineMode=function(r){if(!Ff.defaults.mode&&r!="null"){Ff.defaults.mode=r}Hr.apply(this,arguments)};Ff.defineMIME=Vr;Ff.defineMode("null",(function(){return{token:function(r){return r.skipToEnd()}}}));Ff.defineMIME("text/plain","null");Ff.defineExtension=function(r,t){Ff.prototype[r]=t};Ff.defineDocExtension=function(r,t){xu.prototype[r]=t};Ff.fromTextArea=la;sa(Ff);Ff.version="5.65.9";return Ff}))}));n((function(r,t){(function(r){r(u)})((function(r){r.defineMode("javascript",(function(t,i){var e=t.indentUnit;var n=i.statementIndent;var o=i.jsonld;var u=i.json||o;var f=i.trackScope!==false;var a=i.typescript;var l=i.wordCharacters||/[\w$\xa1-\uffff]/;var s=function(){function r(r){return{type:r,style:"keyword"}}var t=r("keyword a"),i=r("keyword b"),e=r("keyword c"),n=r("keyword d");var o=r("operator"),u={type:"atom",style:"atom"};return{if:r("if"),while:t,with:t,else:i,do:i,try:i,finally:i,return:n,break:n,continue:n,new:r("new"),delete:e,void:e,throw:e,debugger:r("debugger"),var:r("var"),const:r("var"),let:r("var"),function:r("function"),catch:r("catch"),for:r("for"),switch:r("switch"),case:r("case"),default:r("default"),in:o,typeof:o,instanceof:o,true:u,false:u,null:u,undefined:u,NaN:u,Infinity:u,this:r("this"),class:r("class"),super:r("atom"),yield:e,export:r("export"),import:r("import"),extends:e,await:e}}();var c=/[+\-*&%=<>!?|~^@]/;var v=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function h(r){var t=false,i,e=false;while((i=r.next())!=null){if(!t){if(i=="/"&&!e)return;if(i=="[")e=true;else if(e&&i=="]")e=false}t=!t&&i=="\\"}}var d,m;function p(r,t,i){d=r;m=i;return t}function g(r,t){var i=r.next();if(i=='"'||i=="'"){t.tokenize=b(i);return t.tokenize(r,t)}else if(i=="."&&r.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/)){return p("number","number")}else if(i=="."&&r.match("..")){return p("spread","meta")}else if(/[\[\]{}\(\),;\:\.]/.test(i)){return p(i)}else if(i=="="&&r.eat(">")){return p("=>","operator")}else if(i=="0"&&r.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/)){return p("number","number")}else if(/\d/.test(i)){r.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/);return p("number","number")}else if(i=="/"){if(r.eat("*")){t.tokenize=w;return w(r,t)}else if(r.eat("/")){r.skipToEnd();return p("comment","comment")}else if(nt(r,t,1)){h(r);r.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/);return p("regexp","string-2")}else{r.eat("=");return p("operator","operator",r.current())}}else if(i=="`"){t.tokenize=k;return k(r,t)}else if(i=="#"&&r.peek()=="!"){r.skipToEnd();return p("meta","meta")}else if(i=="#"&&r.eatWhile(l)){return p("variable","property")}else if(i=="<"&&r.match("!--")||i=="-"&&r.match("->")&&!/\S/.test(r.string.slice(0,r.start))){r.skipToEnd();return p("comment","comment")}else if(c.test(i)){if(i!=">"||!t.lexical||t.lexical.type!=">"){if(r.eat("=")){if(i=="!"||i=="=")r.eat("=")}else if(/[<>*+\-|&?]/.test(i)){r.eat(i);if(i==">")r.eat(i)}}if(i=="?"&&r.eat("."))return p(".");return p("operator","operator",r.current())}else if(l.test(i)){r.eatWhile(l);var e=r.current();if(t.lastType!="."){if(s.propertyIsEnumerable(e)){var n=s[e];return p(n.type,n.style,e)}if(e=="async"&&r.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,false))return p("async","keyword",e)}return p("variable","variable",e)}}function b(r){return function(t,i){var e=false,n;if(o&&t.peek()=="@"&&t.match(v)){i.tokenize=g;return p("jsonld-keyword","meta")}while((n=t.next())!=null){if(n==r&&!e)break;e=!e&&n=="\\"}if(!e)i.tokenize=g;return p("string","string")}}function w(r,t){var i=false,e;while(e=r.next()){if(e=="/"&&i){t.tokenize=g;break}i=e=="*"}return p("comment","comment")}function k(r,t){var i=false,e;while((e=r.next())!=null){if(!i&&(e=="`"||e=="$"&&r.eat("{"))){t.tokenize=g;break}i=!i&&e=="\\"}return p("quasi","string-2",r.current())}var C="([{}])";function M(r,t){if(t.fatArrowAt)t.fatArrowAt=null;var i=r.string.indexOf("=>",r.start);if(i<0)return;if(a){var e=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(r.string.slice(r.start,i));if(e)i=e.index}var n=0,o=false;for(var u=i-1;u>=0;--u){var f=r.string.charAt(u);var s=C.indexOf(f);if(s>=0&&s<3){if(!n){++u;break}if(--n==0){if(f=="(")o=true;break}}else if(s>=3&&s<6){++n}else if(l.test(f)){o=true}else if(/["'\/`]/.test(f)){for(;;--u){if(u==0)return;var c=r.string.charAt(u-1);if(c==f&&r.string.charAt(u-2)!="\\"){u--;break}}}else if(o&&!n){++u;break}}if(o&&!n)t.fatArrowAt=u}var A={atom:true,number:true,variable:true,string:true,regexp:true,this:true,import:true,"jsonld-keyword":true};function y(r,t,i,e,n,o){this.indented=r;this.column=t;this.type=i;this.prev=n;this.info=o;if(e!=null)this.align=e}function x(r,t){if(!f)return false;for(var i=r.localVars;i;i=i.next)if(i.name==t)return true;for(var e=r.context;e;e=e.prev){for(var i=e.vars;i;i=i.next)if(i.name==t)return true}}function L(r,t,i,e,n){var o=r.cc;S.state=r;S.stream=n;S.marked=null,S.cc=o;S.style=t;if(!r.lexical.hasOwnProperty("align"))r.lexical.align=true;while(true){var f=o.length?o.pop():u?$:H;if(f(i,e)){while(o.length&&o[o.length-1].lex)o.pop()();if(S.marked)return S.marked;if(i=="variable"&&x(r,e))return"variable-2";return t}}}var S={state:null,column:null,marked:null,cc:null};function N(){for(var r=arguments.length-1;r>=0;r--)S.cc.push(arguments[r])}function E(){N.apply(null,arguments);return true}function D(r,t){for(var i=t;i;i=i.next)if(i.name==r)return true;return false}function T(r){var t=S.state;S.marked="def";if(!f)return;if(t.context){if(t.lexical.info=="var"&&t.context&&t.context.block){var e=I(r,t.context);if(e!=null){t.context=e;return}}else if(!D(r,t.localVars)){t.localVars=new B(r,t.localVars);return}}if(i.globalVars&&!D(r,t.globalVars))t.globalVars=new B(r,t.globalVars)}function I(r,t){if(!t){return null}else if(t.block){var i=I(r,t.prev);if(!i)return null;if(i==t.prev)return t;return new R(i,t.vars,true)}else if(D(r,t.vars)){return t}else{return new R(t.prev,new B(r,t.vars),false)}}function O(r){return r=="public"||r=="private"||r=="protected"||r=="abstract"||r=="readonly"}function R(r,t,i){this.prev=r;this.vars=t;this.block=i}function B(r,t){this.name=r;this.next=t}var U=new B("this",new B("arguments",null));function z(){S.state.context=new R(S.state.context,S.state.localVars,false);S.state.localVars=U}function j(){S.state.context=new R(S.state.context,S.state.localVars,true);S.state.localVars=null}z.lex=j.lex=true;function W(){S.state.localVars=S.state.context.vars;S.state.context=S.state.context.prev}W.lex=true;function F(r,t){var i=function(){var i=S.state,e=i.indented;if(i.lexical.type=="stat")e=i.lexical.indented;else for(var n=i.lexical;n&&n.type==")"&&n.align;n=n.prev)e=n.indented;i.lexical=new y(e,S.stream.column(),r,null,i.lexical,t)};i.lex=true;return i}function P(){var r=S.state;if(r.lexical.prev){if(r.lexical.type==")")r.indented=r.lexical.indented;r.lexical=r.lexical.prev}}P.lex=true;function G(r){function t(i){if(i==r)return E();else if(r==";"||i=="}"||i==")"||i=="]")return N();else return E(t)}return t}function H(r,t){if(r=="var")return E(F("vardef",t),Nr,G(";"),P);if(r=="keyword a")return E(F("form"),Q,H,P);if(r=="keyword b")return E(F("form"),H,P);if(r=="keyword d")return S.stream.match(/^\s*$/,false)?E():E(F("stat"),K,G(";"),P);if(r=="debugger")return E(G(";"));if(r=="{")return E(F("}"),j,vr,P,W);if(r==";")return E();if(r=="if"){if(S.state.lexical.info=="else"&&S.state.cc[S.state.cc.length-1]==P)S.state.cc.pop()();return E(F("form"),Q,H,P,Rr)}if(r=="function")return E(jr);if(r=="for")return E(F("form"),j,Br,H,W,P);if(r=="class"||a&&t=="interface"){S.marked="keyword";return E(F("form",r=="class"?r:t),Hr,P)}if(r=="variable"){if(a&&t=="declare"){S.marked="keyword";return E(H)}else if(a&&(t=="module"||t=="enum"||t=="type")&&S.stream.match(/^\s*\w/,false)){S.marked="keyword";if(t=="enum")return E(tt);else if(t=="type")return E(Fr,G("operator"),gr,G(";"));else return E(F("form"),Er,G("{"),F("}"),vr,P,P)}else if(a&&t=="namespace"){S.marked="keyword";return E(F("form"),$,H,P)}else if(a&&t=="abstract"){S.marked="keyword";return E(H)}else{return E(F("stat"),or)}}if(r=="switch")return E(F("form"),Q,G("{"),F("}","switch"),j,vr,P,P,W);if(r=="case")return E($,G(":"));if(r=="default")return E(G(":"));if(r=="catch")return E(F("form"),z,V,H,P,W);if(r=="export")return E(F("stat"),Qr,P);if(r=="import")return E(F("stat"),Kr,P);if(r=="async")return E(H);if(t=="@")return E($,H);return N(F("stat"),$,G(";"),P)}function V(r){if(r=="(")return E(Pr,G(")"))}function $(r,t){return J(r,t,false)}function _(r,t){return J(r,t,true)}function Q(r){if(r!="(")return N();return E(F(")"),K,G(")"),P)}function J(r,t,i){if(S.state.fatArrowAt==S.stream.start){var e=i?tr:rr;if(r=="(")return E(z,F(")"),sr(Pr,")"),P,G("=>"),e,W);else if(r=="variable")return N(z,Er,G("=>"),e,W)}var n=i?X:Y;if(A.hasOwnProperty(r))return E(n);if(r=="function")return E(jr,n);if(r=="class"||a&&t=="interface"){S.marked="keyword";return E(F("form"),Gr,P)}if(r=="keyword c"||r=="async")return E(i?_:$);if(r=="(")return E(F(")"),K,G(")"),P,n);if(r=="operator"||r=="spread")return E(i?_:$);if(r=="[")return E(F("]"),rt,P,n);if(r=="{")return cr(fr,"}",null,n);if(r=="quasi")return N(q,n);if(r=="new")return E(ir(i));return E()}function K(r){if(r.match(/[;\}\)\],]/))return N();return N($)}function Y(r,t){if(r==",")return E(K);return X(r,t,false)}function X(r,t,i){var e=i==false?Y:X;var n=i==false?$:_;if(r=="=>")return E(z,i?tr:rr,W);if(r=="operator"){if(/\+\+|--/.test(t)||a&&t=="!")return E(e);if(a&&t=="<"&&S.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,false))return E(F(">"),sr(gr,">"),P,e);if(t=="?")return E($,G(":"),n);return E(n)}if(r=="quasi"){return N(q,e)}if(r==";")return;if(r=="(")return cr(_,")","call",e);if(r==".")return E(ur,e);if(r=="[")return E(F("]"),K,G("]"),P,e);if(a&&t=="as"){S.marked="keyword";return E(gr,e)}if(r=="regexp"){S.state.lastType=S.marked="operator";S.stream.backUp(S.stream.pos-S.stream.start-1);return E(n)}}function q(r,t){if(r!="quasi")return N();if(t.slice(t.length-2)!="${")return E(q);return E(K,Z)}function Z(r){if(r=="}"){S.marked="string-2";S.state.tokenize=k;return E(q)}}function rr(r){M(S.stream,S.state);return N(r=="{"?H:$)}function tr(r){M(S.stream,S.state);return N(r=="{"?H:_)}function ir(r){return function(t){if(t==".")return E(r?nr:er);else if(t=="variable"&&a)return E(xr,r?X:Y);else return N(r?_:$)}}function er(r,t){if(t=="target"){S.marked="keyword";return E(Y)}}function nr(r,t){if(t=="target"){S.marked="keyword";return E(X)}}function or(r){if(r==":")return E(P,H);return N(Y,G(";"),P)}function ur(r){if(r=="variable"){S.marked="property";return E()}}function fr(r,t){if(r=="async"){S.marked="property";return E(fr)}else if(r=="variable"||S.style=="keyword"){S.marked="property";if(t=="get"||t=="set")return E(ar);var i;if(a&&S.state.fatArrowAt==S.stream.start&&(i=S.stream.match(/^\s*:\s*/,false)))S.state.fatArrowAt=S.stream.pos+i[0].length;return E(lr)}else if(r=="number"||r=="string"){S.marked=o?"property":S.style+" property";return E(lr)}else if(r=="jsonld-keyword"){return E(lr)}else if(a&&O(t)){S.marked="keyword";return E(fr)}else if(r=="["){return E($,hr,G("]"),lr)}else if(r=="spread"){return E(_,lr)}else if(t=="*"){S.marked="keyword";return E(fr)}else if(r==":"){return N(lr)}}function ar(r){if(r!="variable")return N(lr);S.marked="property";return E(jr)}function lr(r){if(r==":")return E(_);if(r=="(")return N(jr)}function sr(r,t,i){function e(n,o){if(i?i.indexOf(n)>-1:n==","){var u=S.state.lexical;if(u.info=="call")u.pos=(u.pos||0)+1;return E((function(i,e){if(i==t||e==t)return N();return N(r)}),e)}if(n==t||o==t)return E();if(i&&i.indexOf(";")>-1)return N(r);return E(G(t))}return function(i,n){if(i==t||n==t)return E();return N(r,e)}}function cr(r,t,i){for(var e=3;e<arguments.length;e++)S.cc.push(arguments[e]);return E(F(t,i),sr(r,t),P)}function vr(r){if(r=="}")return E();return N(H,vr)}function hr(r,t){if(a){if(r==":")return E(gr);if(t=="?")return E(hr)}}function dr(r,t){if(a&&(r==":"||t=="in"))return E(gr)}function mr(r){if(a&&r==":"){if(S.stream.match(/^\s*\w+\s+is\b/,false))return E($,pr,gr);else return E(gr)}}function pr(r,t){if(t=="is"){S.marked="keyword";return E()}}function gr(r,t){if(t=="keyof"||t=="typeof"||t=="infer"||t=="readonly"){S.marked="keyword";return E(t=="typeof"?_:gr)}if(r=="variable"||t=="void"){S.marked="type";return E(yr)}if(t=="|"||t=="&")return E(gr);if(r=="string"||r=="number"||r=="atom")return E(yr);if(r=="[")return E(F("]"),sr(gr,"]",","),P,yr);if(r=="{")return E(F("}"),wr,P,yr);if(r=="(")return E(sr(Ar,")"),br,yr);if(r=="<")return E(sr(gr,">"),gr);if(r=="quasi"){return N(Cr,yr)}}function br(r){if(r=="=>")return E(gr)}function wr(r){if(r.match(/[\}\)\]]/))return E();if(r==","||r==";")return E(wr);return N(kr,wr)}function kr(r,t){if(r=="variable"||S.style=="keyword"){S.marked="property";return E(kr)}else if(t=="?"||r=="number"||r=="string"){return E(kr)}else if(r==":"){return E(gr)}else if(r=="["){return E(G("variable"),dr,G("]"),kr)}else if(r=="("){return N(Wr,kr)}else if(!r.match(/[;\}\)\],]/)){return E()}}function Cr(r,t){if(r!="quasi")return N();if(t.slice(t.length-2)!="${")return E(Cr);return E(gr,Mr)}function Mr(r){if(r=="}"){S.marked="string-2";S.state.tokenize=k;return E(Cr)}}function Ar(r,t){if(r=="variable"&&S.stream.match(/^\s*[?:]/,false)||t=="?")return E(Ar);if(r==":")return E(gr);if(r=="spread")return E(Ar);return N(gr)}function yr(r,t){if(t=="<")return E(F(">"),sr(gr,">"),P,yr);if(t=="|"||r=="."||t=="&")return E(gr);if(r=="[")return E(gr,G("]"),yr);if(t=="extends"||t=="implements"){S.marked="keyword";return E(gr)}if(t=="?")return E(gr,G(":"),gr)}function xr(r,t){if(t=="<")return E(F(">"),sr(gr,">"),P,yr)}function Lr(){return N(gr,Sr)}function Sr(r,t){if(t=="=")return E(gr)}function Nr(r,t){if(t=="enum"){S.marked="keyword";return E(tt)}return N(Er,hr,Ir,Or)}function Er(r,t){if(a&&O(t)){S.marked="keyword";return E(Er)}if(r=="variable"){T(t);return E()}if(r=="spread")return E(Er);if(r=="[")return cr(Tr,"]");if(r=="{")return cr(Dr,"}")}function Dr(r,t){if(r=="variable"&&!S.stream.match(/^\s*:/,false)){T(t);return E(Ir)}if(r=="variable")S.marked="property";if(r=="spread")return E(Er);if(r=="}")return N();if(r=="[")return E($,G("]"),G(":"),Dr);return E(G(":"),Er,Ir)}function Tr(){return N(Er,Ir)}function Ir(r,t){if(t=="=")return E(_)}function Or(r){if(r==",")return E(Nr)}function Rr(r,t){if(r=="keyword b"&&t=="else")return E(F("form","else"),H,P)}function Br(r,t){if(t=="await")return E(Br);if(r=="(")return E(F(")"),Ur,P)}function Ur(r){if(r=="var")return E(Nr,zr);if(r=="variable")return E(zr);return N(zr)}function zr(r,t){if(r==")")return E();if(r==";")return E(zr);if(t=="in"||t=="of"){S.marked="keyword";return E($,zr)}return N($,zr)}function jr(r,t){if(t=="*"){S.marked="keyword";return E(jr)}if(r=="variable"){T(t);return E(jr)}if(r=="(")return E(z,F(")"),sr(Pr,")"),P,mr,H,W);if(a&&t=="<")return E(F(">"),sr(Lr,">"),P,jr)}function Wr(r,t){if(t=="*"){S.marked="keyword";return E(Wr)}if(r=="variable"){T(t);return E(Wr)}if(r=="(")return E(z,F(")"),sr(Pr,")"),P,mr,W);if(a&&t=="<")return E(F(">"),sr(Lr,">"),P,Wr)}function Fr(r,t){if(r=="keyword"||r=="variable"){S.marked="type";return E(Fr)}else if(t=="<"){return E(F(">"),sr(Lr,">"),P)}}function Pr(r,t){if(t=="@")E($,Pr);if(r=="spread")return E(Pr);if(a&&O(t)){S.marked="keyword";return E(Pr)}if(a&&r=="this")return E(hr,Ir);return N(Er,hr,Ir)}function Gr(r,t){if(r=="variable")return Hr(r,t);return Vr(r,t)}function Hr(r,t){if(r=="variable"){T(t);return E(Vr)}}function Vr(r,t){if(t=="<")return E(F(">"),sr(Lr,">"),P,Vr);if(t=="extends"||t=="implements"||a&&r==","){if(t=="implements")S.marked="keyword";return E(a?gr:$,Vr)}if(r=="{")return E(F("}"),$r,P)}function $r(r,t){if(r=="async"||r=="variable"&&(t=="static"||t=="get"||t=="set"||a&&O(t))&&S.stream.match(/^\s+[\w$\xa1-\uffff]/,false)){S.marked="keyword";return E($r)}if(r=="variable"||S.style=="keyword"){S.marked="property";return E(_r,$r)}if(r=="number"||r=="string")return E(_r,$r);if(r=="[")return E($,hr,G("]"),_r,$r);if(t=="*"){S.marked="keyword";return E($r)}if(a&&r=="(")return N(Wr,$r);if(r==";"||r==",")return E($r);if(r=="}")return E();if(t=="@")return E($,$r)}function _r(r,t){if(t=="!")return E(_r);if(t=="?")return E(_r);if(r==":")return E(gr,Ir);if(t=="=")return E(_);var i=S.state.lexical.prev,e=i&&i.info=="interface";return N(e?Wr:jr)}function Qr(r,t){if(t=="*"){S.marked="keyword";return E(Zr,G(";"))}if(t=="default"){S.marked="keyword";return E($,G(";"))}if(r=="{")return E(sr(Jr,"}"),Zr,G(";"));return N(H)}function Jr(r,t){if(t=="as"){S.marked="keyword";return E(G("variable"))}if(r=="variable")return N(_,Jr)}function Kr(r){if(r=="string")return E();if(r=="(")return N($);if(r==".")return N(Y);return N(Yr,Xr,Zr)}function Yr(r,t){if(r=="{")return cr(Yr,"}");if(r=="variable")T(t);if(t=="*")S.marked="keyword";return E(qr)}function Xr(r){if(r==",")return E(Yr,Xr)}function qr(r,t){if(t=="as"){S.marked="keyword";return E(Yr)}}function Zr(r,t){if(t=="from"){S.marked="keyword";return E($)}}function rt(r){if(r=="]")return E();return N(sr(_,"]"))}function tt(){return N(F("form"),Er,G("{"),F("}"),sr(it,"}"),P,P)}function it(){return N(Er,Ir)}function et(r,t){return r.lastType=="operator"||r.lastType==","||c.test(t.charAt(0))||/[,.]/.test(t.charAt(0))}function nt(r,t,i){return t.tokenize==g&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(t.lastType)||t.lastType=="quasi"&&/\{\s*$/.test(r.string.slice(0,r.pos-(i||0)))}return{startState:function(r){var t={tokenize:g,lastType:"sof",cc:[],lexical:new y((r||0)-e,0,"block",false),localVars:i.localVars,context:i.localVars&&new R(null,null,false),indented:r||0};if(i.globalVars&&typeof i.globalVars=="object")t.globalVars=i.globalVars;return t},token:function(r,t){if(r.sol()){if(!t.lexical.hasOwnProperty("align"))t.lexical.align=false;t.indented=r.indentation();M(r,t)}if(t.tokenize!=w&&r.eatSpace())return null;var i=t.tokenize(r,t);if(d=="comment")return i;t.lastType=d=="operator"&&(m=="++"||m=="--")?"incdec":d;return L(t,i,d,m,r)},indent:function(t,o){if(t.tokenize==w||t.tokenize==k)return r.Pass;if(t.tokenize!=g)return 0;var u=o&&o.charAt(0),f=t.lexical,a;if(!/^\s*else\b/.test(o))for(var l=t.cc.length-1;l>=0;--l){var s=t.cc[l];if(s==P)f=f.prev;else if(s!=Rr&&s!=W)break}while((f.type=="stat"||f.type=="form")&&(u=="}"||(a=t.cc[t.cc.length-1])&&(a==Y||a==X)&&!/^[,\.=+\-*:?[\(]/.test(o)))f=f.prev;if(n&&f.type==")"&&f.prev.type=="stat")f=f.prev;var c=f.type,v=u==c;if(c=="vardef")return f.indented+(t.lastType=="operator"||t.lastType==","?f.info.length+1:0);else if(c=="form"&&u=="{")return f.indented;else if(c=="form")return f.indented+e;else if(c=="stat")return f.indented+(et(t,o)?n||e:0);else if(f.info=="switch"&&!v&&i.doubleIndentSwitch!=false)return f.indented+(/^(?:case|default)\b/.test(o)?e:2*e);else if(f.align)return f.column+(v?0:1);else return f.indented+(v?0:e)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:u?null:"/*",blockCommentEnd:u?null:"*/",blockCommentContinue:u?null:" * ",lineComment:u?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:u?"json":"javascript",jsonldMode:o,jsonMode:u,expressionAllowed:nt,skipExpression:function(t){L(t,"atom","atom","true",new r.StringStream("",2,null))}}}));r.registerHelper("wordChars","javascript",/[\w$]/);r.defineMIME("text/javascript","javascript");r.defineMIME("text/ecmascript","javascript");r.defineMIME("application/javascript","javascript");r.defineMIME("application/x-javascript","javascript");r.defineMIME("application/ecmascript","javascript");r.defineMIME("application/json",{name:"javascript",json:true});r.defineMIME("application/x-json",{name:"javascript",json:true});r.defineMIME("application/manifest+json",{name:"javascript",json:true});r.defineMIME("application/ld+json",{name:"javascript",jsonld:true});r.defineMIME("text/typescript",{name:"javascript",typescript:true});r.defineMIME("application/typescript",{name:"javascript",typescript:true})}))}));n((function(r,t){(function(r){r(u)})((function(r){var t="CodeMirror-activeline";var i="CodeMirror-activeline-background";var e="CodeMirror-activeline-gutter";r.defineOption("styleActiveLine",false,(function(t,i,e){var o=e==r.Init?false:e;if(i==o)return;if(o){t.off("beforeSelectionChange",f);n(t);delete t.state.activeLines}if(i){t.state.activeLines=[];u(t,t.listSelections());t.on("beforeSelectionChange",f)}}));function n(r){for(var n=0;n<r.state.activeLines.length;n++){r.removeLineClass(r.state.activeLines[n],"wrap",t);r.removeLineClass(r.state.activeLines[n],"background",i);r.removeLineClass(r.state.activeLines[n],"gutter",e)}}function o(r,t){if(r.length!=t.length)return false;for(var i=0;i<r.length;i++)if(r[i]!=t[i])return false;return true}function u(r,u){var f=[];for(var a=0;a<u.length;a++){var l=u[a];var s=r.getOption("styleActiveLine");if(typeof s=="object"&&s.nonEmpty?l.anchor.line!=l.head.line:!l.empty())continue;var c=r.getLineHandleVisualStart(l.head.line);if(f[f.length-1]!=c)f.push(c)}if(o(r.state.activeLines,f))return;r.operation((function(){n(r);for(var o=0;o<f.length;o++){r.addLineClass(f[o],"wrap",t);r.addLineClass(f[o],"background",i);r.addLineClass(f[o],"gutter",e)}r.state.activeLines=f}))}function f(r,t){u(r,t.ranges)}}))}));n((function(r,t){(function(r){r(u)})((function(r){var t=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8);var i=r.Pos;var e={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function n(r){return r&&r.bracketRegex||/[(){}[\]]/}function o(r,t,o){var f=r.getLineHandle(t.line),a=t.ch-1;var l=o&&o.afterCursor;if(l==null)l=/(^| )cm-fat-cursor($| )/.test(r.getWrapperElement().className);var s=n(o);var c=!l&&a>=0&&s.test(f.text.charAt(a))&&e[f.text.charAt(a)]||s.test(f.text.charAt(a+1))&&e[f.text.charAt(++a)];if(!c)return null;var v=c.charAt(1)==">"?1:-1;if(o&&o.strict&&v>0!=(a==t.ch))return null;var h=r.getTokenTypeAt(i(t.line,a+1));var d=u(r,i(t.line,a+(v>0?1:0)),v,h,o);if(d==null)return null;return{from:i(t.line,a),to:d&&d.pos,match:d&&d.ch==c.charAt(0),forward:v>0}}function u(r,t,o,u,f){var a=f&&f.maxScanLineLength||1e4;var l=f&&f.maxScanLines||1e3;var s=[];var c=n(f);var v=o>0?Math.min(t.line+l,r.lastLine()+1):Math.max(r.firstLine()-1,t.line-l);for(var h=t.line;h!=v;h+=o){var d=r.getLine(h);if(!d)continue;var m=o>0?0:d.length-1,p=o>0?d.length:-1;if(d.length>a)continue;if(h==t.line)m=t.ch-(o<0?1:0);for(;m!=p;m+=o){var g=d.charAt(m);if(c.test(g)&&(u===undefined||(r.getTokenTypeAt(i(h,m+1))||"")==(u||""))){var b=e[g];if(b&&b.charAt(1)==">"==o>0)s.push(g);else if(!s.length)return{pos:i(h,m),ch:g};else s.pop()}}}return h-o==(o>0?r.lastLine():r.firstLine())?false:null}function f(r,e,n){var u=r.state.matchBrackets.maxHighlightLineLength||1e3,f=n&&n.highlightNonMatching;var a=[],l=r.listSelections();for(var s=0;s<l.length;s++){var c=l[s].empty()&&o(r,l[s].head,n);if(c&&(c.match||f!==false)&&r.getLine(c.from.line).length<=u){var v=c.match?"CodeMirror-matchingbracket":"CodeMirror-nonmatchingbracket";a.push(r.markText(c.from,i(c.from.line,c.from.ch+1),{className:v}));if(c.to&&r.getLine(c.to.line).length<=u)a.push(r.markText(c.to,i(c.to.line,c.to.ch+1),{className:v}))}}if(a.length){if(t&&r.state.focused)r.focus();var h=function(){r.operation((function(){for(var r=0;r<a.length;r++)a[r].clear()}))};if(e)setTimeout(h,800);else return h}}function a(r){r.operation((function(){if(r.state.matchBrackets.currentlyHighlighted){r.state.matchBrackets.currentlyHighlighted();r.state.matchBrackets.currentlyHighlighted=null}r.state.matchBrackets.currentlyHighlighted=f(r,false,r.state.matchBrackets)}))}function l(r){if(r.state.matchBrackets&&r.state.matchBrackets.currentlyHighlighted){r.state.matchBrackets.currentlyHighlighted();r.state.matchBrackets.currentlyHighlighted=null}}r.defineOption("matchBrackets",false,(function(t,i,e){if(e&&e!=r.Init){t.off("cursorActivity",a);t.off("focus",a);t.off("blur",l);l(t)}if(i){t.state.matchBrackets=typeof i=="object"?i:{};t.on("cursorActivity",a);t.on("focus",a);t.on("blur",l)}}));r.defineExtension("matchBrackets",(function(){f(this,true)}));r.defineExtension("findMatchingBracket",(function(r,t,i){if(i||typeof t=="boolean"){if(!i){t=t?{strict:true}:null}else{i.strict=t;t=i}}return o(this,r,t)}));r.defineExtension("scanForBracket",(function(r,t,i,e){return u(this,r,t,i,e)}))}))}));n((function(r,t){(function(r){r(u)})((function(r){var t="CodeMirror-lint-markers";var i="CodeMirror-lint-line-";function e(t,i,e){var n=document.createElement("div");n.className="CodeMirror-lint-tooltip cm-s-"+t.options.theme;n.appendChild(e.cloneNode(true));if(t.state.lint.options.selfContain)t.getWrapperElement().appendChild(n);else document.body.appendChild(n);function o(t){if(!n.parentNode)return r.off(document,"mousemove",o);n.style.top=Math.max(0,t.clientY-n.offsetHeight-5)+"px";n.style.left=t.clientX+5+"px"}r.on(document,"mousemove",o);o(i);if(n.style.opacity!=null)n.style.opacity=1;return n}function n(r){if(r.parentNode)r.parentNode.removeChild(r)}function o(r){if(!r.parentNode)return;if(r.style.opacity==null)n(r);r.style.opacity=0;setTimeout((function(){n(r)}),600)}function u(t,i,n,u){var f=e(t,i,n);function a(){r.off(u,"mouseout",a);if(f){o(f);f=null}}var l=setInterval((function(){if(f)for(var r=u;;r=r.parentNode){if(r&&r.nodeType==11)r=r.host;if(r==document.body)return;if(!r){a();break}}if(!f)return clearInterval(l)}),400);r.on(u,"mouseout",a)}function f(r,t,i){this.marked=[];if(t instanceof Function)t={getAnnotations:t};if(!t||t===true)t={};this.options={};this.linterOptions=t.options||{};for(var e in a)this.options[e]=a[e];for(var e in t){if(a.hasOwnProperty(e)){if(t[e]!=null)this.options[e]=t[e]}else if(!t.options){this.linterOptions[e]=t[e]}}this.timeout=null;this.hasGutter=i;this.onMouseOver=function(t){k(r,t)};this.waitingFor=0}var a={highlightLines:false,tooltips:true,delay:500,lintOnChange:true,getAnnotations:null,async:false,selfContain:null,formatAnnotation:null,onUpdateLinting:null};function l(r){var i=r.state.lint;if(i.hasGutter)r.clearGutter(t);if(i.options.highlightLines)s(r);for(var e=0;e<i.marked.length;++e)i.marked[e].clear();i.marked.length=0}function s(r){r.eachLine((function(t){var i=t.wrapClass&&/\bCodeMirror-lint-line-\w+\b/.exec(t.wrapClass);if(i)r.removeLineClass(t,"wrap",i[0])}))}function c(t,i,e,n,o){var f=document.createElement("div"),a=f;f.className="CodeMirror-lint-marker CodeMirror-lint-marker-"+e;if(n){a=f.appendChild(document.createElement("div"));a.className="CodeMirror-lint-marker CodeMirror-lint-marker-multiple"}if(o!=false)r.on(a,"mouseover",(function(r){u(t,r,i,a)}));return f}function v(r,t){if(r=="error")return r;else return t}function h(r){var t=[];for(var i=0;i<r.length;++i){var e=r[i],n=e.from.line;(t[n]||(t[n]=[])).push(e)}return t}function d(r){var t=r.severity;if(!t)t="error";var i=document.createElement("div");i.className="CodeMirror-lint-message CodeMirror-lint-message-"+t;if(typeof r.messageHTML!="undefined"){i.innerHTML=r.messageHTML}else{i.appendChild(document.createTextNode(r.message))}return i}function m(t,i){var e=t.state.lint;var n=++e.waitingFor;function o(){n=-1;t.off("change",o)}t.on("change",o);i(t.getValue(),(function(i,u){t.off("change",o);if(e.waitingFor!=n)return;if(u&&i instanceof r)i=u;t.operation((function(){g(t,i)}))}),e.linterOptions,t)}function p(t){var i=t.state.lint;if(!i)return;var e=i.options;var n=e.getAnnotations||t.getHelper(r.Pos(0,0),"lint");if(!n)return;if(e.async||n.async){m(t,n)}else{var o=n(t.getValue(),i.linterOptions,t);if(!o)return;if(o.then)o.then((function(r){t.operation((function(){g(t,r)}))}));else t.operation((function(){g(t,o)}))}}function g(r,e){var n=r.state.lint;if(!n)return;var o=n.options;l(r);var u=h(e);for(var f=0;f<u.length;++f){var a=u[f];if(!a)continue;var s=[];a=a.filter((function(r){return s.indexOf(r.message)>-1?false:s.push(r.message)}));var m=null;var p=n.hasGutter&&document.createDocumentFragment();for(var g=0;g<a.length;++g){var b=a[g];var w=b.severity;if(!w)w="error";m=v(m,w);if(o.formatAnnotation)b=o.formatAnnotation(b);if(n.hasGutter)p.appendChild(d(b));if(b.to)n.marked.push(r.markText(b.from,b.to,{className:"CodeMirror-lint-mark CodeMirror-lint-mark-"+w,__annotation:b}))}if(n.hasGutter)r.setGutterMarker(f,t,c(r,p,m,u[f].length>1,o.tooltips));if(o.highlightLines)r.addLineClass(f,"wrap",i+m)}if(o.onUpdateLinting)o.onUpdateLinting(e,u,r)}function b(r){var t=r.state.lint;if(!t)return;clearTimeout(t.timeout);t.timeout=setTimeout((function(){p(r)}),t.options.delay)}function w(r,t,i){var e=i.target||i.srcElement;var n=document.createDocumentFragment();for(var o=0;o<t.length;o++){var f=t[o];n.appendChild(d(f))}u(r,i,n,e)}function k(r,t){var i=t.target||t.srcElement;if(!/\bCodeMirror-lint-mark-/.test(i.className))return;var e=i.getBoundingClientRect(),n=(e.left+e.right)/2,o=(e.top+e.bottom)/2;var u=r.findMarksAt(r.coordsChar({left:n,top:o},"client"));var f=[];for(var a=0;a<u.length;++a){var l=u[a].__annotation;if(l)f.push(l)}if(f.length)w(r,f,t)}r.defineOption("lint",false,(function(i,e,n){if(n&&n!=r.Init){l(i);if(i.state.lint.options.lintOnChange!==false)i.off("change",b);r.off(i.getWrapperElement(),"mouseover",i.state.lint.onMouseOver);clearTimeout(i.state.lint.timeout);delete i.state.lint}if(e){var o=i.getOption("gutters"),u=false;for(var a=0;a<o.length;++a)if(o[a]==t)u=true;var s=i.state.lint=new f(i,e,u);if(s.options.lintOnChange)i.on("change",b);if(s.options.tooltips!=false&&s.options.tooltips!="gutter")r.on(i.getWrapperElement(),"mouseover",s.onMouseOver);p(i)}}));r.defineExtension("performLint",(function(){p(this)}))}))}));n((function(r,t){(function(r){r(u)})((function(r){r.registerHelper("lint","json",(function(t){var i=[];if(!window.jsonlint){if(window.console){window.console.error("Error: window.jsonlint not defined, CodeMirror JSON linting cannot run.")}return i}var e=window.jsonlint.parser||window.jsonlint;e.parseError=function(t,e){var n=e.loc;i.push({from:r.Pos(n.first_line-1,n.first_column),to:r.Pos(n.last_line-1,n.last_column),message:t})};try{e.parse(t)}catch(r){}return i}))}))}));var f=n((function(r,t){(function(r){r(u)})((function(r){function t(t,e,o,u){if(o&&o.call){var f=o;o=null}else{var f=n(t,o,"rangeFinder")}if(typeof e=="number")e=r.Pos(e,0);var a=n(t,o,"minFoldSize");function l(r){var i=f(t,e);if(!i||i.to.line-i.from.line<a)return null;if(u==="fold")return i;var n=t.findMarksAt(i.from);for(var o=0;o<n.length;++o){if(n[o].__isFold){if(!r)return null;i.cleared=true;n[o].clear()}}return i}var s=l(true);if(n(t,o,"scanUp"))while(!s&&e.line>t.firstLine()){e=r.Pos(e.line-1,0);s=l(false)}if(!s||s.cleared||u==="unfold")return;var c=i(t,o,s);r.on(c,"mousedown",(function(t){v.clear();r.e_preventDefault(t)}));var v=t.markText(s.from,s.to,{replacedWith:c,clearOnEnter:n(t,o,"clearOnEnter"),__isFold:true});v.on("clear",(function(i,e){r.signal(t,"unfold",t,i,e)}));r.signal(t,"fold",t,s.from,s.to)}function i(r,t,i){var e=n(r,t,"widget");if(typeof e=="function"){e=e(i.from,i.to)}if(typeof e=="string"){var o=document.createTextNode(e);e=document.createElement("span");e.appendChild(o);e.className="CodeMirror-foldmarker"}else if(e){e=e.cloneNode(true)}return e}r.newFoldFunction=function(r,i){return function(e,n){t(e,n,{rangeFinder:r,widget:i})}};r.defineExtension("foldCode",(function(r,i,e){t(this,r,i,e)}));r.defineExtension("isFolded",(function(r){var t=this.findMarksAt(r);for(var i=0;i<t.length;++i)if(t[i].__isFold)return true}));r.commands.toggleFold=function(r){r.foldCode(r.getCursor())};r.commands.fold=function(r){r.foldCode(r.getCursor(),null,"fold")};r.commands.unfold=function(r){r.foldCode(r.getCursor(),{scanUp:false},"unfold")};r.commands.foldAll=function(t){t.operation((function(){for(var i=t.firstLine(),e=t.lastLine();i<=e;i++)t.foldCode(r.Pos(i,0),{scanUp:false},"fold")}))};r.commands.unfoldAll=function(t){t.operation((function(){for(var i=t.firstLine(),e=t.lastLine();i<=e;i++)t.foldCode(r.Pos(i,0),{scanUp:false},"unfold")}))};r.registerHelper("fold","combine",(function(){var r=Array.prototype.slice.call(arguments,0);return function(t,i){for(var e=0;e<r.length;++e){var n=r[e](t,i);if(n)return n}}}));r.registerHelper("fold","auto",(function(r,t){var i=r.getHelpers(t,"fold");for(var e=0;e<i.length;e++){var n=i[e](r,t);if(n)return n}}));var e={rangeFinder:r.fold.auto,widget:"↔",minFoldSize:0,scanUp:false,clearOnEnter:true};r.defineOption("foldOptions",null);function n(r,t,i){if(t&&t[i]!==undefined)return t[i];var n=r.options.foldOptions;if(n&&n[i]!==undefined)return n[i];return e[i]}r.defineExtension("foldOption",(function(r,t){return n(this,r,t)}))}))}));n((function(r,t){(function(r){r(u,f)})((function(r){r.defineOption("foldGutter",false,(function(t,n,o){if(o&&o!=r.Init){t.clearGutter(t.state.foldGutter.options.gutter);t.state.foldGutter=null;t.off("gutterClick",l);t.off("changes",c);t.off("viewportChange",v);t.off("fold",h);t.off("unfold",h);t.off("swapDoc",c);t.off("optionChange",s)}if(n){t.state.foldGutter=new i(e(n));a(t);t.on("gutterClick",l);t.on("changes",c);t.on("viewportChange",v);t.on("fold",h);t.on("unfold",h);t.on("swapDoc",c);t.on("optionChange",s)}}));var t=r.Pos;function i(r){this.options=r;this.from=this.to=0}function e(r){if(r===true)r={};if(r.gutter==null)r.gutter="CodeMirror-foldgutter";if(r.indicatorOpen==null)r.indicatorOpen="CodeMirror-foldgutter-open";if(r.indicatorFolded==null)r.indicatorFolded="CodeMirror-foldgutter-folded";return r}function n(r,i){var e=r.findMarks(t(i,0),t(i+1,0));for(var n=0;n<e.length;++n){if(e[n].__isFold){var o=e[n].find(-1);if(o&&o.line===i)return e[n]}}}function o(r){if(typeof r=="string"){var t=document.createElement("div");t.className=r+" CodeMirror-guttermarker-subtle";return t}else{return r.cloneNode(true)}}function u(r,i,e){var u=r.state.foldGutter.options,a=i-1;var l=r.foldOption(u,"minFoldSize");var s=r.foldOption(u,"rangeFinder");var c=typeof u.indicatorFolded=="string"&&f(u.indicatorFolded);var v=typeof u.indicatorOpen=="string"&&f(u.indicatorOpen);r.eachLine(i,e,(function(i){++a;var e=null;var f=i.gutterMarkers;if(f)f=f[u.gutter];if(n(r,a)){if(c&&f&&c.test(f.className))return;e=o(u.indicatorFolded)}else{var h=t(a,0);var d=s&&s(r,h);if(d&&d.to.line-d.from.line>=l){if(v&&f&&v.test(f.className))return;e=o(u.indicatorOpen)}}if(!e&&!f)return;r.setGutterMarker(i,u.gutter,e)}))}function f(r){return new RegExp("(^|\\s)"+r+"(?:$|\\s)\\s*")}function a(r){var t=r.getViewport(),i=r.state.foldGutter;if(!i)return;r.operation((function(){u(r,t.from,t.to)}));i.from=t.from;i.to=t.to}function l(r,i,e){var o=r.state.foldGutter;if(!o)return;var u=o.options;if(e!=u.gutter)return;var f=n(r,i);if(f)f.clear();else r.foldCode(t(i,0),u)}function s(r,t){if(t=="mode")c(r)}function c(r){var t=r.state.foldGutter;if(!t)return;var i=t.options;t.from=t.to=0;clearTimeout(t.changeUpdate);t.changeUpdate=setTimeout((function(){a(r)}),i.foldOnChangeTimeSpan||600)}function v(r){var t=r.state.foldGutter;if(!t)return;var i=t.options;clearTimeout(t.changeUpdate);t.changeUpdate=setTimeout((function(){var i=r.getViewport();if(t.from==t.to||i.from-t.to>20||t.from-i.to>20){a(r)}else{r.operation((function(){if(i.from<t.from){u(r,i.from,t.from);t.from=i.from}if(i.to>t.to){u(r,t.to,i.to);t.to=i.to}}))}}),i.updateViewportTimeSpan||400)}function h(r,t){var i=r.state.foldGutter;if(!i)return;var e=t.line;if(e>=i.from&&e<i.to)u(r,e,e+1)}}))}));n((function(r,t){(function(r){r(u)})((function(r){function t(t){return function(i,e){var n=e.line,o=i.getLine(n);function u(t){var u;for(var f=e.ch,a=0;;){var l=f<=0?-1:o.lastIndexOf(t[0],f-1);if(l==-1){if(a==1)break;a=1;f=o.length;continue}if(a==1&&l<e.ch)break;u=i.getTokenTypeAt(r.Pos(n,l+1));if(!/^(comment|string)/.test(u))return{ch:l+1,tokenType:u,pair:t};f=l-1}}function f(t){var e=1,o=i.lastLine(),u,f=t.ch,a;r:for(var l=n;l<=o;++l){var s=i.getLine(l),c=l==n?f:0;for(;;){var v=s.indexOf(t.pair[0],c),h=s.indexOf(t.pair[1],c);if(v<0)v=s.length;if(h<0)h=s.length;c=Math.min(v,h);if(c==s.length)break;if(i.getTokenTypeAt(r.Pos(l,c+1))==t.tokenType){if(c==v)++e;else if(!--e){u=l;a=c;break r}}++c}}if(u==null||n==u)return null;return{from:r.Pos(n,f),to:r.Pos(u,a)}}var a=[];for(var l=0;l<t.length;l++){var s=u(t[l]);if(s)a.push(s)}a.sort((function(r,t){return r.ch-t.ch}));for(var l=0;l<a.length;l++){var c=f(a[l]);if(c)return c}return null}}r.registerHelper("fold","brace",t([["{","}"],["[","]"]]));r.registerHelper("fold","brace-paren",t([["{","}"],["[","]"],["(",")"]]));r.registerHelper("fold","import",(function(t,i){function e(i){if(i<t.firstLine()||i>t.lastLine())return null;var e=t.getTokenAt(r.Pos(i,1));if(!/\S/.test(e.string))e=t.getTokenAt(r.Pos(i,e.end+1));if(e.type!="keyword"||e.string!="import")return null;for(var n=i,o=Math.min(t.lastLine(),i+10);n<=o;++n){var u=t.getLine(n),f=u.indexOf(";");if(f!=-1)return{startCh:e.end,end:r.Pos(n,f)}}}var n=i.line,o=e(n),u;if(!o||e(n-1)||(u=e(n-2))&&u.end.line==n-1)return null;for(var f=o.end;;){var a=e(f.line+1);if(a==null)break;f=a.end}return{from:t.clipPos(r.Pos(n,o.startCh+1)),to:f}}));r.registerHelper("fold","include",(function(t,i){function e(i){if(i<t.firstLine()||i>t.lastLine())return null;var e=t.getTokenAt(r.Pos(i,1));if(!/\S/.test(e.string))e=t.getTokenAt(r.Pos(i,e.end+1));if(e.type=="meta"&&e.string.slice(0,8)=="#include")return e.start+8}var n=i.line,o=e(n);if(o==null||e(n-1)!=null)return null;for(var u=n;;){var f=e(u+1);if(f==null)break;++u}return{from:r.Pos(n,o+1),to:t.clipPos(r.Pos(u))}}))}))}));var a=n((function(r){var t=function(){var r=true,t=false;var i={};var e=function(){var r;var t;var i={'"':'"',"\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};var e;var n=function(t){throw{name:"SyntaxError",message:t,at:r,text:e}};var o=function(i){if(i&&i!==t){n("Expected '"+i+"' instead of '"+t+"'")}t=e.charAt(r);r+=1;return t};var u=function(){var r;var i="";if(t==="-"){i="-";o("-")}while(t>="0"&&t<="9"){i+=t;o()}if(t==="."){i+=".";while(o()&&t>="0"&&t<="9"){i+=t}}if(t==="e"||t==="E"){i+=t;o();if(t==="-"||t==="+"){i+=t;o()}while(t>="0"&&t<="9"){i+=t;o()}}r=+i;if(!isFinite(r)){n("Bad number")}else{return r}};var f=function(){var r;var e;var u="";var f;if(t==='"'){while(o()){if(t==='"'){o();return u}if(t==="\\"){o();if(t==="u"){f=0;for(e=0;e<4;e+=1){r=parseInt(o(),16);if(!isFinite(r)){break}f=f*16+r}u+=String.fromCharCode(f)}else if(typeof i[t]==="string"){u+=i[t]}else{break}}else{u+=t}}}n("Bad string")};var a=function(){while(t&&t<=" "){o()}};var l=function(){switch(t){case"t":o("t");o("r");o("u");o("e");return true;case"f":o("f");o("a");o("l");o("s");o("e");return false;case"n":o("n");o("u");o("l");o("l");return null}n("Unexpected '"+t+"'")};var s;var c=function(){var r=[];if(t==="["){o("[");a();if(t==="]"){o("]");return r}while(t){r.push(s());a();if(t==="]"){o("]");return r}o(",");a()}}n("Bad array")};var v=function(){var r;var i={};if(t==="{"){o("{");a();if(t==="}"){o("}");return i}while(t){r=f();a();o(":");if(Object.hasOwnProperty.call(i,r)){n("Duplicate key '"+r+"'")}i[r]=s();a();if(t==="}"){o("}");return i}o(",");a()}}n("Bad object")};s=function(){a();switch(t){case"{":return v();case"[":return c();case'"':return f();case"-":return u();default:return t>="0"&&t<="9"?u():l()}};return function(i,o){var u;e=i;r=0;t=" ";u=s();a();if(t){n("Syntax error")}return typeof o==="function"?function r(t,i){var e;var n;var u=t[i];if(u&&typeof u==="object"){for(e in u){if(Object.prototype.hasOwnProperty.call(u,e)){n=r(u,e);if(n!==undefined){u[e]=n}else{delete u[e]}}}}return o.call(t,i,u)}({"":u},""):u}}();var n=function(){var r={trace:function r(){},yy:{},symbols_:{error:2,JSONString:3,STRING:4,JSONNumber:5,NUMBER:6,JSONNullLiteral:7,NULL:8,JSONBooleanLiteral:9,TRUE:10,FALSE:11,JSONText:12,JSONValue:13,EOF:14,JSONObject:15,JSONArray:16,"{":17,"}":18,JSONMemberList:19,JSONMember:20,":":21,",":22,"[":23,"]":24,JSONElementList:25,$accept:0,$end:1},terminals_:{2:"error",4:"STRING",6:"NUMBER",8:"NULL",10:"TRUE",11:"FALSE",14:"EOF",17:"{",18:"}",21:":",22:",",23:"[",24:"]"},productions_:[0,[3,1],[5,1],[7,1],[9,1],[9,1],[12,2],[13,1],[13,1],[13,1],[13,1],[13,1],[13,1],[15,2],[15,3],[20,3],[19,1],[19,3],[16,2],[16,3],[25,1],[25,3]],performAction:function r(t,i,e,n,o,u,f){var a=u.length-1;switch(o){case 1:this.$=t.replace(/\\(\\|")/g,"$"+"1").replace(/\\n/g,"\n").replace(/\\r/g,"\r").replace(/\\t/g,"\t").replace(/\\v/g,"\v").replace(/\\f/g,"\f").replace(/\\b/g,"\b");break;case 2:this.$=Number(t);break;case 3:this.$=null;break;case 4:this.$=true;break;case 5:this.$=false;break;case 6:return this.$=u[a-1];case 13:this.$={};break;case 14:this.$=u[a-1];break;case 15:this.$=[u[a-2],u[a]];break;case 16:this.$={};this.$[u[a][0]]=u[a][1];break;case 17:this.$=u[a-2];u[a-2][u[a][0]]=u[a][1];break;case 18:this.$=[];break;case 19:this.$=u[a-1];break;case 20:this.$=[u[a]];break;case 21:this.$=u[a-2];u[a-2].push(u[a]);break}},table:[{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],12:1,13:2,15:7,16:8,17:[1,14],23:[1,15]},{1:[3]},{14:[1,16]},{14:[2,7],18:[2,7],22:[2,7],24:[2,7]},{14:[2,8],18:[2,8],22:[2,8],24:[2,8]},{14:[2,9],18:[2,9],22:[2,9],24:[2,9]},{14:[2,10],18:[2,10],22:[2,10],24:[2,10]},{14:[2,11],18:[2,11],22:[2,11],24:[2,11]},{14:[2,12],18:[2,12],22:[2,12],24:[2,12]},{14:[2,3],18:[2,3],22:[2,3],24:[2,3]},{14:[2,4],18:[2,4],22:[2,4],24:[2,4]},{14:[2,5],18:[2,5],22:[2,5],24:[2,5]},{14:[2,1],18:[2,1],21:[2,1],22:[2,1],24:[2,1]},{14:[2,2],18:[2,2],22:[2,2],24:[2,2]},{3:20,4:[1,12],18:[1,17],19:18,20:19},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:23,15:7,16:8,17:[1,14],23:[1,15],24:[1,21],25:22},{1:[2,6]},{14:[2,13],18:[2,13],22:[2,13],24:[2,13]},{18:[1,24],22:[1,25]},{18:[2,16],22:[2,16]},{21:[1,26]},{14:[2,18],18:[2,18],22:[2,18],24:[2,18]},{22:[1,28],24:[1,27]},{22:[2,20],24:[2,20]},{14:[2,14],18:[2,14],22:[2,14],24:[2,14]},{3:20,4:[1,12],20:29},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:30,15:7,16:8,17:[1,14],23:[1,15]},{14:[2,19],18:[2,19],22:[2,19],24:[2,19]},{3:5,4:[1,12],5:6,6:[1,13],7:3,8:[1,9],9:4,10:[1,10],11:[1,11],13:31,15:7,16:8,17:[1,14],23:[1,15]},{18:[2,17],22:[2,17]},{18:[2,15],22:[2,15]},{22:[2,21],24:[2,21]}],defaultActions:{16:[2,6]},parseError:function r(t,i){throw new Error(t)},parse:function r(t){var i=this,e=[0],n=[null],o=[],u=this.table,f="",a=0,l=0,s=0,c=2,v=1;this.lexer.setInput(t);this.lexer.yy=this.yy;this.yy.lexer=this.lexer;if(typeof this.lexer.yylloc=="undefined")this.lexer.yylloc={};var h=this.lexer.yylloc;o.push(h);if(typeof this.yy.parseError==="function")this.parseError=this.yy.parseError;function d(r){e.length=e.length-2*r;n.length=n.length-r;o.length=o.length-r}function m(){var r;r=i.lexer.lex()||1;if(typeof r!=="number"){r=i.symbols_[r]||r}return r}var p,g,b,w,k,C={},M,A,y,x;while(true){b=e[e.length-1];if(this.defaultActions[b]){w=this.defaultActions[b]}else{if(p==null)p=m();w=u[b]&&u[b][p]}if(typeof w==="undefined"||!w.length||!w[0]){if(!s){x=[];for(M in u[b])if(this.terminals_[M]&&M>2){x.push("'"+this.terminals_[M]+"'")}var L="";if(this.lexer.showPosition){L="Parse error on line "+(a+1)+":\n"+this.lexer.showPosition()+"\nExpecting "+x.join(", ")+", got '"+this.terminals_[p]+"'"}else{L="Parse error on line "+(a+1)+": Unexpected "+(p==1?"end of input":"'"+(this.terminals_[p]||p)+"'")}this.parseError(L,{text:this.lexer.match,token:this.terminals_[p]||p,line:this.lexer.yylineno,loc:h,expected:x})}if(s==3){if(p==v){throw new Error(L||"Parsing halted.")}l=this.lexer.yyleng;f=this.lexer.yytext;a=this.lexer.yylineno;h=this.lexer.yylloc;p=m()}while(1){if(c.toString()in u[b]){break}if(b==0){throw new Error(L||"Parsing halted.")}d(1);b=e[e.length-1]}g=p;p=c;b=e[e.length-1];w=u[b]&&u[b][c];s=3}if(w[0]instanceof Array&&w.length>1){throw new Error("Parse Error: multiple actions possible at state: "+b+", token: "+p)}switch(w[0]){case 1:e.push(p);n.push(this.lexer.yytext);o.push(this.lexer.yylloc);e.push(w[1]);p=null;if(!g){l=this.lexer.yyleng;f=this.lexer.yytext;a=this.lexer.yylineno;h=this.lexer.yylloc;if(s>0)s--}else{p=g;g=null}break;case 2:A=this.productions_[w[1]][1];C.$=n[n.length-A];C._$={first_line:o[o.length-(A||1)].first_line,last_line:o[o.length-1].last_line,first_column:o[o.length-(A||1)].first_column,last_column:o[o.length-1].last_column};k=this.performAction.call(C,f,l,a,this.yy,w[1],n,o);if(typeof k!=="undefined"){return k}if(A){e=e.slice(0,-1*A*2);n=n.slice(0,-1*A);o=o.slice(0,-1*A)}e.push(this.productions_[w[1]][0]);n.push(C.$);o.push(C._$);y=u[e[e.length-2]][e[e.length-1]];e.push(y);break;case 3:return true}}return true}};var t=function(){var r={EOF:1,parseError:function r(t,i){if(this.yy.parseError){this.yy.parseError(t,i)}else{throw new Error(t)}},setInput:function(r){this._input=r;this._more=this._less=this.done=false;this.yylineno=this.yyleng=0;this.yytext=this.matched=this.match="";this.conditionStack=["INITIAL"];this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0};return this},input:function(){var r=this._input[0];this.yytext+=r;this.yyleng++;this.match+=r;this.matched+=r;var t=r.match(/\n/);if(t)this.yylineno++;this._input=this._input.slice(1);return r},unput:function(r){this._input=r+this._input;return this},more:function(){this._more=true;return this},less:function(r){this._input=this.match.slice(r)+this._input},pastInput:function(){var r=this.matched.substr(0,this.matched.length-this.match.length);return(r.length>20?"...":"")+r.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var r=this.match;if(r.length<20){r+=this._input.substr(0,20-r.length)}return(r.substr(0,20)+(r.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var r=this.pastInput();var t=new Array(r.length+1).join("-");return r+this.upcomingInput()+"\n"+t+"^"},next:function(){if(this.done){return this.EOF}if(!this._input)this.done=true;var r,t,i,e,n;if(!this._more){this.yytext="";this.match=""}var o=this._currentRules();for(var u=0;u<o.length;u++){i=this._input.match(this.rules[o[u]]);if(i&&(!t||i[0].length>t[0].length)){t=i;e=u;if(!this.options.flex)break}}if(t){n=t[0].match(/\n.*/g);if(n)this.yylineno+=n.length;this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-1:this.yylloc.last_column+t[0].length};this.yytext+=t[0];this.match+=t[0];this.yyleng=this.yytext.length;this._more=false;this._input=this._input.slice(t[0].length);this.matched+=t[0];r=this.performAction.call(this,this.yy,this,o[e],this.conditionStack[this.conditionStack.length-1]);if(this.done&&this._input)this.done=false;if(r)return r;else return}if(this._input===""){return this.EOF}else{this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})}},lex:function r(){var t=this.next();if(typeof t!=="undefined"){return t}else{return this.lex()}},begin:function r(t){this.conditionStack.push(t)},popState:function r(){return this.conditionStack.pop()},_currentRules:function r(){return this.conditions[this.conditionStack[this.conditionStack.length-1]].rules},topState:function(){return this.conditionStack[this.conditionStack.length-2]},pushState:function r(t){this.begin(t)}};r.options={};r.performAction=function r(t,i,e,n){switch(e){case 0:break;case 1:return 6;case 2:i.yytext=i.yytext.substr(1,i.yyleng-2);return 4;case 3:return 17;case 4:return 18;case 5:return 23;case 6:return 24;case 7:return 22;case 8:return 21;case 9:return 10;case 10:return 11;case 11:return 8;case 12:return 14;case 13:return"INVALID"}};r.rules=[/^(?:\s+)/,/^(?:(-?([0-9]|[1-9][0-9]+))(\.[0-9]+)?([eE][-+]?[0-9]+)?\b)/,/^(?:"(?:\\[\\"bfnrt/]|\\u[a-fA-F0-9]{4}|[^\\\0-\x09\x0a-\x1f"])*")/,/^(?:\{)/,/^(?:\})/,/^(?:\[)/,/^(?:\])/,/^(?:,)/,/^(?::)/,/^(?:true\b)/,/^(?:false\b)/,/^(?:null\b)/,/^(?:$)/,/^(?:.)/];r.conditions={INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13],inclusive:true}};return r}();r.lexer=t;return r}();var o=n.parse;n.parse=function(t){var i=o.call(n,t);var u=typeof e==="undefined"?r("./doug-json-parse"):e;try{u(t)}catch(r){if(/Duplicate key|Bad string|Unexpected/.test(r.message)){var f=t.substring(0,r.at).split("\n");var a=f.length;var l=f[a-1].length-1;this.parseError(r.message,{line:a,col:l,message:r.message.replace(/./,(function(r){return r.toLowerCase()}))});throw SyntaxError(r.message+" on line "+a)}}return i};if(typeof i!=="undefined"){i.parser=n;i.parse=function(){return n.parse.apply(n,arguments)};i.main=function t(e){if(!e[1])throw new Error("Usage: "+e[0]+" FILE");if(typeof process!=="undefined"){var n=r("fs").readFileSync(r("path").join(process.cwd(),e[1]),"utf8")}else{var o=r("file").path(r("file").cwd());var n=o.join(e[1]).read({charset:"utf-8"})}return i.parser.parse(n)};if(r.main===t){i.main(typeof process!=="undefined"?process.argv.slice(1):r("system").args)}}return i}();if(r.exports)r.exports=t}));const l=".CodeMirror{font-family:monospace;height:300px;color:black;direction:ltr}.CodeMirror-lines{padding:4px 0;}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{padding:0 4px;}.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{background-color:white;}.CodeMirror-gutters{border-right:1px solid #ddd;background-color:#f7f7f7;white-space:nowrap}.CodeMirror-linenumber{padding:0 3px 0 5px;min-width:20px;text-align:right;color:#999;white-space:nowrap}.CodeMirror-guttermarker{color:black}.CodeMirror-guttermarker-subtle{color:#999}.CodeMirror-cursor{border-left:1px solid black;border-right:none;width:0}.CodeMirror div.CodeMirror-secondarycursor{border-left:1px solid silver}.cm-fat-cursor .CodeMirror-cursor{width:auto;border:0 !important;background:#7e7}.cm-fat-cursor div.CodeMirror-cursors{z-index:1}.cm-fat-cursor .CodeMirror-line::selection,.cm-fat-cursor .CodeMirror-line>span::selection,.cm-fat-cursor .CodeMirror-line>span>span::selection{background:transparent}.cm-fat-cursor .CodeMirror-line::-moz-selection,.cm-fat-cursor .CodeMirror-line>span::-moz-selection,.cm-fat-cursor .CodeMirror-line>span>span::-moz-selection{background:transparent}.cm-fat-cursor{caret-color:transparent}@-moz-keyframes blink{0%{}50%{background-color:transparent}100%{}}@-webkit-keyframes blink{0%{}50%{background-color:transparent}100%{}}@keyframes blink{0%{}50%{background-color:transparent}100%{}}.cm-tab{display:inline-block;text-decoration:inherit}.CodeMirror-rulers{position:absolute;left:0;right:0;top:-50px;bottom:0;overflow:hidden}.CodeMirror-ruler{border-left:1px solid #ccc;top:0;bottom:0;position:absolute}.cm-s-default .cm-header{color:blue}.cm-s-default .cm-quote{color:#090}.cm-negative{color:#d44}.cm-positive{color:#292}.cm-header,.cm-strong{font-weight:bold}.cm-em{font-style:italic}.cm-link{text-decoration:underline}.cm-strikethrough{text-decoration:line-through}.cm-s-default .cm-keyword{color:#708}.cm-s-default .cm-atom{color:#219}.cm-s-default .cm-number{color:#164}.cm-s-default .cm-def{color:#00f}.cm-s-default .cm-variable-2{color:#05a}.cm-s-default .cm-variable-3,.cm-s-default .cm-type{color:#085}.cm-s-default .cm-comment{color:#a50}.cm-s-default .cm-string{color:#a11}.cm-s-default .cm-string-2{color:#f50}.cm-s-default .cm-meta{color:#555}.cm-s-default .cm-qualifier{color:#555}.cm-s-default .cm-builtin{color:#30a}.cm-s-default .cm-bracket{color:#997}.cm-s-default .cm-tag{color:#170}.cm-s-default .cm-attribute{color:#00c}.cm-s-default .cm-hr{color:#999}.cm-s-default .cm-link{color:#00c}.cm-s-default .cm-error{color:#f00}.cm-invalidchar{color:#f00}.CodeMirror-composing{border-bottom:2px solid}div.CodeMirror span.CodeMirror-matchingbracket{color:#0b0}div.CodeMirror span.CodeMirror-nonmatchingbracket{color:#a22}.CodeMirror-matchingtag{background:rgba(255, 150, 0, .3)}.CodeMirror-activeline-background{background:#e8f2ff}.CodeMirror{position:relative;overflow:hidden;background:white}.CodeMirror-scroll{overflow:scroll !important;margin-bottom:-50px;margin-right:-50px;padding-bottom:50px;height:100%;outline:none;position:relative;z-index:0}.CodeMirror-sizer{position:relative;border-right:50px solid transparent}.CodeMirror-vscrollbar,.CodeMirror-hscrollbar,.CodeMirror-scrollbar-filler,.CodeMirror-gutter-filler{position:absolute;z-index:6;display:none;outline:none}.CodeMirror-vscrollbar{right:0;top:0;overflow-x:hidden;overflow-y:scroll}.CodeMirror-hscrollbar{bottom:0;left:0;overflow-y:hidden;overflow-x:scroll}.CodeMirror-scrollbar-filler{right:0;bottom:0}.CodeMirror-gutter-filler{left:0;bottom:0}.CodeMirror-gutters{position:absolute;left:0;top:0;min-height:100%;z-index:3}.CodeMirror-gutter{white-space:normal;height:100%;display:inline-block;vertical-align:top;margin-bottom:-50px}.CodeMirror-gutter-wrapper{position:absolute;z-index:4;background:none !important;border:none !important}.CodeMirror-gutter-background{position:absolute;top:0;bottom:0;z-index:4}.CodeMirror-gutter-elt{position:absolute;cursor:default;z-index:4}.CodeMirror-gutter-wrapper ::selection{background-color:transparent}.CodeMirror-gutter-wrapper ::-moz-selection{background-color:transparent}.CodeMirror-lines{cursor:text;min-height:1px;}.CodeMirror pre.CodeMirror-line,.CodeMirror pre.CodeMirror-line-like{-moz-border-radius:0;-webkit-border-radius:0;border-radius:0;border-width:0;background:transparent;font-family:inherit;font-size:inherit;margin:0;white-space:pre;word-wrap:normal;line-height:inherit;color:inherit;z-index:2;position:relative;overflow:visible;-webkit-tap-highlight-color:transparent;-webkit-font-variant-ligatures:contextual;font-variant-ligatures:contextual}.CodeMirror-wrap pre.CodeMirror-line,.CodeMirror-wrap pre.CodeMirror-line-like{word-wrap:break-word;white-space:pre-wrap;word-break:normal}.CodeMirror-linebackground{position:absolute;left:0;right:0;top:0;bottom:0;z-index:0}.CodeMirror-linewidget{position:relative;z-index:2;padding:0.1px;}.CodeMirror-rtl pre{direction:rtl}.CodeMirror-code{outline:none}.CodeMirror-scroll,.CodeMirror-sizer,.CodeMirror-gutter,.CodeMirror-gutters,.CodeMirror-linenumber{-moz-box-sizing:content-box;box-sizing:content-box}.CodeMirror-measure{position:absolute;width:100%;height:0;overflow:hidden;visibility:hidden}.CodeMirror-cursor{position:absolute;pointer-events:none}.CodeMirror-measure pre{position:static}div.CodeMirror-cursors{visibility:hidden;position:relative;z-index:3}div.CodeMirror-dragcursors{visibility:visible}.CodeMirror-focused div.CodeMirror-cursors{visibility:visible}.CodeMirror-selected{background:#d9d9d9}.CodeMirror-focused .CodeMirror-selected{background:#d7d4f0}.CodeMirror-crosshair{cursor:crosshair}.CodeMirror-line::selection,.CodeMirror-line>span::selection,.CodeMirror-line>span>span::selection{background:#d7d4f0}.CodeMirror-line::-moz-selection,.CodeMirror-line>span::-moz-selection,.CodeMirror-line>span>span::-moz-selection{background:#d7d4f0}.cm-searching{background-color:#ffa;background-color:rgba(255, 255, 0, .4)}.cm-force-border{padding-right:.1px}@media print{.CodeMirror div.CodeMirror-cursors{visibility:hidden}}.cm-tab-wrap-hack:after{content:''}span.CodeMirror-selectedtext{background:none}.CodeMirror-lint-markers{width:16px}.CodeMirror-lint-tooltip{background-color:#ffd;border:1px solid black;border-radius:4px 4px 4px 4px;color:black;font-family:monospace;font-size:10pt;overflow:hidden;padding:2px 5px;position:fixed;white-space:pre;white-space:pre-wrap;z-index:100;max-width:600px;opacity:0;transition:opacity .4s;-moz-transition:opacity .4s;-webkit-transition:opacity .4s;-o-transition:opacity .4s;-ms-transition:opacity .4s}.CodeMirror-lint-mark{background-position:left bottom;background-repeat:repeat-x}.CodeMirror-lint-mark-warning{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJFhQXEbhTg7YAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAMklEQVQI12NkgIIvJ3QXMjAwdDN+OaEbysDA4MPAwNDNwMCwiOHLCd1zX07o6kBVGQEAKBANtobskNMAAAAASUVORK5CYII=\")}.CodeMirror-lint-mark-error{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAADCAYAAAC09K7GAAAAAXNSR0IArs4c6QAAAAZiS0dEAP8A/wD/oL2nkwAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9sJDw4cOCW1/KIAAAAZdEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIEdJTVBXgQ4XAAAAHElEQVQI12NggIL/DAz/GdA5/xkY/qPKMDAwAADLZwf5rvm+LQAAAABJRU5ErkJggg==\")}.CodeMirror-lint-marker{background-position:center center;background-repeat:no-repeat;cursor:pointer;display:inline-block;height:16px;width:16px;vertical-align:middle;position:relative}.CodeMirror-lint-message{padding-left:18px;background-position:top left;background-repeat:no-repeat}.CodeMirror-lint-marker-warning,.CodeMirror-lint-message-warning{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAANlBMVEX/uwDvrwD/uwD/uwD/uwD/uwD/uwD/uwD/uwD6twD/uwAAAADurwD2tQD7uAD+ugAAAAD/uwDhmeTRAAAADHRSTlMJ8mN1EYcbmiixgACm7WbuAAAAVklEQVR42n3PUQqAIBBFUU1LLc3u/jdbOJoW1P08DA9Gba8+YWJ6gNJoNYIBzAA2chBth5kLmG9YUoG0NHAUwFXwO9LuBQL1giCQb8gC9Oro2vp5rncCIY8L8uEx5ZkAAAAASUVORK5CYII=\")}.CodeMirror-lint-marker-error,.CodeMirror-lint-message-error{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAMAAAAoLQ9TAAAAHlBMVEW7AAC7AACxAAC7AAC7AAAAAAC4AAC5AAD///+7AAAUdclpAAAABnRSTlMXnORSiwCK0ZKSAAAATUlEQVR42mWPOQ7AQAgDuQLx/z8csYRmPRIFIwRGnosRrpamvkKi0FTIiMASR3hhKW+hAN6/tIWhu9PDWiTGNEkTtIOucA5Oyr9ckPgAWm0GPBog6v4AAAAASUVORK5CYII=\")}.CodeMirror-lint-marker-multiple{background-image:url(\"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAHCAMAAADzjKfhAAAACVBMVEUAAAAAAAC/v7914kyHAAAAAXRSTlMAQObYZgAAACNJREFUeNo1ioEJAAAIwmz/H90iFFSGJgFMe3gaLZ0od+9/AQZ0ADosbYraAAAAAElFTkSuQmCC\");background-repeat:no-repeat;background-position:right bottom;width:100%;height:100%}.CodeMirror-lint-line-error{background-color:rgba(183, 76, 81, 0.08)}.CodeMirror-lint-line-warning{background-color:rgba(255, 211, 0, 0.1)}.CodeMirror-foldmarker{color:blue;text-shadow:#b9f 1px 1px 2px, #b9f -1px -1px 2px, #b9f 1px -1px 2px, #b9f -1px 1px 2px;font-family:arial;line-height:.3;cursor:pointer}.CodeMirror-foldgutter{width:.7em}.CodeMirror-foldgutter-open,.CodeMirror-foldgutter-folded{cursor:pointer}.CodeMirror-foldgutter-open:after{content:\"\\25BE\"}.CodeMirror-foldgutter-folded:after{content:\"\\25B8\"}:host{display:flex;font-size:var(--code-editor-font-size, 0.875rem);--code-editor-neutral-text-color:var(--contrast-1100);--code-editor-background-color:var(--contrast-200);--code-editor-gutter-background-color:var(--contrast-300);--code-editor-line-number-text-color:var(--contrast-700);--code-editor-cursor-color:var(--color-amber-dark);--code-editor-selection-highlight-color:var(--color-cyan-default);--code-editor-selection-lowlight-color:var(--contrast-600)}:host .cm-attribute,:host .cm-property,:host .cm-keyword{color:rgb(var(--color-violet-light))}:host .cm-operator{color:rgb(var(--color-sky-dark))}:host .cm-variable{color:rgb(var(--color-pink-light))}:host .cm-variable-2{color:rgb(var(--contrast-1100))}:host .cm-variable-3,:host .cm-type{color:rgb(var(--color-amber-darker))}:host .cm-builtin,:host .cm-meta{color:rgb(var(--color-amber-default))}:host .cm-atom{color:rgb(var(--color-coral-default))}:host .cm-tag,:host .cm-number{color:rgb(var(--color-magenta-default))}:host .cm-def{color:rgb(var(--color-sky-default))}:host .cm-string{color:rgb(var(--color-green-dark))}:host .cm-string-2{color:rgb(var(--color-pink-default))}:host .cm-qualifier{color:rgb(var(--color-grass-default))}:host .cm-error{color:rgb(var(--color-white));background-color:rgb(var(--color-red-default))}:host .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.7)}@media (prefers-color-scheme: dark){:root:not([data-theme=force-light]) :host{--code-editor-neutral-text-color:var(--contrast-1600);--code-editor-line-number-text-color:var(--contrast-800);--code-editor-cursor-color:var(--color-amber-default);--code-editor-selection-highlight-color:var(--color-cyan-light);--code-editor-selection-lowlight-color:var(--contrast-100)}:root:not([data-theme=force-light]) :host .cm-attribute,:root:not([data-theme=force-light]) :host .cm-property,:root:not([data-theme=force-light]) :host .cm-keyword{color:rgb(var(--color-purple-lighter))}:root:not([data-theme=force-light]) :host .cm-operator{color:rgb(var(--color-sky-lighter))}:root:not([data-theme=force-light]) :host .cm-variable-3,:root:not([data-theme=force-light]) :host .cm-type{color:rgb(var(--color-yellow-light))}:root:not([data-theme=force-light]) :host .cm-atom{color:rgb(var(--color-coral-light))}:root:not([data-theme=force-light]) :host .cm-tag,:root:not([data-theme=force-light]) :host .cm-number{color:rgb(var(--color-magenta-light))}:root:not([data-theme=force-light]) :host .cm-def{color:rgb(var(--color-sky-light))}:root:not([data-theme=force-light]) :host .cm-string{color:rgb(var(--color-lime-light))}:root:not([data-theme=force-light]) :host .cm-string-2{color:rgb(var(--color-pink-lighter))}:root:not([data-theme=force-light]) :host .cm-qualifier{color:rgb(var(--color-grass-light))}:root:not([data-theme=force-light]) :host .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.4)}}:root[data-theme=force-dark] :host{--code-editor-neutral-text-color:var(--contrast-1600);--code-editor-line-number-text-color:var(--contrast-800);--code-editor-cursor-color:var(--color-amber-default);--code-editor-selection-highlight-color:var(--color-cyan-light);--code-editor-selection-lowlight-color:var(--contrast-100)}:root[data-theme=force-dark] :host .cm-attribute,:root[data-theme=force-dark] :host .cm-property,:root[data-theme=force-dark] :host .cm-keyword{color:rgb(var(--color-purple-lighter))}:root[data-theme=force-dark] :host .cm-operator{color:rgb(var(--color-sky-lighter))}:root[data-theme=force-dark] :host .cm-variable-3,:root[data-theme=force-dark] :host .cm-type{color:rgb(var(--color-yellow-light))}:root[data-theme=force-dark] :host .cm-atom{color:rgb(var(--color-coral-light))}:root[data-theme=force-dark] :host .cm-tag,:root[data-theme=force-dark] :host .cm-number{color:rgb(var(--color-magenta-light))}:root[data-theme=force-dark] :host .cm-def{color:rgb(var(--color-sky-light))}:root[data-theme=force-dark] :host .cm-string{color:rgb(var(--color-lime-light))}:root[data-theme=force-dark] :host .cm-string-2{color:rgb(var(--color-pink-lighter))}:root[data-theme=force-dark] :host .cm-qualifier{color:rgb(var(--color-grass-light))}:root[data-theme=force-dark] :host .cm-comment{color:rgba(var(--code-editor-neutral-text-color), 0.4)}.editor{display:flex;align-items:stretch;width:100%}.editor.readonly .CodeMirror-focused .CodeMirror-cursors{visibility:visible !important}.cm-s-lime.CodeMirror{color:rgb(var(--code-editor-neutral-text-color));background-color:rgb(var(--code-editor-background-color));border-radius:0.25rem;height:auto;width:100%}.cm-s-lime .CodeMirror-scroll{max-height:var(--code-editor-max-height, 10rem)}.cm-s-lime.CodeMirror-focused div.CodeMirror-selected{background:rgba(var(--code-editor-selection-highlight-color), 0.15)}.cm-s-lime div.CodeMirror-selected{background:rgba(var(--code-editor-selection-highlight-color), 0.05)}.cm-s-lime .CodeMirror-gutters{background-color:rgb(var(--code-editor-gutter-background-color));color:rgb(var(--code-editor-line-number-text-color));border:none}.cm-s-lime .CodeMirror-guttermarker,.cm-s-lime .CodeMirror-guttermarker-subtle,.cm-s-lime .CodeMirror-linenumber{color:rgb(var(--code-editor-line-number-text-color))}.cm-s-lime .CodeMirror-cursor{border-left:1px solid rgb(var(--code-editor-cursor-color))}.editor.readonly .cm-s-lime .CodeMirror-cursor{border-color:rgba(var(--code-editor-neutral-text-color), 0.5);border-width:0.125rem}.cm-s-lime .CodeMirror-activeline-background{background:rgba(var(--code-editor-selection-lowlight-color), 0.5)}.cm-s-lime .CodeMirror-matchingbracket{font-weight:bold;color:rgb(var(--code-editor-neutral-text-color)) !important;background:rgba(var(--code-editor-selection-highlight-color), 0.15);position:relative}.cm-s-lime .CodeMirror-matchingbracket:before{content:\"_\";color:rgb(var(--code-editor-selection-highlight-color), 0.8);position:absolute;bottom:-0.4rem;left:0;right:0}.cm-s-lime .CodeMirror-lint-marker-error,.cm-s-lime .CodeMirror-lint-message-error{background-image:url(\"data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32'><defs/><path fill='rgb(255,255,255)' d='M7.219 5.781L5.78 7.22 14.563 16 5.78 24.781 7.22 26.22 16 17.437l8.781 8.782 1.438-1.438L17.437 16l8.782-8.781L24.78 5.78 16 14.563z'/></svg>\");background-color:rgb(var(--color-red-default));background-size:0.75rem;border-radius:50%}.cm-s-lime .CodeMirror-foldmarker{position:relative;transition:color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease-out;cursor:pointer;color:transparent;background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-normal);text-shadow:none;padding:0 0.5rem;border-radius:1rem;background-image:url(\"data:image/svg+xml; utf8, <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 32 32' xml:space='preserve'><circle fill='rgba(186,186,192,0.7)' cx='16' cy='16' r='2'/><circle fill='rgba(186,186,192,0.7)' cx='26' cy='16' r='2'/><circle fill='rgba(186,186,192,0.7)' cx='6' cy='16' r='2'/></svg>\");background-size:contain;background-repeat:no-repeat;background-position:center}.cm-s-lime .CodeMirror-foldmarker:hover{color:var(--mdc-theme-on-surface);background-color:var(--lime-elevated-surface-background-color);box-shadow:var(--button-shadow-hovered)}.cm-s-lime .CodeMirror-foldmarker:active{box-shadow:var(--button-shadow-pressed);transform:translate3d(0, 0.08rem, 0)}.cm-s-lime [class^=CodeMirror-foldgutter]{color:var(--code-editor-neutral-text-color);transition:opacity 0.2s ease;opacity:0.4}.cm-s-lime [class^=CodeMirror-foldgutter]:hover{opacity:1}.cm-s-lime .CodeMirror-foldgutter-folded{opacity:0.7}";const s=class{constructor(i){r(this,i);this.change=t(this,"change",7);this.handleChangeDarkMode=()=>{if(this.colorScheme!=="auto"){return}this.forceRedraw()};this.handleChange=()=>{this.change.emit(this.editor.getValue())};this.handleResize=()=>{if(!this.editor){return}this.editor.refresh()};this.value="";this.language=undefined;this.readonly=false;this.lineNumbers=false;this.fold=false;this.lint=false;this.colorScheme="auto";this.random=undefined}connectedCallback(){this.observer=new ResizeObserver(this.handleResize);this.observer.observe(this.host);this.darkMode.addEventListener("change",this.handleChangeDarkMode)}disconnectedCallback(){this.observer.unobserve(this.host);this.editor.off("change",this.handleChange);this.editor=null;this.darkMode.removeEventListener("change",this.handleChangeDarkMode);const r=this.host.shadowRoot.querySelector(".editor");r===null||r===void 0?void 0:r.childNodes.forEach((r=>{r.remove()}))}componentDidRender(){if(this.editor){return}this.editor=this.createEditor()}watchValue(r){if(!this.editor){return}const t=this.editor.getValue();if(r===t){return}this.editor.getDoc().setValue(r||"")}createEditor(){const r=this.getOptions();const t=u(this.host.shadowRoot.querySelector(".editor"),r);t.on("change",this.handleChange);t.setOption("extraKeys",{Tab:r=>{const t=Array(r.getOption("indentUnit")+1).join(" ");r.replaceSelection(t)}});return t}getOptions(){let r=this.language;const t=4;let i="lime light";const e=[];if(this.isDarkMode()){i="lime dark"}if(this.language==="json"){r={name:"application/json",json:true};if(this.lint){e.push("CodeMirror-lint-markers");if(!("jsonlint"in window)){window["jsonlint"]=a}}}else if(this.language==="typescript"){r={name:"application/typescript",typescript:true}}if(this.fold){e.push("CodeMirror-foldgutter")}return{mode:r,value:this.value||"",theme:i,readOnly:this.readonly,tabSize:t,indentUnit:t,lineNumbers:this.lineNumbers,styleActiveLine:true,matchBrackets:true,lint:this.lint,foldGutter:this.fold,gutters:e}}isDarkMode(){if(this.colorScheme!=="auto"){return this.colorScheme==="dark"}return this.darkMode.matches}render(){const r={editor:true,readonly:this.readonly,"is-dark-mode":this.isDarkMode(),"is-light-mode":!this.isDarkMode()};return i("div",{class:r})}forceRedraw(){this.random=Math.random()}get darkMode(){return matchMedia("(prefers-color-scheme: dark)")}get host(){return e(this)}static get watchers(){return{value:["watchValue"]}}};s.style=l;export{s as limel_code_editor};
2
+ //# sourceMappingURL=p-94cb40fb.entry.js.map